Thanks Mike. You are absolutely right.
I never verified if UnsatisiedLinkError is an Exception or not. It is in fact an Error, not an Exception? If I change my code to catch Throwable (which includes both Exception and Error), everything works fine. Thanks a lot for your help. Regards Peter Kwan ----- Original Message ----- From: "Mike Curwen" <[EMAIL PROTECTED]> To: "'Tomcat Users List'" <[EMAIL PROTECTED]> Sent: Tuesday, July 22, 2003 1:06 AM Subject: RE: System.load Exceptions cannot be caught > Did you mean UnsatisiedLinkError ? Because that's all I can find in the > javadocs. In this case, your code won't catch this Error, since an > Error is not an Exception. So perhaps the container will end up catching > it and wrapping it in a JasperException. Is there a 'route cause' for > the JasperException ? > > > -----Original Message----- > > From: Peter Kwan [mailto:[EMAIL PROTECTED] > > Sent: Monday, July 21, 2003 12:06 PM > > To: [EMAIL PROTECTED] > > Subject: System.load Exceptions cannot be caught > > > > > > I have the following code in my static class initialization > > code for loading native code: > > > > static > > { > > try > > { > > System.load("some_path_A"); > > } > > catch (Exception e) > > { > > System.load("some_path_B"); > > } > > > > .............. > > > > > > The class is used in a JSP project. If I put my native code > > in some_path_B, then when the JSP page is accessed the first > > time, TomCat throws: > > > > org.apache.jasper.JasperException: Can't load library: some_path_A > > > > It is as if the exception is not catched at all. Also, > > according to Java doc, the exception throw should be > > UnsatisfiedLinkException, not org.apache.jasper.JasperException. > > > > The above code runs normally in iPlanet with JDK1.3.1_08. It > > just fails in Tomcat 4.1.24 with the same JDK. So I think it > > is related to Tomcat and not JDK. > > > > Could someone please help me to get around? > > > > Regards > > Peter Kwan > > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]