[jBPM] - Problem with Spring and Persistence
by Gareth Edwards
Gareth Edwards [https://community.jboss.org/people/garethed] created the discussion
"Problem with Spring and Persistence"
To view the discussion, visit: https://community.jboss.org/message/792821#792821
--------------------------------------------------------------
Hello,
I'm creating a jbpm 5.4 web-app. I am using spring for some restful services.
I have a persistence.xml in META-INF which seems to start up correctly.
The problem manifests when I try to add the following spring bean into my applicationContext.xml
<bean id="jbpmEMF"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="org.jbpm.persistence.jta" />
</bean>
The error is:
Error creating bean with name 'jbpmEMF' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No persistence unit with name 'org.jbpm.persistence.jta' found
It seems like a spring problem as I'm pretty sure that the persistence unit has been created.
I'm running jboss from eclipse Juno.
Any ideas?
Gareth.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/792821#792821]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 3 months
[jBPM] - Want to send email using jbpm5 but got some error
by rehankhan
rehankhan [https://community.jboss.org/people/rehankhan] created the discussion
"Want to send email using jbpm5 but got some error"
To view the discussion, visit: https://community.jboss.org/message/792304#792304
--------------------------------------------------------------
ProcessMain.java
import java.util.HashMap;
import java.util.Map;
import org.drools.KnowledgeBase;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.io.ResourceFactory;
import org.drools.logger.KnowledgeRuntimeLogger;
import org.drools.logger.KnowledgeRuntimeLoggerFactory;
import org.drools.runtime.StatefulKnowledgeSession;
import org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler;
import org.jbpm.process.workitem.email.EmailWorkItemHandler;
public class ProcessMain {
public static final void main(String[] args) {
try {
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
EmailWorkItemHandler emailHandler = new EmailWorkItemHandler();
emailHandler.setConnection("smtp.gmail.com", "587", " mailto:myid@gmail.com myid(a)gmail.com", "mypassword");
emailHandler.getConnection().setStartTls(true);
ksession.getWorkItemManager().registerWorkItemHandler("Email", emailHandler);
ksession.startProcess("com.sample.bpmn");
System.out.println("Process started ...");
// emailHandler.getConnection();
} catch (Throwable t) {
t.printStackTrace();
}
}
private static KnowledgeBase readKnowledgeBase() throws Exception {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("mail.bpmn"), ResourceType.BPMN2);
return kbuilder.newKnowledgeBase();
}
}
following error is given
come
org.jbpm.workflow.instance.WorkflowRuntimeException: [com.sample.bpmn:1 - Email:2] -- Unable to send email
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:132)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:279)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:238)
at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)
at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)
at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)
at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:194)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:309)
at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:170)
at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:140)
at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:132)
at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1093)
at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:315)
at ProcessMain.main(ProcessMain.java:38)
Caused by: java.lang.RuntimeException: Unable to send email
at org.jbpm.process.workitem.email.SendHtml.sendHtml(SendHtml.java:65)
at org.jbpm.process.workitem.email.SendHtml.sendHtml(SendHtml.java:37)
at org.jbpm.process.workitem.email.EmailWorkItemHandler.executeWorkItem(EmailWorkItemHandler.java:68)
at org.drools.process.instance.impl.DefaultWorkItemManager.internalExecuteWorkItem(DefaultWorkItemManager.java:70)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:107)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126)
... 14 more
Caused by: java.lang.RuntimeException: Connection failure
at org.jbpm.process.workitem.email.SendHtml.sendHtml(SendHtml.java:59)
... 19 more
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. a4sm12928682pax.25
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
at org.jbpm.process.workitem.email.SendHtml.sendHtml(SendHtml.java:57)
... 19 more
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/792304#792304]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 3 months
[jBPM] - PostgreSQL - empty database - install.demo.db does not exist
by wishmaster7
wishmaster7 [https://community.jboss.org/people/wishmaster7] created the discussion
"PostgreSQL - empty database - install.demo.db does not exist"
To view the discussion, visit: https://community.jboss.org/message/787619#787619
--------------------------------------------------------------
Hello everybody,
I have downloaded the last version of jBPM (5.4.0), unzipped it, launched "ant install.demo", installed a local PostgreSQL database and follow the http://docs.jboss.org/jbpm/v5.4/userguide/ch.installer.html#d0e609 documentation to create the database with the matching user and configured jBPM to connect to this database. At the end of "3.7.3 Quickstart", when I want to reinstall the demo, it says BUILD FAILED - target "install.demo.db" does not exist in the project "jBPM.install".
At this point, I have a database called "jbpm5" with a user called "jbpm5", and a database called "task" with a user called "task". But they are empty. Then I launch Eclipse, create a new jBPM project with "+a more advanced process including human task and persistence+", and when I run the testProcess() method of the jUnit test class, it gives me an error ending by :
> ERROR tool.hbm2ddl.SchemaUpdate.execute - could not get database metadata
> org.h2.jdbc.JdbcSQLException: Table "PG_CLASS" not found; SQL statement:
> select relname from pg_class where relkind='S' [42102-167]
>
> [ ... ]
>
> Caused by: org.h2.jdbc.JdbcSQLException: Sequence "SESSIONINFO_ID_SEQ" not found; SQL statement:
> select nextval ('SESSIONINFO_ID_SEQ') [90036-167]
> at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
> at org.h2.message.DbException.get(DbException.java:169)
> at org.h2.message.DbException.get(DbException.java:146)
> at org.h2.schema.Schema.getSequence(Schema.java:474)
> at org.h2.expression.Function.getSequence(Function.java:1281)
> at org.h2.expression.Function.getValueWithArgs(Function.java:1129)
> at org.h2.expression.Function.getValue(Function.java:447)
> at org.h2.command.dml.Select.queryFlat(Select.java:519)
> at org.h2.command.dml.Select.queryWithoutCache(Select.java:618)
> at org.h2.command.dml.Query.query(Query.java:307)
> at org.h2.command.dml.Query.query(Query.java:277)
> at org.h2.command.dml.Query.query(Query.java:36)
> at org.h2.command.CommandContainer.query(CommandContainer.java:86)
> at org.h2.command.Command.executeQuery(Command.java:191)
> at org.h2.server.TcpServerThread.process(TcpServerThread.java:306)
> at org.h2.server.TcpServerThread.run(TcpServerThread.java:149)
> at java.lang.Thread.run(Unknown Source)
>
> at org.h2.engine.SessionRemote.done(SessionRemote.java:538)
> at org.h2.command.CommandRemote.executeQuery(CommandRemote.java:151)
> at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:96)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:63)
> at $Proxy35.executeQuery(Unknown Source)
> at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:98)
> ... 47 more
I think the problem comes from the missing "install.demo.db" task in the ant file. I've searched if a script exists to create the tables in my database, but found nothing.
Could someone please tell me what I have to do to create the required tables and sequences? Or, if I'm totally wrong, where is the problem?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/787619#787619]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 3 months