mtbtaizo
Contributor
Contributor

Build error[bad class file]

Jump to solution
Hello all,

I try to build Hyperic HQ 3.0.4 by Eclipse 3.2 on Windows XP.
I went through the Build Instruction.
But while building it, I got an error as follows.
Isn't it CLASSPATH correct?
I don't know how to investigate this issue.
if you could give me some advice about this, plese help me.

>compile-app-sources:
> [javac] Compiling 2557 source files to D:\Workspace\HQ3\build\classes
> [javac] D:\Workspace\HQ3\build\src\org\hyperic\hq\autoinventory\shared\AutoinventoryManagerHome.java:109: cannot access org.hyperic.hq.autoinventory.shared.AutoinventoryManager
> [javac] bad class file: D:\Workspace\HQ3\build\src\org\hyperic\hq\autoinventory\shared\AutoinventoryManager.java
> [javac] file does not contain class org.hyperic.hq.autoinventory.shared.AutoinventoryManager
> [javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
> [javac] public org.hyperic.hq.autoinventory.shared.AutoinventoryManager create()
> [javac] ^
> [javac] 1 error
>
>BUILD FAILED

Regards,
mtbtaizo
0 Kudos
1 Solution

Accepted Solutions
dougm_hyperic
VMware Employee
VMware Employee
oh right, you're using the 3.0.5 .tar.gz rather than subversion? If you just want the updated build.xml, you can grab it here:

http://svn.hyperic.org/branches/HQ_3_0/build.xml?root=Hyperic+HQ&revision=4842&content-type=text%2Fp...

The 3.1-beta includes this change too.

View solution in original post

0 Kudos
8 Replies
dougm_hyperic
VMware Employee
VMware Employee

Try 'ant clean all'.  When ant blew up (OOM) xdoclet was in the middle of generating a source file in build\src, 'clean' will force build\src to be re-generated.  It should work fine now that you have ANT_OPTS setup.

On May 22, 2007, at 11:02 PM, mtbtaizo wrote:

Hello all,

I try to build Hyperic HQ 3.0.4 by Eclipse 3.2 on Windows XP.
I went through the Build Instruction.
But while building it, I got an error as follows.
Isn't it CLASSPATH correct?
I don't know how to investigate this issue.
if you could give me some advice about this, plese help me.

>compile-app-sources:
>    [javac] Compiling 2557 source files to D:\Workspace\HQ3\build\classes
>    [javac] D:\Workspace\HQ3\build\src\org\hyperic\hq\autoinventory\shared\AutoinventoryManagerHome.java:109: cannot access org.hyperic.hq.autoinventory.shared.AutoinventoryManager
>    [javac] bad class file: D:\Workspace\HQ3\build\src\org\hyperic\hq\autoinventory\shared\AutoinventoryManager.java
>    [javac] file does not contain class org.hyperic.hq.autoinventory.shared.AutoinventoryManager
>    [javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
>    [javac] public org.hyperic.hq.autoinventory.shared.AutoinventoryManager create()
>    [javac] ^
>    [javac] 1 error
>
>BUILD FAILED

Regards,
mtbtaizo



mtbtaizo
Contributor
Contributor
Thank you very much for the advice, dougm.
You are right!!
I finally build Hyperic HQ.

But I still sometimes fail to build Hyperic HQ.
While running precompile-jsp target, "unable to delete file" error happens.
<JBOSS_HOME>\server\default\lib\antlr-2.7.5H3.jar
<JBOSS_HOME>\server\default\lib\txsnatch.jar

In my case, I deleted these files manually and run precompile-jsp target again.

Of course, I didn't run JBoss at that time.
I don't think this issue is related to Hyperic HQ.
But if anyone see the same problem, what was the way that you managed to solve the problem?

Regards,
mtbtaizo
0 Kudos
dougm_hyperic
VMware Employee
VMware Employee

The problem is that these .jar files are referenced in the build's classpath and Windows doesn't let you delete files that are currently open.  Manually deleting the files is what you should do for now and you'll only have to do that once, or each time you create your JBOSS_HOME.  I opened this ticket and will look at fixing in the next couple of days:
http://jira.hyperic.com/browse/HHQ-912

On May 24, 2007, at 3:50 AM, mtbtaizo wrote:

Thank you very much for the advice, dougm.
You are right!!
I finally build Hyperic HQ.

But I still sometimes fail to build Hyperic HQ.
While running precompile-jsp target, "unable to delete file" error happens.
<JBOSS_HOME>\server\default\lib\antlr-2.7.5H3.jar
<JBOSS_HOME>\server\default\lib\txsnatch.jar

In my case, I deleted these files manually and run precompile-jsp target again.

Of course, I didn't run JBoss at that time.
I don't think this issue is related to Hyperic HQ.
But if anyone see the same problem, what was the way that you managed to solve the problem?

Regards,
mtbtaizo



mtbtaizo
Contributor
Contributor
Thank you for updating the info, dougm.
I'm looking forward the fix.

Regards,
mtbtaizo
0 Kudos
dougm_hyperic
VMware Employee
VMware Employee
Should be fixed now, I changed build.xml to exclude server/default/lib/antlr-*.jar from the classpath in trunk and branches/HQ_3_0
0 Kudos
mtbtaizo
Contributor
Contributor
Thank you, dougm.
But I can't find fixed build.xml. Where can i find it?
Will that fix be included in next release?

Regards,
mtbtaizo
0 Kudos
dougm_hyperic
VMware Employee
VMware Employee
oh right, you're using the 3.0.5 .tar.gz rather than subversion? If you just want the updated build.xml, you can grab it here:

http://svn.hyperic.org/branches/HQ_3_0/build.xml?root=Hyperic+HQ&revision=4842&content-type=text%2Fp...

The 3.1-beta includes this change too.
0 Kudos
mtbtaizo
Contributor
Contributor
Thanks, dougm.
I tried to build HQ again with fixed build.xml.
But I still got the similar error.

>post-prepare-jboss:
> [copy] Copying 2 files to <Jboss install dir>\server\default\deploy\jbossweb-tomcat55.sar\ROOT.war
> [delete] Deleting: <Jboss install dir>\server\default\lib\txsnatch.jar

>BUILD FAILED
> <Eclipse WS dir>\HQ\build_util\jboss-build.xml:218: Unable to delete file <Jboss install dir>\server\default\lib\txsnatch.jar

So I edited build.xml to exclude txsnatch.jar from classpath as follows.
<fileset dir="${jboss.home}/server/default/lib"
includes="*.jar"
excludes="antlr-*.jar,txsnatch.jar" />
Finally I succeed to build HQ 3.0.5 by Eclipse on Windows.
Thank you very much.

Regards,
mtbtaizo
0 Kudos