Discussion:
Weblogic.ejbc error
(too old to reply)
Dhirender Kumar Thakur
2004-09-13 08:19:57 UTC
Permalink
Hi All,

I am learning EJB and trying to deploy a stateless session bean. I have compiled all the java files and created test.jar(contains .class files and META-INF/.xml files) file.

When I am executing the command java weblogic.ejbc test.jar final.jar, following errors are shown:

<Warning> <EJB> <BEA-010054> <EJB Deployment: stat
elessSession has a class TraderBean that is in the classpath. This class should
only be located in the ejb-jar file.>
<Warning> <EJB> <BEA-010054> <EJB Deployment: stat
elessSession has a class TraderHome that is in the classpath. This class should
only be located in the ejb-jar file.>
<Warning> <EJB> <BEA-010054> <EJB Deployment: stat
elessSession has a class Trader that is in the classpath. This class should only
be located in the ejb-jar file.>
<Warning> <EJB> <BEA-010202> <Call-by-reference is
not enabled for the EJB 'statelessSession'. The server will have better perform
ance if it is enabled. To enable call-by-reference, set the enable-call-by-refer
ence element to True in the weblogic-ejb-jar.xml deployment descriptor for this
EJB.>
Compiler class: 'com.sun.tools.javac.Main', not found
java.lang.ClassNotFoundException: com.sun.tools.javac.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvo
ker.java:407)
at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:
329)
at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:
337)
at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:270)
at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476)
at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:397)
at weblogic.ejbc20.runBody(ejbc20.java:519)
at weblogic.utils.compiler.Tool.run(Tool.java:146)
at weblogic.utils.compiler.Tool.run(Tool.java:103)
at weblogic.ejbc.main(ejbc.java:29)

ERROR: Error from ejbc: Compiler class: 'com.sun.tools.javac.Main', not found


ERROR: ejbc couldn't invoke compiler

How can I rectify these errors. Please guide me. I have included the weblogic.jar file in classpath.

Thanks in advance.
Dharminder Singh
2004-09-21 07:57:01 UTC
Permalink
To get rid of the warnings you need to remove the ejb classes from the server classpath.

To fix the classdefnotfound problem you should probably add tools.jar from the jdk to the classpath.

Hope this works.

ds
Philip Glebow
2005-01-15 16:31:49 UTC
Permalink
I had this same problem when building my EJBs using Ant. I added "-compiler javac" to the weblogic task and it fixed the problem:

<weblogic destdir="${JAR.DIR}" args="-nowarn -compiler javac" ejbcclass="weblogic.ejbc">
<wlclasspath>
<path refid="ejbc.classpath"/>
</wlclasspath>
</weblogic>

Phil

Loading...