[jboss-user] [JBoss jBPM] - Making JBPM and Hibernate Work Together

yairfr do-not-reply at jboss.com
Wed Jan 2 10:19:22 EST 2008


hi ,

i am trying to make JBPM use Hibernate session .
the JBPM code worked with before .
the error i get is :


  | 16:15:07,937 ERROR [STDERR] org.hibernate.MappingException: Named query not known: GraphSession.findLatestProcessDefinitionQuery
  | 
  |       at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:70)
  | 
  |       at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1253)
  | 
  |       at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:150)
  | 
  |       at org.jbpm.db.GraphSession.deployProcessDefinition(GraphSession.java:67)
  | 
  |       at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
  | 
  |       at com.mts.WF.Engine.RequestsHandler.deployProcess(RequestsHandler.java:250)
  | 
  |       at com.mts.WF.Engine.RequestsHandler.handleRequest(RequestsHandler.java:88)
  | 
  |       at com.mts.WF.Engine.WorkerThread.run(WorkerThread.java:30)
  | 
  | 

the code :

 
  | JbpmConfiguration conf = JbpmConfiguration.getInstance();
  | 		context = conf.createJbpmContext();
  | 		//context.setSession(HibernateSessionFactory.getSessionFactory().getCurrentSession());
  | 
  | 		
  | 		String fileName = FileHandler.assembleName(req.processProperties.Path+req.processProperties.Name, "processdefinition.xml");
  | 		FileInputStream fis;
  | 		fis = new FileInputStream(fileName);
  | 		
  | 		ProcessDefinition pd = ProcessDefinition.parseXmlInputStream(fis);
  | 		if (pd == null) {
  | 			logger.error("Unable to read definition: " + fileName);
  | 			//context.close();
  | 			return;
  | 		}
  | 		
  | 		context.deployProcessDefinition(pd);
  | 

the error happens on the last line .
i have tried to make JBPM work with the already opened Hibernate session 
by :

context = conf.createJbpmContext();
		context.setSession(HibernateSessionFactory.getSessionFactory().getCurrentSession());

but is has crash because no CurrentSession is configured in the 
hibernate.cfg.xml 
i have tried entering this property with thread, JTA , MANAGED 
values - with no success .
how can i resolve it ?

Thanks,
Yair

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

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



More information about the jboss-user mailing list