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