Hibernate version:3.1.3
Mapping File
Code:
<?xml version="1.0" encoding="utf-8"?>
<!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 Persistence Tools
-->
<hibernate-mapping>
<class name="net.xxx.clients.xxx.vws.model.VjqValRepJobQueue" table="VJQ_VAL_REP_JOB_QUEUE" schema="VWS_OWNER">
<id name="vjqId" type="java.lang.String">
<column name="VJQ_ID" length="30" />
<generator class="select" />
</id>
<property name="vjqVrhId" type="java.lang.String">
<column name="VJQ_VRH_ID" length="30" not-null="true" />
</property>
<property name="vjqSubmittedBy" type="java.lang.String">
<column name="VJQ_SUBMITTED_BY" length="120" not-null="true" />
</property>
<property name="vjqStatus" type="java.lang.String">
<column name="VJQ_STATUS" length="10" not-null="true" />
</property>
<property name="vjqStarted" type="java.util.Date">
<column name="VJQ_STARTED" length="7" />
</property>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Code:
public void save(VjqValRepJobQueue transientInstance) {
log.debug("saving VjqValRepJobQueue instance");
try {
Session session = getSession();
Transaction transaction = session.beginTransaction();
session.save(transientInstance); [i][b]//This is where it throws an exception[/b][/i]
transaction.commit();
session.disconnect();
log.debug("save successful");
} catch (RuntimeException re) {
log.error("save failed", re);
throw re;
}
}
Full stack trace of any exception that occurs:Code:
org.hibernate.MappingException: unknown property: null
at org.hibernate.persister.entity.AbstractPropertyMapping.getColumnNames(AbstractPropertyMapping.java:54)
at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyColumnNames(AbstractEntityPersister.java:1269)
at org.hibernate.persister.entity.AbstractEntityPersister.getSelectByUniqueKeyString(AbstractEntityPersister.java:2008)
at org.hibernate.id.SelectGenerator.getSQL(SelectGenerator.java:37)
at org.hibernate.id.AbstractPostInsertGenerator.getGenerated(AbstractPostInsertGenerator.java:34)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1994)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java
:186)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:530)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:518)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514)
at net.connaught.clients.cbre.vws.dao.impl.VjqValRepJobQueueDAO.save(VjqValRepJobQueueDAO.java:45)
at net.connaught.clients.cbre.vws.manager.impl.VjqValRepJobQueueManager.save(VjqValRepJobQueueManager.java:11)
at net.connaught.clients.cbre.vws.view.actions.PublishDocuments.execute(PublishDocuments.java:30)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher
.java:712)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher
.java:369)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler
.java:865)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler
.java:447)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler
.java:215)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.2.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor
.java:303)
at java.lang.Thread.run(Thread.java:534)
Name and version of the database you are using: Oracle 10g
The problem is that the above code works perfectly fine on
Tomcat 6 but fails on
OC4J. This is weird.
Can anybody please help? Thanks in Advance.
Shardul.