-->
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.  [ 8 posts ] 
Author Message
 Post subject: Runtime error in Hibernate 3.0.3 tutorial
PostPosted: Thu May 19, 2005 12:56 am 
Newbie

Joined: Thu May 19, 2005 12:49 am
Posts: 4
G'Day all,
I have been trying to run the tutorial in Chapter 2 of the Hibernate reference that ships with Hibernate. When I run the tutorial, I get the following output

bash-2.05b$ ant run -Daction=store
Buildfile: build.xml

clean:
[delete] Deleting directory /home/craig/workspace/HibernateTutorial/bin
[mkdir] Created dir: /home/craig/workspace/HibernateTutorial/bin

copy-resources:
[copy] Copying 6 files to /home/craig/workspace/HibernateTutorial/bin

compile:
[javac] Compiling 3 source files to /home/craig/workspace/HibernateTutorial/bin

run:
[java] 14:30:51,539 INFO Environment:464 - Hibernate 3.0.3
[java] 14:30:51,546 INFO Environment:477 - hibernate.properties not found
[java] 14:30:51,551 INFO Environment:510 - using CGLIB reflection optimizer
[java] 14:30:51,554 INFO Environment:540 - using JDK 1.4 java.sql.Timestamp handling
[java] 14:30:51,678 INFO Configuration:1160 - configuring from resource: /hibernate.cfg.xml
[java] 14:30:51,679 INFO Configuration:1131 - Configuration resource: /hibernate.cfg.xml
[java] 14:30:51,810 INFO Configuration:441 - Mapping resource: Event.hbm.xml
[java] 14:30:51,973 INFO HbmBinder:258 - Mapping class: Event -> EVENTS
[java] 14:30:52,019 INFO Configuration:1272 - Configured SessionFactory: null
[java] 14:30:52,021 INFO Configuration:852 - processing extends queue
[java] 14:30:52,022 INFO Configuration:856 - processing collection mappings
[java] 14:30:52,023 INFO Configuration:865 - processing association property references
[java] 14:30:52,025 INFO Configuration:894 - processing foreign key constraints
[java] 14:30:52,155 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
[java] 14:30:52,156 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 1
[java] 14:30:52,157 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
[java] 14:30:52,162 INFO DriverManagerConnectionProvider:80 - using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:data/tutorial
[java] 14:30:52,163 INFO DriverManagerConnectionProvider:86 - connection properties: {user=sa, password=****}
[java] 14:30:52,677 INFO SettingsFactory:72 - RDBMS: HSQL Database Engine, version: 1.7.2
[java] 14:30:52,678 INFO SettingsFactory:73 - JDBC driver: HSQL Database Engine Driver, version: 1.7.2
[java] 14:30:52,714 INFO Dialect:92 - Using dialect: org.hibernate.dialect.HSQLDialect
[java] 14:30:52,732 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
[java] 14:30:52,738 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[java] 14:30:52,739 INFO SettingsFactory:126 - Automatic flush during beforeCompletion(): disabled
[java] 14:30:52,740 INFO SettingsFactory:130 - Automatic session close at end of transaction: disabled
[java] 14:30:52,741 INFO SettingsFactory:137 - JDBC batch size: 15
[java] 14:30:52,745 INFO SettingsFactory:140 - JDBC batch updates for versioned data: disabled
[java] 14:30:52,748 INFO SettingsFactory:145 - Scrollable result sets: enabled
[java] 14:30:52,749 INFO SettingsFactory:153 - JDBC3 getGeneratedKeys(): disabled
[java] 14:30:52,750 INFO SettingsFactory:161 - Connection release mode: null
[java] 14:30:52,757 INFO SettingsFactory:188 - Default batch fetch size: 1
[java] 14:30:52,758 INFO SettingsFactory:192 - Generate SQL with comments: disabled
[java] 14:30:52,759 INFO SettingsFactory:196 - Order SQL updates by primary key: disabled
[java] 14:30:52,761 INFO SettingsFactory:321 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[java] 14:30:52,765 INFO ASTQueryTranslatorFactory:21 - Using ASTQueryTranslatorFactory
[java] 14:30:52,767 INFO SettingsFactory:204 - Query language substitutions: {}
[java] 14:30:52,768 INFO SettingsFactory:210 - Second-level cache: enabled
[java] 14:30:52,769 INFO SettingsFactory:214 - Query cache: disabled
[java] 14:30:52,771 INFO SettingsFactory:308 - Cache provider: org.hibernate.cache.EhCacheProvider
[java] 14:30:52,874 INFO SettingsFactory:229 - Optimize cache for minimal puts: disabled
[java] 14:30:52,875 INFO SettingsFactory:238 - Structured second-level cache entries: enabled
[java] 14:30:52,969 INFO SettingsFactory:258 - Echoing all SQL to stdout
[java] 14:30:52,970 INFO SettingsFactory:262 - Statistics: disabled
[java] 14:30:52,971 INFO SettingsFactory:266 - Deleted entity synthetic identifier rollback: disabled
[java] 14:30:52,973 INFO SettingsFactory:280 - Default entity-mode: pojo
[java] Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/objectweb/asm/Type
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at HibernateUtil.<clinit>(Unknown Source)
[java] at EventManager.createAndStoreEvent(Unknown Source)
[java] at EventManager.main(Unknown Source)
[java] Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/Type
[java] at net.sf.cglib.core.TypeUtils.parseType(TypeUtils.java:180)
[java] at net.sf.cglib.core.KeyFactory.<clinit>(KeyFactory.java:66)
[java] at org.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:319)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
[java] ... 3 more
[java] 14:30:53,216 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:hsqldb:data/tutorial
[java] Java Result: 1

