[jboss-user] [JBoss jBPM] - Table not found in statement. While deloying a Process Defin

chrisrjcox do-not-reply at jboss.com
Thu Mar 6 18:18:43 EST 2008


Hi,

I'm currently getting a 


  | 22:53:18,188 ERROR [JDBCExceptionReporter] Table not found in statement [select top ? processdef0_.ID_ as ID1_119_, processdef0_.NAME_ as NAME3_119_, processdef0_.DESCRIPTION_ as DESCRIPT4_119_, processdef0_.VERSION_ as VERSION5_119_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN6_119_, processdef0_.STARTSTATE_ as STARTSTATE7_119_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc]
  | 

error when I'm trying to deploy a new definition.

The method the code is failing is the following 


  | jbpmContext.deployProcessDefinition(processDefinition);
  | 

from within the following class file


  | package com.distributed.jbpm.mdb;
  | 
  | import javax.ejb.MessageDriven;
  | import javax.ejb.ActivationConfigProperty;
  | 
  | import javax.jms.JMSException;
  | import javax.jms.Message;
  | import javax.jms.MessageListener;
  | import javax.jms.TextMessage;
  | 
  | import org.jbpm.JbpmConfiguration;
  | import org.jbpm.JbpmContext;
  | import org.jbpm.db.GraphSession;
  | import org.jbpm.graph.def.ProcessDefinition;
  | import org.jbpm.graph.exe.ProcessInstance;
  | import org.jbpm.graph.exe.Token;
  | 
  | 
  | 
  | @MessageDriven(activationConfig =
  | 	{
  | 		@ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue = "Auto-acknowledge"),
  | 		@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
  | 		@ActivationConfigProperty(propertyName="destination", propertyValue="/queue/jbpmQueueTwo")
  | 	})
  | 
  | public class NewPartTwoMDB implements MessageListener
  | {
  | 	static JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
  | 	
  | 	public void deployProcessDefinition()
  | 	{
  | 		System.out.println("deployProcessDefinition(): Begining to deploy processDefinition");
  | 		ProcessDefinition processDefinition = ProcessDefinition.parseXmlString
  | 		(
  | 				"<process-definition  name='processTwo'>" +
  | 				"<swimlane name='Record producer'>" +
  | 				"<assignment expression='group(Record producer)'></assignment>" +
  | 				"</swimlane>" +
  | 				"<start-state name='Give band a name'>" +
  | 				"<task name='Give band a name' swimlane='Record producer'>" +
  | 				"<controller>" +
  | 				"<variable access='read,write' name='bandName' mapped-name='Band Name'></variable>" +
  | 				"</controller>" +
  | 				"</task>" +
  | 				"<transition to='end-state1'></transition>" +
  | 				"</start-state>" +
  | 				"<end-state name='end-state1'>" +
  | 				"<event type='node-enter'>" +
  | 				"<action name='SendToQueue' class='com.distributed.part.two.actions.SendMessageToQueueBackForPartOne'></action>" +
  | 				"</event>" +
  | 				"</end-state>" +
  | 				"</process-definition>"
  | 		);
  | 		System.out.println("deployProcessDefinition(): processDefinition.parseXmlString Complete");
  | 		
  | 		
  | 		JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
  | 		System.out.println("deployProcessDefinition(): jbpmContext Created");
  | 		try
  | 		{
  | 			jbpmContext.deployProcessDefinition(processDefinition);
  | 			System.out.println("deployProcessDefinition(): processDefinition deployed");
  | 		}
  | 		finally
  | 		{
  | 			jbpmContext.close();
  | 		}
  | 	}
  | 	
  | 	public void onMessage(Message inMessage)
  | 	{
  | 		TextMessage textMessage = null;
  | 		try
  | 		{
  | 			if(inMessage instanceof TextMessage)
  | 			{
  | 				textMessage = (TextMessage) inMessage;
  | 				System.out.println("onMessage: Message received: "+ textMessage.getText());
  | 				
  | 				deployProcessDefinition();
  | 				System.out.println("onMessage: ProcessDefinition Deployed");
  | 				
  | 				JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
  | 				try
  | 				{
  | 					GraphSession graphSession = jbpmContext.getGraphSession();
  | 					System.out.println("onMessage: GraphSession created");
  | 					
  | 					ProcessDefinition processDefinition = graphSession.findLatestProcessDefinition("processTwo");
  | 					System.out.println("onMessage: ProcessDefinition created");
  | 					
  | 					ProcessInstance processInstance = new ProcessInstance(processDefinition);
  | 					System.out.println("onMessage: ProcessInstance created");
  | 					
  | 					Token token = processInstance.getRootToken();
  | 					System.out.println("onMessage: Token created");
  | 					System.out.println("onMessage: Node is" + token.getNode().getName());
  | 					
  | 					jbpmContext.save(processInstance);
  | 					System.out.println("onMessage: processInstance Saved");
  | 				}
  | 				finally
  | 				{
  | 					jbpmContext.close();
  | 				}
  | 				
  | 			}
  | 			else
  | 			{
  | 				System.out.println("MDB: Message of wrong type: " + inMessage.getClass().getName());
  | 			}
  | 		}
  | 		catch (JMSException e)
  | 		{
  | 			e.printStackTrace();
  | 		}
  | 		catch (Throwable t)
  | 		{
  | 			t.printStackTrace();
  | 		}
  | 		
  | 	}
  | }
  | 

Below is an extract of the error from the terminal showing the error being reported by JDBCExceptionReporter.


  | 22:53:16,954 INFO  [STDOUT] onMessage: Message received: Start processTwo
  | 22:53:16,954 INFO  [STDOUT] deployProcessDefinition(): Begining to deploy processDefinition
  | 22:53:17,046 INFO  [STDOUT] deployProcessDefinition(): processDefinition.parseXmlString Complete
  | 22:53:17,056 INFO  [STDOUT] deployProcessDefinition(): jbpmContext Created
  | 22:53:17,060 INFO  [Configuration] configuring from resource: hibernate.cfg.xml
  | 22:53:17,060 INFO  [Configuration] Configuration resource: hibernate.cfg.xml
  | 22:53:17,063 INFO  [Configuration] Reading mappings from resource : org/jbpm/graph/action/Script.hbm.xml
  | 

followed by several lines of INFO then.


  | 22:53:17,558 INFO  [SettingsFactory] Default entity-mode: pojo
  | 22:53:17,558 INFO  [SettingsFactory] Named query checking : enabled
  | 22:53:17,566 INFO  [SessionFactoryImpl] building session factory
  | 22:53:18,036 INFO  [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
  | 22:53:18,188 WARN  [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
  | 22:53:18,188 ERROR [JDBCExceptionReporter] Table not found in statement [select top ? processdef0_.ID_ as ID1_119_, processdef0_.NAME_ as NAME3_119_, processdef0_.DESCRIPTION_ as DESCRIPT4_119_, processdef0_.VERSION_ as VERSION5_119_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN6_119_, processdef0_.STARTSTATE_ as STARTSTATE7_119_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc]
  | 22:53:18,390 ERROR [STDERR] org.hibernate.exception.SQLGrammarException: could not execute query
  | 	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
  | 	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
  | 
  | 

I can't see any guidance on any additional configuration to deploy the process over then adding the hybernate.cfg.xml into the /conf directory

Could Hybernate be looking at an incorrect database? or something?

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

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



More information about the jboss-user mailing list