Issue 6 in thread-weaver: Refuses to build due to error running javac.exe compiler

24 views
Skip to first unread message

thread...@googlecode.com

unread,
Jun 21, 2010, 1:43:52 PM6/21/10
to thread...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 6 by iainsproat: Refuses to build due to error running javac.exe
compiler
http://code.google.com/p/thread-weaver/issues/detail?id=6

What steps will reproduce the problem?
1.Checkout r9

2.Add dependent libraries and attempt to build.

javassist-jar=../lib/javassist.jar
objenesis-jar=../lib/objenesis-1.2.jar
cglib-jar=../lib/cglib-2.2.jar
easymock-jar=../lib/easymock-3.0.jar
easymockclassextension-jar=../lib/easymockclassextension-3.0.jar
junit-jar=../lib/junit-4.8.2.jar
asm-jar=../lib/asm-3.3.jar

3.Can't build, following error message is given.

pathToSource\ThreadWeaver\build.xml:32: The following error occurred
while executing this line:
pathToSource\ThreadWeaver\main\build.xml:57: The following error
occurred while executing this line:
pathToSource\ThreadWeaver\main\build.xml:36: Error running javac.exe
compiler

thread...@googlecode.com

unread,
Jun 21, 2010, 1:50:13 PM6/21/10
to thread...@googlegroups.com

Comment #1 on issue 6 by alasdair.mackintosh: Refuses to build due to error

Do you have the output from javac?

Without seeing the output, there are 2 possible things I can think of.
Firstly, are you sure that you're using version 6 of the JDK?
Secondly, your use of backslashes suggests that you are running on
Windows. I recently built ThreadWeaver on Windows, and I think I had
to put absolute paths into build.properties instead of relative ones:

cglib-jar=c:/java/lib/cglib-2.2.jar

If neither of these two things is the problem, I think I'd need to see
the output from javac to be able to help you.


thread...@googlecode.com

unread,
Jun 21, 2010, 2:50:14 PM6/21/10
to thread...@googlegroups.com

Comment #2 on issue 6 by iainsproat: Refuses to build due to error running
javac.exe compiler
http://code.google.com/p/thread-weaver/issues/detail?id=6

Thanks for your prompt response.

Unfortunately, there's no javac output being produced. - which is half the
problem as I'm unable to debug. I can't see any compiler suppression flags
in the build.xml, so not quite sure what the problem there is. I've tried
forcing some other errors to prove that javac output can be produced, and
it's not some setting on my end.

using version 6.0.200.2

I've changed to absolute paths just incase but it doesn't seem to help.
I've added an echo in /main/build.xml to verify the parameters are being
passed correctly, which they seem to be.

thread...@googlecode.com

unread,
Jun 21, 2010, 3:02:44 PM6/21/10
to thread...@googlegroups.com

Comment #3 on issue 6 by alasdair.mackintosh: Refuses to build due to error

I'll try to reproduce this. Can you confirm you're running on Windows, and
let me know which version? Also, are you launching ant from the command
line, or are you using an IDE? Which version of javassist are you building
against?

Thanks.

thread...@googlecode.com

unread,
Jun 21, 2010, 3:17:25 PM6/21/10
to thread...@googlegroups.com

Comment #4 on issue 6 by iainsproat: Refuses to build due to error running
javac.exe compiler
http://code.google.com/p/thread-weaver/issues/detail?id=6

Thanks.

I'm attempting this build on Windows XP using Ant through eclipse.
I took the advice in the documentation and am using Javassist 3.8.1

thread...@googlecode.com

unread,
Jun 21, 2010, 7:14:05 PM6/21/10
to thread...@googlegroups.com

Comment #5 on issue 6 by alasdair.mackintosh: Refuses to build due to error

Hi Iain,

I'm not sure I fully understand your workflow here. I've tried to import
ThreadWeaver into Eclipse, by using the 'Java Project from Existing Ant
Buildfile" option, but that doesn't work. (This is a limitation of Eclipse
- it can only handle certain kinds of build.xml files, and in general, this
feature is designed to parse build files that were autogenerated by
Eclipse.)

I can create a new Eclipse project from the ThreadWeaver source, and then
run the build.xml file successfully, but I can't actually build the project
directly using Eclipse until I manually import the various dependent jars
into the Eclipse build path.

This might be your best approach. Alternatively, I've attached an Ant built
file that was autogenerated by Eclipse after I'd configured it manually.
You'd need to set your own paths to the various dependent jars.

If you want to debug the original problem, can you try running ant from the
command line rather than from Eclipse? That might give you better
diagnostics.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one
in the same
directory with the processing instruction
<?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="ThreadWeaver">
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<path id="ThreadWeaver.classpath">
<pathelement location="bin"/>
<pathelement location="javassist.jar"/>
<pathelement location="objenesis-1.0.jar"/>
<pathelement location="cglib-2.2.jar"/>
<pathelement location="easymock.jar"/>
<pathelement location="easymockclassextension.jar"/>
<pathelement location="junit.jar"/>
<pathelement location="asm-3.0.jar"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="main" excludes="**/BUILD, **/OWNERS, **/*.launch,
**/*.java"/>
</copy>
<copy includeemptydirs="false" todir="bin">
<fileset dir="test" excludes="**/BUILD, **/OWNERS, **/*.launch,
**/*.java"/>
</copy>
<copy includeemptydirs="false" todir="bin">
<fileset dir="extensions" excludes="**/BUILD, **/OWNERS,
**/*.launch, **/*.java"/>
</copy>
<copy includeemptydirs="false" todir="bin">
<fileset dir="extensions_test" excludes="**/BUILD, **/OWNERS,
**/*.launch, **/*.java"/>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin"
source="${source}" target="${target}">
<src path="main"/>
<classpath refid="ThreadWeaver.classpath"/>
</javac>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin"
source="${source}" target="${target}">
<src path="test"/>
<classpath refid="ThreadWeaver.classpath"/>
</javac>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin"
source="${source}" target="${target}">
<src path="extensions"/>
<classpath refid="ThreadWeaver.classpath"/>
</javac>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin"
source="${source}" target="${target}">
<src path="extensions_test"/>
<classpath refid="ThreadWeaver.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project.
Useful to propagate changes." name="build-refprojects"/>
</project>

