[jboss-user] [JBoss jBPM] - Re: how to integrate commandservicebean

AJanz do-not-reply at jboss.com
Tue Jul 29 08:05:33 EDT 2008


ok. added type mapping to the jbpm-ds 

and datasource mapping in the jbosscmp-jdbc.xml 


  | <jbosscmp-jdbc>
  |  <defaults>
  |   <datasource>java:JbpmDS</datasource> 
  |   <datasource-mapping>Oracle9i</datasource-mapping> 
  |   <create-table>false</create-table> 
  |   <remove-table>false</remove-table> 
  |   <pk-constraint>false</pk-constraint> 
  |   </defaults>
  |  <enterprise-beans>
  |  <entity>
  |   <ejb-name>TimerEntityBean</ejb-name> 
  |   <table-name>JBPM_JOB</table-name> 
  |  <cmp-field>
  |   <field-name>timerId</field-name> 
  |   <column-name>ID_</column-name> 
  |   </cmp-field>
  |  <cmp-field>
  |   <field-name>name</field-name> 
  |   <column-name>NAME_</column-name> 
  |   </cmp-field>
  |  <cmp-field>
  |   <field-name>tokenId</field-name> 
  |   <column-name>TOKEN_</column-name> 
  |   </cmp-field>
  |  <cmp-field>
  |   <field-name>processInstanceId</field-name> 
  |   <column-name>PROCESSINSTANCE_</column-name> 
  |   </cmp-field>
  |   </entity>
  |   </enterprise-beans>
  |   </jbosscmp-jdbc>
  | 
  | 

but now when i execute the following code

  | 
  | 
  | 	Object returnValue;
  | 			try {
  | 				GetProcessDefinitionsCommand cmd = new GetProcessDefinitionsCommand();
  | 				InitialContext initialContext = new InitialContext();
  | 				LocalCommandServiceHome localCommandServiceHome = (LocalCommandServiceHome) initialContext
  | 						.lookup("java:ejb/CommandServiceBean");
  | 				LocalCommandService localCommandService = localCommandServiceHome
  | 						.create();
  | 				returnValue = localCommandService.execute(cmd);
  | 				localCommandService.remove();
  | 			} catch (Exception e) {
  | 				e.printStackTrace();
  | 				throw new RuntimeException("couldn't execute command", e);
  | 			}
  | 


i got 

13:53:20,598 ERROR [LogInterceptor] RuntimeException in method: public abstract java.lang.Object org.jbpm.command.CommandService.execute(org.jbpm.command.Command):
org.jbpm.JbpmException: couldn't start JTA transaction

what is now missing? 

it's now nearly two days trying to get it work.......



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

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



More information about the jboss-user mailing list