1 2 Previous Next 21 Replies Latest reply on Jun 5, 2004 8:53 PM by jww_xj Go to original post
      • 15. Re: servlet 2.3 web container first class loading in JBoss 3
        pjaromin

        First, I've not seen the ASCII issue you're describing so I'm sorry I don't have any insight into that one.

        Now, I've been experimenting all morning with my JBoss 3.2.3 installation and am running short on ideas....

        I've created a very simple Struts-based webapp that includes an action with the following code:

        protected void output() throws NamingException {
         Context ctx = new InitialContext();
         String parent = "java:/";
         NamingEnumeration children = ctx.list(parent);
        
         System.out.println("CHILDREN of " + parent);
         while (children.hasMore()) {
         NameClassPair pair = (NameClassPair)children.nextElement();
         System.out.println("NAME: " + pair.getName() + " TYPE: " + pair.getClassName());
         }


        There are also two oracle datasources specified in deploy/oracle-ds.xml

        When I run this with the default jbossweb-tomcat41.sar/META-INF/jboss-service.xml settings,

        <attribute name="Java2ClassLoadingCompliance">true</attribute>
        <attribute name="UseJBossWebLoader">true</attribute>


        The output from the action is:
        14:18:41,169 INFO [STDOUT] CHILDREN of java:/
        14:18:41,171 INFO [STDOUT] NAME: comp TYPE: javax.naming.Context
        14:18:41,172 INFO [STDOUT] NAME: jgsi.oracle1 TYPE: org.jboss.resource.adapter.jdbc.WrapperDataSource
        14:18:41,172 INFO [STDOUT] NAME: jgsi.oracle2 TYPE: org.jboss.resource.adapter.jdbc.WrapperDataSource
        14:18:41,173 INFO [STDOUT] NAME: TransactionPropagationContextImporter TYPE: org.jboss.tm.TransactionPropagationContextImporter
        14:18:41,174 INFO [STDOUT] NAME: TransactionPropagationContextExporter TYPE: org.jboss.tm.TransactionPropagationContextFactory
        14:18:41,175 INFO [STDOUT] NAME: TransactionManager TYPE: org.jboss.tm.TxManager


        HOWEVER, when I then change the settings of jbossweb-tomcat41.sar/META-INF/jboss-service.xml to

        <attribute name="Java2ClassLoadingCompliance">false</attribute>
        <attribute name="UseJBossWebLoader">false</attribute>


        There are no children in the context at "java:/".

        I've tried moving the oracle classes out of the war to the server's lib directory, but this had no effect.

        Anyone have any ideas?

        • 16. Re: servlet 2.3 web container first class loading in JBoss 3
          pjaromin

          In researching further, I located an old post elsewhere from Scott Stark stating that the "java:" context is bound to a class loader. (http://www.mail-archive.com/jboss-user@lists.sourceforge.net/msg23203.html//www.mail-archive.com/jboss-user@lists.sourceforge.net/msg23203.html) This would explain why my webapp using a separate class loader wouldn't have the oracle datasource in it.

          So, my question is: What are my options? Am I screwed here?

          I've got literally dozens of apps to migrate that need to be grouped in a managable (less than a dozen) number of JBoss instances. I would prefer to (need to, really) have a group of webapps in a JBoss instance share a common oracle datasource as I do now with WebLogic (what we're migrating from). At the same time, these webapps must be able to use different versions of some libraries (Struts or Jakarta commons for example) since they were written at different times over a number of years -- upgrading/retesting all webapps in a container every time one of them is upgraded would be cost/time prohibitive.

          Please tell me I've misunderstood something or have something misconfigured.

          • 17. Re: servlet 2.3 web container first class loading in JBoss 3
            starksm64

            Submit a bug report to sourceforge with a sample wars. I can't determine what is going on here based on this info.
            http://sourceforge.net/tracker/?group_id=22866&atid=376685

            • 18. Re: servlet 2.3 web container first class loading in JBoss 3
              pjaromin

              The JNDI issue is *not* reproducable under JBoss 3.2.4RC2. I will wait the couple weeks for 3.2.4 Final to continue my migration. Thanks!

              I've just updated the bug request (#952672) http://sourceforge.net/tracker/index.php?func=detail&aid=952672&group_id=22866&atid=376685.

              • 19. Re: servlet 2.3 web container first class loading in JBoss 3
                hate12sj

                I get the following error when I followed the steps.

                2004-06-01 15:51:45,007 ERROR [STDERR] log4j:ERROR A "org.jboss.logging.util.OnlyOnceErrorHandler" object is not assignable to a "org.apache.log4j.spi.ErrorHandler" variable.
                2004-06-01 15:51:45,007 ERROR [STDERR] log4j:ERROR The class "org.apache.log4j.spi.ErrorHandler" was loaded by
                2004-06-01 15:51:45,007 ERROR [STDERR] log4j:ERROR [WebappClassLoader
                available:
                Extension[javax.ejb, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=2.0, specificationVendor=Sun Microsystems, Inc., specificationVersion=2.0]
                Extension[javax.xml.bind, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.0, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.0]
                Extension[com.sun.msv, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.0, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.0]
                Extension[com.sun.xml.bind, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.0, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.0]
                Extension[com.sun.tools.xjc, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.0, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.0]
                Extension[org.saxpath, implementationVendor= werken digital., implementationVersion=1.0, specificationVendor=werken digital., specificationVersion=1.0 FCS]
                delegate: false
                repositories:
                /WEB-INF/classes/
                required:
                ----------> Parent Classloader:
                java.net.FactoryURLClassLoader@1cd3dd7
                ] whereas object of type
                2004-06-01 15:51:45,007 ERROR [STDERR] log4j:ERROR "org.jboss.logging.util.OnlyOnceErrorHandler" was loaded by [org.jboss.system.server.NoAnnotationURLClassLoader@4a5ab2].
                2004-06-01 15:51:45,085 ERROR [STDERR] log4j:ERROR Could not create an Appender. Reported error follows.
                2004-06-01 15:51:45,085 ERROR [STDERR] java.lang.ClassCastException
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:165)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:384)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:783)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:666)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:602)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.log4j.LogManager.(LogManager.java:113)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.log4j.Logger.getLogger(Logger.java:85)
                2004-06-01 15:51:45,100 ERROR [STDERR] at com.bitfone.server.commons.logging.Log4JLogger.(Log4JLogger.java:78)
                2004-06-01 15:51:45,100 ERROR [STDERR] at com.bitfone.server.commons.logging.Log4JFactory.getBitfoneLogger(Log4JFactory.java:97)
                2004-06-01 15:51:45,100 ERROR [STDERR] at com.bitfone.server.delivery.RequestHeaderFilter.init(RequestHeaderFilter.java:106)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:266)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:327)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:120)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3160)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3617)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.jboss.web.tomcat.tc4.EmbeddedTomcatService.createWebContext(EmbeddedTomcatService.java:549)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.jboss.web.tomcat.tc4.EmbeddedTomcatService.performDeploy(EmbeddedTomcatService.java:309)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:428)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
                2004-06-01 15:51:45,100 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
                2004-06-01 15:51:45,100 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
                2004-06-01 15:51:45,100 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                2004-06-01 15:51:45,116 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
                2004-06-01 15:51:45,116 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                2004-06-01 15:51:45,116 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
                2004-06-01 15:51:45,116 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                2004-06-01 15:51:45,116 ERROR [STDERR] at $Proxy6.deploy(Unknown Source)
                2004-06-01 15:51:45,116 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
                2004-06-01 15:51:45,116 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
                2004-06-01 15:51:45,116 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
                2004-06-01 15:51:45,116 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)
                2004-06-01 15:51:45,116 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
                2004-06-01 15:51:45,116 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
                2004-06-01 15:51:45,116 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                2004-06-01 15:51:45,116 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
                2004-06-01 15:51:45,116 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                2004-06-01 15:51:45,116 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
                2004-06-01 15:51:45,116 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
                2004-06-01 15:51:45,116 ERROR [STDERR] at $Proxy0.start(Unknown Source)
                2004-06-01 15:51:45,116 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:394)
                2004-06-01 15:51:45,116 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
                2004-06-01 15:51:45,116 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                2004-06-01 15:51:45,116 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                2004-06-01 15:51:45,194 ERROR [STDERR] at $Proxy4.start(Unknown Source)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
                2004-06-01 15:51:45,194 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                2004-06-01 15:51:45,194 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                2004-06-01 15:51:45,194 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                2004-06-01 15:51:45,194 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                2004-06-01 15:51:45,194 ERROR [STDERR] at $Proxy5.deploy(Unknown Source)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.Main.boot(Main.java:150)
                2004-06-01 15:51:45,194 ERROR [STDERR] at org.jboss.Main$1.run(Main.java:395)
                2004-06-01 15:51:45,194 ERROR [STDERR] at java.lang.Thread.run(Thread.java:534)

                • 20. Re: servlet 2.3 web container first class loading in JBoss 3
                  jww_xj

                  pls change your code

                  protected void output() throws NamingException {
                  Context ctx = new InitialContext();
                  String parent = "java:/";
                  NamingEnumeration children = ctx.list(parent);

                  System.out.println("CHILDREN of " + parent);
                  while (children.hasMore()) {
                  NameClassPair pair = (NameClassPair)children.nextElement();
                  System.out.println("NAME: " + pair.getName() + " TYPE: " + pair.getClassName());
                  }




                  change as this test ,good luck

                  protected void output() throws NamingException {

                  Properties prop = new Properties();
                  prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                  prop.put(Context.PROVIDER_URL, "jnp://localhost:1099");
                  prop.put(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
                  Context ctx = new InitialContext(prop);
                  String parent = "java:/";
                  NamingEnumeration children = ctx.list(parent);

                  System.out.println("CHILDREN of " + parent);
                  while (children.hasMore()) {
                  NameClassPair pair = (NameClassPair)children.nextElement();
                  System.out.println("NAME: " + pair.getName() + " TYPE: " + pair.getClassName());
                  }



                  • 21. Re: servlet 2.3 web container first class loading in JBoss 3
                    jww_xj

                    pls change your code

                    protected void output() throws NamingException {
                     Context ctx = new InitialContext();
                     String parent = "java:/";
                     NamingEnumeration children = ctx.list(parent);
                    
                     System.out.println("CHILDREN of " + parent);
                     while (children.hasMore()) {
                     NameClassPair pair = (NameClassPair)children.nextElement();
                     System.out.println("NAME: " + pair.getName() + " TYPE: " + pair.getClassName());
                     }


                    change as this test ,good luck

                    protected void output() throws NamingException {
                    
                     Properties prop = new Properties();
                     prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                     prop.put(Context.PROVIDER_URL, "jnp://localhost:1099");
                     prop.put(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
                    Context ctx = new InitialContext(prop);
                     String parent = "java:/";
                     NamingEnumeration children = ctx.list(parent);
                    
                     System.out.println("CHILDREN of " + parent);
                     while (children.hasMore()) {
                     NameClassPair pair = (NameClassPair)children.nextElement();
                     System.out.println("NAME: " + pair.getName() + " TYPE: " + pair.getClassName());
                     }




                    1 2 Previous Next