Search Results

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

Page 76/528 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • Reflection PropertyInfo GetValue call errors out for Collection<> type property.

    - by Vinit Sankhe
    Hey Guys, I have a propertyInfo object and I try to do a GetValue using it. object source = mysourceObject //This object has a property "Prop1" of type Collection<>. var propInfo = source.GetType().GetProperty("Prop1"); var propValue = prop.GetValue(this, null); // do whatever with propValue // ... I get error at the GetValue() call as "Value cannot be null.\r\nParameter name: source" "Prop1" is a plain property declared as Collection. prop.PropertyType = {Name = "Collection1" FullName = "System.Collections.ObjectModel.Collection1[[Application1.DummyClass, Application1, Version=1.5.5.5834, Culture=neutral, PublicKeyToken=628b2ce865838339]]"} System.Type {System.RuntimeType}

    Read the article

  • Can't declare unused exception variable when using catch-all pattern

    - by b0x0rz
    what is a best practice in cases such as this one: try { // do something } catch (SpecificException ex) { Response.Redirect("~/InformUserAboutAn/InternalException/"); } the warning i get is that ex is never used. however all i need here is to inform the user, so i don't have a need for it. do i just do: try { // do something } catch { Response.Redirect("~/InformUserAboutAn/InternalException/"); } somehow i don't like that, seems strange!!? any tips? best practices? what would be the way to handle this. thnx

    Read the article

  • GORM "getNextException" equivalent

    - by Josh K
    GORM sits on top of [Hibernate](http://en.wikipedia.org/wiki/Hibernate_(Java). The issue is that sometimes Hibernate will throw exceptions from the JDBC driver that I can't figure out how to investigate. Specifically: Could not execute JDBC batch update; /* snip */ Caused by: java.sql.BatchUpdateException: /* snip */ [insert] was aborted. Call getNextException to see the cause. If it makes any difference I'm using PostgreSQL.

    Read the article

  • What's the standard behaviour for an out parameter when a TryXxxx method returns false?

    - by Matt Lacey
    Assuming a method with the following signature bool TryXxxx(object something, out int toReturn) What is it acceptable for toReturn to be if TryXxxx returns false? In that it's infered that toReturn should never be used if TryXxxx fails does it matter? If toReturn was a nulable type, then it would make sense to return null. But int isn't nullable and I don't want to have to force it to be. If toReturn is always a certain value if TryXxxx fails we risk having the position where 2 values could be considered to indicate the same thing. I can see this leading to potential possible confusion if the 'default' value was returned as a valid response (when TryXxxx returns true). From an implementation point if view it looks like having toReturn be a[ny] value is easiest, but is there anything more important to consider?

    Read the article

  • Exceptions by DataContext

    - by Bas
    I've been doing some searching on the internet, but I can't seem to find the awnser. What exceptions can a DataContext throw? Or to be more specific, what exceptions does the DataContext.SubmitChanges() method throw?

    Read the article

  • How to pass content in response from Exception filter in Asp.net WebAPI?

    - by jaffa
    Consider following code: My problem is: 1) I can't seem to cast the errors to HttpContent 2) I can't use the CreateContent extension method as this doesn't exist on the context.Response.Content.CreateContent public class ServiceLayerExceptionFilter : ExceptionFilterAttribute { public override void OnException(HttpActionExecutedContext context) { if (context.Response == null) { var exception = context.Exception as ModelValidationException; if ( exception != null ) { var modelState = new ModelStateDictionary(); modelState.AddModelError(exception.Key, exception.Description); var errors = modelState.SelectMany(x => x.Value.Errors).Select(x => x.ErrorMessage); // Cannot cast errors to HttpContent?? // var resp = new HttpResponseMessage(HttpStatusCode.BadRequest) {Content = errors}; // throw new HttpResponseException(resp); // Cannot create response from extension method?? //context.Response.Content.CreateContent } else { context.Response = new HttpResponseMessage(context.Exception.ConvertToHttpStatus()); } } base.OnException(context); } }

    Read the article

  • Castle windsor security exception

    - by Sunil
    I developed a small WCF service that uses Castle Windsor IoC container and it works fine on my PC. When I deploy it onto a Win 2008 R2 server and host the WCF service in IIS 7 it fails with the following error. I checked the server level web.config and the trust level is set to "Full". What do I need to do to get this to work. As a test I deployed the same service as it is onto a Windows 2003 server with the trust level set to "Full" and it works fine. I am unable to figure out what setting/configuration I am missing on the 2008 server that is making the service fail. Stack Trace: [SecurityException: That assembly does not allow partially trusted callers.] Castle.Windsor.WindsorContainer..ctor() +0 WMS.ServiceContractImplementation.IoC.IoCInstanceProvider..ctor(Type serviceType) in D:\WCF\WCFProofOfConcept\WMSServices \WMS.ServiceContractImplementation\IoC\IoCInstanceProvider.cs:19 WMS.ServiceContractImplementation.IoC.IoCServiceBehavior.ApplyDispatchBehav­ior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase) in D:\WCF \WCFProofOfConcept\WMSServices\WMS.ServiceContractImplementation\IoC \IoCServiceBehavior.cs:24 System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(Ser­viceDescription description, ServiceHostBase serviceHost) +377 System.ServiceModel.ServiceHostBase.InitializeRuntime() +37 System.ServiceModel.ServiceHostBase.OnBeginOpen() +27 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +49 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +121 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

    Read the article

  • IO Exception: directory name is invalid C#

    - by Bi
    My C# application throws a System.IO.IOExcepton (The directory name is invalid) for the following code for implementing a filewatcher: public void OnChanged(object source, FileSystemEventArgs e) { DirectoryInfo dList = new DirectoryInfo(e.FullPath); FileInfo[] TxtFiles = dList.GetFiles("*.TXT"); } e.FullPath is "C:/Documents and Settings/Bi/Application Data/TestApp/Reports\\0MA01P62240_000005798_TRI_4947712701738551.TXT". If you notice it seems to append a "\\" to the path when it tracks the file. Any idea what the problem may be? Thanks

    Read the article

  • Java: Cannot listen to port, BindException

    - by bguiz
    Hi, I am developing an application in Netbeans, and it is using JavaDB. I can connect to it and execute queries without issues, but for some reason, the "Output - JavaDB Database Process" pane within Netbeans keeps displaying Security manager installed using the Basic server security policy. Could not listen on port 1527 on host localhost: java.net.BindException: Address already in use How do I find out what process is already using, or bound to, that port number?

    Read the article

  • XPath expression exception

    - by fftoolbar
    Hi I am not really sure if i am doing this right with XPath expression. I am trying to locate a text on DOM and this text is assingned to a variable. I have text stored in SQLite and i have retrievd the text and i am trying to locate it on the webpage which actually contains the text. so i ahve the following code: var searchText = dataset[x]['selectedText']; alert(dataset[x]['selectedText']); var res = googbar_frames[0].contentDocument.evaluate("//*[.=searchText]",googbar_frames[0].contentDocument.body,null,XPathResult.ANY_TYPE,null); alert(res.snapshotLength); And i get the following error. Error: Permission denied for <http://en.wikipedia.org> to call method XPathException.toString on <>. Error: Permission denied for <http://en.wikipedia.org> to call method XPathException.toString on <>. Have got the expression correct. I am trying to look for the text on DOM. Or am i going wrong somwehere? cheers

    Read the article

  • ScheduledExecutorService throwable lost

    - by Andrey
    Hello, Consider I scheduled a Runnable for periodic execution with ScheduledExecutorService and there occurs some system Error like OutOfMemory. It will be silently swallowed. scheduler.scheduleWithFixedDelay(new Runnable() { @Override public void run() { throw new OutOfMemoryError(); // Swallowed } }, 0, delay, TimeUnit.SECONDS); Is it normal? Why doesn't it propagate to the container? What is the correct way to handle such errors? Thanks!

    Read the article

  • validate constructor arguments or method parameters with annotations, and let them throw an exceptio

    - by marius
    I am validating constructor and method arguments, as I want to the software, especially the model part of it, to fail fast. As a result, constructor code often looks like this public MyModelClass(String arg1, String arg2, OtherModelClass otherModelInstance) { if(arg1 == null) { throw new IllegalArgumentsException("arg1 must not be null"); } // further validation of constraints... // actual constructor code... } Is there a way to do that with an annotation driven approach? Something like: public MyModelClass(@NotNull(raise=IllegalArgumentException.class, message="arg1 must not be null") String arg1, @NotNull(raise=IllegalArgumentException.class) String arg2, OtherModelClass otherModelInstance) { // actual constructor code... } In my eyes this would make the actual code a lot more readable. In understand that there are annotations in order to support IDE validation (like the existing @NotNull annotation). Thank you very much for your help.

    Read the article

  • Exception if there is IBOutlet in view controller created by initWithNibName

    - by Kail
    When I create a Navigation-based application, the second view controller is created with initWithNibName, if I add a label onto the second view and connect it with IBOutlet in the second view controller. After I navigate to the second view by clicking table cell, and then back to the root view, the application aborts - send message retainCount to a freed object. I know this is caused by the IBOutlet label, which is retained, set nil in viewDidUnload and dealloc in dealloc. But I don't know why, and if I wanna still use IBOutlet, what can I do? Not dealloc it in viewcontroller's dealloc? Anybody could help? Thank you.

    Read the article

  • jsp servlet exception: bean not found within scope.

    - by stu
    I'm getting this error: javax.servlet.ServletException: bean givingFormBean not found within scope on a page with this at the top. The class exists in the classpath, it worked this morning, and I don't get what not found within scope means. I've googled and googled and nothing useful came up.

    Read the article

  • Exception when access inner class reflectively

    - by MikeJiang
    Hi Folk, Here is a sample java program. I wonder why the two approaches reslut different stories. Is it a bug or kind of bitter java feature? And I run the sample upon java 1.5 package test; public class TestOut{ public static void main(String[] args){ new TestIn();//it works Class.forName("test.TestOut$TestIn").newInstance();// throw IllegalAccessException } private static class TestIn{} }

    Read the article

  • IO Exception on invoking execute() method of HttpGet class

    - by AndroidNoob
    Why I'm getting IOException in this peace of code? Thanks. HttpClient httpclient = new DefaultHttpClient(); HttpGet httpget = new HttpGet("http://www.google.com/"); HttpResponse response; try { response = httpclient.execute(httpget); } catch (ClientProtocolException e) { Toast.makeText(this, "ClientProtocolEx", Toast.LENGTH_LONG).show(); e.printStackTrace(); } catch (IOException e) { Toast.makeText(this, "IOEx", Toast.LENGTH_LONG).show(); e.printStackTrace(); }

    Read the article

  • Entity Framework: Setting EntityReference EntityKey causes exception on save

    - by NYSystemsAnalyst
    I have a table with a ModifiedUserID field that is a foreign key to a User table. In entity framework, I'm loading the first table, but not the users table. I have the user ID of the current user, and would like to set the ModifiedUserID to that value for all entities that have been modified prior to saving. Before calling SaveChanges(), I use the ObjectStateManager to get all modified entities. Since I do not have the user object, but I do have the user ID, I set the EntityReference.EntityKey property as follows: entity.UserReference.EntityKey = New EntityKey("MyContainer.User", "UserID", DatabaseUserID) This works fine, but when I execute SaveChanges(), I receive the following error: A relationship is being added or deleted from an AssociationSet 'FK_Table1_User'. With cardinality constraints, a corresponding 'Table1' must also be added or deleted. Now, I see that setting the EntityReference.EntityKey creates a new AssociationSet entry, but how to I prevent this error?

    Read the article

  • How to detect exception when executing Javascript in NPAPI plugin?

    - by Jordfräs
    In a plug-in I am using NPN_Evaluate() to execute some Javascript. How can I detect wether the Javascript raises an exception? Basically I want to execute any piece of Javascript and get the result from it or detect if it raised an exception. I tried wrapping my Javascript code like this: try { // Injected Javascript code here } catch (exc) { exc; } That way the result from NPN_Evaluate() will be an NPObject* containing a property "message" with the exception message if something goes wrong. But how can I know that it is an exception? It might as well be a result from the injected Javascript code. Am I approaching this the wrong way? Can I detect an exception without catching it in Javascript and returning the exception as the result?

    Read the article

  • How do you fix "Too many open files" problem in Hudson?

    - by Randyaa
    We use Hudson as a continuous integration system to execute automated builds (nightly and based on CVS polling) of a lot of our projects. Some projects poll CVS every 15 minutes, some others poll every 5 minutes and some poll every hour. Every few weeks we'll get a build that fails with the following output: FATAL: java.io.IOException: Too many open files java.io.IOException: java.io.IOException: Too many open files at java.lang.UNIXProcess.<init>(UNIXProcess.java:148) The next build always worked (with 0 changes) so we always chalked it up to 2 build jobs being run at the same time and happening to have too many files open during the process. This weekend we had a build fail Friday night (automatic nightly build) with the message and every other nightly build also failed. Somehow this triggered Hudson to continuously build every project which failed until the issue was resolved. This resulted in a build every 30 minutes or so of every project until sometime Saturday night when the issue magically disappeared.

    Read the article

< Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >