Forums Register Login
Creating jar file for EJB
I am trying to create a jar file containing EJB Home,EJB remote,EJB bean,client files and deployment descriptor.My EJB Home,remote and bean classes are in C:\EJB and my client classes and deployment descriptor are in C:\EJBClient.These folder contains both java and classs files.Now to jar these files I am issuing following command :
C:\>jar cfm test.jar EJB\*.java EJBClient\*.java EJB\ejb-jar.xml
then it gives following error:
java.io.IOException:invalid header field
at java.util.jar.Attributes.read(Attributes.java:383)
at java.util.jar.Manifest.read(Manifest.java:167)
at java.util.jar.Manifest.<init>(Manifest.java:52)
at sun.tools.jar.Main.run.(Main.java:124)
at sun.tools.jar.Main.run.(Main.java:904)
Please tell me whats wrong with the syntax.
Not sure but it is possible that it is looking for a manifest files since you have specified jar cfm instead of jar cf.
Could be that you have not created a META-INF folder and copied all ur xml files there.
Command to create a jar file is :
jar cv0f zzzzz.jar META-INF xxxfolder yyyfolderv
where xxxfolder is the folder where u've copied ur class files related to EJB and yyyfolder is where ur client files are.
U can then use the weblogic.ejbc to create a weblogic related jar/ear file for deploying ur ejb.

This thread has been viewed 845 times.

All times above are in ranch (not your local) time.
The current ranch time is
Dec 13, 2018 21:54:23.