Hibernate version: 3.1
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="hibernatebeans.Account"
table="account">
<id name="benutzername"
type="string"
column="Benutzername">
<generator class="assigned"/>
</id>
<property
name="passwort"
column="Passwort"
type="string"
update="true"
insert="true"/>
<property
name="kundeID"
column="KundeID"
type="integer"
update="true"
insert="true"/>
<property
name="admin"
column="Admin"
type="integer"
update="true"
insert="true"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Code:
Account acc = null;
Session hiSession = HibernateUtil.currentSession();
acc = (Account) hiSession.get(Account.class, benutzername);
HibernateUtil.closeSession();
Full stack trace of any exception that occurs:Code:
java.lang.ExceptionInInitializerError
hibernate.other.HibernateUtil.<clinit>(HibernateUtil.java:19)
hibernate.manager.KundeAccountManager.getAccountByPrimaryKey(KundeAccountManager.java:52)
struts.action.LoginAction.execute(LoginAction.java:38)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Name and version of the database you are using: MySql 5 The generated SQL (show_sql=true):Debug level Hibernate log excerpt:leider wirft obiges Codestück eine Exception.
Nichtmal der Stack Trace ist in den Logs auffindbar.
zum Eingrenzen habe ich im gleichen Eclipseprojekt ein kleines Testproggi integriert:
Code:
Account acc = null;
acc = KundeAccountManager.getAccountByPrimaryKey("foo42");
System.out.println(acc.getKundeID() + acc.getPasswort());
dies läuft zur Verwunderung fehlerfrei durch (verwendet aber die Hibernate Konfiguration / Sessions / Factory aus dem grossen Program)
bin leider mit meinem Latein am Ende
thnx für alle Tipps im Voraus.[/code]