-->
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.  [ 2 posts ] 
Author Message
 Post subject: hibernate with sql
PostPosted: Fri Oct 27, 2006 2:33 am 
Newbie

Joined: Thu Oct 26, 2006 11:35 pm
Posts: 3
Location: India
i'm using hibernate with sql and a stand alone java application when i'm running the application it is creating the configuration object and after wards when it is trying to create sessionfactory object it is giving me an error like

23:56:32,980 INFO Environment:479 - Hibernate 3.1.3
23:56:32,996 INFO Environment:509 - hibernate.properties not found
23:56:32,996 INFO Environment:525 - using CGLIB reflection optimizer
23:56:32,996 INFO Environment:555 - using JDK 1.4 java.sql.Timestamp handling
23:56:33,230 INFO Configuration:1308 - configuring from resource: /hibernate.cf
g.xml
23:56:33,230 INFO Configuration:1285 - Configuration resource: /hibernate.cfg.x
ml
23:56:33,855 INFO Configuration:469 - Reading mappings from resource: Emp.hbm.x
ml
23:56:34,121 INFO HbmBinder:309 - Mapping class: Employee -> employee
23:56:34,168 INFO Configuration:1419 - Configured SessionFactory: null
conf created
23:56:34,355 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in
connection pool (not for production use!)
23:56:34,355 INFO DriverManagerConnectionProvider:42 - Hibernate connection poo
l size: 20
23:56:34,355 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
23:56:34,386 INFO DriverManagerConnectionProvider:80 - using driver: sun.jdbc.o
dbc.JdbcOdbcDriver at URL: jdbc:odbc:mail
23:56:34,386 INFO DriverManagerConnectionProvider:86 - connection properties: {
}
23:56:35,293 INFO SettingsFactory:77 - RDBMS: Microsoft SQL Server, version: 08
.00.0194
23:56:35,293 INFO SettingsFactory:78 - JDBC driver: JDBC-ODBC Bridge (SQLSRV32.
DLL), version: 2.0001 (03.85.1117)
23:56:35,355 INFO Dialect:103 - Using dialect: org.hibernate.dialect.SQLServerD
ialect
23:56:35,371 INFO TransactionFactoryFactory:31 - Using default transaction stra
tegy (direct JDBC transactions)
23:56:35,386 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLoo
kup configured (in JTA environment, use of read-write or transactional second-le
vel cache is not recommended)
23:56:35,386 INFO SettingsFactory:125 - Automatic flush during beforeCompletion
(): disabled
23:56:35,386 INFO SettingsFactory:129 - Automatic session close at end of trans
action: disabled
23:56:35,386 INFO SettingsFactory:144 - Scrollable result sets: enabled
23:56:35,386 INFO SettingsFactory:152 - JDBC3 getGeneratedKeys(): disabled
23:56:35,386 INFO SettingsFactory:160 - Connection release mode: auto
23:56:35,386 INFO SettingsFactory:187 - Default batch fetch size: 1
23:56:35,386 INFO SettingsFactory:191 - Generate SQL with comments: disabled
23:56:35,386 INFO SettingsFactory:195 - Order SQL updates by primary key: disab
led
23:56:35,386 INFO SettingsFactory:338 - Query translator: org.hibernate.hql.ast
.ASTQueryTranslatorFactory
23:56:35,402 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactor
y
23:56:35,402 INFO SettingsFactory:203 - Query language substitutions: {}
23:56:35,402 INFO SettingsFactory:209 - Second-level cache: enabled
23:56:35,402 INFO SettingsFactory:213 - Query cache: disabled
23:56:35,402 INFO SettingsFactory:325 - Cache provider: org.hibernate.cache.EhC
acheProvider
23:56:35,418 INFO SettingsFactory:228 - Optimize cache for minimal puts: enable
d
23:56:35,418 INFO SettingsFactory:237 - Structured second-level cache entries:
disabled
23:56:35,433 INFO SettingsFactory:257 - Echoing all SQL to stdout
23:56:35,433 INFO SettingsFactory:264 - Statistics: disabled
23:56:35,433 INFO SettingsFactory:268 - Deleted entity synthetic identifier rol
lback: disabled
23:56:35,433 INFO SettingsFactory:283 - Default entity-mode: pojo
23:56:35,543 INFO SessionFactoryImpl:154 - building session factory
Exception in thread "main" java.lang.NoClassDefFoundError
at org.hibernate.tuple.EntityMetamodel.class$(EntityMetamodel.java:41)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:122)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(Abstrac
tEntityPersister.java:412)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(Sing
leTableEntityPersister.java:108)
at org.hibernate.persister.PersisterFactory.createClassPersister(Persist
erFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:
216)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1176)
at App.main(App.java:10)
Caused by: java.lang.ClassNotFoundException: net.sf.cglib.transform.impl.Interce
ptFieldEnabled
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
... 8 more



but i had set the classpath to all the jar files.

can you help me to overcome this problem.

_________________
Regards
Upendra


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 27, 2006 3:52 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Even if you say you set the classpath correctly, it doesn't seem to... I'd recommend you trying to do the same thing as Hibernate in a Main class of yours.

Write a class with a main method in the same environment, then try to load the net.sf.cglib.transform.impl.InterceptFieldEnabled class.

Code:
Class.forName("net.sf.cglib.transform.impl.InterceptFieldEnabled");

If this code throws an exception, then don't look anywhere else, it's your classpath you did not configure well.

Check that the cglib library is in your path.

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


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