Search Results

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

Page 104/528 | < Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >

  • Question about multiple 'catch'

    - by chun
    Can anyone tell me why the output of this class is 'xa'? why the other exception won't be caught? public class Tree { public static void main(String... args){ try { throw new NullPointerException(new Exception().toString()); } catch (NullPointerException e) { System.out.print("x"); } catch (RuntimeException e) { System.out.print("y"); } catch (Exception e) { System.out.print("z"); } finally{System.out.println("a");} } }

    Read the article

  • LinkDemand error on webserver when using TrackSource

    - by robertpnl
    Hi, On a webserver (shared hosting provider) I published a website with a ADO.Net Framework model in use with MySql Connector 6.3.1. When I request a page, a Security Exception will be happen with this error messages: "LinkDemand The type of the first permission that failed was: System.Security.Permissions.SecurityPermission The Zone of the assembly that failed was: MyComputer ". This exception raised when code collect the listeners of a tracksource: public class MySqlTrace { private static TraceSource source = new TraceSource("mysql"); static MySqlTrace() { foreach (TraceListener listener in source.Listeners) // <-- Exception throw here { // ... } } } The web.config doesn't have any trace data or system.diagnostics. My question is, why will a get a LinkDemand security exception during collecting the source listeners. What can maybe be wrong in here?

    Read the article

  • PHP namespaces and using the \ prefix in declaration

    - by Jason McCreary
    The following throws an error stating Exception can no be redeclared. namespace \NYTD\ReadingListBackend; class Exception extends \Exception { } However, removing the \ prefix in the namespace declaration does not: namespace NYTD\ReadingListBackend; I recently adopted PHP namespaces. My understanding is that namespaces prefixed with \ are a fully qualified name. So why can't I use the prefix in the namespace declaration? I can when referencing (e.g. new \NYTD\ReadingListBackend\Exception). Would appreciate a full explanation as I couldn't find anything in the docs.

    Read the article

  • jQuery, ajax request doesn't success with JSON on IE

    - by sylouuu
    I made an AJAX call and it works on FF & Chrome but not on IE 7-8-9. I'm loading a JSON file from my domain: $.ajax({ url: 'js/jquery.desobbcode.json', dataType: 'json', cache: false, success: function(json) { alert('ok'); }, error: function(xhr, errorString, exception) { alert("xhr.status="+xhr.status+" error="+errorString+" exception="+exception); } }); I also tried by adding contentType: 'application/json' but I receive the same output which is : xhr.status=200 error=parsererror exception=SyntaxError Unterminated string constant I checked my JSON file with JSONLint and it's OK. I checked if there is an extra comma and the content is also trimmed. See my JSON file If I put dataType: 'text', I receive the OK alert but a debug popup too. Could you help me? Regards.

    Read the article

  • How to use @BeforeClass and @AfterClass in JunitPerf?

    - by allenzzzxd
    Hi, I want to do some actions before the whole test suite (also after the suite). So I wrote like: public class PerformanceTest extends TestCase { @BeforeClass public static void suiteSetup() throws Exception { //do something } @AfterClass public static void suiteSetup() throws Exception { //do something } @Before public void setUp() throws Exception { //do something } @After public void tearDown() throws Exception { //do something } public PerformanceTest(String testName){ super(testName); } public static Test suite() { TestSuite suite = new TestSuite(); Test testcase1 = new PerformanceTest("DoTest1"); Test loadTest1 = new LoadTest(testcase1, n); Test testcase2 = new PerformanceTest("DoTest2"); Test loadTest2 = new LoadTest(testcase2, n); } public void DoTest1 throws Throwable{ //do something } public void DoTest2 throws Throwable{ //do something } } But I found that it never reach the code in @BeforeClass and @AfterClass. So how could I do to solve this problem? Or is there other way to realize this? Thank you for your help.

    Read the article

  • Android: Problems downloading images and converting to bitmaps

    - by Mike
    Hi all, I am working on an application that downloads images from a url. The problem is that only some images are being correctly downloaded and others are not. First off, here is the problem code: public Bitmap downloadImage(String url) { HttpClient client = new DefaultHttpClient(); HttpResponse response = null; try { response = client.execute(new HttpGet(url)); } catch (ClientProtocolException cpe) { Log.i(LOG_FILE, "client protocol exception"); return null; } catch (IOException ioe) { Log.i(LOG_FILE, "IOE downloading image"); return null; } catch (Exception e) { Log.i(LOG_FILE, "Other exception downloading image"); return null; } // Convert images from stream to bitmap object try { Bitmap image = BitmapFactory.decodeStream(response.getEntity().getContent()); if(image==null) Log.i(LOG_FILE, "image conversion failed"); return image; } catch (Exception e) { Log.i(LOG_FILE, "Other exception while converting image"); return null; } } So what I have is a method that takes the url as a string argument and then downloads the image, converts the HttpResponse stream to a bitmap by means of the BitmapFactory.decodeStream method, and returns it. The problem is that when I am on a slow network connection (almost always 3G rather than Wi-Fi) some images are converted to null--not all of them, only some of them. Using a Wi-Fi connection works perfectly; all the images are downloaded and converted properly. Does anyone know why this is happening? Or better, how can I fix this? How would I even go about testing to determine the problem? Any help is awesome; thank you!

    Read the article

  • Why is the main method not covered?

    - by Mike.Huang
    main method: public static void main(String[] args) throws Exception { if (args.length != EXPECTED_NUMBER_OF_ARGUMENTS) { System.err.println("Usage - java XFRCompiler ConfigXML PackageXML XFR"); } String configXML = args[0]; String packageXML = args[1]; String xfr = args[2]; AutoConfigCompiler compiler = new AutoConfigCompiler(); compiler.setConfigDocument(loadDocument(configXML)); compiler.setPackageInfoDoc(loadDocument(packageXML)); // compiler.setVisiblityDoc(loadDocument("VisibilityFilter.xml")); compiler.compileModel(xfr); } private static Document loadDocument(String fileName) throws Exception { TXDOMParser parser = (TXDOMParser) ParserFactory.makeParser(TXDOMParser.class.getName()); InputSource source = new InputSource(new FileInputStream(fileName)); parser.parse(source); return parser.getDocument(); } testcase: @Test public void testCompileModel() throws Exception { // construct parameters URL configFile = Thread.currentThread().getContextClassLoader().getResource("Ford_2008_Mustang_Config.xml"); URL packageFile = Thread.currentThread().getContextClassLoader().getResource("Ford_2008_Mustang_Package.xml"); File tmpFile = new File("Ford_2008_Mustang_tmp.xfr"); if(!tmpFile.exists()) { tmpFile.createNewFile(); } String[] args = new String[]{configFile.getPath(),packageFile.getPath(),tmpFile.getPath()}; try { // test main method XFRCompiler.main(args); } catch (Exception e) { assertTrue(true); } try { // test args length is less than 3 XFRCompiler.main(new String[]{"",""}); } catch (Exception e) { assertTrue(true); } tmpFile.delete(); } Coverage outputs displayed as the lines from String configXML = args[0]; in main method are not covered.

    Read the article

  • How do I fix a "Request format is unrecognized for URL..." error in a web service running in IIS?

    - by Hary
    I am get the following error while running web service in IIS: Server Error in '/Inbox Sevice' Application. Request format is unrecognized for URL unexpectedly ending in '/GetMailsInfo'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/GetMailsInfo'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/GetMailsInfo'.] System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +490982 System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +104 System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +127 System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +175 System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +120 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 Does anyone know why I am seeing this error and if there is any way to fix it?

    Read the article

  • Issue selenium code maintenance

    - by Rajasankar
    I want to group the common methods in one file and use it. For example, login to a page using selenium may be used in multiple times. Define that in class A and call it in class B. However, it throws null pointer exception. class A has public void test_Login() throws Exception { try{ selenium.setTimeout("60000"); selenium.open("http://localhost"); selenium.windowFocus(); selenium.windowMaximize(); selenium.windowFocus(); selenium.type("userName", "admin"); selenium.type("password", "admin"); Result=selenium.isElementPresent("//input[@type='image']"); selenium.click("//input[@type='image']"); selenium.waitForPageToLoad(Timeout); } catch(Exception ex) { System.out.println(ex); ex.printStackTrace(); } } with all other java syntax in class B public void test_kk() throws Exception { try { a.test_Login(); } catch(Exception ex) { System.out.println(ex); ex.printStackTrace(); } } with all syntax. When I execute class B, I got this error, java.lang.NullPointerException at A.test_Login(A.java:32) at B.test_kk(savefile.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.j ava:212) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at junit.textui.TestRunner.doRun(TestRunner.java:116) at junit.textui.TestRunner.doRun(TestRunner.java:109) at junit.textui.TestRunner.run(TestRunner.java:77) at B.main(B.java:77) I hope someone must have tried this before. I may miss something here.

    Read the article

  • server reboot has caused django project to lose directories

    - by wmfox3
    A fully functional Django project as well as a couple in development have all broken following the rebooting of the server. In addition to some pieces of the Django admin returning errors as well as missing .js and .css files, I'm getting errors like this when viewing pages that include images uploaded through the admin. Exception Type: TemplateSyntaxError Exception Value: Caught an exception while rendering: (2, 'No such file or directory') Exception Location: /usr/lib/pymodules/python2.6/django/template/debug.py in render_node, line 81 Python Executable: /usr/bin/python Python Version: 2.6.4 So did the reboot stomp on some part of my configuration/setup or did it fail to restart a critical piece?

    Read the article

  • Correct handling of return data

    - by Serhiy
    Hello, I have a question related to correct handling of returns of the DAO library I'm writing for one project. This library probably is going to be used by another people and I want to do it correctly. So I would like to know, how I should deal with return statements of the functions of my DAO. Example 1 I have function to getCustomer which should return String. In case query doesn't return any result should I return null, empty string or throw some kind of Exception? Example 2 I have function getCutomerList which return ArrayList. In case query doesn't return any result should I return null, empty ArrayList or throw some Exception? Example 3 Some sql exception was detected, what should I do: throw exception or do try..catch of the block where it can occur? What is the "good" practice or "best" practice to apply in my case? Thanks on advance, Serhiy.

    Read the article

  • GWT.setUncaughtExceptionHandler()

    - by moorsu
    Has anyone successfully use the above statement to catch the exception before it goes to the browser as an alert?. I did set an exception handler in the first line of my entry point. But it does not catch the exception as expected. public void onModuleLoad(){ GWT.setUncaughtExceptionHandler(new MyExceptionHandler()); ... .... }

    Read the article

  • Get history of file changes from TFS

    - by Andreas Zita
    I'm trying to make some way of figuring out who to "blame" when an exception is thrown in our application (at work). It could be me causing it of course but I can accept that :). But to do this I need the history of a file in TFS so I can check who last made a change at the line of the exception. Its of course not always at the row of the exception that the erroneous change was inserted, so I would probably also need to check any changes to the same file and lastly any check-ins made very recently. I'm not sure how I will work out this but I would like to check with the community first if there is any already existing solutions for this? I have no experience with the TFS API yet so I have no way of telling whats possible and whats not. I guess I would integrate this into our app in the unhandled exceptions-handler. When some candidates of the exception is found I need to inform them by email. In the process it would be nice to log how many times a certain exception has been thrown by any user on our intranet, who, when, how etc. It could save us a lot of time (and money).

    Read the article

  • Remote interface lookup-problem in Glassfish3

    - by andersmo
    I have deployed a war-file, with actionclasses and a facade, and a jar-file with ejb-components (a stateless bean, a couple of entities and a persistence.xml) on glassfish3. My problem is that i cant find my remote interface to the stateless bean from my facade. My bean and interface looks like: @Remote public interface RecordService {... @Stateless(name="RecordServiceBean", mappedName="ejb/RecordServiceJNDI") public class RecordServiceImpl implements RecordService { @PersistenceContext(unitName="record_persistence_ctx") private EntityManager em;... and if i look in the server.log the portable jndi looks like: Portable JNDI names for EJB RecordServiceBean : [java:global/recordEjb/RecordServiceBean, java:global/recordEjb/RecordServiceBean!domain.service.RecordService]|#] and my facade: ...InitialContext ctx= new InitialContext(); try{ recordService = (RecordService) ctx.lookup("java:global/recordEjb/RecordServiceBean!domain.service.RecordService"); } catch(Throwable t){ System.out.println("ooops"); try{ recordService = (RecordService)ctx.lookup("java:global/recordEjb/RecordServiceImpl"); } catch(Throwable t2){ System.out.println("noooo!"); }... } and when the facade makes the first call this exception occur: javax.naming.NamingException: Lookup failed for 'java:global/recordEjb/RecordServiceBean!domain.service.RecordService' in SerialContext [Root exception is javax.naming.NamingException: ejb ref resolution error for remote business interfacedomain.service.RecordService [Root exception is java.lang.ClassNotFoundException: domain.service.RecordService]] and the second call: javax.naming.NamingException: Lookup failed for 'java:global/recordEjb/RecordServiceBean' in SerialContext [Root exception is javax.naming.NamingException: ejb ref resolution error for remote business interfacedomain.service.RecordService [Root exception is java.lang.ClassNotFoundException: domain.service.RecordService]] I have also tested to inject the bean with the @EJB-annotation: @EJB(name="RecordServiceBean") private RecordService recordService; But that doesnt work either. What have i missed? I tried with an ejb-jar.xml but that shouldnt be nessesary. Is there anyone who can tell me how to fix this problem?

    Read the article

  • Creating an Attribute to check for Exceptions

    - by BiffBaffBoff
    I'm creating an attribute so that whenever an exception occurs on my site, I'll receive an email detailing the exception. I've got so far but my Attribute code doesn't seem to fire if an exception occurs: public class ReportingAttribute : FilterAttribute, IExceptionFilter { public void OnException(ExceptionContext filterContext) { // This will generate an email to me ErrorReporting.GenerateEmail(filterContext.Exception); } } Then above my Controller I'm doing: [ReportingAttribute] public class AccountController : Controller The other way to do it is ofcourse putting ErrorReporting.GenerateEmail(ex) inside my catch blocks? There must be a simpler way? Thats why I thought of creating the Attribute to handle this

    Read the article

  • Catch hibernate exceptions with errorpage handler?

    - by membersound
    I'm catching all exceptions within: java.lang.Throwable /page.xhtml java.lang.Error /page.xhtml But what If I get eg a hibernate ex: org.hibernate.exception.ConstraintViolationException Do I have to define error-pages for EVERY maybe occuring exception? Can't I just say "catch every exception"? Update Redirect on a 404 works. But on a throwable does not! <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> <url-pattern>*.xhtml</url-pattern> </servlet-mapping> <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/error.xhtml</location> </error-page> <error-page> <error-code>404</error-code> <location>/error.xhtml</location> </error-page>

    Read the article

  • How to configure an index.htm file in IIS?

    - by salvationishere
    I am running IIS 6.0 on an XP OS using VS 2008 and SQL Server 2008 (Full install). I developed two web apps. Both of these I can run from IIS by setting them to the default website. However, now I tried adding an index.htm file. Real simple; all it has is two hyperlinks to these web apps. But now only the first web app works. The first web app is pure VS. The second web app modifies an Adventureworks database table. But now when I click the hyperlink for the second web app, it gives me the error below. However this error doesn't make sense to me cause I have the two web apps configured as two virtual directories beneath C:\inetpub\ and the index.htm file is also beneath C:\inetpub. And the default website is set to home directory C:\inetpub\ with Document index.htm on top. Also, why does the first web app work and not the second now? Server Error in '/AddFileToSQL' Application. The path '/AddFileToSQL/App_GlobalResources/' maps to a directory outside this application, which is not supported. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: The path '/AddFileToSQL/App_GlobalResources/' maps to a directory outside this application, which is not supported. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Read the article

  • Converting String to int in Java and getting a NumberFormatException, can't figure out why

    - by user1687682
    ipString is a String representation of an IP address with spaces instead of dots. String[] ipArray = ipString.split(" "); String ip = ""; for (String part : ipArray){ if (part != null){ ip += part } } ip = ip.trim(); int ipInt = Integer.parseInt(ip); // Exception is thrown here. Exception in thread "main" java.lang.NumberFormatException: For input string: "6622015176". Could someone explain why this exception is being thrown?

    Read the article

  • Getting source code information from groovy stack trace

    - by dotsid
    When exception generated I want to show some additional information (source code) for particular exception. But grails have very hairy exceptions (it's all about groovy dynamic nature). It's my problem where to get and how to display source code. All I need is file/line information. So... Is there any possibility to get file and line where exception were generated in grails/groovy?

    Read the article

  • Help understanding this stack trace

    - by user80632
    Hi I have health monitoring turned on, and i have the following error i'm trying to understand: Exception: Exception information: Exception type: System.InvalidCastException Exception message: Specified cast is not valid. Thread information: Thread ID: 5 Thread account name: NT AUTHORITY\NETWORK SERVICE Is impersonating: False Stack trace: at _Default.Repeater1_ItemDataBound(Object sender, RepeaterItemEventArgs e) at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) at _Default.up1_Load() at _Default.Timer1_Tick(Object sender, EventArgs e) at System.Web.UI.Timer.OnTick(EventArgs e) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) I'm just trying to figure out exactly where the problem is happening and what it is - is it happening in the Repeater1_ItemDataBound sub routine, or in the Timer1_Tick sub routine? Is the last thing that happened before the error occured at the top or bottom of the trace? any help much appreciated thanks

    Read the article

  • Windows Service Fails on Launch

    - by Jeff
    I'm trying to write a windows service. It installs fine, but fails when I run it with the following exception. I've searched for the string "MyNewProgramService", but I can't find any conversions that would throw this error. I've also added try/catch blocks to a bunch of code with custom exception handling without finding where this exception is occuring. I'm thinking it's somewhere in the auto-generated configuartion/setup code. Any ideas? Event Type: Error Event Source: MyNewProgram Event Category: None Event ID: 0 Date: 4/15/2010 Time: 12:48:34 PM User: N/A Computer: 20F7KF1 Description: Service cannot be started. System.InvalidCastException: Conversion from string "MyNewProgramService" to type 'Integer' is not valid. ---> System.FormatException: Input string was not in a correct format. at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat) at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) --- End of inner exception stack trace --- at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) at TaskManagerFailureHandlerService.MyNewProgramService.OnStart(String[] args) at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

    Read the article

  • @Intertceptors does not work for web bean for JSF page.

    - by Drevlyanin
    @Named @ConversationScoped @Interceptors(MyInterceptor.class) public class BeanWeb implements Serializable { public String methodThrowException throws Exception() { throws new Exception(); } } public class MyInterceptor { @AroundInvoke public Object intercept(InvocationContext ic) throws Exception { try { return ic.proceed(); } catch (Exception e) { return null; } } } For @Stateless beans interceptor works, but for the BeanWeb interceptor does not work. And we have never entered into "intercept" method. Why is this happening? How could intercept method calls in BeanWeb? P.S.: All this spin under Glassfish 3.x.

    Read the article

  • hibernate: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException

    - by user121196
    when saving an object to database using hibernate, sometimes it fails because certain fields of the object exceed the maximum varchar length defined in the database. There force I am using the following approach: 1. attempt to save 2. if getting an DataException, then I truncate the fields in the object to the max length specified in the db definition, then try to save again. However, in the second save after truncation. I'm getting the following exception: hibernate: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails here's the relevant code, what's wrong? public static void saveLenientObject(Object obj){ try { save2(rec); } catch (org.hibernate.exception.DataException e) { // TODO Auto-generated catch block e.printStackTrace(); saveLenientObject(rec, e); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } private static void saveLenientObject(Object rec, DataException e) { Util.truncateObject(rec); System.out.println("after truncation "); save2(rec); } public static void save2(Object obj) throws Exception{ try{ beginTransaction(); getSession().save(obj); commitTransaction(); }catch(Exception e){ e.printStackTrace(); rollbackTransaction(); //closeSession(); throw e; }finally{ closeSession(); } }

    Read the article

  • exceptions thrown terminate the script?

    - by fayer
    i wonder if exceptions that are thrown in php will terminate the script in php? cause when i save an entry that is already created in doctrine it throws an exception. i catch the exception and ignore it (so that the user won't see it) but the script seems to be terminated. is there a way to catch the exception and keep the script alive? thanks

    Read the article

< Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >