aspose file tools*
The moose likes BEA/Weblogic and the fly likes Unable to run ejbc from within eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Unable to run ejbc from within eclipse" Watch "Unable to run ejbc from within eclipse" New topic
Author

Unable to run ejbc from within eclipse

Premil Jacob
Ranch Hand

Joined: Sep 10, 2004
Posts: 30
I have eclipse version Version: 3.0.1 , but every time I try to run the following weblogic ant task

<target name="deploy" depends="startup">
<ejbjar descriptordir="${config}" srcdir="${dest}" naming="ejb-name">
<weblogic destdir="${deploy}" ejbcclass="weblogic.ejbc" />
<exclude name="weblogic*.xml"/>
</ejbjar>
</target>

I get the following error message.

[ejbc] Compiler class: 'com.sun.tools.javac.Main', not found
[ejbc] java.lang.ClassNotFoundException: com.sun.tools.javac.Main
[ejbc] at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
[ejbc] at java.security.AccessController.doPrivileged(Native Method)
[ejbc] at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
[ejbc] at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
[ejbc] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
[ejbc] at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[ejbc] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[ejbc] at java.lang.Class.forName0(Native Method)
[ejbc] at java.lang.Class.forName(Class.java:141)
[ejbc] at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:406)
[ejbc] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:328)
[ejbc] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:336)
[ejbc] at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:270)
[ejbc] at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476)
[ejbc] at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:397)
[ejbc] at weblogic.ejbc20.runBody(ejbc20.java:517)
[ejbc] at weblogic.utils.compiler.Tool.run(Tool.java:146)
[ejbc] at weblogic.utils.compiler.Tool.run(Tool.java:103)
[ejbc] at weblogic.ejbc.main(ejbc.java:29)
[ejbc] ERROR: Error from ejbc: Compiler class: 'com.sun.tools.javac.Main', not found
[ejbc] ERROR: ejbc couldn't invoke compiler


When I try to run the same ant task from the command prompt, it seems to be working fine.


Thanks,<br />Premil<br /> <br />SCJP 1.4
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Originally posted by Premil Jacob:
I have eclipse version Version: 3.0.1 , but every time I try to run the following weblogic ant task

<target name="deploy" depends="startup">
<ejbjar descriptordir="${config}" srcdir="${dest}" naming="ejb-name">
<weblogic destdir="${deploy}" ejbcclass="weblogic.ejbc" />
<exclude name="weblogic*.xml"/>
</ejbjar>
</target>


When I try to run the same ant task from the command prompt, it seems to be working fine.


Try adding compiler="javac". Here's what that one line looks like in our build file:
<weblogic destdir="${compiledEJBs}" suffix="EJB.jar" ejbcclass="weblogic.ejbc" compiler="javac" >

I only run it on the command line, but I get the error (Compiler class: 'com.sun.tools.javac.Main', not found) if I take out compiler="javac".
Premil Jacob
Ranch Hand

Joined: Sep 10, 2004
Posts: 30
Great !!! its working now, thanks Carol.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to run ejbc from within eclipse
 
Similar Threads
problem in deploying my stateless session bean application
Error in deploying EJB-
EJB deployment error
UnsupportedClassVersionError
please help me out "Compiler Adapter 'javac' can't be found"