Search Results

Search found 13191 results on 528 pages for 'unhandled exception'.

Page 63/528 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • How to profile Doctrine in Zend Framework

    - by David Zapata
    Good day. I'm using Doctrine as ORM for my Zend Framework project. This is the first time I use it. I've followed the ZendCasts Doctrine chapters, and everything works for me, but I needed to perform some profiling; There is a Doctrine_Connection_Profiler class that should be used to profile the Doctrine Model internal queries, but I've tried to use it without success. I always get a "PDOException: You cannot serialize or unserialize PDOStatement instances" exception when I perform my Unit Tests. Here is a example: $conn = Doctrine_Manager::connection($doctrineConfig['dsn'], $dbconfname); ... if( APPLICATION_ENV != 'production'){ $obj_doctrine_profiler = new Doctrine_Connection_Profiler(); $conn->setListener($obj_doctrine_profiler); } All of my Unit Tests works if I comment/delete the $conn->setListener($obj_doctrine_profiler); line. This code block is located in my Bootstrap.php class; the weird thing is, the web application works just fine even with the mentioned code line. Thank you so much for your help. please excuse me if my english is not the best.

    Read the article

  • Expression Tree with Property Inheritance causes an argument exception

    - by Adam Driscoll
    Following this post: link text I'm trying to create an expression tree that references the property of a property. My code looks like this: public interface IFoo { void X {get;set;} } public interface IBar : IFoo { void Y {get;set;} } public interface IFooBarContainer { IBar Bar {get;set;} } public class Filterer { //Where T = "IFooBarContainer" public IQueryable<T> Filter<T>(IEnumerable<T> collection) { var argument = Expression.Parameter(typeof (T), "item"); //... //where propertyName = "IBar.X"; PropertyOfProperty(argument, propertyName); } private static MemberExpression PropertyOfProperty(Expression expr, string propertyName) { return propertyName.Split('.').Aggregate<string, MemberExpression>(null, (current, property) => Expression.Property(current ?? expr, property)); } } I receive the exception: System.ArgumentException: Instance property 'X' is not defined for type 'IBar' ReSharper turned the code in the link above into the condensed statement in my example. Both forms of the method returned the same error. If I reference IBar.Y the method does not fail.

    Read the article

  • java.lang.NoSuchMethodError: main Exception in thread "main" .

    - by russell
    I Cant understand why this messege come--------- java.lang.NoSuchMethodError: main Exception in thread "main" . I know it expecting main() method but as i m building an applet which does not contain main method rather contain init() method.So what will i do??My code is s follow --- import java.applet.*; import java.awt.*; public class Ballbewegung1 extends Applet implements Runnable { // Initialisierung der Variablen int x_pos = 10; // x - Position des Balles int y_pos = 100; // y - Position des Balles int radius = 20; // Radius des Balles public void init() { setBackground (Color.blue); } public void start () { // Schaffen eines neuen Threads, in dem das Spiel l?uft Thread th = new Thread (this); // Starten des Threads th.start (); } public void stop() { } public void destroy() { } public void run () { // Erniedrigen der ThreadPriority um zeichnen zu erleichtern Thread.currentThread().setPriority(Thread.MIN_PRIORITY); // Solange true ist l?uft der Thread weiter while (true) { // Ver?ndern der x- Koordinate x_pos ++; // Neuzeichnen des Applets repaint(); try { // Stoppen des Threads f?r in Klammern angegebene Millisekunden Thread.sleep (20); } catch (InterruptedException ex) { // do nothing } // Zur?cksetzen der ThreadPriority auf Maximalwert Thread.currentThread().setPriority(Thread.MAX_PRIORITY); } } public void paint (Graphics g) { g.setColor (Color.red); g.fillOval (x_pos - radius, y_pos - radius, 2 * radius, 2 * radius); } } And I dont know how to use code tag.so plz someone ans.

    Read the article

  • ADO/SQL Server: What is the error code for "timeout expired"?

    - by Ian Boyd
    i'm trying to trap a "timeout expired" error from ADO. When a timeout happens, ADO returns: Number: 0x80040E31 (DB_E_ABORTLIMITREACHED in oledberr.h) SQLState: HYT00 NativeError: 0 The NativeError of zero makes sense, since the timeout is not a function of the database engine (i.e. SQL Server), but of ADO's internal timeout mechanism. The Number (i.e. the COM hresult) looks useful, but the definition of DB_E_ABORTLIMITREACHED in oledberr.h says: Execution stopped because a resource limit was reached. No results were returned. This error could apply to things besides "timeout expired" (some potentially server-side), such as a governor that limits: CPU usage I/O reads/writes network bandwidth and stops a query. The final useful piece is SQLState, which is a database-independent error code system. Unfortunately the only reference for SQLState error codes i can find have no mention of HYT00. What to do? What do do? Note: i can't trust 0x80040E31 (DB_E_ABORTLIMITREACHED) to mean "timeout expired", anymore than i could trust 0x80004005 (E_UNSPECIFIED_ERROR) to mean "Transaction was deadlocked on lock resources with another process and has been chosen as the deadlock victim". My pseudo-question becomes: does anyone have documentation on what the SQLState "HYT000" means? And my real question still remains: How can i specifically trap an ADO timeout expired exception thrown by ADO? Gotta love the questions where the developer is trying to "do the right thing", but nobody knows how to do the right thing. Also gotta love how googling for DB_E_ABORTLIMITREACHED and this question is #9, with MSDN nowhere to be found. Update 3 From the OLEdb ICommand.Execute reference: DB_E_ABORTLIMITREACHED Execution has been aborted because a resource limit has been reached. For example, a query timed out. No results have been returned. "For example", meaning not an exhaustive list.

    Read the article

  • Null reference exception While Navigating to PlayListItem.

    - by Subhen
    Hi, I am trying to play the selected media from PlayList,if the selected index is not zero as below: if (playList.Items.Count == 0) { setPlayList(); if (selectedIndex!= 0) { if(custMediaElement.Playlist!=null) custMediaElement.GoToPlaylistItem(selectedIndex); } } The setPlayLIst method is as below: private void setPlayList() { IEnumerable eLevelData = pMainPage.GetDataFromDictonary(pMainPage.strChildFolderID); foreach (RMSMedia folderItems in eLevelData) { string strmediaURL = folderItems.strMediaFileName; string strmediaExtension = GetExtension(strmediaURL); if (strmediaExtension == "wmv" || strmediaExtension == "mp4" || strmediaExtension == "mp3" || strmediaExtension == "mpg") { PlaylistItem playListItem = new PlaylistItem(); string thumbSource = folderItems.strAlbumcoverImage; playListItem.MediaSource = new Uri(strmediaURL, UriKind.RelativeOrAbsolute); playListItem.Title = folderItems.strAlbumName; if (!string.IsNullOrEmpty(thumbSource)) playListItem.ThumbSource = new Uri(thumbSource, UriKind.RelativeOrAbsolute); playList.Items.Add(playListItem); } } custMediaElement.Playlist = playList; } But I am getting a Null reference Exception while trying to go to PlayList Item with the help of selected index , as explained in top. This works fine if I don't use custMediaElement.GoToPlaylistItem(selectedIndex); but in that case the Media Player Always plays the 1st Item , No matter , Which ever Song I select from the List Box. Below is few details from Stack Trace: ExpressionMediaPlayer.MediaPlayer.DoOpenPlaylistItem(PlaylistItem playlistItem) at ExpressionMediaPlayer.MediaPlayer.GoToPlaylistItem(Int32 playlistItemIndex) Thanks, Subhen

    Read the article

  • Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 401'

    - by Peak Reconstruction Wavelength
    I am using a php-script that has been working for years, but suddenly it aborts with Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 401' NoLinkedYouTubeAccount Error 401 It starts like this <?php function anmelden_yt($name,$passwort) { $yt_source = 'known'; $yt_api_key = 'key'; $yt = null; $authenticationURL= 'https://www.google.com/accounts/ClientLogin'; $httpClient = Zend_Gdata_ClientLogin::getHttpClient( $username = $name, $password = $passwort, $service = 'youtube', $client = null, $source = $yt_source, // a short string identifying your application $loginToken = null, $loginCaptcha = null, $authenticationURL); abschnitt("Login"); return new Zend_Gdata_YouTube($httpClient, $yt_source, NULL, $yt_api_key); } require_once("Zend/Gdata/ClientLogin.php"); require_once("Zend/Gdata/HttpClient.php"); require_once("Zend/Gdata/YouTube.php"); require_once("Zend/Gdata/App/MediaFileSource.php"); require_once("Zend/Gdata/App/HttpException.php"); require_once('Zend/Uri/Http.php'); require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Gdata_YouTube'); Zend_Loader::loadClass('Zend_Gdata_AuthSub'); Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); $yt = anmelden_yt($name,$pass); $videoFeed = $yt->getUserUploads('Google'); sleep(0.5); @ob_flush(); @flush(); ?> What could be the reason for this? ..................................................................................................

    Read the article

  • Help to resolve 'Out of memory' exception when calling DrawImage

    - by Jack Juiceson
    Hi guys, About one percent of our users experience sudden crash while using our application. The logs show below exception, the only thing in common that I've seen so far is that, they all have XP SP3. Thanks in advance Out of memory. at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData) at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback) at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr) at System.Windows.Forms.ControlPaint.DrawBackgroundImage(Graphics g, Image backgroundImage, Color backColor, ImageLayout backgroundImageLayout, Rectangle bounds, Rectangle clipRect, Point scrollOffset, RightToLeft rightToLeft) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle) at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent) at System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs e) at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region transparentRegion) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle) at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent) at System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs e) at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region transparentRegion) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset) at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle) at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Operation System Information ---------------------------- Name = Windows XP Edition = Home Service Pack = Service Pack 3 Version = 5.1.2600.196608 Bits = 32

    Read the article

  • Java: Exception in thread main java.lang.NoClassDefFoundError

    - by cath
    I am trying to get the Red5 Flash Media Server working on my computer. I have installed it, but when I run the server I get this error Exception in thread "main" java.lang.NoClassDefFoundError: org/red5/server/Bootstrap Caused by: java.lang.ClassNotFoundException: org.red5.server.Bootstrap at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334) Could not find the main class: org.red5.server.Bootstrap. Program will exit. I came across this link where someone had the same issue: http://trac.red5.org/ticket/762 It looks like they ran this command: export CLASSPATH=3D$RED5_HOME/lib/slf4j-api-1.5.10.jar:$RED5_HOME/lib/logback- core-0.9.18.jar:$RED5_HOME/lib/logback-classic-0.9.18.jar I have red5 installed in /usr/share/red5, so I ran this: export CLASSPATH=3D$/usr/share/red5/lib/slf4j-api-1.5.10.jar:$/usr/share/red5/lib/logback-core-0.9.18.jar:$/usr/share/red5/lib/logback-classic-0.9.18.jar Yet despite all this I am still seeing the same error message.

    Read the article

  • How can I add a plugin to the registry while using a Zend_Form?

    - by Mallika Iyer
    I have a zend form that I'm initializing as follows: $form = new Form_XYZ(); I have a display group in that form, which I'm calling like this: $form->addDisplayGroup($generalSettingsGroup, 'general', array( 'legend' => 'General', 'disableDefaultDecorators' => true, 'decorators' => array( 'FormElements', 'FieldSet', array('HtmlTag', array('tag' => 'div', 'class' => 'general') ) ) ) ); I get this error : ArrayObject Object ( [exception] => Zend_Loader_PluginLoader_Exception Object ( [message:protected] => Plugin by name 'FieldSet' was not found in the registry; used paths:Zend_Form_Decorator_: Zend/Form/Decorator/ [string:private] => [code:protected] => 0 [file:protected] => /usr/share/pear/PEAR/Zend/Loader/PluginLoader.php [line:protected] => 406 [trace:private] => Array ................... How can I add the FieldSet plugin to the registry? I'm using the default Zend_Form Fieldset decorator.

    Read the article

  • Flex 3 Close UrlLoader throws exception

    - by gmoniey
    I am trying to simulate a 'HEAD' method using UrlLoader; essentially, I just want to check for the presence of a file without downloading the entire thing. I figured I would just use HttpStatusEvent, but the following code throws an exception (one that I can't wrap in a try/catch block) when you run in debug mode. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="init()"> <mx:Script> <![CDATA[ private static const BIG_FILE:String = "http://www.archive.org/download/gspmovvideotestIMG0021mov/IMG_0021.mov"; private var _loader:URLLoader; private function init():void { _loader = new URLLoader(); _loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, statusHandler); _loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); _loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler); _loader.load(new URLRequest(BIG_FILE)); } public function unload():void { try { _loader.close(); _loader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, statusHandler); _loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler); _loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler); } catch(error:Error) { status.text = error.message; } } private function errorHandler(event:Event):void { status.text = "error"; unload(); } private function statusHandler(event:HTTPStatusEvent):void { if(event.status.toString().match(/^2/)) { status.text = "success"; unload(); } else { errorHandler(event); } } ]]> </mx:Script> <mx:Label id="status" /> I tried using ProgressEvents instead, but it seems that some 404 pages return content, so the status event will correctly identify if the page exists. Anyone have any ideas?

    Read the article

  • Calling method on category included from iPhone static library causes NSInvalidArgumentException

    - by Corey Floyd
    I have created a static library to house some of my code like categories. I have a category for UIViews in "UIView-Extensions.h" named Extensions. In this category I have a method called: - (void)fadeOutWithDelay:(CGFloat)delay duration:(CGFloat)duration; Calling this method works fine on the simulator on Debug configuration. However, if try to run the app on the device I get a NSInvalidArgumentException: [UIView fadeOutWithDelay:duration:]: unrecognized selector sent to instance 0x1912b0 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIView fadeOutWithDelay:duration:]: unrecognized selector sent to instance 0x1912b0 It seems for some reason UIView-Extensions.h is not being included in the device builds. What I have checked/tried I did try to include another category for NSString, and had the same issue. Other files, like whole classes and functions work fine. It is an issue that only happens with categories. I did a clean all targets, which did not fix the problem. I checked the static library project, the categories are included in the target's "copy headers" and "compile sources" groups. The static library is included in the main projects "link binary with library" group. Another project I have added the static library to works just fine. I deleted and re-added the static library with no luck -ObjC linker flag is set Any ideas? nm output libFJSCodeDebug.a(UIView-Extensions.o): 000004d4 t -[UIView(Extensions) changeColor:withDelay:duration:] 00000000 t -[UIView(Extensions) fadeInWithDelay:duration:] 000000dc t -[UIView(Extensions) fadeOutWithDelay:duration:] 00000abc t -[UIView(Extensions) firstResponder] 000006b0 t -[UIView(Extensions) hasSubviewOfClass:] 00000870 t -[UIView(Extensions) hasSubviewOfClass:thatContainsPoint:] 000005cc t -[UIView(Extensions) rotate:] 000002d8 t -[UIView(Extensions) shrinkToSize:withDelay:duration:] 000001b8 t -[UIView(Extensions) translateToFrame:delay:duration:] U _CGAffineTransformRotate 000004a8 t _CGPointMake U _CGRectContainsPoint U _NSLog U _OBJC_CLASS_$_UIColor U _OBJC_CLASS_$_UIView U ___CFConstantStringClassReference U ___addsf3vfp U ___divdf3vfp U ___divsf3vfp U ___extendsfdf2vfp U ___muldf3vfp U ___truncdfsf2vfp U _objc_enumerationMutation U _objc_msgSend U _objc_msgSend_stret U dyld_stub_binding_helper

    Read the article

  • ClassNotFoundException com.mysql.jdbc.Driver

    - by Dusk
    This question might have asked here number of times . After doing some google search for the above error and doing some update, I can't understand why I'm still getting that error. I've already put my driver-- mysql-connector-java-5.1.5-bin in the classpath: Java_Home\jre\lib\ Java_Home\jre\lib\ext\ Java_Home\lib and the code which I'm using to connect to mysql database is: try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/mail","root",""); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("select message_body from deadletter"); String dbtime; while (rs.next()) { dbtime = rs.getString(1); System.out.println(dbtime); } con.close(); } catch (SQLException e) { System.out.println("Connection Failed! Check output console"); e.printStackTrace(); } } and the complete stacktrace of the above exception is: java.lang.ClassNotFoundException: com.mysql.jdbc:Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at mail.main(mail.java:114) Now, what's wrong I'm doing here?

    Read the article

  • android numberformat exception

    - by asifkt
    my application shows this number format exception errror while running. 1 0-22 11:09:06.095: WARN/System.err(290): at java.lang.Long.parseLong(Long.java:330) 10-22 11:09:06.095: WARN/System.err(290): at java.lang.Long.parseLong(Long.java:307) 10-22 11:09:06.105: WARN/System.err(290): at com.htc.socialnetwork.facebook.FacebookUtils.getSyncInterval(FacebookUtils.java:54) 10-22 11:09:06.105: WARN/System.err(290): at com.htc.socialnetwork.facebook.remote.FacebookReceiver.getSyncInterval(FacebookReceiver.java:269) 10-22 11:09:06.105: WARN/System.err(290): at com.htc.socialnetwork.facebook.remote.FacebookReceiver.onReceive(FacebookReceiver.java:196) 10-22 11:09:06.105: WARN/System.err(290): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2751) 10-22 11:09:06.105: WARN/System.err(290): at android.app.ActivityThread.access$3100(ActivityThread.java:126) 10-22 11:09:06.105: WARN/System.err(290): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1982) 10-22 11:09:06.105: WARN/System.err(290): at android.os.Handler.dispatchMessage(Handler.java:99) 10-22 11:09:06.105: WARN/System.err(290): at android.os.Looper.loop(Looper.java:123) 10-22 11:09:06.105: WARN/System.err(290): at android.app.ActivityThread.main(ActivityThread.java:4603) 10-22 11:09:06.105: WARN/System.err(290): at java.lang.reflect.Method.invokeNative(Native Method) 10-22 11:09:06.105: WARN/System.err(290): at java.lang.reflect.Method.invoke(Method.java:521) 10-22 11:09:06.105: WARN/System.err(290): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 10-22 11:09:06.105: WARN/System.err(290): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 10-22 11:09:06.115: WARN/System.err(290): at dalvik.system.NativeStart.main(Native Method) anybody please help me to get the reason for this error

    Read the article

  • Exiting from the Middle of an Expression Without Using Exceptions

    - by Jon Purdy
    Is there a way to emulate the use of flow-control constructs in the middle of an expression? Is it possible, in a comma-delimited expression x, y, for y to cause a return? Edit: I'm working on a compiler for something rather similar to a functional language, and the target language is C++. Everything is an expression in the source language, and the sanest, simplest translation to the destination language leaves as many things expressions as possible. Basically, semicolons in the target language become C++ commas. In-language flow-control constructs have presented no problems thus far; it's only return. I just need a way to prematurely exit a comma-delimited expression, and I'd prefer not to use exceptions unless someone can show me that they don't have excessive overhead in this situation. The problem of course is that most flow-control constructs are not legal expressions in C++. The only solution I've found so far is something like this: try { return x(), // x(); (1 ? throw Return(0) : 0); // return 0; } catch (Return& ret) { return ref.value; } The return statement is always there (in the event that a Return construct is not reached), and as such the throw has to be wrapped in ?: to get the compiler to shut up about its void result being used in an expression. I would really like to avoid using exceptions for flow control, unless in this case it can be shown that no particular overhead is incurred; does throwing an exception cause unwinding or anything here? This code needs to run with reasonable efficiency. I just need a function-level equivalent of exit().

    Read the article

  • Can't connect to SQL Server 2005 Express from an ASP.NET C# page

    - by Aviv
    Hey guys, I have an MS SQL Server 2005 Express running on a VPS. I'm using pymssql in Python to connect to my server with the following code: conn = pymssql.connect(host='host:port', user='me', password='pwd', database='db') and it works perfectly. When I try to connect to the server from an ASP.NET C# page with the following code: SqlConnection myConnection = new SqlConnection("Data Source=host,port;Network Library=DBMSSOCN; Initial Catalog=db;User ID=me;Password=pwd;"); myConnection.Open(); When I run the ASP.NET page I get the following exception at myConnection.Open();: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) I tried restarting the SQL Server but I had no luck. Can anyone point me out to what I'm missing here? Thanks!

    Read the article

  • JPA native query join returns object but dereference throws class cast exception

    - by masato-san
    I'm using JPQL Native query to join table and query result is stored in List<Object[]>. public String getJoinJpqlNativeQuery() { String final SQL_JOIN = "SELECT v1.bitbit, v1.numnum, v1.someTime, t1.username, t1.anotherNum FROM MasatosanTest t1 JOIN MasatoView v1 ON v1.username = t1.username;" System.out.println("get join jpql native query is being called ============================"); EntityManager em = null; List<Object[]> out = null; try { em = EmProvider.getDefaultManager(); Query query = em.createNativeQuery(SQL_JOIN); out = query.getResultList(); System.out.println("return object ==========>" + out); System.out.println(out.get(0)); String one = out.get(0).toString(); //LINE 77 where ClassCastException System.out.println(one); } catch(Exception e) { } finally { if(em != null) { em.close; } } } The problem is System.out.println("return object ==========>" + out); outputs: return object ==========> [[true, 0, 2010-12-21 15:32:53.0, masatosan, 0.020], [false, 0, 2010-12-21 15:32:53.0, koga, 0.213]] System.out.println(out.get(0)) outputs: [true, 0, 2010-12-21 15:32:53.0, masatosan, 0.020] So I assumed that I can assign return value of out.get(0) which should be String: String one = out.get(0).toString(); But I get weird ClassCastException. java.lang.ClassCastException: java.util.Vector cannot be cast to [Ljava.lang.Object; at local.test.jaxrs.MasatosanTestResource.getJoinJpqlNativeQuery (MasatosanTestResource.java:77) So what's really going on? Even Object[] foo = out.get(0); would throw an ClassCastException :(

    Read the article

  • Getting exception when trying to monkey patch pymongo.connection._Pool

    - by Creotiv
    I use pymongo 1.9 on Ubuntu 10.10 with python 2.6.6 When i trying to monkey patch pymongo.connection._Pool i'm getting error on connection: AutoReconnect: could not find master/primary But when i change _Pool class in pymongo.connection module, it work pretty fine. Even if i copy _Pool implementation from pymongo.connection module and will try to monkey patch by the same code, it still giving same exception. I need to remove threading.local from _Pool class, because i use gevent and i need to implement Pool for all mongo connections(for all threads). I use this code: import pymongo class GPool: """A simple connection pool. Uses thread-local socket per thread. By calling return_socket() a thread can return a socket to the pool. Right now the pool size is capped at 10 sockets - we can expose this as a parameter later, if needed. """ # Non thread-locals __slots__ = ["sockets", "socket_factory", "pool_size","sock"] #sock = None def __init__(self, socket_factory): self.pool_size = 10 if not hasattr(self,"sock"): self.sock = None self.socket_factory = socket_factory if not hasattr(self, "sockets"): self.sockets = [] def socket(self): # we store the pid here to avoid issues with fork / # multiprocessing - see # test.test_connection:TestConnection.test_fork for an example # of what could go wrong otherwise pid = os.getpid() if self.sock is not None and self.sock[0] == pid: return self.sock[1] try: self.sock = (pid, self.sockets.pop()) except IndexError: self.sock = (pid, self.socket_factory()) return self.sock[1] def return_socket(self): if self.sock is not None and self.sock[0] == os.getpid(): # There's a race condition here, but we deliberately # ignore it. It means that if the pool_size is 10 we # might actually keep slightly more than that. if len(self.sockets) < self.pool_size: self.sockets.append(self.sock[1]) else: self.sock[1].close() self.sock = None pymongo.connection._Pool = GPool

    Read the article

  • Illegal Argument Exception in Google Wave App

    - by Yoenhofen
    I'm writing a Google Wave robot and I just messed something up. It was working just fine but now I'm getting an IllegalArgument exception on the line that includes query.execute. Am I doing something stupid? I've seen several code samples very similar to what I'm doing. I can include the code of the WaveUpdate class if necessary. The intent here is to select all WaveUpdate members that have an updateDateTime in the last hour. PersistenceManager pm = PMF.get().getPersistenceManager(); try { Query query = pm.newQuery(WaveUpdate.class); query.setFilter("emailAddress > '' && updateDateTime > referenceDateTime"); query.declareParameters("java.util.Date referenceDateTime"); Calendar referenceDateTime = Calendar.getInstance(); referenceDateTime.add(Calendar.HOUR_OF_DAY, -1); List<WaveUpdate> updates = (List<WaveUpdate>) query.execute(referenceDateTime.getTime());

    Read the article

  • DataTable throwing exception on RejectChanges

    - by Vale
    I found this bug while working with a DataTable. I added a primary key column to a DataTable, than added one row to that table, removed that row, and added row with the same key to the table. This works. When I tried to call RejectChanges() on it, I got ConstraintException saying that value is already present. Here is the example: var dataTable = new DataTable(); var column = new DataColumn("ID", typeof(decimal)); dataTable.Columns.Add(column); dataTable.PrimaryKey = new [] {column }; decimal id = 1; var oldRow = dataTable.NewRow(); oldRow[column] = id; dataTable.Rows.Add(oldRow); dataTable.AcceptChanges(); oldRow.Delete(); var newRow = dataTable.NewRow(); newRow[column] = id; dataTable.Rows.Add(newRow); dataTable.RejectChanges(); // This is where it crashes I think since the row is deleted, exception should not be thrown (constraint is not violated because row is in deleted state). Is there something I can do about this? Any help is appreciated.

    Read the article

  • URI scheme is not "file"

    - by Ankur
    I get the exception: "URI scheme is not file" The url I am playing with is ... and it very much is a file http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/domefisheye/ladybug/fish4.jpg What I am doing is trying to get the name of a file and then save that file (from another server) onto my computer/server from within a servlet. I have a String called "url", from thereon here is my code: url = Streams.asString(stream); //gets the URL from a form on a webpage System.out.println("This is the URL: "+url); URI fileUri = new URI(url); File fileFromUri = new File(fileUri); onlyFile = fileFromUri.getName(); URL fileUrl = new URL(url); InputStream imageStream = fileUrl.openStream(); String fileLoc2 = getServletContext().getRealPath("pics/"+onlyFile); File newFolder = new File(getServletContext().getRealPath("pics")); if(!newFolder.exists()){ newFolder.mkdir(); } IOUtils.copy(imageStream, new FileOutputStream("pics/"+onlyFile)); } The line causing the error is this one: File fileFromUri = new File(fileUri); I have added the rest of the code so you can see what I am trying to do.

    Read the article

  • MKMapKit exception when using canShowCallout on annotation view

    - by Kendall Helmstetter Gelner
    I'm trying to use a pretty straightforward custom map annotation view and callout - the annotation view when I create it, just adds a UIImageView as a subview to itself. That works fine. However, when I call canShowCallout on the annotation view, An exception is thrown in MapKit immediately after returning the view. The end of the stack looks like: #0 0x94e964e6 in objc_exception_throw #1 0x01e26404 in -[MKOverlayView _addViewForAnnotation:] #2 0x01e22037 in -[MKOverlayView _addViewsForAnnotations:animated:] #3 0x01e1ddf9 in -[MKOverlayView showAddedAnnotationsAnimated:] #4 0x01df9c0e in -[MKMapView _showAddedAnnotationsAndRouteAnimated:] #5 0x01e0371a in -[MKMapView levelView:didLoadTile:] My viewForAnnotation is pretty simple: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { if ( ! [annotation isKindOfClass:[MyAnnotation class]] ) return nil; MyAnnotationView *useView = (MyAnnotationView *)[myMapView dequeueReusableAnnotationViewWithIdentifier:@"resuseview"]; if ( useView == nil ) { useView = [[[MyAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"resuseview"] autorelease]; useView.canShowCallout = YES; // if commented out view appears just fine } else { useView.annotation = annotation; } return useView; } As noted in the code, the annotation view works fine as is - until I add canShowCallout, then it crashes the first time the map gets the view.

    Read the article

  • ObjectDisposedException when .Show()'ing a form that shouldn't be disposed.

    - by user320781
    ive checked out some of the other questions and obviously the best solution is to prevent the behavior that causes this issue in the first place, but the problem is very intermittent, and very un-reproduceable. I basically have a main form, with sub forms. The sub forms are shown from menus and/or buttons from the main form like so: private void myToolStripMenuItem_Click(object sender, EventArgs e) { try { xDataForm.Show(); xDataForm.Activate(); } catch (ObjectDisposedException) { MessageBox.Show("ERROR 10103"); ErrorLogging newLogger = new ErrorLogging("10103"); Thread errorThread = new Thread(ErrorLogging.writeErrorToLog); errorThread.Start(); } } and the sub forms are actually in the main form(for better or worse. i would actually like to change this but would be a considerable amount of time to do so): public partial class FormMainScreen : Form { Form xDataForm = new xData(); ...(lots more here) public FormMainScreen(int pCount, string pName) { InitializeComponent(); ... } ... } The Dispose function for the sub form is modified so that, the 'close' and 'X' buttons actually hide the form so we dont have to re-create it every time. When the main screen closes, it sets a "flag" to 2, so the other forms know that it is actually ok to close; protected override void Dispose(bool disposing) { if (FormMainScreen.isExiting == 2) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } else { if (xData.ActiveForm != null) { xData.ActiveForm.Hide(); } } } So, the question is, why would this work over and over and over again flawlessly, but, literally, about every 1/1000 of the time, cause an exception, or rather, why is my form being disposed? I had a suspicion that the garbage collector was getting confused, because it occurs slightly more frequently after it has been running for many hours.

    Read the article

  • zend session exception on zend_session::start with forms

    - by Grant Collins
    Hi I'm having issues with trying to use Zend_Form_SubForm and sessions. My controller is in essance acting a wizard showing different subforms depending on the stage of the wizard. Using the example I am planning on storing the forms in a session namespace. My controller looks like this. include 'mylib/Form/addTaskWizardForm.php'; class AddtaskController extends Zend_Controller_Action{ private $config = null; private $log = null; private $subFormSession = null; /** * This function is called and initialises the global variables to this object * which is the configuration details and the logger to write to the log file. */ public function init(){ $this->config = Zend_Registry::getInstance()->get('config'); $this->log = Zend_Registry::getInstance()->get('log'); //set layout $this->_helper->layout->setLayout('no-sidemenus'); //we need to get the subforms and $wizardForms = new addTaskWizardForm(); $this->subFormSession = new Zend_Session_Namespace('addTaskWizardForms'); if(!isset($this->subFormSession->subforms)){ $this->subFormSession->subforms = $wizardForms; } } /** * The Landing page controller for the site. */ public function indexAction(){ $form = $this->subFormSession->subforms->getSubForm('start'); $this->view->form = $form; } However this is causing the application session to crash out with Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() Any idea why this is having issues with the Zend Session?? thanks.

    Read the article

  • how to fix error in bitmap size exceeds VM budget

    - by narasimha
    hi folks i am working one application image uploading to sdcard i am scaling that sdcard saved into database some times one error is occurs bitmap size exceeds vm budget ouput : 01-11 15:39:51.809: ERROR/AndroidRuntime(6214): Uncaught handler: thread main exiting due to uncaught exception 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): java.lang.OutOfMemoryError: bitmap size exceeds VM budget 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:384) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:397) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at com.fitzgeraldsoftware.shout.presentationLayer.Shout.onActivityResult(Shout.java:1653) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.Activity.dispatchActivityResult(Activity.java:3624) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread.deliverResults(ActivityThread.java:3220) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3266) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread.access$2600(ActivityThread.java:116) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.os.Handler.dispatchMessage(Handler.java:99) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.os.Looper.loop(Looper.java:123) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread.main(ActivityThread.java:4203) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at java.lang.reflect.Method.invokeNative(Native Method) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at java.lang.reflect.Method.invoke(Method.java:521) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at dalvik.system.NativeStart.main(Native Method) how can fix the error please forward some solution thanks in advance

    Read the article

  • Java XHTML Doclet: fatal exception

    - by Cheeso
    Has anyone used XHTML Doclet, and can you provide some hints as to how to get it to work successfully? I run it like this: \sunjdk\bin\javadoc -doclet net.sourceforge.xhtmldoclet.Doclet -docletpath c:\sw\java\XHTML_Doclet_0.4.jar -d <output> [class files here] (all on one line) When I run it I get this: javadoc: error - In doclet class net.sourceforge.xhtmldoclet.Doclet, method validOptions has thrown an exception java.lang.reflect.InvocationTargetException java.lang.Error: Fatal: Resource (net.sourceforge.xhtmldoclet.resources.doclet) for javadoc doclets is missing. at com.sun.tools.doclets.internal.toolkit.util.MessageRetriever.getText(MessageRetriever.java:110) at com.sun.tools.doclets.internal.toolkit.util.MessageRetriever.getText(MessageRetriever.java:92) at com.sun.tools.doclets.internal.toolkit.util.MessageRetriever.getText(MessageRetriever.java:81) at com.sun.tools.doclets.internal.toolkit.Configuration.getText(Configuration.java:634) at com.sun.tools.doclets.internal.toolkit.Configuration.generalValidOptions(Configuration.java:515) at net.sourceforge.xhtmldoclet.Config.validOptions(Unknown Source) at net.sourceforge.xhtmldoclet.Doclet.validOptions(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269) at com.sun.tools.javadoc.DocletInvoker.validOptions(DocletInvoker.java:198) at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:317) at com.sun.tools.javadoc.Start.begin(Start.java:128) at com.sun.tools.javadoc.Main.execute(Main.java:41) at com.sun.tools.javadoc.Main.main(Main.java:31) 1 error It seems like it ought to just work. What am I doing wrong?

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >