-->
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.  [ 4 posts ] 
Author Message
 Post subject: java.lang.NullPointerException in AbstractEntityPersister
PostPosted: Thu Sep 22, 2005 6:29 pm 
Newbie

Joined: Tue Sep 20, 2005 5:06 pm
Posts: 9
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
hibernate 3.1

Mapping documents:
Code:
    <property name="hibernate.dialect">br.com.glr.populis.util.compatibility.SQLServer7Dialect</property>
    <property name="hibernate.connection.datasource">jdbc/dsPOPULIS</property>
   <property name="TransactionStrategy">org.hibernate.transaction.CMTTransactionFactory</property>
   <property name="transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
   <property name="TransactionManagerLookup">org.hibernate.transaction.WebSphereTransactionManagerLookup</property>
   <property name="transaction.manager_lookup_class">org.hibernate.transaction.WebSphereTransactionManagerLookup</property>
   <property name="TransactionManagerLookupStrategy">org.hibernate.transaction.WebSphereTransactionManagerLookup</property>
   <property name="transaction.auto_close_session">true</property>
   <property name="transaction.flush_before_completion">true</property>



Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
Code:
Hibernate: insert into JBPM_PROCESSDEFINITION (NAME_, VERSION_, ISTERMINATIONIMPLICIT_, STARTSTATE_) values (?, ?, ?, ?)
[22/09/05 19:12:44:106 GMT-03:00]  fae902b GraphSession  E org.jbpm.db.GraphSession  java.lang.NullPointerException
[22/09/05 19:12:44:168 GMT-03:00]  fae902b SystemOut     O 122266 FATAL ctx:[[businessdelegate=WorkflowBusinessDelegate.java, method=publicarProcesso(processVo)] [sessionFacade=WorkflowSessionFacadeBean.java, method=publicarProcesso(processVo)] [classe=MainWorkflow.java, method=deployProcessDefinition(zipInputStream)]] - couldn't save process definition 'ProcessDefinition(teste)'
java.lang.RuntimeException: couldn't save process definition 'ProcessDefinition(teste)'
   at org.jbpm.db.GraphSession.saveProcessDefinition(GraphSession.java:35)
   at br.com.glr.populis.model.workflow.common.MainWorkflow.deployProcessDefinition(MainWorkflow.java:77)
   at br.com.glr.populis.model.workflow.ejb.WorkflowSessionFacadeBean.publicarProcesso(WorkflowSessionFacadeBean.java:51)
   at br.com.glr.populis.model.workflow.ejb.EJSLocalStatelessWorkflowSessionFacade_618810f4.publicarProcesso(EJSLocalStatelessWorkflowSessionFacade_618810f4.java:119)
   at br.com.glr.populis.web.workflow.delegate.WorkflowBusinessDelegate.publicarProcesso(WorkflowBusinessDelegate.java:56)
   at br.com.glr.populis.web.workflow.action.ProcessFormAction.addData(ProcessFormAction.java:25)
   at br.com.glr.populis.webcommon.action.GenericFormMaintenanceAction.executeAddData(GenericFormMaintenanceAction.java:151)
   at br.com.glr.populis.webcommon.action.GenericFormMaintenanceAction.execute(GenericFormMaintenanceAction.java:84)
   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 br.com.glr.populis.webcommon.servlet.PopulisServlet.process(PopulisServlet.java:22)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
   at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
   at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
   at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
   at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
   at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
   at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
   at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
   at br.com.glr.populis.webcommon.controller.filter.LogFilter.doFilter(LogFilter.java:18)
   at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
   at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
   at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:965)
   at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
   at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
   at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
   at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
   at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
   at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
   at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
   at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
   at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
   at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
   at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:443)
   at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
Caused by: java.lang.NullPointerException
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1954)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2395)
   at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37)
   at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
   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:523)
   at org.hibernate.impl.SessionImpl.save(SessionImpl.java:513)
   at org.hibernate.impl.SessionImpl.save(SessionImpl.java:509)
   at org.jbpm.db.GraphSession.saveProcessDefinition(GraphSession.java:31)
   ... 38 more



Name and version of the database you are using:
MSSqlServer7.0

The generated SQL (show_sql=true):
Hibernate: insert into JBPM_PROCESSDEFINITION (NAME_, VERSION_, ISTERMINATIONIMPLICIT_, STARTSTATE_) values (?, ?, ?, ?)

Debug level Hibernate log excerpt:
Code:
log4j.rootLogger=DEBUG, stdout, stderr
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%r %-5p ctx:[%x] - %m\n
log4j.appender.stderr=org.apache.log4j.ConsoleAppender
log4j.appender.stderr.Target=System.err
log4j.appender.stderr.Threshold=ERROR
log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
log4j.appender.stderr.layout.ConversionPattern=%r %-5p ctx:[%x] - %m\n
log4j.logger.br.com.glr=DEBUG
log4j.logger.org.hibernate=DEBUG
log4j.logger.org.jbpm=DEBUG


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 8:12 pm 
Newbie

Joined: Tue Sep 20, 2005 5:06 pm
Posts: 9
All right, i found a work aroumd for this trouble!

i've created SQLServer7Dialect in my own utility application, that looks like this:

Code:
package br.com.glr.populis.util.compatibility;

public class SQLServer7Dialect extends org.hibernate.dialect.SQLServerDialect {

   public String appendIdentitySelectToInsert(String arg0) {
      return arg0;
   }

   [b]public boolean supportsInsertSelectIdentity() {
      return false;
   }[/b]

}



The method supportsInsertSelectIdentity, was the solution for my trouble, but i'm not sure if it will work in the future, couse i do only a test case, but at this moment it works

and i user the following config for hibernate with websphere!

Code:
    <property name="hibernate.dialect">br.com.glr.populis.util.compatibility.SQLServer7Dialect</property>
    <property name="hibernate.connection.datasource">jdbc/dsPOPULIS</property>
   <property name="TransactionStrategy">org.hibernate.transaction.CMTTransactionFactory</property>
   <property name="transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
   <property name="TransactionManagerLookup">org.hibernate.transaction.WebSphereTransactionManagerLookup</property>
   <property name="transaction.manager_lookup_class">org.hibernate.transaction.WebSphereTransactionManagerLookup</property>
   <property name="TransactionManagerLookupStrategy">org.hibernate.transaction.WebSphereTransactionManagerLookup</property>
   <property name="transaction.auto_close_session">true</property>
   <property name="transaction.flush_before_completion">true</property>



Its solved my problem for this time, i'll make more tests on this!

Thanks for no replies on this!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 9:52 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
Thanks for no replies on this!


How could anyone possibly have replied when the source of the problem was a bug in your custom Dialect that you did not even show in the original post?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 23, 2005 2:46 pm 
Newbie

Joined: Tue Sep 20, 2005 5:06 pm
Posts: 9
gavin wrote:
Quote:
Thanks for no replies on this!


How could anyone possibly have replied when the source of the problem was a bug in your custom Dialect that you did not even show in the original post?



I think that someone could at least send to me some direction on how to solve this problem, but i've got no replies.

i dont wrote that to bother someone, it just was a relief.

Sorry if i bother you!


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