8 Replies Latest reply on Oct 19, 2007 5:34 AM by Jeff Yu

    RA deployment in JBoss

    Jeff Yu Master

      Hi, All

      I have a RA, which is packed in an EAR. I've followed this thread ( http://www.jboss.com/index.html?module=bb&op=viewtopic&t=88080 ) to deploy the RAR in ear.

      ----myapp.ear
      ++++myapp.rar
      ++++META-INF/application.xml
      ++++META-INF/jboss-app.xml
      ++++myapp-ds.xml

      in the jboss-app.xml, I set the classloader is isolated, and the java2ParentDelegation as false.

      And then I start the JBoss, I would see below error.

      Error stack is:
      ------------------------
      org.jboss.util.NestedRuntimeException: Premature end of file.; - nested throwable: (org.xml.sax.SAXP
      arseException: Premature end of file.)
      at org.jboss.util.propertyeditor.DocumentEditor.getAsDocument(DocumentEditor.java:88)
      at org.jboss.util.propertyeditor.ElementEditor.setAsText(ElementEditor.java:41)
      at org.jboss.system.ServiceConfigurator.parseTextSerialData(ServiceConfigurator.java:565)
      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:329)
      at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:460)
      at org.jboss.system.ServiceConfigurator.processDependency(ServiceConfigurator.java:661)
      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:357)
      at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:460)
      at org.jboss.system.ServiceConfigurator.processDependency(ServiceConfigurator.java:661)
      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:357)
      at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:460)
      at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
      at org.jboss.system.ServiceController.install(ServiceController.java:226)
      at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy4.install(Unknown Source)
      at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterce
      ptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy35.create(Unknown Source)
      at org.jboss.deployment.XSLSubDeployer.create(XSLSubDeployer.java:192)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:959)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterce
      ptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeplo
      ymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentSca
      nner.java:336)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)

      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterce
      ptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      at org.jboss.Main.boot(Main.java:200)
      at org.jboss.Main$1.run(Main.java:490)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: org.xml.sax.SAXParseException: Premature end of file.
      at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
      at org.jboss.util.propertyeditor.DocumentEditor.getAsDocument(DocumentEditor.java:79)
      ... 106 more





      Thanks
      Jeff

        • 1. Re: RA deployment in JBoss
          Vicky Kak Master

           

          in the jboss-app.xml, I set the classloader is isolated, and the java2ParentDelegation as false.

          Are you able to get this working without this modification ?



          • 2. Re: RA deployment in JBoss
            Adrian Brock Master

            The message says it cannot parse an xml document because it is not complete/well formed.

            Without the more detailed server.log (one exception is useless) it's hard to even tell
            which xml it is talking about.

            I'd guess it is the -ds.xml in your ear, since neither of the other two xml files you
            mention go through the ServiceController/Configurator.

            Posting the -ds.xml might also be relevant to your problem, don't you think? :-)

            • 3. Re: RA deployment in JBoss
              Jeff Yu Master

              And then I found it was caused by the xmlapi jar.

              In my RA.rar, I have the xmlapi.jar, whose version is lower than the xmlapi in the $JBoss_HOME/lib/endorsed folder, so I remove the xmlapi.jar in my RA.

              Then I start the jboss again, and see another error is:

              22:28:26,091 ERROR [STDERR] java.lang.ClassCastException: $Proxy63
              22:28:26,091 ERROR [STDERR] at sun.reflect.annotation.AnnotationParser.annotationForMap(Annotati
              onParser.java:239)
              22:28:26,091 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
              22:28:26,123 ERROR [STDERR] at sun.reflect.annotation.AnnotationParser.parseAnnotation(Annotatio
              nParser.java:229)
              22:28:26,123 ERROR [STDERR] at sun.reflect.annotation.AnnotationParser.parseAnnotations2(Annotat
              ionParser.java:69)
              22:28:26,123 ERROR [STDERR] at sun.reflect.annotation.AnnotationParser.parseAnnotations(Annotati
              onParser.java:52)
              22:28:26,123 ERROR [STDERR] at java.lang.Class.initAnnotationsIfNecessary(Class.java:3031)
              22:28:26,123 ERROR [STDERR] at java.lang.Class.getAnnotation(Class.java:2989)
              22:28:26,123 ERROR [STDERR] at org.apache.cxf.jaxws.support.JaxWsImplementorInfo.initialise(JaxW
              sImplementorInfo.java:259)


              It seems it uses the JBoss server lib again, instead of using the library in my RAR file.

              • 4. Re: RA deployment in JBoss
                Jeff Yu Master

                Firstly, thanks for your reply, to make you easy understood my situation, I will post all relevant xml configure file. ;-)

                1. application.xml

                <?xml version="1.0" encoding="UTF-8"?>

                <display-name>cxf-jca</display-name>

                cxf.rar



                2. jboss-app.xml
                <?xml version="1.0" encoding="UTF-8"?>
                <jboss-app>
                <loader-repository>
                apache.cxf:loader=cxf.ear
                <loader-repository-config>
                java2ParentDelegation=false
                </loader-repository-config>
                </loader-repository>

                cxf-ds.xml

                </jboss-app>

                3. cxf-ds.xml
                <?xml version="1.0" encoding="UTF-8"?>
                <connection-factories>
                <no-tx-connection-factory>
                <jndi-name>EIS/CXFConnector</jndi-name>
                <rar-name>cxf.ear#cxf.rar</rar-name>
                <connection-definition>org.apache.cxf.connector.CXFConnectionFactory</connection-definition>
                </no-tx-connection-factory>
                </connection-factories>

                • 5. Re: RA deployment in JBoss
                  Jeff Yu Master

                  A little story about my situation:

                  Before I pack the rar file in an ear, I use the cxf-ds.xml and cxf.rar to do the deployment.

                  Because the cxf uses some jars which JBoss used its older version, to make it cxf based RA works, I need to endorse a bunch of jars in the $JBoss/lib/endorsed.

                  * geronimo-activation_1.1_spec-1.0-M1.jar
                  * geronimo-annotation_1.0_spec-1.1.jar
                  * geronimo-ws-metadata_2.0_spec-1.1.1.jar
                  * jaxb-api-2.1.jar
                  * jaxb-impl-2.1.4.jar
                  * jaxb-xjc-2.1.4.jar
                  * jsr181-api-1.0-MR1.jar
                  * saaj-api-1.3.jar
                  * saaj-impl-1.3.jar
                  * stax-api-1.0.1.jar
                  * stax-utils-20060502.jar

                  and it can start successfully, however, I am looking for an elegant way to do this instead of using endorsed.

                  So I know I need to use the scoped classloader, and in order to do that, it needs me to pack the RAR to an EAR, and then adding the jboss-app.xml to configure.

                  • 6. Re: RA deployment in JBoss
                    Jeff Yu Master

                    Back to the problem.

                    As I said before, the error that I had firstly is due to the older version (xmlapi.jar and resolver.jar) in the my RAR than the $JBoss/lib, So I remove these two jars to use the jars that JBoss had.

                    But then I restart it again, it complains the ClassCastException,,, the error stack is:
                    -------------------------
                    23:00:59,248 ERROR [STDERR] java.lang.ClassCastException: $Proxy63
                    23:00:59,248 ERROR [STDERR] at sun.reflect.annotation.AnnotationParser.annotationForMap(Annotati
                    onParser.java:239)
                    23:00:59,248 ERROR [STDERR] at sun.reflect.annotation.AnnotationParser.parseAnnotation(Annotatio
                    nParser.java:229)
                    23:00:59,248 ERROR [STDERR] at sun.reflect.annotation.AnnotationParser.parseAnnotations2(Annotat
                    ionParser.java:69)
                    23:00:59,248 ERROR [STDERR] at sun.reflect.annotation.AnnotationParser.parseAnnotations(Annotati
                    onParser.java:52)
                    23:00:59,248 ERROR [STDERR] at java.lang.Class.initAnnotationsIfNecessary(Class.java:3031)
                    23:00:59,248 ERROR [STDERR] at java.lang.Class.getAnnotation(Class.java:2989)
                    23:00:59,248 ERROR [STDERR] at org.apache.cxf.jca.servant.EJBEndpoint.isJaxWsServiceInterface(EJ
                    BEndpoint.java:159)
                    23:00:59,279 ERROR [STDERR] at org.apache.cxf.jca.servant.EJBEndpoint.publish(EJBEndpoint.java:7
                    6)
                    23:00:59,279 ERROR [STDERR] at org.apache.cxf.jca.cxf.JCABusFactory.initializeServantsFromProper
                    ties(JCABusFactory.java:128)
                    23:00:59,279 ERROR [STDERR] at org.apache.cxf.jca.cxf.JCABusFactory.access$200(JCABusFactory.jav
                    a:49)
                    23:00:59,279 ERROR [STDERR] at org.apache.cxf.jca.cxf.JCABusFactory$EJBServicePropertiesMonitorW
                    orker.run(JCABusFactory.java:269)
                    23:00:59,279 ERROR [STDERR] at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)

                    23:00:59,279 ERROR [STDERR] at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.j
                    ava:275)
                    23:00:59,279 ERROR [STDERR] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Pooled
                    Executor.java:743)
                    23:00:59,279 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)


                    The code is:
                    ------------------------
                    Class<?> interfaceClass = Class.forName(this.getServiceClassName());
                    if (cls == null) {
                    return false;
                    }

                    if (null != cls.getAnnotation(WebService.class)) {
                    return true;
                    }
                    return true;


                    So, I suspect that in this situation, it might used the different classloader...

                    Any thoughts?

                    Thanks
                    Jeff

                    • 7. Re: RA deployment in JBoss
                      Jeff Yu Master

                      Resolved this error by putting the ejb in the ear. I forgot to put the ejb jar in the ear, but the RAR has need to access the ejb jar, so the "ClassCastException" occurs.

                      However, now I am facing another problem, it also refers to classloader, I don't know which part of this forum should I post to regard to the classloader issue, I post it here
                      ( http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4096879#4096879 )

                      Can someone, who is familiar with the classloader, give me a hint.

                      Regards
                      Jeff

                      • 8. Re: RA deployment in JBoss
                        Jeff Yu Master

                        Just found this forum doesn't allow author to update the thread. :(

                        for convenience, click http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4096879#4096879 to get the issue that I am talking about.