thread...@googlecode.com

unread,
Jun 22, 2010, 3:36:17 AM6/22/10
to thread...@googlegroups.com

Comment #6 on issue 6 by iainsproat: Refuses to build due to error running
javac.exe compiler
http://code.google.com/p/thread-weaver/issues/detail?id=6

I've now run it from command line, which returns the same error but at
least provides javac output. I get 100 javac errors for missing symbols -
which suggests it's not importing a library.

[javac]
pathToSource\main\com\google\testing\threadtester\TestInstrumenter.java:648:
cannot find symbol
[javac] symbol : class NotFoundException
[javac] location: class com.google.testing.threadtester.TestInstrumenter
[javac] } catch (NotFoundException e) {
[javac] ^

With regards to using eclipse; my workflow was to create a new project from
source and add the libraries manually to the classpath.

I've also exported eclipse to an Ant build file, which is copied below for
comparison:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one
in the same
directory with the processing instruction
<?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="ThreadWeaver">
<property environment="env"/>

<property name="ECLIPSE_HOME" value="../../../../../Program
Files/Eclipse/eclipse-java-galileo-SR2-win32/eclipse"/>


<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<path id="ThreadWeaver.classpath">
<pathelement location="bin"/>

<pathelement location="lib/asm-3.3.jar"/>
<pathelement location="lib/cglib-2.2.jar"/>
<pathelement location="lib/easymock-3.0.jar"/>
<pathelement location="lib/easymockclassextension-3.0.jar"/>
<pathelement location="lib/javassist.jar"/>
<pathelement location="lib/junit-4.8.2.jar"/>
<pathelement location="lib/objenesis-1.2.jar"/>


</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">

<fileset dir="examples">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>


</copy>
<copy includeemptydirs="false" todir="bin">
<fileset dir="extensions">

<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>


</copy>
<copy includeemptydirs="false" todir="bin">
<fileset dir="extensions_test">

<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>


</copy>
<copy includeemptydirs="false" todir="bin">

<fileset dir="main">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>


</copy>
<copy includeemptydirs="false" todir="bin">
<fileset dir="test">

<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>


</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin"
source="${source}" target="${target}">

<src path="examples"/>

<target description="copy Eclipse compiler jars to ant lib directory"
name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins"
includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins"
includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler"
name="build-eclipse-compiler">
<property name="build.compiler"
value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
</project>

thread...@googlecode.com

unread,
Jun 22, 2010, 12:50:36 PM6/22/10
to thread...@googlegroups.com

Comment #7 on issue 6 by alasdair.mackintosh: Refuses to build due to error

The NotFoundException is a javassist class. Most likely there is something
wrong with your javassist jar file, or with the path to it. Can you please
verify that you have the correct name? In your build file yo are
referencing "lib/javassist.jar" Is that the actual name of the jar file, or
is there a version number as well? (E.g. javassist_3.8.4.jar, or something
like that.)

If the path is correct, please verify the jar. Go to the directory that
contains hte jar and run:

jar tf javassist.jar

Should get output like this:

META-INF/
META-INF/MANIFEST.MF
javassist/
javassist/ByteArrayClassPath.class
javassist/CannotCompileException.class
javassist/ClassClassPath.class

In particular, check for:

javassist/NotFoundException.class

thread...@googlecode.com

unread,
Jun 22, 2010, 1:10:09 PM6/22/10
to thread...@googlegroups.com

Comment #8 on issue 6 by iainsproat: Refuses to build due to error running
javac.exe compiler
http://code.google.com/p/thread-weaver/issues/detail?id=6

NotFoundException is there:

> jar tf javassist.jar
....
javassist/LoaderClassPath.class
javassist/Modifier.class
javassist/NotFoundException.class
javassist/SerialVersionUID$1.class
javassist/SerialVersionUID$2.class
....

Would seem to be a problem with the path. I've attempted once again with
absolute paths, but no luck.

thread...@googlecode.com

unread,
Jun 22, 2010, 2:55:20 PM6/22/10
to thread...@googlegroups.com

Comment #9 on issue 6 by alasdair.mackintosh: Refuses to build due to error

The only other thing I notice that's obviously different is the order of
the jars. I have javassist as the first jar. I suppose you might try to
change that and see what happens?

Alternatively, try building directly from Eclipse rather than from the ant
build file. Add all the source, add the external jars, and see if Eclipse
will build it for you.

As another suggestion, try building a simple app using javassist. I think
the javassist download comes with some. Or see
http://www.ibm.com/developerworks/java/library/j-dyn0916.html. Create a
separate project, and see if you can build that.

Sorry I can't be of further help, but it looks as though there must be
something odd with your build setup. I have built ThreadWeaver on Windows
with no problems.


thread...@googlecode.com

unread,
Oct 22, 2013, 1:52:15 AM10/22/13
to thread...@googlegroups.com
Updates:
Status: WontFix

Comment #10 on issue 6 by alasdair.mackintosh: Refuses to build due to
No update in 3 years, and a non-reproducible issue. Closing.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages