I created a time management system (webapplication) with the struts and hibernate framework. Everything works fine (saves, inserts, updates deletion of data) but sometimes, but not always users get following Exception, right after the login:
Quote:
755716095 [ajp-8009-8] ERROR pers.PersonalMaXisDAO - find by property name failed
org.hibernate.AssertionFailure: null id in com.ris.db.det.DetErfassung entry (don't flush the Session after an exception occurs)
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:48)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:150)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:106)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:954)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1099)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.ris.db.pers.PersonalMaXisDAO.findByTwoProperties(PersonalMaXisDAO.java:143)
at com.ris.db.pers.PersonalMaXisDAO.findByLoginIdAndKennwort(PersonalMaXisDAO.java:151)
at com.ris.bo.login.UserHandlerBo.getPersonalRow(UserHandlerBo.java:57)
at com.ris.bo.login.UserHandlerBo.checkLogin(UserHandlerBo.java:21)
at com.ris.struts.action.LoginAction.execute(LoginAction.java:48)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:439)
at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:496)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1498)
at java.lang.Thread.run(Unknown Source)
It should check if the password is correct for the username and then bring up the next page...
What I cannot understand is why it mentions
com.ris.db.det.DetErfassung as this view/mapping file isn't used at this point, it has nothing todo in the login process.
Can this happen when there is a generel error with this mapping file? But, it works.. when this file is used at the point it is really USED everything works fine. As said.. the error occurs not everytime the users tries to login, hibernate bug?
Here is the mapping file (DetErfassung.hbm.xml):
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">
<!--
Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping>
<class name="com.ris.db.det.DetErfassung" table="DET_Erfassung" schema="dbo">
<id name="detailZeiterfId" type="java.lang.Integer">
<column name="`Detail-Zeiterf-ID`" />
<generator class="identity"/>
</id>
<property name="woZeiterfId" type="java.lang.Integer">
<column name="`WO-Zeiterf-ID`" not-null="true" />
</property>
<property name="tagId" type="java.lang.Integer">
<column name="`Tag-ID`" not-null="true" />
</property>
<property name="detailCodeId" type="java.lang.Integer">
<column name="`Detail-Code-ID`" not-null="true" />
</property>
<property name="meldungsId" type="java.lang.String">
<column name="`Meldungs-ID`" length="20" />
</property>
<property name="zeitStd" type="java.lang.Float">
<column name="ZeitStd" precision="24" scale="0" />
</property>
<property name="kommentar" type="java.lang.String">
<column name="Kommentar" />
</property>
</class>
</hibernate-mapping>
maybe this helps too, the classes:
Code:
package com.ris.db.det;
/**
* DetErfassung generated by MyEclipse - Hibernate Tools
*/
public class DetErfassung extends AbstractDetErfassung implements java.io.Serializable {
// Constructors
/**
*
*/
private static final long serialVersionUID = -8488889379608600585L;
/** default constructor */
public DetErfassung() {
}
/** minimal constructor */
public DetErfassung(Integer detailZeiterfId, Integer woZeiterfId, Integer tagId, Integer detailCodeId) {
super(detailZeiterfId, woZeiterfId, tagId, detailCodeId);
}
/** full constructor */
public DetErfassung(Integer detailZeiterfId, Integer woZeiterfId, Integer tagId, Integer detailCodeId, String meldungsId, Float zeitStd, String kommentar) {
super(detailZeiterfId, woZeiterfId, tagId, detailCodeId, meldungsId, zeitStd, kommentar);
}
}
Code:
/**
* AbstractDetErfassung generated by MyEclipse - Hibernate Tools
*/
public abstract class AbstractDetErfassung implements java.io.Serializable {
// Fields
private Integer detailZeiterfId;
private Integer woZeiterfId;
private Integer tagId;
private Integer detailCodeId;
private String meldungsId;
private Float zeitStd;
private String kommentar;
// Constructors
/** default constructor */
public AbstractDetErfassung() {
}
/** minimal constructor */
public AbstractDetErfassung(Integer detailZeiterfId, Integer woZeiterfId, Integer tagId, Integer detailCodeId) {
this.detailZeiterfId = detailZeiterfId;
this.woZeiterfId = woZeiterfId;
this.tagId = tagId;
this.detailCodeId = detailCodeId;
}
/** full constructor */
public AbstractDetErfassung(Integer detailZeiterfId, Integer woZeiterfId, Integer tagId, Integer detailCodeId, String meldungsId, Float zeitStd, String kommentar) {
this.detailZeiterfId = detailZeiterfId;
this.woZeiterfId = woZeiterfId;
this.tagId = tagId;
this.detailCodeId = detailCodeId;
this.meldungsId = meldungsId;
this.zeitStd = zeitStd;
this.kommentar = kommentar;
}
// Property accessors
public Integer getDetailZeiterfId() {
return this.detailZeiterfId;
}
public void setDetailZeiterfId(Integer detailZeiterfId) {
this.detailZeiterfId = detailZeiterfId;
}
public Integer getWoZeiterfId() {
return this.woZeiterfId;
}
public void setWoZeiterfId(Integer woZeiterfId) {
this.woZeiterfId = woZeiterfId;
}
public Integer getTagId() {
return this.tagId;
}
public void setTagId(Integer tagId) {
this.tagId = tagId;
}
public Integer getDetailCodeId() {
return this.detailCodeId;
}
public void setDetailCodeId(Integer detailCodeId) {
this.detailCodeId = detailCodeId;
}
public String getMeldungsId() {
return this.meldungsId;
}
public void setMeldungsId(String meldungsId) {
this.meldungsId = meldungsId;
}
public Float getZeitStd() {
return this.zeitStd;
}
public void setZeitStd(Float zeitStd) {
this.zeitStd = zeitStd;
}
public String getKommentar() {
return this.kommentar;
}
public void setKommentar(String kommentar) {
this.kommentar = kommentar;
}
}