Hello all,
the following post deals with one simple question: do I have to do something to tell JBoss
to include the jBPM hibernate.cfg.xml when he bootstraps his own CMP hibernate
configuration?
In detail:
I'm trying to get jBPM 3.2 running in a JBoss 4.2 application server. Mainly, I'm
evaluating the question: should I use EJB3 entity beans or pure hibernate beans beneath
jBPM (I want to use the same schema / datasource / transactions and I want to have own
beand as process variables).
To achieve this, I've followed the wiki article
http://wiki.jboss.org/wiki/Wiki.jsp?page=Jbpm32UsingCMT.
Unfortunately, it does not work at all. I've followed the instructions in the wiki
article with absolutely no success.
My first disappointment was "createSchema", which only gives "You cannot
commit during a managed transaction". I've googled a lot and finally found a
french article which told me to call createSchema with a jbpmContext parameter, after
having put an injected hibernate session into this context. Sounds plausible, but
unfortunately, createSchema can't be called with a context parameter. Only with a
context name parameter, which doesn't help much. Don't know which version of jBPM
was used in France.
Ok, creating the schema is not that important. I've created the schema using the
supplied scripts and skipped this step.
Next step was trying to deploy a process definition. Again I wrote in my stateless session
bean:
| @PersistenceContext
| private Session session;
| public void deployProcessDefinition() {
| ProcessDefinition processDefinition = ProcessDefinition
| .parseXmlString("<process-definition name='hello world'>"
| + " <start-state name='start'>"
| + " <transition to='s' />" + "
</start-state>"
| + " <state name='s'>" + " <transition
to='end' />"
| + " </state>" + " <end-state name='end'
/>"
| + "</process-definition>");
|
| JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| jbpmContext.setSession(session);
| jbpmContext.deployProcessDefinition(processDefinition);
| jbpmContext.close();
| }
|
Of course, I get an error, it's the following:
anonymous wrote :
| Named query not known: GraphSession.findLatestProcessDefinitionQuery
|
Some lines up in the log, he told me:
anonymous wrote :
| 14:34:29,065 INFO [Configuration] Reading mappings from resource :
org/jbpm/db/hibernate.queries.hbm.xml
|
, and there is absolutely nothing suspicious in the log (I think).
It sounds to me that he has build a second Hibernate config, but setSession forces him to
use JBoss' Hibernate config which does not contain the jBPM stuff.
I've taken the jbpm.cfg.xml and hibernate.cfg.xml from jbpm-enterprise.jar with only
little modifications (in hibernate, I've put my own datasource, and in jbpm I changed
the non-existent message and scheduler entries.
Altogether packaged in a rather basic EAR.
Can anybody help me?
Marcus.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088402#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...