|
From: <php...@li...> - 2007-06-13 21:59:52
|
We did some research on the JAXBContext class, and found that when most people had trouble and saw ClassCastExceptions, it was related to the class loader. To avoid class loader issues as much as possible, we started sticking the result of each "new JavaClass(...)" in a static class (which will persist indefintely), so we'd only have to call it once per class in all of our code. This seemed to lessen the problem, but then we began seeing IllegalArgumentExceptions popping up here and there, like so: [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:ObjectFactory]]->createContactInformation((o:ContactInformationType) [o:ContactInformationType]). Cause: java.lang.IllegalArgumentException: argument type mismatch Responsible VM: 1.5.0_08@http://java.sun.com/" at: #-9 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) #-8 sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) #-7 sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) #0 http://localhost:8181/JavaBridge/java/Java.inc(151): java_ThrowExceptionProxyFactory->getProxy(41, true) #1 http://localhost:8181/JavaBridge/java/Java.inc(304): java_Arg->getResult(true) #2 http://localhost:8181/JavaBridge/java/Java.inc(310): java_Client->getWrappedResult(true) #3 http://localhost:8181/JavaBridge/java/Java.inc(489): java_Client->getResult() #4 http://localhost:8181/JavaBridge/java/Java.inc(735): java_Client->invokeMethod(38, 'createContactIn...', Array) #5 http://localhost:8181/JavaBridge/java/Java.inc(853): java_JavaProxy->__call('createContactIn...', Array) #6 [internal function]: Java->__call('createContactIn...', Array) #7 C:\deploy\merged\php-client\IndivoAPI.class.php(708): Java->createContactInformation(Object(java_InternalJavaObject)) Perfectly functional methods are now rejecting perfectly good arguments, also pointing toward class loader issues. It bears repeating that we're using version 4.0.7 now, and never saw such issues with v3.0.7. We even checked out the trunk from CVS and built the latest-and-greatest, and still saw these problems. To be completely transparent, we also need to mention that almost all of the classes that we're working with have either been generated by JAXB or are part of the JAXB API. I think JAXB is a red-herring (it all worked well together in php-java-bridge 3.0.7) but its worth mentioning. One last fact... We've run the JavaBridge through Tomcat and in standalone mode (java -jar...) and the problem seems to arise much "quicker" when we run in Tomcat. The errors are sporadic in both and happen in different locations each time. Sometimes a method invocation will succeed in one run and then fail in another. We want to be as helpful as possible while trying to resolve this issue. What other information can we send you to help isolate the problem? Thanks, Jon Abbett & Bill Simons Children's Hospital Boston P.S. How do I specify where to write the log file in a Tomcat-deployed Java Bridge? > -----Original Message----- > From: php...@li...=20 > [mailto:php...@li...]=20 > On Behalf Of php...@li... > Sent: Wednesday, June 06, 2007 5:15 AM > To: php...@li... > Subject: Re: [Php-java-bridge-users] ClassCastExceptions in=20 > standalone deployment >=20 > Hi Jonathan, >=20 > > [[o:Exception]:"java.lang.Exception: Invoke failed: > > > [[c:JAXBContext]]->newInstance((o:String)[o:String]). > > Cause: > > java.lang.ClassCastException: > > com.sun.xml.bind.v2.runtime.JAXBContextImpl >=20 > sounds like a problem internal to JAXBContextImpl. >=20 > > Responsible VM: > > 1.5.0_08@http://java.sun.com/" at: > > #-14 > > > javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:149) >=20 > I guess the above class uses a constructor which > requires a different logging API than provided. >=20 > Do you have the source code of the above class? >=20 >=20 > Regards, > Jost Boekemeier >=20 >=20 >=20 > __________________________________ Yahoo! Clever: Sie=20 > haben Fragen? Yahoo! Nutzer antworten Ihnen. www.yahoo.de/clever >=20 >=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users >=20 >=20 |