2 Replies Latest reply on Feb 6, 2007 10:32 AM by Toni Beckman

    Getting the Initial Context for a EJB3 client

    Toni Beckman Novice

      Hi,

      I'm trying to get the initial context for a java client. I include ALL the client jars in the jboss/client/ directory, but I nevertheless get an exception:

      What other jars do I have to include???

      java -cp activation.jar:antlr-2.7.6.jar:avalon-framework.jar:commons-httpclient.jar:commons-logging.jar:concurrent.jar:ejb3-persistence.jar:getopt.jar:hibernate-annotations.jar:hibernate-client.jar:jacorb.jar:javassist.jar:javax.servlet.jar:jbossall-client.jar:jboss-annotations-ejb3.jar:jboss-aop-jdk50-client.jar:jboss-aspect-jdk50-client.jar:jboss-client.jar:jboss-common-client.jar:jbosscx-client.jar:jboss-deployment.jar:jboss-ejb3-client.jar:jboss-ejb3x.jar:jbossha-client.jar:jboss-iiop-client.jar:jboss-j2ee.jar:jboss-jaxrpc.jar:jbossjmx-ant.jar:jboss-jsr77-client.jar:jbossmq-client.jar:jboss-remoting.jar:jboss-saaj.jar:jboss-serialization.jar:jboss-srp-client.jar:jbosssx-client.jar:jboss-system-client.jar:jboss-transaction-client.jar:jbossws-client.jar:jboss-xml-binding.jar:jmx-client.jar:jmx-invoker-adaptor-client.jar:jnp-client.jar:juddisaaj.jar:log4j.jar:logkit.jar:mail.jar:scout.jar:trove.jar:wsdl4j.jar:xmlsec.jar -jar ~toni/projects/di/bin/import.jar

      Exception in thread "main" javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
      at javax.naming.InitialContext.init(InitialContext.java:223)
      at javax.naming.InitialContext.(InitialContext.java:197)
      at de.pilati.hhe.client.OrganizerImport.getContext(OrganizerImport.java:91)
      at de.pilati.hhe.client.OrganizerImport.(OrganizerImport.java:40)
      at de.pilati.hhe.client.OrganizerImport.main(OrganizerImport.java:96)
      Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      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(VersionHelper12.java:42)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
      ... 6 more