Search Results

Search found 16643 results on 666 pages for 'exception handling'.

Page 13/666 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Sending an email when an Exception is Thrown

    - by hariubc
    Hi: I have written a java class where if a method throws an exception, an email is sent, via java mail, with a report to the administrators. It works - my question is w.r.t elegance - to catch the exception thrown by the main method, the sendEmail() method resides in the catch block of the main method. The sendEmail() method has its own try-catch block. In effect - it looks like below - is there a more beautiful way of writing this? try { foo; } catch { try{ sendEmail(); } catch { log(e.message); } }

    Read the article

  • JDBC ResultSet.getString Before/After Start/End of ResultSet Exception

    - by Geowil
    I have done a lot of searching about this topic through Google but I have yet to find someone using getString() in the way that I am using it so I have not been able to fix this issue in the normal ways that are suggested. What I am trying to do is to obtain all of the information from the database and then use it to populate a table model within the program. I do so by obtaining the data with getString and place it into a String[] object: try { while (rSet.next()) { String row[] = {rSet.getString("DonorName"),rSet.getString("DonorCharity"),((String)rSet.getString("DonationAmount"))}; model.addRow(row); } } However I am always getting a dialog error message stating those error messages in the title: Exception: Before start of result set Exception: After end of result set The data is still added and everything works correctly but it is just annoying to have to dismiss those message windows. Does anyone have some suggestions?

    Read the article

  • JsonStore.insert() causes exception in extjs

    - by kalan
    I have an EditorGridPanel with toolbar button to add new records. Everything works fine except one scenario. When I try to insert a record which already exists in database, server sends back: {"success":false,"message":"already exists","data":{}} but grid creates a new row marked with red triangle. If after that I try to insert a new record (even if it doesn't exist in database), everything works fine on the server side, but i get an 'uncaught exception' in firebug. It says: 'uncaught exception: Ext.data.DataReader: #realize was called with invalid remote-data. Please see the docs for DataReader#realize and review your DataReader configuration.' why is that?

    Read the article

  • The Java interface doesn't declare any exception. How to manage checked exception of the implementat

    - by Frór
    Let's say I have the following Java interface that I may not modify: public interface MyInterface { public void doSomething(); } And now the class implementing it is like this: class MyImplementation implements MyInterface { public void doSomething() { try { // read file } catch (IOException e) { // what to do? } } } I can't recover from not reading the file. A subclass of RuntimeException can clearly help me, but I'm not sure if it's the right thing to do: the problem is that that exception would then not be documented in the class and a user of the class would possibly get that exception an know nothing about solving this. What can I do?

    Read the article

  • Python continue from the point where exception was thrown

    - by James Lin
    Hi is there a way to continue from the point where exception was thrown? eg I have the following psudo code unique code 1 unique code 2 unique code 3 if I want to ignore the exceptions of any of the unique code statements I will have to do it like this: try: #unique code 1 except: pass try: #unique code 2 except: pass try: #unique code 3 except: pass but this isn't elegant to me, and for the life of me I can't remember how I resolved this kind of problem last time... what I want to have is something like try: unique code 1 unique code 2 unique code 3 except: continue from last exception raised

    Read the article

  • C++ catch constructor exception

    - by aaa
    hi. I do not seem to understand how to catch constructor exception. Here is relevant code: struct Thread { rysq::cuda::Fock fock_; template<class iterator> Thread(const rysq::cuda::Centers &centers, const iterator (&blocks)[4]) : fock_() { if (!fock_) throw; } }; Thread *ct; try { ct = new Thread(centers_, blocks); } catch(...) { return false; } // catch never happens, So catch statement do not execute and I get unhandled exception. What did I do wrong? this is straight C++ using g++.

    Read the article

  • Exception handling in WebForms

    - by user999379
    I have a webform with a formview <asp:FormView ID="formViewBrouwers" runat="server" AllowPaging="True" DataKeyNames="BrouwerNr" DataSourceID="brouwerDataSource" onitemupdated="formViewBrouwers_ItemUpdated" onitemupdating="formViewBrouwers_ItemUpdating" oniteminserted="formViewBrouwers_ItemInserted" oniteminserting="formViewBrouwers_ItemInserting"> <EditItemTemplate> BrouwerNr: <asp:Label ID="BrouwerNrLabel1" runat="server" Text='<%# Eval("BrouwerNr") %>' /> <br /> BrNaam: <asp:TextBox ID="BrNaamTextBox" runat="server" Text='<%# Bind("BrNaam") %>' /> <br /> Adres: <asp:TextBox ID="AdresTextBox" runat="server" Text='<%# Bind("Adres") %>' /> <br /> Postcode: <asp:TextBox ID="PostcodeTextBox" runat="server" Text='<%# Bind("Postcode") %>' /> <br /> Gemeente: <asp:TextBox ID="GemeenteTextBox" runat="server" Text='<%# Bind("Gemeente") %>' /> <br /> Omzet: <asp:TextBox ID="OmzetTextBox" runat="server" Text='<%# Bind("Omzet") %>' /> <br /> Status: <asp:TextBox ID="StatusTextBox" runat="server" Text='<%# Bind("Status") %>' /> <br /> <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" /> &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </EditItemTemplate> <InsertItemTemplate> BrNaam: <asp:TextBox ID="BrNaamTextBox" runat="server" Text='<%# Bind("BrNaam") %>' /> <br /> Adres: <asp:TextBox ID="AdresTextBox" runat="server" Text='<%# Bind("Adres") %>' /> <br /> Postcode: <asp:TextBox ID="PostcodeTextBox" runat="server" Text='<%# Bind("Postcode") %>' /> <br /> Gemeente: <asp:TextBox ID="GemeenteTextBox" runat="server" Text='<%# Bind("Gemeente") %>' /> <br /> Omzet: <asp:TextBox ID="OmzetTextBox" runat="server" Text='<%# Bind("Omzet") %>' /> <br /> Status: <asp:TextBox ID="StatusTextBox" runat="server" Text='<%# Bind("Status") %>' /> <br /> <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /> &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </InsertItemTemplate> <ItemTemplate> BrouwerNr: <asp:Label ID="BrouwerNrLabel" runat="server" Text='<%# Eval("BrouwerNr") %>' /> <br /> BrNaam: <asp:Label ID="BrNaamLabel" runat="server" Text='<%# Bind("BrNaam") %>' /> <br /> Adres: <asp:Label ID="AdresLabel" runat="server" Text='<%# Bind("Adres") %>' /> <br /> Postcode: <asp:Label ID="PostcodeLabel" runat="server" Text='<%# Bind("Postcode") %>' /> <br /> Gemeente: <asp:Label ID="GemeenteLabel" runat="server" Text='<%# Bind("Gemeente") %>' /> <br /> Omzet: <asp:Label ID="OmzetLabel" runat="server" Text='<%# Bind("Omzet") %>' /> <br /> Status: <asp:Label ID="StatusLabel" runat="server" Text='<%# Bind("Status") %>' /> <br /> <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" /> &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" /> &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New" Text="New" /> </ItemTemplate> <PagerSettings Mode="NextPreviousFirstLast" /> </asp:FormView> In my property Postcode I check the value like this: private Int16 postcodeValue; public Int16 Postcode { get { return postcodeValue; } set { if (value < 1000 || value > 9999) { throw new Exception("Postcode moet tussen 1000 en 9999 liggen"); } else { postcodeValue = value; } } } How can I handle the exception I threw? If there is an exception I want a label to appear with the following exception?

    Read the article

  • c++: strange syntax in what() method of std::exception

    - by Patrick Oscity
    When i am inheriting from std::exception in order to define my own exception type, i need to override the what() method, which has the following signature: virtual const char* what() const throw(); This definitely looks strange to me, like if there were two method names in the signature. Is this some very specific syntax, like with pure virtual methods, e.g.: virtual int method() const = 0; or is this a feature, that could somehow be used in another context, too? And if so, for what could it be used?

    Read the article

  • Browser not handling exception from AJAX panel, ASP.NET c#

    - by Grant
    Hi, i am having trouble catching errors in an AJAX panel. Even when i throw an exception in the c# code behind the front end completely ignores it. Here is the code i have setup, can anyone see why? I ideally want to show a js alert window on error. Code Behind: protected void btnX_Click(object sender, EventArgs e) { throw new ApplicationException("test"); } protected void ScriptManager_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e) { ScriptManager.AsyncPostBackErrorMessage = e.Exception.Message; } Markup: <script type="text/javascript" language="javascript"> Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); function EndRequestHandler(sender, e) { window.alert(e.get_error().name); } </script> <asp:ScriptManager ID="ScriptManager" runat="server" AllowCustomErrorsRedirect="true" OnAsyncPostBackError="ScriptManager_AsyncPostBackError" />

    Read the article

  • Exception message (Python 2.6)

    - by TurboJupi
    If I want to open binary file (in Python 2.6), that doesn't exists, program exits with an error and prints this: Traceback (most recent call last): File "C:\Python_tests\Exception_Handling\src\exception_handling.py", line 4, in <module> pkl_file = open('monitor.dat', 'rb') IOError: [Errno 2] No such file or directory: 'monitor.dat' I can handle this with 'try-except', like: try: pkl_file = open('monitor.dat', 'rb') monitoring_pickle = pickle.load(pkl_file) pkl_file.close() except Exception: print 'No such file or directory' Does anybody know, how could I, in caught Exception, print the following line? File "C:\Python_tests\Exception_Handling\src\exception_handling.py", line 11, in <module> pkl_file = open('monitor.dat', 'rb') So, program would not exits, and I would have useful information.

    Read the article

  • Can somebody explain the difference between exceptions and errors (specific to PHP)?

    - by letseatfood
    I am having trouble figuring the best way to display errors to my clients. Should I use exceptions or errors? For example, if the user's login information does not match the database, should I throw new Exception('Login information is incorrect. Please try again.') and catch it with an exception handler using set_exception_handler()? Or, should I use trigger_error() to display an error message to the user? I think the main issue is that I cannot differentiate between errors and exceptions. I have read a lot of "answers" to this question on the internet and in some books, but it seems that people are really divided or aren't sure. Thanks!

    Read the article

  • returning null or throwing an exception?

    - by MoKi
    I have the following types: typedef QPair < QTime , QTime > CalculatedTimeSlotRange; typedef QList < CalculatedTimeSlotRange > CalculatedTimeSlotRangeList; typedef QHash < quint8 , CalculatedTimeSlotRangeList > TimeSlotsTable; I have a function like the following: const CalculatedTimeSlotRangeList* TimeSlots::getCalculatedTimeSlotRangeList(const quint8 id) const { QHashIterator<quint8,CalculatedTimeSlotRangeList> it(mTimeSlotsTable); while (it.hasNext()) { it.next(); if(it.key() == id) { return &it.value(); } } return NULL; } as you can see my function returns a null if it fails to find a key that matches id. Is this correct? or should I just throw an exception if the key does not exist? how should i throw an exception for this situation?

    Read the article

  • Convert an exception into HTTP 404 response in the Application_Error

    - by Dmitriy Nagirnyak
    Hi, First of all, quickly what exactly I want to achieve: translate particular exception into the HTTP 404 so the ASP.NET can handle it further. I am handling exceptions in the ASP.NET (MVC2) this way: protected void Application_Error(object sender, EventArgs e) { var err = Server.GetLastError(); if (err == null) return; err = err.GetBaseException(); var noObject = err as ObjectNotFoundException; if (noObject != null) HandleObjectNotFound(); var handled = noObject != null; if (!handled) Logger.Fatal("Unhandled exception has occured in application.", err); } private void HandleObjectNotFound() { Server.ClearError(); Response.Clear(); // new HttpExcepton(404, "Not Found"); // Throw or not to throw? Response.StatusCode = 404; Response.StatusDescription = "Not Found"; Response.StatusDescription = "Not Found"; Response.Write("The whole HTML body explaining whata 404 is??"); } The problem is that I cannot configure default customErrors to work with it. When it is on then it never redirects to the page specified in customErrors: <error statusCode="404" redirect="404.html"/>. I also tried to raise new HttpExcepton(404, "Not Found") from the handler but then the response code is 200 which I don't understand why. So the questions are: What is the proper way of translating AnException into HTTP 404 response? How does customErrors section work when handling exceptions in Application_Error? Why throwing HttpException(404) renders (blank) page with success (200) status? Thanks, Dmitriy.

    Read the article

  • Translate an exception into 404 from Application_Error

    - by Dmitriy Nagirnyak
    Hi, First of all, quickly what exactly I want to achieve: translate particular exception into the HTTP 404 so the ASP.NET can handle it further. I am handling exceptions in the ASP.NET (MVC2) this way: protected void Application_Error(object sender, EventArgs e) { var err = Server.GetLastError(); if (err == null) return; err = err.GetBaseException(); var noObject = err as ObjectNotFoundException; if (noObject != null) HandleObjectNotFound(); var handled = noObject != null; if (!handled) Logger.Fatal("Unhandled exception has occured in application.", err); } private void HandleObjectNotFound() { Server.ClearError(); Response.Clear(); // new HttpExcepton(404, "Not Found"); // Throw or not to throw? Response.StatusCode = 404; Response.StatusDescription = "Not Found"; Response.StatusDescription = "Not Found"; Response.Write("The whole HTML body explaining whata 404 is??"); } The problem is that I cannot configure default customErrors to work with it. When it is on then it never redirects to the page specified in customErrors: <error statusCode="404" redirect="404.html"/>. I also tried to raise new HttpExcepton(404, "Not Found") from the handler but then the response code is 200 which I don't understand why. So the questions are: What is the proper way of translating AnException into HTTP 404 response? How does customErrors section work when handling exceptions in Application_Error? Why throwing HttpException(404) renders (blank) page with success (200) status? Thanks, Dmitriy.

    Read the article

  • Design Pattern for error handling in ASP.NET 3.5 site

    - by Kevin
    I am relatively new to ASP.NET programming, and web programming in general. We have a site we recently ported from .NET 1.1 to 3.5. Currently we have two methods of error handling: either catching the error during data load on a page and displaying the formatted error in a label on the page, or redirecting to a generic error page. Both of these are somewhat annoying, as right now I'm trying to redesign how our errors are displayed. We are soon moving to Master pages, and I'm wondering if there is a way to "build in" an error handling control. What I mean by this is using a ASP.NET user control I've designed that simply gets passed the error string returned from the server. If an error occurs, the page would not display the content, and instead display the error control. This provides us with the ability to retain the current banner/navigation during an error (which we don't get with the generic error page), as well as keeping me from having to add the control to every aspx page we have (which I have to do with using the label-per-page system). Does something like this make sense? Ultimately I just want to have the error control added to a single page, and all other pages have access to it directly. Is this something Master pages help with? Thanks!

    Read the article

  • Centralized Exception handling for Eclipse plug-in

    - by Svilen
    Hello, At first I thought this would be question often asked, however trying (and failing) to look up info on this proved me wrong. Is there a mechanism in Eclipse platform for centralized exception handling of exceptions? For example... You have plug-in project which connects to a DB and issues queries, results of which are used to populate some e.g. views. This is like the most common example ever. :) Queries are executed almost for any user action, from every UI control the plug-in provides. Most likely the DB Query API will have some specific to the DB SomeDBGeneralException declared as being thrown by it. That's OK, you can handle those according to whatever your software design is. But how about unchecked exceptions which are likely to occur, e.g. , when communication with DB suddenly breaks for some network related reason? What if in such case one would like to catch those exceptions in a central place and for example provide user friendly message to the user (rather than the low level communication protocol api messages) and even some possible actions the user could execute in order to deal with the specific problem? Thinking in Eclipse platform context, the question may be rephrased as "Is there an extension point like "org.eclipse.ExceptionHandler" which allows to declare exception handlers for specific (some kind of filtering support) exceptions giving a lot of flexibility with the actual handling?"

    Read the article

  • Using callback functions for error handling in C

    - by Earlz
    Hi, I have been thinking about the difficulty incurred with C error handling.. like who actually does if(printf("hello world")==-1){exit(1);} But you break common standards by not doing such verbose, and usually useless coding. Well what if you had a wrapper around the libc? like so you could do something like.. //main... error_catchall(my_errors); printf("hello world"); //this will automatically call my_errors on an error of printf ignore=1; //this makes it so the function will return like normal and we can check error values ourself if(fopen.... //we want to know if the file opened or not and handle it ourself. } int my_errors(){ if(ignore==0){ _exit(1); //exit if we aren't handling this error by flagging ignore } return 0; //this is called when there is an error anywhere in the libc } ... I am considering making such a wrapper as I am synthesizing my own BSD licensed libc(so I already have to touch the untouchable..), but I would like to know what people think about it.. would this actually work in real life and be more useful than returning -1?

    Read the article

  • Request format is unrecognized for URL unexpectedly ending exception in web service.

    - by Jalpesh P. Vadgama
    Recently I was getting error when I am calling web service using Java script. I searching on net and debugging I have found following things. Any web service support three kinds of protocol HttpGet,HttpPost and SOAP. In framework 1.0 it was enabled by default but after 1.0 framework it will not be enabled by default due to security issues and WS-Specifications. So we have to enabled them via putting configuration settings in web.config. Here is the code for that. <configuration> <system.web> <webservices> <protocols> <add name="HttpGet"></add> <add name="HttpPost"></add> </protocols> </webservices> </system.web> </configuration> Hope this will help you. Stay tuned for more. Till that Happy programming!!!. Technorati Tags: WebService,Request,Javascript,Ajax

    Read the article

  • Can't find the source of an exception in Java

    - by Invader Zim
    Basically an exception is being thrown and I can't find the reason. Here is what I get on the console: Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 0 at org.apache.batik.gvt.renderer.StrokingTextPainter.computeTextRuns(Unknown Source) at org.apache.batik.gvt.renderer.StrokingTextPainter.getTextRuns(Unknown Source) at org.apache.batik.gvt.renderer.StrokingTextPainter.getOutline(Unknown Source) at org.apache.batik.gvt.renderer.BasicTextPainter.getGeometryBounds(Unknown Source) at org.apache.batik.gvt.TextNode.getGeometryBounds(Unknown Source) at org.apache.batik.gvt.TextNode.getSensitiveBounds(Unknown Source) at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedSensitiveBounds(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.nodeHitAt(Unknown Source) at org.apache.batik.gvt.event.AbstractAWTEventDispatcher.dispatchMouseEvent(Unknown Source) at org.apache.batik.gvt.event.AbstractAWTEventDispatcher.dispatchEvent(Unknown Source) at org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(Unknown Source) at org.apache.batik.gvt.event.AbstractAWTEventDispatcher.mouseEntered(Unknown Source) at org.apache.batik.swing.gvt.AbstractJGVTComponent$Listener.dispatchMouseEntered(Unknown Source) at org.apache.batik.swing.svg.AbstractJSVGComponent$SVGListener.dispatchMouseEntered(Unknown Source) at org.apache.batik.swing.gvt.AbstractJGVTComponent$Listener.mouseEntered(Unknown Source) at java.awt.AWTEventMulticaster.mouseEntered(Unknown Source) at java.awt.AWTEventMulticaster.mouseEntered(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.trackMouseEnterExit(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$400(Unknown Source) at java.awt.EventQueue$2.run(Unknown Source) at java.awt.EventQueue$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) It is obviously from a batik lib that I use to paint SVG files, but I made sure that nothing is painted until the document is loaded, ready and showing on screen. When thrown nothing is painted. Another interesting thing is the timing of the throwing. I am unable to find any logical patern, as sometimes it is thrown as soon as I initiate the class and sometimes it needs more then five minutes. In addition to this, as far as I tested there is no single action that calls repaint() that triggers it or rather all do. I am new to Java and all the other exceptions had the class and row number of where they were thrown so I don't know what to do here. Any suggestions would be greatly appreciated. The code is enormous so I'll put just the paint method and if anything additional is needed please say so. @Override public void paint(Graphics g) { if(documentLoaded && showingOnScreen){ try{ rad = (int)(radInit+zoom*faktorRad); //max rad = 20 super.paint(g); Graphics2D g2d = (Graphics2D) g; paintElements(g2d); } catch(NullPointerException nulle){ } } } edit: There is no array in my class so i can't check any index. I think that this exception is thrown from a library I use, but it's a .jar file and I don't know how to open it.

    Read the article

  • .NET remoting exception: Exception in the Socket#33711845::DoBind - Only one usage of each socket ad

    - by wollemi
    Hi All, I'm attempting to setup a simple remoting windows service and getting the following error when starting the service: "System.Net.Sockets Error: 0 : [4180] Exception in the Socket#33711845::DoBind - Only one usage of each socket address (protocol/network address/port) is normally permitted System.Net.Sockets Verbose: 0 : [4180] ExclusiveTcpListener#4032828::Start() System.Net.Sockets Verbose: 0 : [4180] Socket#33711845::Bind(0:9998#9998) System.Net.Sockets Error: 0 : [4180] Exception in the Socket#33711845::DoBind - Only one usage of each socket address (protocol/network address/port) is normally permitted ". In the windows service application I have the following code in the "OnStart" method - the error occurs when registering the Channel - ChannelServices.RegisterChannel(tcpPipe, true); As far as I can tell there are no other processes using port 9998 ... Your help to resolve this is most appreciated! protected override void OnStart(string[] args) { int portNumber = int.Parse(ConfigurationManager.AppSettings["endPointTCPPort"]); TcpChannel tcpPipe = new TcpChannel(portNumber); ChannelServices.RegisterChannel(tcpPipe, true); Type serviceType = Type.GetType("TractionGatewayService.TractionGateway"); try { RemotingConfiguration.RegisterWellKnownServiceType(serviceType, "updateCustomerDetails", WellKnownObjectMode.SingleCall); } catch (RemotingException e) { EventLog.WriteEntry("unable to establish listening port because " + e.message; ChannelServices.UnregisterChannel(tcpPipe); } w

    Read the article

  • FaultException<T>() exception thrown by the service is not caught by the client catch(FaultException

    - by Ashish Gupta
    Ok, I know I am missing something here. I have the following operation contract: public double DivideByZero(int x, int y) { if (y == 0) { throw new FaultException<ArgumentException> (new ArgumentException("Just some dummy exception") ,new FaultReason("some very bogus reason"), new FaultCode("007")); } return x / y; } And following is taken from the client:- Console.WriteLine("Enter the x value"); string x = Console.ReadLine(); Console.WriteLine("Enter the Y value"); string y = Console.ReadLine(); try { double val = client.DivideByZero(Convert.ToInt32(x), Convert.ToInt32(y)); Console.WriteLine("The result is " + val.ToString()); } catch(FaultException<ArgumentException> exp) { Console.WriteLine("An ArgumentException was thrown by the service "+ exp.ToString()); } catch (Exception exp) { Console.WriteLine(exp.ToString()); } In the above case catch(FaultException exp) (the first catch block with ArgumentException in the client code) block does not get executed. However, when I remove ArgumentException to have catch(FaultException exp), the same catch block gets executed. I am not sure about this as I am throwing FaultException from my operation contract. Am I missing anything here. Appreciate your help, Ashish

    Read the article

  • NserviceBus throws exception when referencing a Nettiers assembly

    - by IGoor
    We use nettiers as a our data layer, and we recently have started looking at using NServiceBus, but we have hit a wall. We have a windows service which hosts NSB and references our Nettiers assembly. the service is throwing an exception when the following line is encountered. var Bus = Configure.With().SpringBuilder() .XmlSerializer() .MsmqTransport() .IsTransactional(false) .PurgeOnStartup(false) .UnicastBus() .ImpersonateSender(false) .CreateBus() .Start(); the exceptions that is throw is: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. the loader exception message is: Could not load file or assembly 'Microsoft.Practices.Unity, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.":"Microsoft.Practices.Unity, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 stacktrace is: at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark) at System.Reflection.Assembly.GetTypes() at NServiceBus.Configure.<>c__DisplayClass1.<With>b__0(Assembly a) in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs:line 122 at System.Array.ForEach[T](T[] array, Action`1 action) at NServiceBus.Configure.With(Assembly[] assemblies) in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs:line 122 at NServiceBus.Configure.With(IEnumerable`1 assemblies) in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs:line 111 at NServiceBus.Configure.With(String probeDirectory) in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs:line 101 at NServiceBus.Configure.With() in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs:line 78 at MessageSender.Program.Main(String[] args) in C:\Development\NSBTest4\MessageSender\Program.cs:line 18 without the nettiers reference NSB works fine. Any idea what the problem is and how to solve it? thanks.

    Read the article

  • AppletClassLoader exception : class not found

    - by gautam
    Hi, I am getting exception when i am trying to open an applet in my jsp. My jsp and applet is in same directory. My code is like: <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="720" height="500"`enter code here` type="application/x-java-applet;version=1.5"> <param name="type" value="application/x-java-applet;version=1.5"> <param name="code" value="com.timer.AppletGenerator.class"> <param name="codebase" value="."> <param name="ARCHIVE" value="Applet.jar, jcommon-1.0.0.jar, jfreechart-1.0.0.jar, log4j-1.2.13.jar, itext-1.3.1.jar" embed width="720" height="500" type="application/x-java-applet;version=1.5" code="com.timer.AppletGenerator.class" codebase="." ARCHIVE='Applet.jar, jcommon-1.0.0.jar, jfreechart-1.0.0.jar, log4j-1.2.13.jar, itext-1.3.1.jar' > </embed> </object> My AppletGenerator.class is like: public class AppletGenerator extends JApplet { public void init() { //Some code } } earlier it was woking fine. But now when i sign and verify the new jar its giving exception: load: class com.timer.AppletGenerator.class not found. java.lang.ClassNotFoundException: com.timer.AppletGenerator.class at sun.applet.AppletClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadCode(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.plugin.AppletViewer.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: open HTTP connection failed. at sun.applet.AppletClassLoader.getBytes(Unknown Source) at sun.applet.AppletClassLoader.access$100(Unknown Source) at sun.applet.AppletClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) ... 10 more I have searched a lot but didnt get any correct answer. There are few posts regarding this in stactoverflow but that also didnt work. Thanks and Regards,

    Read the article

  • Twitter4J throws exception in TwitterFactory

    - by Philipp Andre
    Hello Guys, i'm trying to access twitter via oauth. Therefore, i registered my app, downloaded Twitter4j, added the jars in my Eclipse-Project, and then tried to execute the following code: Twitter twitter = new TwitterFactory().getOAuthAuthorizedInstance("[key]","[secretKey]); RequestToken requestToken = twitter.getOAuthRequestToken(); System.out.println(requestToken.getAuthorizationURL()); But it raises the following exception: [Sat May 29 11:19:11 CEST 2010]Using class twitter4j.internal.logging.StdOutLoggerFactory as logging factory. [Sat May 29 11:19:11 CEST 2010]Use twitter4j.internal.http.alternative.HttpClientImpl as HttpClient implementation. Exception in thread "main" java.lang.AssertionError: java.lang.reflect.InvocationTargetException at twitter4j.internal.http.HttpClientFactory.getInstance(HttpClientFactory.java:71) at twitter4j.internal.http.HttpClientWrapper.<init>(HttpClientWrapper.java:59) at twitter4j.http.OAuthAuthorization.init(OAuthAuthorization.java:83) at twitter4j.http.OAuthAuthorization.<init>(OAuthAuthorization.java:74) at twitter4j.TwitterFactory.getOAuthAuthorizedInstance(TwitterFactory.java:112) at MainProgram.main(MainProgram.java:18) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at twitter4j.internal.http.HttpClientFactory.getInstance(HttpClientFactory.java:65) ... 5 more Caused by: java.lang.NoClassDefFoundError: org/apache/http/impl/client/DefaultHttpClient at twitter4j.internal.http.alternative.HttpClientImpl.<init>(HttpClientImpl.java:63) ... 10 more I currently can't figure out why ... can you please give me some suggestions? Best regards Philipp

    Read the article

  • Xcode raises exception when refactoring

    - by Sam Gwydir
    When I run a refactor on my code in xcode, all the files are correctly refactored except one, and when I click to check the changes made in that file, the following 'Internal Error Occurs': Uncaught Exception: Invalid parameter not satisfying: fileName Stack Backtrace: The stack backtrace has been logged to the console. Here is what it spat out in the console: 4/7/10 06:47:30 Xcode[35355] [MT] Uncaught Exception: Invalid parameter not satisfying: fileName Backtrace: 0 0x92842bbd __raiseError (in CoreFoundation) 1 0x914b9509 objc_exception_throw (in libobjc.A.dylib) 2 0x92842908 +[NSException raise:format:arguments:] (in CoreFoundation) 3 0x98801dc3 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] (in Foundation) 4 0x98db0f8e -[NSDocument(NSDeprecated) initWithContentsOfFile:ofType:] (in AppKit) 5 0x0075c07e -[PBXTextFileDocument initWithContentsOfFile:ofType:] (in DevToolsInterface) 6 0x007dc5be -[PBXFileDocument initWithFileReference:usingType:] (in DevToolsInterface) 7 0x00b1c0f8 -[XCRefactoringFileChangeSet(XCRefactoringModule_HelperMethods) referencedTextFileDocument] (in DevToolsInterface) 8 0x00b1d1f4 -[XCRefactoringEditableExistingTextFileChangeSet populateComparator:] (in DevToolsInterface) 9 0x00ab19b7 -[XCRefactoringModuleFileItem populateComparator:previewFinished:] (in DevToolsInterface) 10 0x00aa4606 -[XCRefactoringModule(MasterListDelegate) outlineViewSelectionDidChange:] (in DevToolsInterface) 11 0x987381cb _nsnote_callback (in Foundation) 12 0x927ca3f9 __CFXNotificationPost (in CoreFoundation) 13 0x927c9e2a _CFXNotificationPostNotification (in CoreFoundation) 14 0x9872d098 -[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation) 15 0x9873a475 -[NSNotificationCenter postNotificationName:object:] (in Foundation) 16 0x98af1de2 -[NSTableView _enableSelectionPostingAndPost] (in AppKit) 17 0x98bd11d0 -[NSTableView mouseDown:] (in AppKit) 18 0x98bcfeea -[NSOutlineView mouseDown:] (in AppKit) 19 0x007596c3 -[PBXExtendedOutlineView mouseDown:] (in DevToolsInterface) 20 0x98b6e548 -[NSWindow sendEvent:] (in AppKit) 21 0x00757a06 -[XCWindow sendEvent:] (in DevToolsInterface) 22 0x98a871af -[NSApplication sendEvent:] (in AppKit) 23 0x006f6dec -[PBXExtendedApplication sendEvent:] (in DevToolsInterface) 24 0x98a1ac4f -[NSApplication run] (in AppKit) 25 0x98a12c85 NSApplicationMain (in AppKit) 26 0x0000eee1 27 0x000021a5 If you would like to take a look at the project I'm working on, here is a link to download my xcodeproject: Tea Timer.zip To recreate my problem, open Timer.h, attempt to refactor timeField to minuteField, use the preview function of refactor and then select Timer.m, to look at the changes supposedly made within. It will then raise this error without editing the file.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >