From: <php...@li...> - 2006-03-15 09:17:55
|
Hi, thanks for the detailed answer, I better understand my problem now. Moving my jars into jre/lib/ext is not an option because you must be=20 root to do that (and I am not). Hardcoding the java.classpath in the php.ini is maybe possible thanks to=20 a .htaccess so this is ok, I will watch for this today. Concerning the isssue, here is a snippet from my report engine code in=20 order to provide more details: this is the call to the compiler : JRClassLoader.loadClassForName("org.eclipse.jdt.internal.compiler.Compile= r"); Here is the JRClassLoader called method : ** *public* static *Class* loadClassForName(*String* className) *throws* *C= lassNotFoundException* { *Class* clazz =3D *null*; *ClassLoader* classLoader =3D *Thread*.currentThread().getContextClassL= oader(); *if* (classLoader !=3D *null*) { *try* { clazz =3D *Class*.forName(className, *true*, classLoader); } *catch* (*ClassNotFoundException* e) { ///if (log.isWarnEnabled())/ /// log.warn("Failure using Thread.currentThread().getContextClassLoa= der() in JRClassLoader class. Using JRClassLoader.class.getClassLoader() = instead.");/ } } *if* (clazz =3D=3D *null*) { classLoader =3D JRClassLoader.class.getClassLoader(); *if* (classLoader =3D=3D *null*) { clazz =3D *Class*.forName(className); } *else* { clazz =3D *Class*.forName(className, *true*, classLoader); } } *return* clazz; } Is the "*Thread*.currentThread().getContextClassLoader()" not the good me= thod to obtain PHP-Java-bridge class loader ? Again, thanks for the answer, best regards, chris php...@li... wrote: > Hi, > > =20 >> Just to say I digg into this problem all day and >> still find no solution. >> =20 > > Sorry for that. I assumed that this wasn't an > important issue, you've said that it works if you move > the jars to jre/lib/ext. > > > =20 >> What I do not understand is why a thread does not >> inherit the classpath=20 >> from the creating thread ? >> =20 > > JSP is a good example. The container doesn't want to > make the jsp classloader available to the webapp, so > it sets the thread context classloader to the parent > of the current classloader. > > I don't know if and how your reporting engine handles > this, but in general applications may choose to ignore > our dynamic loader and load classes or create dynamic > proxies via the system classloader. If this happens, > the loaded classes or defined proxies cannot access > classes loaded via the dynamic loader. > > So I think the best workaround is to install your > libraries in $JAVA_HOME/jre/lib/ext or to hard-code > the java.classpath in the php.ini file, for example: > > java.classpath=3D/path/to/JavaBridge.jar:/path/to/lib1.jar:... > > I have created a ticket for this problem, please see > PR1449780 for details > (http://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D1449780&g= roup_id=3D117793&atid=3D679233) > > > Thank you very much for this bug report! > > > Regards, > Jost Boekemeier > > > > > > > > > =09 > > =09 > =09 > ___________________________________________________________=20 > Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting lang= uage > that extends applications into web and mobile media. Attend the live we= bcast > and join the prime developer group breaking into this new coding territ= ory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > > > =20 --=20 =20 _________________________________________________________________________= ______________ Tennaxia, www.tennaxia.com, Pilotez vos obligations environnementales _________________________________________________________________________= ______________ Si=E8ge social : 6, rue L=E9onard de Vinci - 53001 Laval Cedex -=20 T=E9l : 02 43 49 75 50 - Fax : 02 43 49 75 77 Agence Paris : 19, rue r=E9aumur - 75003 Paris -=20 T=E9l : 01 42 77 04 19 - Fax : 08 25 19 19 61 Agence Lyon : Parc du Chater - 63 rue de la garenne - 69340 FRANCHEVILLE -=20 T=E9l : 04 72 39 98 14 - Fax : 04 72 39 93 85 Les informations contenues dans ce message envoy=E9es par TENNAXIA sont c= onfidentielles et sont =E9tablies =E0 l'attention exclusive de leurs destinataires. L'acc=E8= s =E0 ce message par toute autre personne n'est pas autoris=E9. Si vous n'=EAtes pas le de= stinataire de ce message, merci de le d=E9truire et d'en avertir l'exp=E9diteur : toute al= t=E9ration, copie, distribution ou toute action prise ou omise sont interdites et peuvent =EA= tre ill=E9gales. The information in this message sent by TENNAXIA is confidential and may = be legally privileged. It is intended solely for the addressee(s). Access to this me= ssage by anyone else is unauthorized. If you are not the intended recipient, please delet= e it and notify the sender : any disclosure, copying, distribution or any action taken or= omitted to be taken in reliance on it, is prohibited and may be unlawful. |