Thats good catch
. Actually, I was inviting more experts comment on this, but you wrongly interpreted. But, luckily you are the only expert who have shared the views.
Here is what I did and probably you can try if your env is set up -
HelloWorld EJB SLSB
Weblogic Server 8
(Source for ejb-jar.xml -
http://docs.jboss.org/jbossas/jboss4guide/r2/html/ch12.html) And in the existing ejb-jar.xml, I replaced the starting tag as
<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" version="2.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Then I tried to compile using weblogic.ejbc and using weblogic ant build file. Here is the stacktrace when I used the following command
<target name="appc" depends="jar.ejb">
<wlappc debug="${debug}" source="${dist}/ejb20_basic_statelessSession.jar" />
</target>
BUILD FAILED
file:C:/bea8/user_projects/domains/wsdomain/work/webservices/build.xml:46: weblogic.utils.compiler.ToolFailureExce
ption: [J2EE:160119]Appc is unable to process the file 'C:\bea8\user_projects\domains\wsdomain\work\webservices\di
st\ejb20_basic_statelessSession.jar'. The following error occurred:
weblogic.utils.compiler.ToolFailureException: [J2EE:160113]Error: The source file, 'C:\bea8\user_projects\domains\
wsdomain\work\webservices\dist\ejb20_basic_statelessSession.jar', is not a valid ejb-jar file. To be valid, it mus
t contain a META-INF/ejb-jar.xml file.
at weblogic.appc.compileInput(appc.java:422)
at weblogic.appc.runBody(appc.java:184)
at weblogic.utils.compiler.Tool.run(Tool.java:192)
at weblogic.utils.compiler.Tool.run(Tool.java:147)
at weblogic.appc.main(appc.java:1030)
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:324)
at weblogic.ant.taskdefs.j2ee.CompilerTask.invokeMain(CompilerTask.java:278)
at weblogic.ant.taskdefs.j2ee.Appc.privateExecute(Appc.java:200)
at weblogic.ant.taskdefs.j2ee.Appc.execute(Appc.java:124)
at org.apache.tools.ant.Task.perform(Task.java:341)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
at org.apache.tools.ant.Main.runBuild(Main.java:609)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
- with nested exception:
[weblogic.utils.compiler.ToolFailureException: [J2EE:160113]Error: The source file, 'C:\bea8\user_projects\domains
\wsdomain\work\webservices\dist\ejb20_basic_statelessSession.jar', is not a valid ejb-jar file. To be valid, it mu
st contain a META-INF/ejb-jar.xml file.]
When I tried to compile weblogic.ejbc I got these errors -
C:\bea8\user_projects\domains\wsdomain\work\webservices>
java weblogic.ejbc ejb111.jar wshello.jar
ERROR: ejbc found errors while parsing the descriptor for ejb111.jar:
ERROR: Error from ejbc: Error parsing file 'META-INF/ejb-jar.xml' at line: 8 column: 106. Attribute "xmlns" must
be declared for xtype "ejb-jar".
ERROR: ejbc couldn't load descriptor from jar