|
|
 |
BOOK: Professional Hibernate  | This is the forum to discuss the Wrox book Professional Hibernate by Eric Pugh, Joseph D. Gradecki; ISBN: 9780764576775 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional Hibernate section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

March 28th, 2005, 08:46 PM
|
|
Registered User
|
|
Join Date: Mar 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
java.lang.NoClassDefFoundError: javax/transaction/
Dear Friends,
I am using the standalone SWING application code provided by the authors but its not working. Here is the output from the console along with the error.
INFO: Not binding factory to JNDI, no JNDI name configured
java.lang.NoClassDefFoundError: javax/transaction/Synchronization
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryImpl.java:314)
Why is this error happening? I have j2ee.jar in my classpath (see bottom for classpath).
I am using Windows XP Professional with SQL Server 2000 Developer along with Hibernate 2 (as recommended by the book) as well as JDK 1.4. My goal is to use Hibernate with Websphere.
Mar 27, 2005 7:18:36 PM net.sf.hibernate.transaction.TransactionManagerLoo kupFac
tory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process
level read-write cache is not recommended)
Mar 27, 2005 7:18:36 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use scrollable result sets: true
Mar 27, 2005 7:18:36 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use JDBC3 getGeneratedKeys(): false
Mar 27, 2005 7:18:36 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: false
Mar 27, 2005 7:18:36 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: echoing all SQL to stdout
Mar 27, 2005 7:18:36 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
Mar 27, 2005 7:18:36 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.hibernate.cache.EhCacheProvider
Mar 27, 2005 7:18:36 PM net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
Mar 27, 2005 7:18:36 PM net.sf.ehcache.config.Configurator configure
WARNING: No configuration found. Configuring ehcache from ehcache-failsafe.xml f
ound in the classpath: jar:file:/C:/Hibernate/lib/ehcache-0.9.jar!/ehcache-fails
afe.xml
Mar 27, 2005 7:18:36 PM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Mar 27, 2005 7:18:36 PM net.sf.hibernate.impl.SessionFactoryObjectFactory addIns
tance
INFO: Not binding factory to JNDI, no JNDI name configured
java.lang.NoClassDefFoundError: javax/transaction/Synchronization
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryIm
pl.java:314)
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryIm
pl.java:327)
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryIm
pl.java:335)
at CDTest$3.actionPerformed(CDTest.java:111)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
at javax.swing.AbstractButton$ForwardActionEvents.act ionPerformed(Unknow
n Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierar chy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.NoClassDefFoundError: javax/transaction/Synchronization
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryIm
pl.java:314)
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryIm
pl.java:327)
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryIm
pl.java:335)
at CDTest$5.actionPerformed(CDTest.java:148)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
at javax.swing.AbstractButton$ForwardActionEvents.act ionPerformed(Unknow
n Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierar chy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.NoClassDefFoundError: javax/transaction/Synchronization
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryIm
pl.java:314)
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryIm
pl.java:327)
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryIm
pl.java:335)
at CDTest$5.actionPerformed(CDTest.java:148)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
at javax.swing.AbstractButton$ForwardActionEvents.act ionPerformed(Unknow
n Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierar chy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.NoClassDefFoundError: javax/transaction/Synchronization
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryIm
pl.java:314)
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryIm
pl.java:327)
at net.sf.hibernate.impl.SessionFactoryImpl.openSessi on(SessionFactoryIm
pl.java:335)
at CDTest$5.actionPerformed(CDTest.java:148)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
at javax.swing.AbstractButton$ForwardActionEvents.act ionPerformed(Unknow
n Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
CLASSPATH WOES (separate post) :
C:\Java\Swing\standalone>echo %CLASSPATH%
C:\Sun\AppServer\lib\j2ee.jar;C:\jakarta-struts-1.2.4\lib\struts.jar;%HIBERNATE_
HOME%\hibernate2.jar;C:\SQLServerJDBC\lib\msbase.j ar;C:\SQLServerJDBC\lib\msutil
.jar;C:\SQLServerJDBC\lib\mssqlserver.jar;C:\j2sdk 1.4.2_06\bin;C:\Hibernate\hibe
rnate2.jar;C:\Hibernate\lib\dom4j-1.4.jar;C:\Hibernate\lib\commons-logging-1.0.4
.jar;C:\Hibernate\lib\commons-collections-2.1.1.jar;C:\Hibernate\lib\ehcache-0.9
.jar;C:\Hibernate\lib\cglib-full-2.0.2.jar
Asyou can see all imaginable jars are in this classpath!
and yet when I do the following :
C:\Java\Swing\standalone>java CDTest
Exception in thread "main" java.lang.NoClassDefFoundError: CDTest
That is the error I get!
Until I have to use the following command line "command":
C:\Java\Swing\standalone>java -classpath .;C:\Hibernate\hibernate2.jar;C:\Hibern
ate\lib\dom4j-1.4.jar;C:\Hibernate\lib\commons-logging-1.0.4.jar;C:\Hibernate\li
b\commons-collections-2.1.1.jar;C:\SQLServerJDBC\lib\msbase.jar;C:\SQLSe rverJDBC
\lib\mssqlserver.jar;C:\SQLServerJDBC\lib\msutil.j ar;C:\Hibernate\lib\ehcache-0.
9.jar;C:\Hibernate\lib\cglib-full-2.0.2.jar CDTest
I have to include the path in the command line, why is that?
|

April 7th, 2005, 01:25 PM
|
|
Registered User
|
|
Join Date: Feb 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey Orange boy, why don't you use an IDE like eclipse and forget all "classpaths problems"...
|

August 7th, 2007, 04:09 AM
|
|
Registered User
|
|
Join Date: Aug 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I am again gettting this problem.
i am working on eclipse IDE.
plz help me on this Error:
java.lang.NoClassDefFoundError: javax/transaction/Synchronization
|

August 8th, 2007, 03:17 PM
|
|
Registered User
|
|
Join Date: Aug 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I am having the same trouble as orange_jhon. If anyone has the solution can you post on forum.
Thanks!
|

August 15th, 2007, 12:27 PM
|
|
Registered User
|
|
Join Date: Aug 2007
Location: , , Argentina.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hello. Imports 'jta.jar' at your project
|

February 25th, 2008, 11:07 PM
|
|
Registered User
|
|
Join Date: Feb 2008
Location: hyderabad, ap, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanx mr it was solved a big problem for me
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |