5 Replies Latest reply on Mar 27, 2004 9:51 AM by Thorsten Westmeier

    ClassNotFoundException in JBoss.Net deployment

    javajames27 Newbie

      I have successfully deployed my stateless EJB to Jboss.net and communicated to it via WSIF. I'm now trying to add more functionality to my EJB and will need to import new classes and deploy additional jars. The EJB deploys fine, but the .wsr fails due to not finding the .class files that are inside packaged jars in my .ear. If I put all the .class files in the jars into the EJB jar rather than external jars, I can deploy fine. Here is the setup that fails - can someone shed some light on why/how I can tell JBoss.net to look at other jars contained in the parent ear rather than just the EJB jar? I don't see a DTD for web-service.xml, so I'm not sure if there are any directives that I can use to get JBoss.net/Axis to work.

      WebServiceGateway.ear:

      META-INF
      --application.xml
      WebServiceGateway.wsr
      --META-INF
      ----web-service.xml
      ----manifest.mf (Class-path: lib/common.jar)
      WebServiceGatewayBean.jar
      --META-INF
      ----manifest.mf (Class-path: lib/common.jar)
      ----<various EJB files>
      --lib
      ----common.jar

      Finally, here is the stacktrace of the failed deploy:

      org.apache.axis.deployment.wsdd.WSDDNonFatalException: java.lang.ClassNotFoundException: No ClassLoaders found for: com.betweenmarkets.framework.gateway.webservice.DocumentInput
      java.lang.ClassNotFoundException: No ClassLoaders found for: com.betweenmarkets.framework.gateway.webservice.DocumentInput
      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:241)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoader3.java:169)
      at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:123)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:141)
      at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:197)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:171)
      at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:112)
      at org.apache.axis.deployment.wsdd.WSDDTypeMapping.getLanguageSpecificType(WSDDTypeMapping.java:221)
      at org.apache.axis.deployment.wsdd.WSDDDeployment.deployMapping(WSDDDeployment.java:341)
      at org.apache.axis.deployment.wsdd.WSDDDeployment.getTypeMappingRegistry(WSDDDeployment.java:520)
      at org.jboss.net.axis.Deployment.getTypeMappingRegistry(Deployment.java:207)
      at org.jboss.net.axis.Deployment.equipTypeMappingWithOptions(Deployment.java:113)
      at org.jboss.net.axis.Deployment.deployTypeMapping(Deployment.java:196)
      at org.jboss.net.axis.Deployment.(Deployment.java:83)
      at org.jboss.net.axis.server.AxisService.start(AxisService.java:555)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:458)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)

      at org.apache.axis.deployment.wsdd.WSDDDeployment.deployMapping(WSDDDeployment.java:358)
      at org.apache.axis.deployment.wsdd.WSDDDeployment.getTypeMappingRegistry(WSDDDeployment.java:520)
      at org.jboss.net.axis.Deployment.getTypeMappingRegistry(Deployment.java:207)
      at org.jboss.net.axis.Deployment.equipTypeMappingWithOptions(Deployment.java:113)
      at org.jboss.net.axis.Deployment.deployTypeMapping(Deployment.java:196)
      at org.jboss.net.axis.Deployment.(Deployment.java:83)
      at org.jboss.net.axis.server.AxisService.start(AxisService.java:555)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:458)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)

      at org.jboss.net.axis.Deployment.deployTypeMapping(Deployment.java:198)
      at org.jboss.net.axis.Deployment.(Deployment.java:83)
      at org.jboss.net.axis.server.AxisService.start(AxisService.java:555)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:458)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)

      at org.jboss.net.axis.Deployment.deployTypeMapping(Deployment.java:198)
      at org.jboss.net.axis.Deployment.(Deployment.java:83)
      at org.jboss.net.axis.server.AxisService.start(AxisService.java:555)
      ... 16 more

        • 1. Re: ClassNotFoundException in JBoss.Net deployment
          James Clover Newbie

          Try putting your jar files in the root of your .ear, not under a lib directory.

          • 2. Re: ClassNotFoundException in JBoss.Net deployment
            javajames27 Newbie

             

            "james.clover" wrote:
            Try putting your jar files in the root of your .ear, not under a lib directory.



            Actually, I tried that as well but no joy. Is this a proven fact or just a guess at a solution? Just wondering if I did something wrong when I attempted it.

            Thanks

            • 3. Re: ClassNotFoundException in JBoss.Net deployment
              James Clover Newbie

              No, not a guess - this is how my .ear web services work. I don't see any obvious differences between what you have and what I have....

              I'll have to think on it a bit, maybe I can come up with something.

              • 4. Re: ClassNotFoundException in JBoss.Net deployment
                Thorsten Westmeier Newbie

                Hi,

                i think, that i have similar problem with my web-service.

                My Application, which uses EJBs, works with a local TestClient (see 1.)without problems.

                In future the RealClient should be a Web-Start-Application with Port 80 Server-Communication
                (to avoid firewall-problems) and so I tried to create an Axis Web-Service (see 2.).

                My Problem is, that after deploying my web-service the URL
                http://localhost:8080/jboss-net/services/UserService?wsdl
                leads an Axis-ErrorMessage.It looks like Axis can't find my EJB, but why?

                Do you have any hints?
                Thorsten



                The URL http://localhost:8080/jboss-net/services/UserService?wsdl leads to the following errorMessage:

                AXIS error
                
                Sorry, something seems to have gone wrong... here are the details:
                
                Fault - ; nested exception is:
                org.apache.axis.ConfigurationException: java.lang.ClassNotFoundException: No ClassLoaders found for: UserSL
                AxisFault
                 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
                 faultSubcode:
                 faultString: java.lang.ClassNotFoundException: No ClassLoaders found for: UserSL
                 faultActor:
                 faultNode:
                 faultDetail:
                {http://xml.apache.org/axis/}stackTrace: java.lang.ClassNotFoundException: No ClassLoaders found for: UserSL
                at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:241)
                at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoader3.java:181)
                at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:135)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
                at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(Class.java:141)
                at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:197)
                at java.security.AccessController.doPrivileged(Native Method)
                . . .
                



                My System is : JDK 1.4.2_04-b05, JBoss 3.2.4RC1, JBoss integrated Tomcat, JBoss integr. Axis (JBoss-net.sar),
                Microsoft IIS, JK2-Connector (isapi_redirector2.dll)



                1.) EJB-TestClient:
                ****************
                import testEJB.UserSLHome;
                import testEJB.UserSL;
                . . .
                private UserSLHome userSLHome = null;
                private UserSL userSL = null;
                . . .
                
                try
                {
                 Hashtable env = new Hashtable();
                 env.put("java.naming.factory.initial",
                 "org.jnp.interfaces.NamingContextFactory");
                 env.put("java.naming.provider.url",
                 "localhost:1099");
                
                 Context jndiContext = new InitialContext(env);
                
                 Object ref = jndiContext.lookup("UserSL");
                 userSLHome = (UserSLHome)
                 PortableRemoteObject.narrow(ref, UserSLHome.class);
                
                 userSL = userSLHome.create();
                 userAccount = userSL.userLogin(loginName, loginPassword);
                }
                catch (Exception ex)
                {
                 ex.printStackTrace();
                }
                



                2.) TestEJBModul.wsr:
                ******************

                /Meta-inf/Manifest.mf
                /Meta-inf/web-service.xml


                web-service.xml:
                ---------------------
                <?xml version="1.0" encoding="UTF-8"?>
                <deployment
                 xmlns="http://xml.apache.org/axis/wsdd/"
                 xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
                 <service name="UserService" provider="java:EJB">
                 <parameter name="beanJndiName" value="UserSL"/>
                 <parameter name="homeInterfaceName" value="UserSLHome"/>
                 <parameter name="remoteInterfaceName" value="UserSL"/>
                 <parameter name="allowedMethods" value="userLogin"/>
                 <parameter name="jndiURL" value="jnp://localhost:1099"/>
                 <parameter name="jndiContextClass"
                 value="org.jnp.interfaces.NamingContextFactory"/>
                 </service>
                </deployment>
                



                3.) TestEJBModul.jar:
                ******************

                /Meta-inf/ejb-jar.xml
                /Meta-inf/jboss.xml
                /Meta-inf/jbosscmp-jdbc.xml
                . . .
                /testEJB/UserSL.class
                /testEJB/UserSLHome.class
                /testEJB/UserSLBean.class
                . . .
                . . .


                ejb-jar.xml:
                -------------
                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
                <ejb-jar>
                 <display-name>TestEJBModul</display-name>
                 <enterprise-beans>
                 <session>
                 <display-name>UserSL</display-name>
                 <ejb-name>UserSL</ejb-name>
                 <home>testEJB.UserSLHome</home>
                 <remote>testEJB.UserSL</remote>
                 <ejb-class>testEJB.UserSLBean</ejb-class>
                 <session-type>Stateless</session-type>
                 <transaction-type>Container</transaction-type>
                 </session>
                 . . .
                 </enterprise-beans>
                 <assembly-descriptor>
                 <container-transaction>
                 <method>
                 <ejb-name>UserSL</ejb-name>
                 <method-name>*</method-name>
                 </method>
                 <trans-attribute>Required</trans-attribute>
                 </container-transaction>
                 . . .
                 </assembly-descriptor>
                </ejb-jar>
                


                jboss.xml:
                ------------
                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
                <jboss>
                 <enterprise-beans>
                 <session>
                 <ejb-name>UserSL</ejb-name>
                 <jndi-name>UserSL</jndi-name>
                 </session>
                 . . .
                 </enterprise-beans>
                </jboss>
                


                • 5. Re: ClassNotFoundException in JBoss.Net deployment
                  Thorsten Westmeier Newbie

                  Sorry, i forgot something to mention:

                  I use the JBoss default-configuration and added manually the ?jboss-net.sar? from all-configuration to the deploy-directory without any further configuration. May this cause any problems?

                  Thorsten