1 2 Previous Next 15 Replies Latest reply on Feb 14, 2008 3:18 AM by Joaquin de Vicente

    Deploy Problem

    Joaquin de Vicente Newbie

      Hello,

      I've got a problem to access to a Remote SessionBean with JNDI and EJB 3.0

      In Developt Enviroment (IDE NetBeans 5.5) all works fine. But in Production (Client and Server separates) doesn't work.

      The .ear which I use in Server side is the same that compile NetBeans (in Develop) and is in <JBOSS_HOME>\server\default\deploy

      The .jar which I use in Client side is the same that compile NetBeans (in Develop) and is in <PROYECTO_HOME>\<PROY_NAME>-app-client\dist

      The order to run the client-server that I'm using is
      java -jar <PROY_NAME>-app-client.jar

      Context in server side is loading like:

       iniCtx = new InitialContext();
      


      and it's configurated throw parameters as system properties (java -Dclave=valor)

       -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       -Djava.naming.provider.url=jnp://192.200.10.1:1099
       -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      


      Client side code:
       private controladorPUsuarios() {
       uBean = lookupUsuariosBean();
       }
      
      
       private Hashtable Contexto() {
       Hashtable env2 = new Hashtable();
       env2.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
       env2.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
       env2.put(Context.PROVIDER_URL, "jnp://localhost:1099");
       return env2;
       }
      
       private UsuariosRemote lookupUsuariosBean() {
       Context iniCtx;
       try {
       Map env = null;
       Set propertiesSet = null;
       Iterator it = null;
      
       iniCtx = new InitialContext();
       env = this.Contexto();
       propertiesSet = env.keySet();
       it = propertiesSet.iterator();
      
       Context ejbCtx = (Context) iniCtx.lookup("");
       return (UsuariosRemote) ejbCtx.lookup("UsuariosBean");
       } catch (NamingException ex) {
       Logger.getLogger(getClass().getName()).log(Level.SEVERE,"exception caught" ,ex);
       throw new RuntimeException(ex);
       } catch (RuntimeException e) {
       e.printStackTrace();
       return null;
       }
       }
      
      


      Server side code:
      @Stateless
       @RemoteBinding(jndiBinding="UsuariosBean")
       public class UsuariosBean implements UsuariosRemote {
      
       public UsuariosBean() {
       conUsers = IControladorU.getInstance();
       }
      
      
       public Usuarios conectar(String nusuario, String clave)
       {
       return conUsers.conectar(nusuario, clave);
       }
       }
      


      Stack trace error:

      com.gui.funcionalidad.seguridad.controladorPUsuarios lookupUsuariosBean
      GRAVE: exception caught
      javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
       at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
       at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
       at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
       at javax.naming.InitialContext.lookup(Unknown Source)
       at com.gui.funcionalidad.seguridad.controladorPUsuarios.lookupUsuariosBean(controladorPUsuarios.java:78)
       at com.gui.funcionalidad.seguridad.controladorPUsuarios.<init>(controladorPUsuarios.java:61)
       at com.gui.funcionalidad.seguridad.controladorPUsuarios.<clinit>(controladorPUsuarios.java:43)
       at com.gui.pantalla.seguridad.LOGIN.btAceptarActionPerformed(LOGIN.java:102)
       at com.gui.pantalla.seguridad.LOGIN.access$000(LOGIN.java:17)
       at com.gui.pantalla.seguridad.LOGIN$1.actionPerformed(LOGIN.java:46)
       at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
       at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
       at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
       at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
       at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
       at java.awt.Component.processMouseEvent(Unknown Source)
       at javax.swing.JComponent.processMouseEvent(Unknown Source)
       at java.awt.Component.processEvent(Unknown Source)
       at java.awt.Container.processEvent(Unknown Source)
       at java.awt.Component.dispatchEventImpl(Unknown Source)
       at java.awt.Container.dispatchEventImpl(Unknown Source)
       at java.awt.Component.dispatchEvent(Unknown Source)
       at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
       at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
       at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
       at java.awt.Container.dispatchEventImpl(Unknown Source)
       at java.awt.Window.dispatchEventImpl(Unknown Source)
       at java.awt.Component.dispatchEvent(Unknown Source)
       at java.awt.EventQueue.dispatchEvent(Unknown Source)
       at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
       at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.run(Unknown Source)
      Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
       at com.gui.pantalla.seguridad.LOGIN.btAceptarActionPerformed(LOGIN.java:102)
       at com.gui.pantalla.seguridad.LOGIN.access$000(LOGIN.java:17)
       at com.gui.pantalla.seguridad.LOGIN$1.actionPerformed(LOGIN.java:46)
       at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
       at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
       at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
       at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
       at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
       at java.awt.Component.processMouseEvent(Unknown Source)
       at javax.swing.JComponent.processMouseEvent(Unknown Source)
       at java.awt.Component.processEvent(Unknown Source)
       at java.awt.Container.processEvent(Unknown Source)
       at java.awt.Component.dispatchEventImpl(Unknown Source)
       at java.awt.Container.dispatchEventImpl(Unknown Source)
       at java.awt.Component.dispatchEvent(Unknown Source)
       at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
       at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
       at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
       at java.awt.Container.dispatchEventImpl(Unknown Source)
       at java.awt.Window.dispatchEventImpl(Unknown Source)
       at java.awt.Component.dispatchEvent(Unknown Source)
       at java.awt.EventQueue.dispatchEvent(Unknown Source)
       at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
       at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.run(Unknown Source)
      Caused by: java.lang.RuntimeException: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
       at com.gui.funcionalidad.seguridad.controladorPUsuarios.lookupUsuariosBean(controladorPUsuarios.java:81)
       at com.gui.funcionalidad.seguridad.controladorPUsuarios.<init>(controladorPUsuarios.java:61)
       at com.gui.funcionalidad.seguridad.controladorPUsuarios.<clinit>(controladorPUsuarios.java:43)
       ... 28 more
      Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
       at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
       at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
       at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
       at javax.naming.InitialContext.lookup(Unknown Source)
       at com.gui.funcionalidad.seguridad.controladorPUsuarios.lookupUsuariosBean(controladorPUsuarios.java:78)
       ... 30 more





      Please, can you help me??




        • 1. Re: Deploy Problem
          jaikiran pai Master

          Looks like the parameters that you passing as JVM params are not reaching the client.

          Try this:

          private UsuariosRemote lookupUsuariosBean() {
           Context iniCtx;
           try {
           Map env = null;
           Set propertiesSet = null;
           Iterator it = null;
          
           iniCtx = new InitialContext();
          
          System.out.println("************** System Properties ****************");
           Properties props = System.getProperties();
           props.list(System.out);
           System.out.println("************** System Properties ****************");
           .....................
          


          What does this output?

          • 2. Re: Deploy Problem
            Joaquin de Vicente Newbie

            the output is the next one:

            ************** System Properties ****************
            -- listing properties --
            java.runtime.name=Java(TM) SE Runtime Environment
            sun.boot.library.path=C:\Program Files\Java\jdk1.6.0\jre\bin
            java.vm.version=1.6.0-b105
            java.vm.vendor=Sun Microsystems Inc.
            java.vendor.url=http://java.sun.com/
            path.separator=;
            java.vm.name=Java HotSpot(TM) Client VM
            file.encoding.pkg=sun.io
            user.country=ES
            sun.java.launcher=SUN_STANDARD
            sun.os.patch.level=Service Pack 2
            java.vm.specification.name=Java Virtual Machine Specification
            user.dir=C:\CS
            java.runtime.version=1.6.0-b105
            java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
            java.endorsed.dirs=C:\Program Files\Java\jdk1.6.0\jre\li...
            os.arch=x86
            java.io.tmpdir=C:\DOCUME~1\JOAQUN~1\LOCALS~1\Temp\
            line.separator=

            java.vm.specification.vendor=Sun Microsystems Inc.
            user.variant=
            java.naming.factory.url.pkgs=org.jboss.naming.client
            os.name=Windows XP
            sun.jnu.encoding=Cp1252
            java.library.path=C:\Program Files\Java\jdk1.6.0\jre\bi...
            java.specification.name=Java Platform API Specification
            java.class.version=50.0
            java.naming.provider.url=jnp://localhost:1099
            sun.management.compiler=HotSpot Client Compiler
            os.version=5.1
            user.home=C:\Documents and Settings\JoaquÃn de ...
            user.timezone=
            java.awt.printerjob=sun.awt.windows.WPrinterJob
            file.encoding=Cp1252
            java.specification.version=1.6
            user.name=JoaquÃn de Vicente
            java.class.path=C:\CS\CS-ejb\dist\CS-ejb.jar;C:\CS\CS...
            java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
            java.vm.specification.version=1.0
            sun.arch.data.model=32
            java.home=C:\Program Files\Java\jdk1.6.0\jre
            java.specification.vendor=Sun Microsystems Inc.
            user.language=es
            awt.toolkit=sun.awt.windows.WToolkit
            java.vm.info=mixed mode, sharing
            java.version=1.6.0
            java.ext.dirs=C:\Program Files\Java\jdk1.6.0\jre\li...
            j2ee.clientName=CS-app-client
            sun.boot.class.path=C:\Program Files\Java\jdk1.6.0\jre\li...
            java.vendor=Sun Microsystems Inc.
            file.separator=\
            java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport...
            sun.cpu.endian=little
            sun.io.unicode.encoding=UnicodeLittle
            sun.desktop=windows
            sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+m...
            ************** System Properties ****************

            • 3. Re: Deploy Problem
              jaikiran pai Master

              From the output that you posted, this is what is relevant:


              java.naming.factory.url.pkgs=org.jboss.naming.client
              java.naming.provider.url=jnp://localhost:1099
              java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory


              This is different from what you are passing through JVM parameters. Do you have any jndi.properties file in the <PROY_NAME>-app-client.jar file? What are its contents?

              By the way, i would have expected some other error and not a NoInitialContextException, in this case.



              • 4. Re: Deploy Problem
                Joaquin de Vicente Newbie

                Oh, it's true.... sorry

                The last test I did was
                jnp://localhost:1099
                and
                -Djava.naming.provider.url=jnp://localhost:1099

                because i'm trying now to do the deployment in a single machine with a server side and a client side

                • 5. Re: Deploy Problem
                  Joaquin de Vicente Newbie

                  After I change that values and the problem still exist

                  • 6. Re: Deploy Problem
                    jaikiran pai Master

                    Which Java version do you use on the server side. On the client side, i see that you are using Java 1.6. Might sound weird, but can you try using 1.5 and see if it's working?

                    • 7. Re: Deploy Problem
                      Joaquin de Vicente Newbie

                      On the server side i've working with JDK1.6, as same as client side.

                      I tried use 1.5 on the client side but the problem still remain.

                      • 8. Re: Deploy Problem
                        jaikiran pai Master

                         

                        The order to run the client-server that I'm using is
                        java -jar <PROY_NAME>-app-client.jar


                        Can you post the exact command that you are using (along with the -D parameters) to run this client? I dont see a reason why this should fail with a NoInitialContextException.



                        • 9. Re: Deploy Problem
                          Joaquin de Vicente Newbie

                          The command that I am using to run the client is:

                          C:\>java -Djava.naming.factory.initial=org.jnp.interface.NamingContextFactory -D
                          java.naming.provider.url=jnp://localhost:1099 -Djava.naming.factory.url.pkgs=org
                          .jnp.interfaces -jar CS-app-client.jar
                          


                          The proyect's name is CS.

                          Then the error is the next one (now it's a ClassNotFoundException)

                          11-feb-2008 9:40:06 com.gui.funcionalidad.seguridad.controladorPUsuarios lookupU
                          suariosBean
                          GRAVE: exception caught
                          javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interf
                          ace.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: or
                          g.jnp.interface.NamingContextFactory]
                           at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
                           at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
                           at javax.naming.InitialContext.init(Unknown Source)
                           at javax.naming.InitialContext.<init>(Unknown Source)
                           at com.gui.funcionalidad.seguridad.controladorPUsuarios.lookupUsuariosBe
                          an(controladorPUsuarios.java:94)
                           at com.gui.funcionalidad.seguridad.controladorPUsuarios.<init>(controlad
                          orPUsuarios.java:61)
                           at com.gui.funcionalidad.seguridad.controladorPUsuarios.<clinit>(control
                          adorPUsuarios.java:43)
                           at com.gui.pantalla.seguridad.LOGIN.btAceptarActionPerformed(LOGIN.java:
                          109)
                           at com.gui.pantalla.seguridad.LOGIN.access$000(LOGIN.java:18)
                           at com.gui.pantalla.seguridad.LOGIN$1.actionPerformed(LOGIN.java:53)
                           at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
                           at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
                           at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
                           at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
                           at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
                          ce)
                           at java.awt.Component.processMouseEvent(Unknown Source)
                           at javax.swing.JComponent.processMouseEvent(Unknown Source)
                           at java.awt.Component.processEvent(Unknown Source)
                           at java.awt.Container.processEvent(Unknown Source)
                           at java.awt.Component.dispatchEventImpl(Unknown Source)
                           at java.awt.Container.dispatchEventImpl(Unknown Source)
                           at java.awt.Component.dispatchEvent(Unknown Source)
                           at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
                           at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
                           at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
                           at java.awt.Container.dispatchEventImpl(Unknown Source)
                           at java.awt.Window.dispatchEventImpl(Unknown Source)
                           at java.awt.Component.dispatchEvent(Unknown Source)
                           at java.awt.EventQueue.dispatchEvent(Unknown Source)
                           at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
                           at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
                           at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
                           at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                           at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                           at java.awt.EventDispatchThread.run(Unknown Source)
                          Caused by: java.lang.ClassNotFoundException: org.jnp.interface.NamingContextFact
                          ory
                           at java.net.URLClassLoader$1.run(Unknown Source)
                           at java.security.AccessController.doPrivileged(Native Method)
                           at java.net.URLClassLoader.findClass(Unknown Source)
                           at java.lang.ClassLoader.loadClass(Unknown Source)
                           at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
                           at java.lang.ClassLoader.loadClass(Unknown Source)
                           at java.lang.ClassLoader.loadClassInternal(Unknown Source)
                           at java.lang.Class.forName0(Native Method)
                           at java.lang.Class.forName(Unknown Source)
                           at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
                           ... 35 more
                          Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
                           at com.gui.pantalla.seguridad.LOGIN.btAceptarActionPerformed(LOGIN.java:
                          109)
                           at com.gui.pantalla.seguridad.LOGIN.access$000(LOGIN.java:18)
                           at com.gui.pantalla.seguridad.LOGIN$1.actionPerformed(LOGIN.java:53)
                           at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
                           at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
                           at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
                           at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
                           at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
                          ce)
                           at java.awt.Component.processMouseEvent(Unknown Source)
                           at javax.swing.JComponent.processMouseEvent(Unknown Source)
                           at java.awt.Component.processEvent(Unknown Source)
                           at java.awt.Container.processEvent(Unknown Source)
                           at java.awt.Component.dispatchEventImpl(Unknown Source)
                           at java.awt.Container.dispatchEventImpl(Unknown Source)
                           at java.awt.Component.dispatchEvent(Unknown Source)
                           at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
                           at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
                           at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
                           at java.awt.Container.dispatchEventImpl(Unknown Source)
                           at java.awt.Window.dispatchEventImpl(Unknown Source)
                           at java.awt.Component.dispatchEvent(Unknown Source)
                           at java.awt.EventQueue.dispatchEvent(Unknown Source)
                           at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
                           at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
                           at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
                           at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                           at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                           at java.awt.EventDispatchThread.run(Unknown Source)
                          Caused by: java.lang.RuntimeException: javax.naming.NoInitialContextException: C
                          annot instantiate class: org.jnp.interface.NamingContextFactory [Root exception
                          is java.lang.ClassNotFoundException: org.jnp.interface.NamingContextFactory]
                           at com.gui.funcionalidad.seguridad.controladorPUsuarios.lookupUsuariosBe
                          an(controladorPUsuarios.java:114)
                           at com.gui.funcionalidad.seguridad.controladorPUsuarios.<init>(controlad
                          orPUsuarios.java:61)
                           at com.gui.funcionalidad.seguridad.controladorPUsuarios.<clinit>(control
                          adorPUsuarios.java:43)
                           ... 28 more
                          Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org
                          .jnp.interface.NamingContextFactory [Root exception is java.lang.ClassNotFoundEx
                          ception: org.jnp.interface.NamingContextFactory]
                           at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
                           at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
                           at javax.naming.InitialContext.init(Unknown Source)
                           at javax.naming.InitialContext.<init>(Unknown Source)
                           at com.gui.funcionalidad.seguridad.controladorPUsuarios.lookupUsuariosBe
                          an(controladorPUsuarios.java:94)
                           ... 30 more
                          Caused by: java.lang.ClassNotFoundException: org.jnp.interface.NamingContextFact
                          ory
                           at java.net.URLClassLoader$1.run(Unknown Source)
                           at java.security.AccessController.doPrivileged(Native Method)
                           at java.net.URLClassLoader.findClass(Unknown Source)
                           at java.lang.ClassLoader.loadClass(Unknown Source)
                           at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
                           at java.lang.ClassLoader.loadClass(Unknown Source)
                           at java.lang.ClassLoader.loadClassInternal(Unknown Source)
                           at java.lang.Class.forName0(Native Method)
                           at java.lang.Class.forName(Unknown Source)
                           at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
                           ... 35 more
                          


                          Thank's a lot

                          • 10. Re: Deploy Problem
                            jaikiran pai Master

                             

                            Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org
                            .jnp.interface.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interface.NamingContextFactory]


                            OK, now it makes sense. You will have to include the jbossall-client.jar (which you can find in %JBOSS_HOME%/client) folder in the classpath of the client application. Since you are running the application as a jar, you will have to add the jbossall-client.jar file in the classpath by adding an Classpath entry in the Manifest.MF file of the CS-app-client.jar.


                            • 11. Re: Deploy Problem
                              Joaquin de Vicente Newbie

                              I made all that changes.

                              The new classpath is this:

                              C:\>set classpath CLASSPATH=.;C:\Program Files\Java\jre1.6.0;C:\Program Files\Java\jre1.6.0\bin;C:\Program Files\Java\jre1.6.0\bin\javaw.exe;C:\Program Files\Java\jre1.6.0_02\lib\ext\QTJava.zip;C:\jboss-4.0.4.GA;C:\jboss-4.0.4.GA\server\default\deploy;C:\CS\CS-ejb\setup;C:\Program Files\Java\jre1.5.0_14;C:\Program Files\Java\jre1.5.0_14\bin;;C:\Program Files\Java\jre1.5.0_14\bin\javaw.exe;C:\jboss-4.0.4.GA\client;
                              


                              In C:\jboss-4.0.4.GA\client; I have the jbossall-client.jar

                              I put it in the Client's Manifest.MF (Client's .jar is in C:\):
                              Class-Path: jboss-4.0.4.GA\client\jbossall-client.jar;
                              


                              With this changes I try to execute the command again:

                              C:\>java -Djava.naming.factory.initial=org.jnp.interface.NamingContextFactory -Djava.naming.provider.url=jnp://localhost:1099 -Djava.naming.factory.url.pkgs=org.jnp.interfaces -jar CS-app-client.jar
                              


                              and the error result is the next one:

                              com.gui.funcionalidad.seguridad.controladorPUsuarios lookupUsuariosBean
                              GRAVE: exception caught
                              javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interface.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interface.NamingContextFactory]
                               at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
                               at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
                               at javax.naming.InitialContext.init(Unknown Source)
                               at javax.naming.InitialContext.<init>(Unknown Source)


                              • 12. Re: Deploy Problem
                                jaikiran pai Master

                                 

                                Class-Path: jboss-4.0.4.GA\client\jbossall-client.jar;


                                That's not how the Class-Path entry works in the Manifest.MF file. See this http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html for details.

                                Assuming you have your CS-app-client.jar in C: then copy the jbosall-client.jar to C:.
                                C:
                                |
                                |---- CS-app-client.jar
                                |
                                |---- jbossall-client.jar


                                Now in the Manifest.MF add the Class-Path entry as follows:

                                Class-Path: jbossall-client.jar


                                When you add this as the Class-Path entry, the jbossall-client.jar is expected to be in the same folder as the CS-app-client.jar (i.e. this path is relative to where your executable jar file is located).

                                Now run your client application.

                                • 13. Re: Deploy Problem
                                  Joaquin de Vicente Newbie

                                  Thanks for the information.

                                  I made this changes.

                                  I put jbossall-client.jar at same level as CS-app-client.jar (in C:\)

                                  I put the new entry into client's Manifest.MF:

                                  Manifest-Version: 1.0
                                  Ant-Version: Apache Ant 1.6.5
                                  Created-By: 1.6.0-b105 (Sun Microsystems Inc.)
                                  X-COMMENT: Main-Class will be added automatically by build
                                  Main-Class: cs.Main
                                  Class-Path: CS-ejb.jar jbossall-client.jar
                                  


                                  I used same classpath and commands than before but the error was the same too:

                                  12-feb-2008 9:55:12 com.gui.funcionalidad.seguridad.controladorPUsuarios lookupUsuariosBean
                                  GRAVE: exception caught
                                  javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interface.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interface.NamingContextFactory]
                                   at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
                                   at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
                                   at javax.naming.InitialContext.init(Unknown Source)
                                   at javax.naming.InitialContext.<init>(Unknown Source)
                                   at com.gui.funcionalidad.seguridad.controladorPUsuarios.lookupUsuariosBean(controladorPUsuarios.java:94)
                                   at com.gui.funcionalidad.seguridad.controladorPUsuarios.<init>(controladorPUsuarios.java:61)
                                   at com.gui.funcionalidad.seguridad.controladorPUsuarios.<clinit>(controladorPUsuarios.java:43)
                                   at com.gui.pantalla.seguridad.LOGIN.btAceptarActionPerformed(LOGIN.java:109)
                                  


                                  I think that the problem is in Manifest.MF Class-Path that import a CS-ejb.jar (which it should be in C:\ but it's the server side). Could it be??

                                  • 14. Re: Deploy Problem
                                    jaikiran pai Master

                                    That's strange. Your (earlier) exception stacktrace shows that this piece of code is called through some Swing component. Does cs.Main class render this UI?

                                    1 2 Previous Next