-->
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: QuickStart example compilation fails
PostPosted: Mon Oct 23, 2006 11:45 pm 
Newbie

Joined: Mon Oct 23, 2006 11:03 pm
Posts: 17
I know this is my problem, but as a rank Hibernate beginner I have no idea where
to look for a solution. I can't get past step 4 of the "Getting Started" instructions.

Hibernate version: 3.2.0
OS: Fedora Core 5 with all current patches applied

[jhg@athena hibernate-3.2]$ rpm -q jdk
jdk-1.5.0_09-fcs

[jhg@athena hibernate-3.2]$ ant eg
Buildfile: build.xml
Trying to override old definition of datatype splash
Trying to override old definition of datatype junit
Trying to override old definition of datatype junitreport
[taskdef] Could not load definitions from resource clovertasks. It could not be found.

eg:
[javac] Compiling 1 source file to /home/jhg/hibernate-3.2/build/eg
[javac] ----------
[javac] 1. ERROR in /home/jhg/hibernate-3.2/eg/org/hibernate/auction/Main.java
[javac] (at line 10)
[javac] import org.hibernate.FetchMode;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import org.hibernate.FetchMode cannot be resolved
[javac] ----------
[javac] 2. ERROR in /home/jhg/hibernate-3.2/eg/org/hibernate/auction/Main.java
[javac] (at line 11)
[javac] import org.hibernate.FlushMode;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import org.hibernate.FlushMode cannot be resolved

[snip]

[javac] 48. ERROR in /home/jhg/hibernate-3.2/eg/org/hibernate/auction/Main.java
[javac] (at line 387)
[javac] test.factory.close();
[javac] ^^^^^^^^^^^^
[javac] test.factory cannot be resolved or is not a field
[javac] ----------
[javac] 48 problems (48 errors)

BUILD FAILED
/home/jhg/hibernate-3.2/build.xml:406: Compile failed; see the compiler error output for details.

Total time: 2 seconds

