-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: build error question
PostPosted: Mon Jun 19, 2006 9:24 pm 
Beginner
Beginner

Joined: Mon Jun 19, 2006 9:21 pm
Posts: 25
I'm trying to do the build for the demo of hibernate 3.1 and I keep getting the following error

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\hibernate-3.1>ant -v eg
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: build.xml
Detected Java version: 1.5 in: C:\PROGRA~1\Java\jdk1.5.0_06\jre
Detected OS: Windows XP
parsing buildfile C:\hibernate-3.1\build.xml with URI = file:///C:/hibernate-3.1
/build.xml
Project base dir set to: C:\hibernate-3.1
[property] Loading C:\hibernate-3.1\build.properties
[property] Unable to find property file: C:\hibernate-3.1\build.properties
[property] Loading C:\Documents and Settings\justin\.ant.properties
[property] Unable to find property file: C:\Documents and Settings\justin\.ant.
properties
dropping C:\ant\lib\clover.jar from path as it doesn't exist
dropping C:\ant\lib\clover.jar from path as it doesn't exist

BUILD FAILED
C:\hibernate-3.1\build.xml:116: taskdef A class needed by class org.apache.tools
.ant.taskdefs.optional.junit.JUnitTask cannot be found: junit/framework/Test
at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:487)

at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:183)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
142)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav
a:91)
at org.apache.tools.ant.Main.runBuild(Main.java:653)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.NoClassDefFoundError: junit/framework/Test
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:457)

... 10 more
--- Nested Exception ---
java.lang.NoClassDefFoundError: junit/framework/Test
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:457)

at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:183)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
142)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav
a:91)
at org.apache.tools.ant.Main.runBuild(Main.java:653)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Total time: 1 second

I checked, and junit is definitely in the lib folder, so not sure what's going on. I didn't change the build.xml file and not sure if I need to. Any help would be appreciated.

I also saw somewhere someone saying to use netbeans to build it, but wasn't sure how to do that exactly.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 12:38 am 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
You also need the junit jar in your ant lib directory, or in some directory that ant looks in. This is for the ant junit task.

In fact, you only need it in your ant lib directory for the eg target, as no junits are run. If you can't get it to work, just delete all references to junit in build.xml.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 5:43 pm 
Beginner
Beginner

Joined: Mon Jun 19, 2006 9:21 pm
Posts: 25
great! Yeah, I just got rid of that part in the build.xml file and it worked perfectly. As a side note though, junit was in the ant lib folder, so still not sure what was going on, but it compiled, so I'm happy :). Thanks for the help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.