4 Replies Latest reply on Jun 6, 2005 3:42 PM by chaman kumar

    Why does error come  in deployment?

    chaman kumar Newbie

      sir,
      I used following file(java & xml) & make jar file with command
      jar -cvf greet.jar *.class META-INF\*.xml

      It gives follwing message after making jar file(which is wriiten down
      with header "jar").
      Now copy this jar file in jboss-3.2.2\server\ default\deploy
      directory.After than we start jboss server it gives following error
      message,which is written with header "error". I use java 1.4.1 version
      & sst classpath as:-
      classpath=f:\java;f:\jboss-3.2.2\client\log4j.jar;
      f:\jboss-3.2.2\client\jboss-system-client.jar;
      f:\jboss-3.2.2\client\jboss-common-client.jar;
      f:\jboss-3.2.2\client\jboss-client.jar;
      f:\jboss-3.2.2\client\jbosssx-client.jar;
      f:\jboss-3.2.2\client\jboss-j2ee.jar;
      f:\jboss-3.2.2\client\jnp-client.jar;
      f:\jboss-3.2.2\client\jboss-transaction-client.jar;
      f:\jboss-3.2.2\server\default\lib\javax.servlet.jar;


      How can I solve this problem ?
      -------------------------------------------------------------------
      greethome.java
      -------------------------------------------------------------------
      import javax.ejb.*;
      import java.rmi.RemoteException;

      public interface greethome extends EJBHome
      {
      greethome create() throws
      RemoteException,CreateException;
      }
      ------------------------------------------------------------------
      greetremote.java
      -------------------------------------------------------------------
      import javax.ejb.*;
      import java.rmi.RemoteException;

      public interface greetremote extends EJBObject
      {
      public String greetme(String s) throws RemoteException;
      }
      -----------------------------------------------------------------
      greetbean.java
      -----------------------------------------------------------------
      import javax.ejb.*;
      public class greetbean implements SessionBean
      {
      public String greetme(String s) throws RemoteException
      {
      return "How are you?............."+s;
      }
      public void ejbCreate() {}
      public void ejbRemove() {}
      public void ejbActivate() {}
      public void ejbPassivate() {}

      public void setSessionContext(SessionContext sc)
      {}
      }
      -----------------------------------------------------------------
      ejb-jar.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" version="2.1"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
      <enterprise-beans>

      <ejb-name>greetbean</ejb-name>
      greethome
      greetremote
      <ejb-class>greetbean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container </transaction-type>

      </enterprise-beans>
      </ejb-jar>
      --------------------------------------------------------------------
      jboss.xml
      -------------------------------------------------------------------
      <!DOCTYPE jboss PUBLIC
      "-//JBoss//DTD JBOSS 4.0//EN"
      "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">

      <enterprise-beans>

      <ejb-name>greetbean</ejb-name>
      <jndi-name>greetjndi</jndi-name>

      </enterprise-beans>

      ----------------------------------------------------------------------
      jar
      ------------------------------------------------------------------
      adding: META-INF/ (in=0) (out=0) (stored 0%)
      adding: META-INF/MANIFEST.MF (in=56) (out=56) (stored 0%)
      adding: greetbean.class (in=806) (out=397) (deflated 50%)
      adding: greethome.class (in=243) (out=178) (deflated 26%)
      adding: greetremote.class (in=242) (out=173) (deflated 28%)
      adding: META-INF/ejb-jar.xml (in=577) (out=282) (deflated 51%)
      adding: META-INF/jboss.xml (in=272) (out=174) (deflated 36%)

      Total:
      ------
      (in = 2184) (out = 2030) (deflated 7%)
      ----------------------------------------------------------------
      error
      ----------------------------------------------------------------
      10:38:34,773 ERROR [XmlFileLoader] XmlFileLoader: File META-INF/jboss.xml process fatal error.
      Line: 13. Error message: Content is not allowed in trailing section.
      10:38:34,776 ERROR [XmlFileLoader] Content is not allowed in trailing
      section.:1:13
      org.xml.sax.SAXParseException: Content is not allowed in trailing section.
      at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:313)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:257)
      at org.jboss.ejb.EJBDeployer.init(EJBDeployer.java:425)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:799)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:736)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
      at sun.reflect.GeneratedMethodAccessor29.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:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke
      (ModelMBeanOperationInterceptor.java:131)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:481)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
      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:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:416)
      at sun.reflect.GeneratedMethodAccessor5.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:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
      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:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
      at org.jboss.Main.boot(Main.java:151)
      at org.jboss.Main$1.run(Main.java:405)
      at java.lang.Thread.run(Thread.java:595)
      10:38:35,956 ERROR [MainDeployer] Could not initialise deployment: file:/opt/jboss-4.0.0/server/default/deploy/greet.jar
      org.jboss.deployment.
      DeploymentException: Content is not allowed in trailing section.; - nested throwable: (org.xml.sax.SAXParseException: Content is not allowed in trailing section.)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:327)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:257)
      at org.jboss.ejb.EJBDeployer.init(EJBDeployer.java:425)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:799)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:736)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
      at sun.reflect.GeneratedMethodAccessor29.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:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:481)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
      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:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:416)
      at sun.reflect.GeneratedMethodAccessor5.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:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
      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:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
      at org.jboss.Main.boot(Main.java:151)
      at org.jboss.Main$1.run(Main.java:405)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: org.xml.sax.SAXParseException: Content is not allowed in trailing section.
      at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:313)

        • 1. Re: Why does error come  in deployment?
          Stefan Meier Newbie

          Dear chaman4110,

          the first thing to do is putting the names of the remote and home interfaces inside the proper xml-tags and wrap all the tags concerning your bean with a session-tag:


          <?xml version="1.0" encoding="UTF-8"?>
          <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" version="2.1"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
          <enterprise-beans>

          <ejb-name>greetbean</ejb-name>
          greethome
          greetremote

          </enterprise-beans>
          </ejb-jar>


          Perhaps there's some more that has to be changed but I hope this can be a starting point for you.

          Regards,
          Stefan

          • 2. Re: Why does error come  in deployment?
            chaman kumar Newbie


            sir,
            Actually my Xml code is this but It gives error when deployment

            <?xml version="1.0" ?>
            <!DOCTYPE ejb-jar PUBLIC
            "-Sun MicroSystem, INC.//DTD Enterprise JavaBeans 2.0//EN"
            "http://java.sun.com/dtd/ejb.jar_2_0.dtd" >
            <ejb-jar>
            <enterprise-beans>

            <ejb-name>greetbean</ejb-name>
            greethome
            greetremote
            <ejb-class>greetbean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container </transaction-type>

            </enterprise-beans>
            </ejb-jar>

            • 3. Re: Why does error come  in deployment?
              Darran Lofthouse Master

              Can you please stop repeating the same post again and again, I am getting bored reading it.

              In your first post I asked you for further information, that is where you should have continued the discussion instead of repeating it in additional posts.

              The error you are getting relates to the jboss.xml deployment descriptor, unfortunately your XML has quite a few bits missing. Can you re-post the contents of your jboss.xml file. After pasting the contents into the message text box you need to select the XML and click the code button above so that it gets surrounded with [ code ] [/ code ] tags so that it will be displayed properly.

              Also use the 'Preview' button to see what your post comes out like.

              • 4. Re: Why does error come  in deployment?
                chaman kumar Newbie

                sir,
                sorry, for disturbance.second time I again Actually home & remote in ejb-jar.xml are wriiten as
                greethome
                greetremote

                But in posting case net miss these lines & write these lines as
                greethome
                greetremote

                ejb-jar.xml & jboss.xml files are

                ------------------------------------------------------------
                ejb-jar.xml
                ------------------------------------------------------------
                <?xml version="1.0" ?>
                <!DOCTYPE ejb-jar PUBLIC
                "-Sun MicroSystem, INC.//DTD Enterprise JavaBeans 2.0//EN"
                "http://java.sun.com/dtd/ejb.jar_2_0.dtd" >
                <ejb-jar>
                <enterprise-beans>

                <ejb-name>greetbean</ejb-name>
                greethome
                greetremote
                <ejb-class>greetbean</ejb-class>
                <session-type>Stateless</session-type>
                <transaction-type>Container </transaction-type>

                </enterprise-beans>
                </ejb-jar>

                ------------------------------------------------------------
                jboss.xml
                ------------------------------------------------------------
                <?xml version="1.0" ?>
                <!DOCTYPE jboss PUBLIC
                "-//JBoss//DTD JBOSS 3.2//EN"
                "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">

                <enterprise-beans>

                <ejb-name>greetbean</ejb-name>
                <jndi-name>greetjndi</jndi-name>

                </enterprise-beans>