-->
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: Newbie Questions
PostPosted: Fri Feb 24, 2006 8:36 pm 
Newbie

Joined: Fri Feb 24, 2006 8:01 pm
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1.2

Mapping documents: ?

Code between sessionFactory.openSession() and session.close(): ?

Full stack trace of any exception that occurs: ?

Name and version of the database you are using: ?

The generated SQL (show_sql=true): ?

Debug level Hibernate log excerpt: ?

I downloaded Hibernate 3.1.2 and am trying to work my way through Day 1 of the "road map" for new users. So far, it isn't going too well.

I looked through the FAQs and didn't see my problem(s) and the alternate "getting started" document, Chapter 2 of Hibernate in Action, seems to be a dead link: I've tried it several times in the last few minutes but never get the page.

So here's my problem. Step 4 for Day 1 says:

from a command prompt in the install dir
- if you have Ant installed (and copied antlr.jar and junit.jar to ANT_HOME/lib), type ant eg
- if not, type build eg under Windows
- the example should run successfully

Well, I _do_ have Ant installed (1.6.5) and I have ant-antlr.jar and ant-junit.jar installed in its lib directory. I'm not sure if these are the same as antlr.jar and junit.jar or not. I do _not_ have antlr.jar or junit.jar in Ant's lib directory. Does this make a difference?

In any case, I tried both alternatives at a command prompt, assuming that the install dir was the one for Hibernate, not Ant. (I created a Hibernate directory on D: and extracted the zip file into it; the result was that I have a hibernate-3.1 directory within d:\Hibernate. I'm assuming that the 'install dir' is d:\Hibernate\hibernate-3.1.)

When I tried 'ant eg' (minus the quotes), I got:
D:\Hibernate\hibernate-3.1>ant eg
Buildfile: build.xml

BUILD FAILED
D:\Hibernate\hibernate-3.1\build.xml:116: taskdef A class needed by class org.ap
ache.tools.ant.taskdefs.optional.junit.JUnitTask cannot be found: junit/framewor
k/Test

Total time: 2 seconds

When I tried 'build eg' (minus the quotes), I got:
D:\Hibernate\hibernate-3.1>build eg

D:\Hibernate\hibernate-3.1>java -cp "lib/ant-launcher-1.6.5.jar" org.apache.tool
s.ant.launch.Launcher -lib lib eg
Unable to locate tools.jar. Expected to find it in D:\Java\jre1.5.0_06\lib\tools
.jar
Buildfile: build.xml
[taskdef] Could not load definitions from resource checkstyletask.properties.
It could not be found.
[taskdef] Could not load definitions from resource clovertasks. It could not b
e found.

eg:
[javac] Compiling 8 source files to D:\Hibernate\hibernate-3.1\eg

BUILD FAILED
D:\Hibernate\hibernate-3.1\build.xml:695: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

Total time: 2 seconds

Contrary to the error message, my JAVA_HOME environment variable _does_ point to the JDK, it is: JAVA_HOME=D:\Java\jdk1.5.0_06


So, can anyone tell me what I'm doing wrong?

Are ant-antlr.jar and ant-junit.jar reasonable substitutes for antlr.jar and junit.jar? If not, where can I find the correct jars and will they clash with ant-antlr.jar and ant-junit.jar when I put them in the same library? I'm really not sure what the differences are.

If those two jars aren't the problem, what do I need to do to get either of the approaches in Step 4 of Day 1 working?

--
Rhino


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 25, 2006 3:32 am 
Regular
Regular

Joined: Wed Feb 08, 2006 3:59 pm
Posts: 75
If you want to save yourself the nightmare of environement variables and classpath management, use an IDE such as Eclipse or Netbeans. The have built-in ant support. Basically you'll only have to click on the ant target you want to execute.

If you want to stick to command line, with windows the common pitfalls I know are :
Sometimes you have to reboot after editing an environment variable
Sometimes you have reopen a new prompt after editing an environment variable
Beware of folders with space ex 'Document and settings'


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 25, 2006 3:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
scratch that.......just do as the instructions say...antlr-junit.jar != junit.jar ...there are about six chars different there.

the jars are in the hibernate lib directory; where else should they be ?

_________________
Max
Don't forget to rate


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.