OK, that one was fairly easy to figure out. I had to put a copy of hibernate3.jar into the lib/ subdirectory (it's only in the install root). Shouldn't that be in the instructions?

Problem 2:
[jhg@athena hibernate-3.2]$ ant eg
Buildfile: build.xml
Trying to override old definition of datatype splash
Trying to override old definition of datatype junit
Trying to override old definition of datatype junitreport
[taskdef] Could not load definitions from resource clovertasks. It could not be found.

eg:
[javac] Compiling 1 source file to /home/jhg/hibernate-3.2/build/eg
[copy] Copying 3 files to /home/jhg/hibernate-3.2/build/eg

.... OK, it's compiling this time ...

[java] 23:39:43,779 INFO SessionFactoryImpl:163 - building session factory
[java] 23:39:43,779 DEBUG SessionFactoryImpl:176 - Session factory constructed with filter configurations : {}
[java] 23:39:43,780 DEBUG SessionFactoryImpl:183 - instantiating session factory with properties: {path.separator=:, java.vm.name=GNU libgcj, hibernate.jdbc.use_streams_for_binary=true, java.vm.specification.name=Java(tm) Virtual Machine Specification, java.runtime.version=1.4.2, hibernate.dialect=org.hibernate.dialect.MySQLDialect, java.home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre, java.vm.specification.version=1.0, line.separator=

... that doesn't look right ... gcj and 1.4.2?

[java] Exception in thread "main" java.lang.NoClassDefFoundError: net.sf.cglib.core.DebuggingClassWriter$1
[java] at java.lang.Class.initializeClass(libgcj.so.7)
[java] at net.sf.cglib.core.DebuggingClassWriter.toByteArray(DebuggingClassWriter.java:73)
[java] at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:26)
[java] at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
[java] at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
[java] at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
[java] at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
[java] at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
[java] at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
[java] at java.lang.Class.initializeClass(libgcj.so.7)
[java] at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:111)
[java] at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
[java] at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:176)
[java] at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
[java] at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:51)
[java] at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
[java] at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
[java] at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:79)
[java] at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
[java] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
[java] at org.hibernate.auction.Main.main(Main.java:368)
[java] Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.util.TraceClassVisitor not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/home/jhg/hibernate-3.2/lib/ant-1.6.5.jar,file:/home/jhg/hibernate-3.2/lib/ant-antlr-1.6.5.jar,file:/home/jhg/hibernate-3.2/lib/ant-junit-1.6.5.jar,file:/home/jhg/hibernate-3.2/lib/ant-launcher-1.6.5.jar,file:/home/jhg/hibernate-3.2/lib/ant-swing-1.6.5.jar,file:/home/jhg/hibernate-3.2/lib/antlr-2.7.6.jar,file:/home/jhg/hibernate-3.2/lib/asm-attrs.jar,file:/home/jhg/hibernate-3.2/lib/asm.jar,file:/home/jhg/hibernate-3.2/lib/c3p0-0.9.0.jar,file:/home/jhg/hibernate-3.2/lib/cglib-2.1.3.jar,file:/home/jhg/hibernate-3.2/lib/checkstyle-all.jar,file:/home/jhg/hibernate-3.2/lib/cleanimports.jar,file:/home/jhg/hibernate-3.2/lib/commons-collections-2.1.1.jar,file:/home/jhg/hibernate-3.2/lib/commons-logging-1.0.4.jar,file:/home/jhg/hibernate-3.2/lib/concurrent-1.3.2.jar,file:/home/jhg/hibernate-3.2/lib/connector.jar,file:/home/jhg/hibernate-3.2/lib/dom4j-1.6.1.jar,file:/home/jhg/hibernate-3.2/lib/ehcache-1.2.jar,file:/home/jhg/hibernate-3.2/lib/hibernate3.jar,file:/home/jhg/hibernate-3.2/lib/jaas.jar,file:/home/jhg/hibernate-3.2/lib/jacc-1_0-fr.jar,file:/home/jhg/hibernate-3.2/lib/javassist.jar,file:/home/jhg/hibernate-3.2/lib/jaxen-1.1-beta-7.jar,file:/home/jhg/hibernate-3.2/lib/jboss-cache.jar,file:/home/jhg/hibernate-3.2/lib/jboss-common.jar,file:/home/jhg/hibernate-3.2/lib/jboss-jmx.jar,file:/home/jhg/hibernate-3.2/lib/jboss-system.jar,file:/home/jhg/hibernate-3.2/lib/jdbc2_0-stdext.jar,file:/home/jhg/hibernate-3.2/lib/jgroups-2.2.8.jar,file:/home/jhg/hibernate-3.2/lib/jta.jar,file:/home/jhg/hibernate-3.2/lib/junit-3.8.1.jar,file:/home/jhg/hibernate-3.2/lib/log4j-1.2.11.jar,file:/home/jhg/hibernate-3.2/lib/mysql-connector-java-5.0.4-bin.jar,file:/home/jhg/hibernate-3.2/lib/oscache-2.1.jar,file:/home/jhg/hibernate-3.2/lib/proxool-0.8.3.jar,file:/home/jhg/hibernate-3.2/lib/swarmcache-1.0rc2.jar,file:/home/jhg/hibernate-3.2/lib/syndiag2.jar,file:/home/jhg/hibernate-3.2/lib/versioncheck.jar,file:/home/jhg/hibernate-3.2/lib/xerces-2.6.2.jar,file:/home/jhg/hibernate-3.2/lib/xml-apis.jar,file:/home/jhg/hibernate-3.2/build/eg/,file:/home/jhg/hibernate-3.2/etc/], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
[java] at java.net.URLClassLoader.findClass(libgcj.so.7)
[java] at java.lang.ClassLoader.loadClass(libgcj.so.7)
[java] at java.lang.ClassLoader.loadClass(libgcj.so.7)
[java] at java.lang.Class.forName(libgcj.so.7)
[java] at java.lang.Class.initializeClass(libgcj.so.7)
[java] ...22 more

BUILD FAILED
/home/jhg/hibernate-3.2/build.xml:420: Java returned: 1


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 24, 2006 4:23 am 
Senior
Senior

Joined: Tue Aug 23, 2005 8:52 am
Posts: 181
You need to change the PATH and JAVA_HOME environment variables to point to your jdk1.5 rpms.

export JAVA_HOME=/usr/java/jdk1.5.0_09
export PATH=$JAVA_HOME/bin:$PATH

Try compiling after that


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 24, 2006 8:10 pm 
Newbie

Joined: Mon Oct 23, 2006 11:03 pm
Posts: 17
Thanks - I knew it was something simple (d'oh :-)


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.