Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

appc fails with 'com.sun.tools.javac.Main', not found - Please Help!

2 views
Skip to first unread message

Naresh Bhatia

unread,
Sep 9, 2003, 1:47:22 PM9/9/03
to

We are running into a bizzare problem with appc (WebLogic 8.1 SP1). On a select
few machines when we fire appc via ant we get the following exception:

appc:
[java] Compiler class: 'com.sun.tools.javac.Main', not found
[java] java.lang.ClassNotFoundException: com.sun.tools.javac.Main
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
[java] at java.security.AccessController.doPrivileged(NativeMethod)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:141)
[java] at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:407)
[java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:329)
[java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:337)
[java] at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:270)
[java] at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476)
[java] at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:387)
[java] at weblogic.appc.compileEJB(appc.java:796)
[java] at weblogic.appc.compileEJB(appc.java:770)
[java] at weblogic.appc.compileInput(appc.java:462)
[java] at weblogic.appc.runBody(appc.java:183)
[java] at weblogic.utils.compiler.Tool.run(Tool.java:146)
[java] at weblogic.utils.compiler.Tool.run(Tool.java:103)
[java] at weblogic.appc.main(appc.java:1022)
[java] [J2EE:160121]Errors encountered while compiling module 'E:\oss.sandbox\components\server\OssSession\dist\OssSession.jar':

[java] Compiler class: 'com.sun.tools.javac.Main', not found


It appears that appc cannot find the Java compiler. Has anybody come across this
problem? We checked the Windows path a million times and it is correct. Other
java files are being compiled by ant without any problems. As soon as appc start
we get this error!

Any help would be much appreciated.
Thanks.
Naresh

Rob Woollen

unread,
Sep 9, 2003, 2:06:34 PM9/9/03
to
Make sure you have the $JAVA_HOME/lib/tools.jar in your $CLASSPATH

-- Rob

Naresh Bhatia

unread,
Sep 9, 2003, 5:26:50 PM9/9/03
to

We have narrowed the problem down to WL 8.1.0 vs WL 8.1.1. With zero changes to
the environment, WL 8.1.0 does not have the problem but WL 8.1.1 has. To fix the
problem we tried putting tools.jar in the system classpath. But that does not
work. Then we tried putting it in the Ant target as follows and that worked:

<path id="compile.path">
<pathelement location="C:\j2sdk\lib\tools.jar"/>
<pathelement location="${weblogic.jar}"/>
</path>

<target name="appc">
<java classname="weblogic.appc" fork="yes" failonerror="yes"
classpathref="compile.path">
<arg value="${dist.dir}/${ejb-name}.jar"/>
</java>
</target>

Before we go about changing our build scripts, we would like to understand why
is WL 8.1.1 behaving differently. Please let us know if you have any ideas.

Thanks.
Naresh

Rob Woollen

unread,
Sep 9, 2003, 9:11:59 PM9/9/03
to
I know that in 8.1 SP1 (8.1.1) the default is to invoke javac in-process
so that's probably why you see the behavior change. Adding it to the
system classpath won't help if you fork java and specify a -classpath.

I would recommend that you use the wlappc ant task rather than the raw
java task.

If you'd prefer to use the <java> task for some reason, then I'd
recommend fork="no" and adding -noexit to the appc args. This will
definitely help your build speed.

Naresh Bhatia

unread,
Sep 10, 2003, 1:50:07 PM9/10/03
to

Rob,

Thanks for the response. I would prefer to use the wlappc task, however I am having
some trouble with its syntax. I have read the manuals, but that did not help.
Can you please help?

My path is defined using the following ant syntax:

<path id="compile.path">
<pathelement location="${framework.jar}"/>
<pathelement location="${oss-common.jar}"/>
<pathelement location="${server-oss-common.jar}"/>


<pathelement location="${weblogic.jar}"/>
</path>

I am trying to use this classpath in the wlappc task. I have tried two approaches:

1)
<target name="appc">
<wlappc
source="${dist.dir}/${ejb-name}.jar"
classpathref="compile.path"/>
</target>

2)
<target name="appc">
<wlappc
source="${dist.dir}/${ejb-name}.jar">

<classpath>
<path refid="compile.path"/>
</classpath>
</wlappc>
</target>

Both approaches give the following error:
java.util.MissingResourceException: Can't find bundle for base name weblogic.i18n.J2EELogLocalizer,
locale en_US

Isn't there anyway to reference a classpath that is defined elswhere? I can't
define the classpath directly in the wlappc task because it is referenced in multiple
places and I like to keep only one copy of it.

0 new messages