Search Results

Search found 13006 results on 521 pages for 'exception'.

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

  • Logout exception flooding elmah

    - by durilai
    I am using ASP.NET membership, and in particular a copy of the membership code included in the MVC project. I am also using elmah to log exceptions. I am getting flooded with the following when people sign out. System.Web.HttpException: Server cannot set status after HTTP headers have been sent. Here is the stack trace sent System.Web.HttpException: Server cannot set status after HTTP headers have been sent. at System.Web.HttpResponse.set_StatusCode(Int32 value) at System.Web.HttpResponseWrapper.set_StatusCode(Int32 value) at System.Web.Mvc.HandleErrorAttribute.OnException(ExceptionContext filterContext) at System.Web.Mvc.ControllerActionInvoker.InvokeExceptionFilters(ControllerContext controllerContext, IList`1 filters, Exception exception) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) at System.Web.Mvc.Controller.ExecuteCore() at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__4() at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0() at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End() at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) I cannot seem to find any reason for this. It is not causing an issue for end users, but would still like to resolve/learn about it. Thanks for any help or guidance.

    Read the article

  • sql exception when transferring project from usb to c:\

    - by jello
    I'm working on a C# windows program with Visual Studio 2008. Usually, I work from school, directly on my usb drive. But when I copy the folder on my hard drive at home, an sql exception is unhandled whenever I try to write to the database. it is unhandled at the conn.Open(); line. here's the exception unhandled Database 'L:\system\project\the_project\the_project\bin\Debug\PatientMonitoringDatabase.mdf' already exists. Choose a different database name. Cannot attach the file 'C:\Documents and Settings\Administrator\My Documents\system\project\the_project\the_project\bin\Debug\PatientMonitoringDatabase.mdf' as database 'PatientMonitoringDatabase'. it's weird, because my connection string says |DataDirectory|, so it should work on any drive... here's my connection string: string connStr = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\PatientMonitoringDatabase.mdf; " + "Initial Catalog=PatientMonitoringDatabase; " + "Integrated Security=True"; Someone told me to: Connect to localhost with SQL Server Management Studio Express, and remove/detach the existing PatientMonitoringDatabase database. Whether it's a persistent database or only active within a running application, you can't have 2 databases with the same name at the same time attached to a SQL Server instance. So I did that, and now it gives me: Directory lookup for the file "C:\Documents and Settings\Administrator\My Documents\system\project\the_project\the_project\bin\Debug\PatientMonitoringDatabase.mdf" failed with the operating system error 5(Access is denied.). Cannot attach the file 'C:\Documents and Settings\Administrator\My Documents\system\project\the_project\the_project\bin\Debug\PatientMonitoringDatabase.mdf' as database 'PatientMonitoringDatabase' I checked the files' properties, and I have allow for everyone. Does anyone know what's going on here?

    Read the article

  • Question about the Cloneable interface and the exception that should be thrown

    - by Nazgulled
    Hi, The Java documentation says: A class implements the Cloneable interface to indicate to the Object.clone() method that it is legal for that method to make a field-for-field copy of instances of that class. Invoking Object's clone method on an instance that does not implement the Cloneable interface results in the exception CloneNotSupportedException being thrown. By convention, classes that implement this interface should override Object.clone (which is protected) with a public method. See Object.clone() for details on overriding this method. Note that this interface does not contain the clone method. Therefore, it is not possible to clone an object merely by virtue of the fact that it implements this interface. Even if the clone method is invoked reflectively, there is no guarantee that it will succeed. And I have this UserProfile class: public class UserProfile implements Cloneable { private String name; private int ssn; private String address; public UserProfile(String name, int ssn, String address) { this.name = name; this.ssn = ssn; this.address = address; } public UserProfile(UserProfile user) { this.name = user.getName(); this.ssn = user.getSSN(); this.address = user.getAddress(); } // get methods here... @Override public UserProfile clone() { return new UserProfile(this); } } And for testing porpuses, I do this in main(): UserProfile up1 = new UserProfile("User", 123, "Street"); UserProfile up2 = up1.clone(); So far, no problems compiling/running. Now, per my understanding of the documentation, removing implements Cloneable from the UserProfile class should throw an exception in up1.clone() call, but it doesn't. I've read around here that the Cloneable interface is broken but I don't really know what that means. Am I missing something?

    Read the article

  • protecting COM interfaces from exceptions

    - by rmeador
    I have several dozen objects exposed through COM interfaces, each of which with many methods, totaling a few hundred methods. These interfaces expose business objects from my app to a scripting engine. I have been given the task of protecting every single one of these methods from exceptions being thrown (to catch them and return an error using COM's Error() function, which incidentally I can find no documentation on because it's impossible to google). To my understanding, this requires that I add a try/catch around the guts of each one of these methods. The catch blocks are going to be similar or identical for each and every one of these hundreds of methods, which strongly smells of a problem (massively violates the DRY principle), but I can't think of any way to avoid changing every method. As far as I can tell, these methods are invoked directly by COM, with no intervening code that I can hook into to catch the exceptions. My current best idea is to make a macro for the catch block, but that has it's own sort of code-smell. Can anyone come up with a better approach? BTW, my app's exceptions do not derive from std::exception, so if there is some way of COM automatically handling standard exceptions, it won't help. And I sadly cannot change the existing exceptions to derive from std::exception.

    Read the article

  • Destructors not called when native (C++) exception propagates to CLR component

    - by Phil Nash
    We have a large body of native C++ code, compliled into DLLs. Then we have a couple of dlls containing C++/CLI proxy code to wrap the C++ interfaces. On top of that we have C# code calling into the C++/CLI wrappers. Standard stuff, so far. But we have a lot of cases where native C++ exceptions are allowed to propagate to the .Net world and we rely on .Net's ability to wrap these as System.Exception objects and for the most part this works fine. However we have been finding that destructors of objects in scope at the point of the throw are not being invoked when the exception propagates! After some research we found that this is a fairly well known issue. However the solutions/ workarounds seem less consistent. We did find that if the native code is compiled with /EHa instead of /EHsc the issue disappears (at least in our test case it did). However we would much prefer to use /EHsc as we translate SEH exceptions to C++ exceptions ourselves and we would rather allow the compiler more scope for optimisation. Are there any other workarounds for this issue - other than wrapping every call across the native-managed boundary in a (native) try-catch-throw (in addition to the C++/CLI layer)?

    Read the article

  • ActiveRecord exceptions not rescued

    - by zoopzoop
    I have the following code block: unless User.exist?(...) begin user = User.new(...) # Set more attributes of user user.save! rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotUnique => e # Check if that user was created in the meantime user = User.exists?(...) raise e if user.nil? end end The reason is, as you can probably guess, that multiple processes might call this method at the same time to create the user (if it doesn't already exist), so while the first one enters the block and starts initializing a new user, setting the attributes and finally calling save!, the user might already be created. In that case I want to check again if the user exists and only raise the exception if it still doesn't (= if no other process has created it in the meantime). The problem is, that regularly ActiveRecord::RecordInvalid exceptions are raised from the save! and not rescued from the rescue block. Any ideas? EDIT: Alright, this is weird. I must be missing something. I refactored the code according to Simone's tip to look like this: unless User.find_by_email(...).present? # Here we know the user does not exist yet user = User.new(...) # Set more attributes of user unless user.save # User could not be saved for some reason, maybe created by another request? raise StandardError, "Could not create user for order #{self.id}." unless User.exists?(:email => ...) end end Now I got the following exception: ActiveRecord::RecordNotUnique: Mysql::DupEntry: Duplicate entry '[email protected]' for key 'index_users_on_email': INSERT INTO `users` ... thrown in the line where it says 'unless user.save'. How can that be? Rails thinks the user can be created because the email is unique but then the Mysql unique index prevents the insert? How likely is that? And how can it be avoided?

    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

  • vb.net A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in ms

    - by prasoon99
    I just installed Visual Basic 2010 Express. I created a simple console application: Module Module1 Sub Main() Dim i As Integer i = 0 End Sub End Module I'm getting the following error SIX times before I get to line "i = 0": A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll Can anyone help? Why is this happening? Is there something wrong with my configuration? -Prasoon

    Read the article

  • Filter on exception text in elmah

    - by Uwe
    Is there a way to filter exceptions in elma using the exception message? Examples: "System.Web.HttpException: Request timed out." I don't want to filter out all HttpException, but only the timed-out requests. "System.Web.HttpException: Maximum request length exceeded." What I don't want to do is write own code for that. So is it possible to do this with the buildin-web.config configuration? Thank you!

    Read the article

  • stored procedure exception handling in asp.net

    - by anay
    Do i need to use try catch in my stored procedure to know where exactly in my procedure error has occured or can i achieve the same if i useSqlConnection.BeginTransaction in my ASP.NET form or simple try catch may be...??? I tried implementing try catch in my stored procedure..i m using sql server 2005 but it does not know TRY and CATCH keywords or ERROR_MESSAGE() function...i also installed sql server 2005 service manager but still it does not work.. if an error is thrown using RAISERROR method will the exception will be shown in my ASP.NET form??

    Read the article

  • Java - JSON Null Exception

    - by user1112111
    Hi, I'm using JSON to deserialize an input string that contains a null value for certain hashmap property. Does anyone have any clue why this exception occurs ? Is it possible that null is not accepted as a value Is this configurable somehow ? input sample: {"prop1":"val1", "prop2":123, "prop3":null} stacktrace: net.sf.json.JSONException: null object at net.sf.json.JSONObject.verifyIsNull(JSONObject.java:2856) at net.sf.json.JSONObject.isEmpty(JSONObject.java:2212) Thanks.

    Read the article

  • Hide an access violation on another application

    - by Fernando
    Hi, I have an application that sometimes causes an access violation on exit. This is quite unpredictable and all attempts to locate the bug have been unsuccesful so far. The bug is harmless, as no data is lost, so I was thinking if it might be possible to just hide it. Is it possible to have another app launch the buggy one and catch the Access Violation exception if it occurs? If yes, how? Thanks in advance!

    Read the article

  • Catch All (handled or unhandled) Exceptions

    - by andySF
    Hi, I want to catch all exceptions raised (handled or unhandled) to log them. for unhandled i use ThreadExceptionEventHandler and UnhandledExceptionEventHandler but i want to catch and exceptions that are in try catch block with or without (Exception e). It's possible to inherit the exceptions class to create a general event?

    Read the article

  • Php mkdir( ) exception handling

    - by Doodle
    mkdir() is working correctly this question is more about catching an error. Instead of printing this when the directory exists I would just like to have it write to a message to me in a custom log. How do I create this exception. Warning: mkdir() [function.mkdir]: File exists

    Read the article

  • .NET Application broken on one PC, unhandleable exception

    - by Bobby
    Hello people. I have a .NET 2.0 application with nothing fancy in it. It worked until yesterday on every PC I installed or copied it to, no matter if 2.0, 3.0, 3.5 or 3.5 SP1 was installed, no matter if it was Win2000, XP or even Win7 (in total 100+ machines). Yesterday I did my normal installation procedure and wanted to start it one time to check if everything is working...and it wasn't. The program crashed hard leaving me with the uninformative "Do you wanna report this error?" dialog. The problem is an exception in the Main(String[] args) routine of my application. The event viewer is showing the following entry: Event Type: ErrorEvent Source: .NET Runtime 2.0 Error Reporting Event Category: None Event ID: 5000 Date: 05/05/2010 Time: 16:09:09 User: N/A Computer: myClientPC Description: EventType clr20r3, P1 apomenu.exe, P2 1.4.90.53, P3 4bdedea4, P4 system.configuration, P5 2.0.0.0, P6 4889de74, P7 1a6, P8 136, P9 ioibmurhynrxkw0zxkyrvfn0boyyufow, P10 NIL. Well...great information. After a lot of searching I finally was able to get further information about this exception (by adding a handler for UnhandledExceptions directly in My.MyApplication.New(), Application.Designer.vb): System.Configuration.ConfigurationErrorsException Configuration system failed to initialize at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName) at System.Configuration.ConfigurationManager.GetSection(String sectionName) at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName) at System.Net.Configuration.SettingsSectionInternal.get_Section() at System.Net.Sockets.Socket.InitializeSockets() at System.Net.Sockets.Socket.get_SupportsIPv4() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.get_HostName() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.RegisterChannel(Boolean SecureChannel) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at MyAppNameHere.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Line 81. And at this point I'm stuck...I'm out of ideas. I'm not using any kind of configuration system from the framework (no reference to System.Configuration, and there never was a MyAppnameHere.exe.config generated or distributed, nor have I seen this error before). I also found a bug report at Microsoft (Google Cache) about this bug (in another context, though). But as it seems, they won't even look at it. Every help is greatly appreciated! Edit: I'm using Visual Studio 2008 Prof.. Crash happens in Release- and Debug-Build on the client machine. Debugging the application directly on this machine is out of question I fear, 300+ Miles and they only have two computers to work with.

    Read the article

  • Why should I not wrap every block in "try"-"catch"?

    - by Konrad
    I have always been of the belief that if a method can throw an exception then it is reckless not to protect this call with a meaningful try block. I just posted 'You should ALWAYS wrap calls that can throw in try, catch blocks.' to this question and was told that it was 'remarkably bad advice' - I'd like to understand why. Thanks!

    Read the article

  • Ada: Adding an exception in a separate procedure when reading a file

    - by yCalleecharan
    This is a follow-up of this question: Ada: reading from a file . I would like to add an exception that checks if the file that I'm opening actually exists or not. I have made a separate procedure to avoid code clutter. Here is the main code test_read.adb: with Ada.Text_IO; use Ada.Text_IO; with Ada.Long_Float_Text_IO; with Ada.Float_Text_IO; procedure Test_Read is Input_File : File_Type; Value : Long_Float; procedure Open_Data (File : in Ada.Text_IO.File_Type; Name : in String) is separate; begin Ada.Text_IO.Open (File => Input_File, Mode => Ada.Text_IO.In_File, Name => "fx.txt"); while not End_Of_File (Input_File) loop Ada.Long_Float_Text_IO.Get (File => Input_File, Item => Value); Ada.Long_Float_Text_IO.Put (Item => value, Fore => 3, Aft => 5, Exp => 0); Ada.Text_IO.New_Line; end loop; Ada.Text_IO.Close (File => Input_File); end Test_Read; And here is the separate body test_read-open_data.adb of the procedure Open_Data: separate(test_read) procedure Open_Data (File : in Ada.Text_IO.File_Type; Name : in String) is --this procedure prepares a file for reading begin begin Ada.Text_IO.Open (File => File, Mode => Ada.Text_IO.In_File, Name => Name); exception when Ada.Text_IO.Name_Error => Ada.Text_IO.Put(File => Standard_Error, Item => "File not found."); end; end Open_Data; On compilation I get an error message in the separate body test_read-open_data.adb: actual for "File" must be a variable How to fix this? Thanks a lot...

    Read the article

  • When is it appropriate to use error codes?

    - by Jim Hurne
    In languages that support exception objects (Java, C#), when is it appropriate to use error codes? Is the use of error codes ever appropriate in typical enterprise applications? Many well-known software systems employ error codes (and a corresponding error code reference). Some examples include operating systems (Windows), databases (Oracle, DB2), and middle-ware products (WebLogic, WebSphere). What benefits do error codes provide? What are the disadvantages to using error codes?

    Read the article

  • Unhandled Exception in c#

    - by nightcoder1
    Hello i am currently trying to run a web crawler through the terminal. it compiles fine and the debug does not find any errors, however i get the following error which i do not understand. any ideas on how to get rid of this error would be much appreciated Unhandled Exception: System.ArgumentOutOfRangeException: startIndex + length > this.length Parameter name: length at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] at OpenWebSpiderCS.mysql.executeSQLQuery (System.String SQL) [0x00000] at OpenWebSpiderCS.db.startIndexThisSite (OpenWebSpiderCS.page p) [0x00000] at OpenWebSpiderCS.ows.startCrawling () [0x00000] at OpenWebSpiderCS.mainClass.Main (System.String[] args) [0x00000] thank you

    Read the article

  • Ruby Exception or Error?

    - by Ell
    I have noticed that in the Ruby exception hierarchy, there are "errors" such as ArgumentError and there are "exceptions" such as SignalException. Is there a certain practise of naming exceptions? thanks in advance, ell.

    Read the article

  • Servlet Exception + Class Cast Exception + Glassfish + Netbeans + JPA Entities + Vaadin

    - by Random Joe
    Hi all, I get this error: StandardWrapperValve[Vaadin Servlet]: PWC1406: Servlet.service() for servlet Vaadin Servlet threw exception java.lang.ClassCastException: com.delhi.entities.Category cannot be cast to com.delhi.entities.Category when I try to run my webapps on glassfish v2. Category is a JPA entity object the offending code according to the server log is: for (Category c : categories) { mymethod(); } categories is derived from: List<Category> categories = q.getResultList(); Any idea what went wrong?

    Read the article

  • How to simulate an unhandled exception in Java

    - by Martin Wiboe
    Hi, I am creating some multi-threaded code, and I have created a JobDispatcher class that creates threads. I want this object to handle any unhandled exceptions in the worker threads, and so I am using Thread.setUncaughtExceptionHandler(this); Now, I would like to test this functionality - how can I generate an unhandled exception in the run() method of my worker object? Thanks, Martin

    Read the article

  • Class Cast Exception

    - by iaagty
    why do i get this exception? Map myHash = null myHash = (HashMap)Collections.synchronizedMap(new HashMap()); If i try to use this hashmap, i get java.lang.ClassCastException

    Read the article

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