-->
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.  [ 5 posts ] 
Author Message
 Post subject: Liste meiner Einträhge bekommen??
PostPosted: Tue Feb 21, 2006 8:02 am 
Newbie

Joined: Tue Feb 21, 2006 7:55 am
Posts: 3
Hallo,
bin absoluter neuling in Sachen Hibernate und hoffe ihr könnt mir helfen.

Ich versuche eine Liste meiner Einträge in der Datenbank zu bekommen.

Folgenden Code habe ich erstellt:

SessionFactory sf;
Transaction tx = null;
Session session = null;


sf = new Configuration().configure().buildSessionFactory();
session = sf.openSession();
tx = session.beginTransaction();

List list = session.createQuery("from myTable").list();
tx.commit();


tut aber nicht funktionieren, bekomme ein Exception Fehler.

vielen Danke um eure Mühe


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 8:06 am 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
Kannst du mal deine exception posten`?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 8:08 am 
Newbie

Joined: Tue Feb 21, 2006 7:55 am
Posts: 3
hier:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: antlr/ANTLRException
at org.hibernate.hql.ast.ASTQueryTranslatorFactory.createQueryTranslator(ASTQueryTranslatorFactory.java:31)
at org.hibernate.impl.SessionFactoryImpl.createQueryTranslators(SessionFactoryImpl.java:407)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:466)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1025)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:975)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at de.md.learning.GUI.Login.actionPerformed(Login.java:61)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.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(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown 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.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 8:12 am 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
Da scheint dein classpath nicht komplett gefüllt sein.
Anscheinend hast du nur die hibernate.jar drinnen. ANTLR fehlt jedenfalls.

Welche Jars hast du im classpath?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2006 1:03 pm 
Beginner
Beginner

Joined: Tue Jul 19, 2005 5:08 am
Posts: 26
Location: Germany
im /lib verzeichnis von Hibernate gibt es eine datei namens "_README.txt" da steht genau drin, welche jar dateien du in den classpath aufnehmen musst.


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