I was wondering why Seam deploys each jbpm process every time I start JBossAS, that's the normal behavior? after few restarts JBPM tables looks too dirty, I think it would be wise to check the version of the process somehow and only deploy when a change occurs,
Anyway, I tried to avoid setting my processes through components.xml and deploy them in runtime but I'm having some problems,
Here's my try:
private Jbpm jbpm;
private JbpmContext jbpmContext;
ProcessDefinition pd = jbpm.getProcessDefinitionFromXml(xmlProcessDefinition);
At the moment jbpm.getProcessDefinitionFromXml(xmlProcessDefinition); gets invoked I see many JBPM lines warming up and then I get the following exceptions:
20:18:16,234 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
20:18:16,234 INFO [SchemaUpdate] Running hbm2ddl schema update
20:18:16,250 INFO [SchemaUpdate] fetching database metadata
20:18:16,250 ERROR [SchemaUpdate] could not get database metadata
java.sql.SQLException: You cannot set autocommit during a managed transaction!
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
It's working, I mean, JBPM starts(many lines appear, all JBPM conf mappings, etc...), then the process gets deployed and everything work.
well, after the first deployment time, I don't see this errors again and all work perfectly...(unless I restart Jboss again of course)
As a workaround, I just left one process within components.xml so seam starts JBPM when the -server starts-, so no error occur that way, but it's ugly...
I guess I'm already in a transaction and then JBPM starts in the middle or something... if so, is there a way to start JBPM when the server loads? (without setting any processes in components.xml?), if it's another issue then fix me :)
For deployment only? what do you mean by that?
So what came out of this ticket? none yet?
So what is the best practice in production use right now?
modify components.xml, deploy, then clean components.xml?, this sounds too dirty to me..
Anyway, I would like to deploy processes out of my ear file, thus I'm using jbpm.getProcessDefinitionFromXml which works but for the first time it thorugh the exception as I mentioned below.
any clue about this issue?
For development only == not for use in production (i.e. when you deploy with a clean db each time. The issue is still open so no work is done.
Deploy the process using some jbpm means and use an empty
in components.xml (I think this is working)
and nah, it's not working, I already tried it,
Jbpm does not load itself when server starts with empty '<bpm:jbpm />' tag,
(jbpm starts at the moment I make a use of it in runtime, but that causes transaction exceptions when it's done on later stages)
so as a workaround I just left an empty process in component.xml, but this is too dirty as it deploys every restart an unneeded process :-/
Ok, I will look at that when I get a minute :)