1 Reply Latest reply on Jun 4, 2005 2:30 PM by Darran Lofthouse

    How can I remove jar file error

    chaman kumar Newbie

      Sir,
      I have used following java file & xml file, these java file has been compiled by follwing command:-
      javac *.java . It didn't produce any error , then after I have written two
      xml file (ejb-jar.xml & jboss .xml) in META-INF directory. For making jar
      file we used following command:-
      jar cvf greet.jar *.class META-INF/*.xml , it has given following errors which are wrriten below with heading "Following error".
      What is the meaning of this error & how can I solve it. I use jboss-4.0.0 server,inbuilt Tomcat server.


      greethome.java(Home interface java file)
      ----------------------------------------------------------------------------------
      import javax.ejb.*;
      import java.rmi.RemoteException;

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

      public interface greetremote extends EJBObject
      {
      public String greetme(String s) throws RemoteException;
      }
      -------------------------------------------------------------------------------------
      greetbean.java( Implementation interface java file)

      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( FOR Deployment process)
      ------------------------------------------------------------------------------------
      <?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( FOR Deployment process)
      -------------------------------------------------------------------------------------

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

      -------------------------------------------------------------------------------------
      Following error
      -------------------------------------------------------------------------------------
      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%)