BUILD SUCCESSFUL
Total time: 4 seconds

I have followed the tutorial to the letter, and I have checked that the jar files are indeed in the lib directory. I have searched the web for similar instances, and I am at a loss.

Any suggestions, tips, pointers, etc will be appreciated.

Thanking you in advance for your help,

Craig.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 6:50 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read lib/README.txt, copy asm.jar to your classpath. It's also the first item in the FAQ.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 7:20 am 
Newbie

Joined: Thu May 19, 2005 12:49 am
Posts: 4
G'Day Christian,
Thanks for thje reply, however what I don't understand is why should I copy it to the classpath?

I would like to stress that I have been following the tutorial in chapter 2, to the letter, and I get this error. This includes using the ant script, which sets the classpath that includes the directory (<project>/lib) that has the asm.jar file. As shown in the log output, the Hibernate3, CGLIB and hsqldb jar files are being successfully invoked and used, and these are in the same directory as the asm.jar, which cannot be found. All the jar files in the <project>/lib directory have the same permissions.

I hope you can see the problem I am having?

My apologies for what seems like a "read the FAQ"/"RTFM" style question, but to my perspective, it falls outside the assistance that the documentation supplies.

Thanking you for your help,

Craig.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 8:38 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read the tutorial again. Follow the advice in the tutorial to check README.txt. Double check everything.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 9:38 am 
Beginner
Beginner

Joined: Tue May 17, 2005 7:39 am
Posts: 27
Location: Rome, Italy
hi marauder13, i'm going to configure hibernate with tomcat, and i'm following the tutorial on the hibernate reference.
i didn't understand the part in wich it says that i have to add a resource declaration to the server.xml of tomcat, on page 8.
i detail, i don't know in which part of the server.xml i have to add the code suggested: in the <server> part? in the <service> one? basically it's only a matter of cut and paste, but i'm wondering WHERE to paste it!!!
thanks for your help
mox


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 9:48 am 
Beginner
Beginner

Joined: Tue May 17, 2005 7:39 am
Posts: 27
Location: Rome, Italy
christian wrote:
Read the tutorial again. Follow the advice in the tutorial to check README.txt. Double check everything.


i've read the readme.txt and i'm wondering if i'm right: i have copied the libs required in the context classpath, not in the global one (not in C:\Programmi\netbeans-4.0\nb4.0\jakarta-tomcat-5.0.28\common\lib, but in C:\Programmi\netbeans-4.0\nb4.0\jakarta-tomcat-5.0.28\webapps\quickstart\web\WEB-INF\lib)

actually i didn't finish the config because i'm editing the server.xml, but i hope i started with the right foot!

mox


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 22, 2005 8:06 am 
Newbie

Joined: Thu May 19, 2005 12:49 am
Posts: 4
christian wrote:
Read the tutorial again. Follow the advice in the tutorial to check README.txt. Double check everything.


G'Day Christian,
I will do as you suggest, particularly the double check part.

Thanks for your help,

Craig.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 22, 2005 8:08 am 
Newbie

Joined: Thu May 19, 2005 12:49 am
Posts: 4
mox601 wrote:
hi marauder13, i'm going to configure hibernate with tomcat, and i'm following the tutorial on the hibernate reference.
i didn't understand the part in wich it says that i have to add a resource declaration to the server.xml of tomcat, on page 8.
mox


G'Day mox,
I'm doing the Tutorial in Chapter 2 (stand alone app), not the tutorial in Chapter 1 (Tomcat app). So, I'm sorry but I can't help you with that one.


Cheers,

Craig.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.