[jbpm-users] [JBoss jBPM] - Hibernate error while deploying process in a web application

vignesh57 do-not-reply at jboss.com
Tue Jul 7 04:51:24 EDT 2009


i am trying to implement jBPM in a J2EE Web application. I am doing three things.
1) Deploy a process
2) Start an instance.
3) Show a list of available instances.

My Environment:
jBPM      : 3.2.X
jBoss     : 4.2.X
Database: MySQL

Below is the piece of code embedded in a method inside a DAO class. This is invoked from the servlet when the user hits the Deploy button in the jsp page.

  | public String redeployProcess(String processName) {
  | 		System.out.println("->public String redeployProcess(String processName)");
  | 		System.out.println("----->Creating jBPM Configuration....");
  | 		JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
  | 		try {
  | 			System.out.println("----->Parsing process definition....");
  | 			ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource(processName);
  | 			System.out.println("----->Deploying Process definition....");
  | 			jbpmContext.deployProcessDefinition(processDefinition);
  | 			System.out.println("----->Deploy Successful....");
  | 			return "Process " + processDefinition.getName() + " redeployed.";
  | 		} finally {
  | 			System.out.println("----->Closing jBPM Context....");
  | 			jbpmContext.close();
  | 		}
  | 	}
  | 

And this is the exception i got....

  | ->public String redeployProcess(String processName)
  | 13:45:38,882 INFO  [STDOUT] ----->Creating jBPM Configuration....
  | 13:45:38,882 INFO  [STDOUT] ----->Parsing process definition....
  | 13:45:38,928 INFO  [STDOUT] ----->Deploying Process definition....
  | 13:45:38,928 INFO  [STDOUT] ----->Closing jBPM Context....
  | 13:45:38,928 ERROR [[JBPMServlet]] Servlet.service() for servlet JBPMServlet threw exception
  | org.hibernate.HibernateException: No CurrentSessionContext configured!
  | 	at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:542)
  | 	at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:90)
  | 	at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:330)
  | 	at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:636)
  | 	at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:170)
  | 	at com.sample.dao.JBPMDao.redeployProcess(JBPMDao.java:23)
  | 	at com.sample.JBPMServlet.doGet(JBPMServlet.java:34)
  | 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
  | 	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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  | 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
  | 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
  | 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
  | 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
  | 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  | 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  | 	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
  | 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  | 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
  | 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
  | 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
  | 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
  | 	at java.lang.Thread.run(Thread.java:595)
  | 

Works well in Tomcat !

I ran this application in Tomcat and it worked perfectly alright. Initially i faced some problems but with the help of existing posts, i made it work well.....

Why not in jBoss ?

If it works well in Tomcat, then it must work in jBoss too. And also i dont know Hibernate. I can see that it is trying to get a Session through SessionFactoryImpl.getCurrentSession() and the effort fails. 
But how is it able to get one in Tomcat ?

Any help here would be deeply appreciated. if I am missing out to provide any info, please do ask me.


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242120#4242120

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242120



More information about the jbpm-users mailing list