1 Reply Latest reply on Jun 20, 2005 1:42 AM by m s

    Why my code doen't deploy on jboss-3.2.2

    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.5.0_01 version
      & set 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" ?>
      <!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>
      <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>

      ----------------------------------------------------------------------
      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)