From: <php...@li...> - 2006-02-15 14:21:58
|
Hi, First of all, I would like to say your work is amazing and this is an incredible tool. I've gotten the bridge running and everything was looking good until I tried instantiating JBoss' Initial Naming Context Factory. My goal is to run Apache 2 and PHP on the front-end and use the bridge to connect to an EJB3 Session Bean running on a JBoss AS 4. I believe this is simply a classpath issue but I have tried placing the JAR= s which I think it is looking for in all of the places I can think of. So I'll start with a the code. java_require(" http://localhost/jbossall-client.jar"); // My last resor= t was trying to load the jars in this style java_require(" http://localhost/jnp-client.jar"); $envt =3D array( "java.naming.factory.initial" =3D> "org.jnp.interfaces.NamingContex tFactory", "java.naming.factory.url.pkgs" =3D> " org.jboss.naming:org.jnp.interfaces ", "java.naming.provider.url" =3D> "jnp://localhost:1099" ); $ctx =3D new Java("javax.naming.InitialContext", $envt); // At this line = it fails... $cal =3D $ctx->lookup(" stickygroups-ear-0.1/LocalRemoteCalculator/remote")= ; In the JBoss console I get the following stack trace: 21:59:41,595 INFO [[/JavaBridge]] JavaBridge ERROR: Exception occured 21:59:41,595 ERROR [[/JavaBridge]] java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0... at sun.reflect.NativeConstructorAccessorImpl.newInstance ... at sun.reflect.DelegatingConstructorAccessorImpl.newInstance .. . at java.lang.reflect.Constructor.newInstance... at php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:515) at php.java.bridge.Request.handleRequest(Request.java:406) at php.java.bridge.Request.handleRequests (Request.java:425) at php.java.bridge.http.ContextRunner.run(ContextRunner.java:71) at php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:28) Caused by: javax.naming.NoInitialContextException : Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: Could not find org.jnp.interfaces.NamingContextFactory in java_require() path] at javax.naming.spi.NamingManager.getInitialContext at javax.naming.InitialContext.getDefaultInitCtx( at javax.naming.InitialContext.init(InitialContext.java:223) at javax.naming.InitialContext .<init>(InitialContext.java:197) ... 9 more Caused by: java.lang.ClassNotFoundException: Could not find org.jnp.interfaces.NamingContextFactory in java_require() path at php.java.bridge.DynamicJavaBridgeClassLoader.loadClass ( DynamicJavaBridgeClassLoader.java:272) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at com.sun.naming.internal.VersionHelper12.loadClass at javax.naming.spi.NamingManager.getInitialContext ... 12 more Caused by: java.lang.ClassNotFoundException: Class org.jnp.interfaces.NamingContextFactory not found at php.java.bridge.DynamicClassLoader.loadClass( DynamicClassLoader.java: 379) at php.java.bridge.DynamicJavaBridgeClassLoader.loadClass( DynamicJavaBridgeClassLoader.java:270) ... 17 more The class file it is looking for is in the jnp-client.jar. The other place= s which I have tried placing jnp-client.jar are in the JavaBridge.war/WEB-INF/lib/ folder, the PHP/ext/lib/ folder, within the actual JavaBridge.jar file, the java/jre/ext/... folder (which made JBoss break =3D), and about everywhere else I could imagine including on the http server as in the code above. I'm temporarily out of ideas for what to try next or where to turn. Any advice would be very appreciated. Cheers, Kris Jordan |