<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Write records on jBoss datasource using hibernate
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/lauradp">Laura delli Paoli</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/787612#787612">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hello everybody,</p><p>I don't If I posted my question in the right section, but I tryed the same code in a JBoss war, without jBPM and it worked fine.</p><p>I'm developping an application running in JBoss AS7. My app is a web service that launchs jBPM workflows. I need to write some records in a table of the JBoss Datasource using Hibernate.</p><p>on executing</p><p>session.beginTransaction();</p><p>I get the following error (see full trace attached):</p><p>14:29:45,500 WARN&#160; [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost-127.0.0.1-8080-1) SQL Error: 0, SQLState: 08001</p><p>14:29:45,502 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost-127.0.0.1-8080-1) No suitable driver found for jdbc:mysql://10.21.101.175:3306/jbpm5</p><p>14:29:45,519 ERROR [eu.discoveryreply.serviceLayer.jbpm.wiHandlers.LogTaskHandler] (http-localhost-127.0.0.1-8080-1) Unable to save process 37 to DB: org.hibernate.exception.JDBCConnectionException: Could not open connection</p><p>&#160; at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:131) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>&#160; at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>&#160; at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>&#160; at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>&#160; at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:304) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>&#160; at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:169) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>&#160; at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doBegin(JdbcTransaction.java:67) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>&#160; at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.begin(AbstractTransactionImpl.java:160) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>&#160; at org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:1263) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>&#160; at eu.discoveryreply.dataLayer.dao.MCF_ProcessesDetailsDAO.save(MCF_ProcessesDetailsDAO.java:32) [classes:]</p><p>&#160; at eu.discoveryreply.serviceLayer.jbpm.wiHandlers.LogTaskHandler.executeWorkItem(LogTaskHandler.java:68) [classes:]</p><p>&#160; at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:55) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]</p><p>&#160; at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:107) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]</p><p>&#160; at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]</p><p>&#160; at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:279) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]</p><p>&#160; at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:238) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]</p><p>&#160; at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]</p><p>&#160; at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]</p><p>&#160; at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:126) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]</p><p>&#160; at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]</p><p>&#160; at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:194) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]</p><p>&#160; at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:309) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]</p><p>&#160; at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:170) [jbpm-flow-5.4.0.Final.jar:5.4.0.Final]</p><p>&#160; at org.drools.common.AbstractWorkingMemory.startProcessInstance(AbstractWorkingMemory.java:1108) [drools-core-5.5.0.Final.jar:5.5.0.Final]</p><p>&#160; at org.drools.impl.StatefulKnowledgeSessionImpl.startProcessInstance(StatefulKnowledgeSessionImpl.java:330) [drools-core-5.5.0.Final.jar:5.5.0.Final]</p><p>&#160; at org.drools.command.runtime.process.StartProcessInstanceCommand.execute(StartProcessInstanceCommand.java:46) [drools-core-5.5.0.Final.jar:5.5.0.Final]</p><p>&#160; at org.drools.command.runtime.process.StartProcessInstanceCommand.execute(StartProcessInstanceCommand.java:25) [drools-core-5.5.0.Final.jar:5.5.0.Final]</p><p>&#160; at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36) [drools-core-5.5.0.Final.jar:5.5.0.Final]</p><p>&#160; at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:373) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]</p><p>&#160; at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcessInstance(CommandBasedStatefulKnowledgeSession.java:237) [drools-core-5.5.0.Final.jar:5.5.0.Final]</p><p>&#160; at eu.discoveryreply.serviceLayer.jbpm.JBpmPrimaryWkfLauncher.startWorkflow(JBpmPrimaryWkfLauncher.java:113) [classes:]</p><p>&#160; at eu.discoveryreply.serviceLayer.webServer.StartWkfWS.startWorkflow(StartWkfWS.java:51) [classes:]</p><p>&#160; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_32]</p><p>&#160; at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_32]</p><p>&#160; at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_32]</p><p>&#160; at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.6.0_32]</p><p>&#160; at org.jboss.ws.common.invocation.AbstractInvocationHandlerJSE.invoke(AbstractInvocationHandlerJSE.java:108)</p><p>&#160; at org.jboss.wsf.stack.cxf.JBossWSInvoker.performInvocation(JBossWSInvoker.java:149)</p><p>&#160; at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) [cxf-rt-core-2.4.4.jar:2.4.4]</p><p>&#160; at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:178) [cxf-rt-frontend-jaxws-2.4.4.jar:2.4.4]</p><p>&#160; at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:64) [cxf-rt-frontend-jaxws-2.4.4.jar:2.4.4]</p><p>&#160; at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:129)</p><p>&#160; at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) [cxf-rt-core-2.4.4.jar:2.4.4]</p><p>&#160; at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.6.0_32]</p><p>&#160; at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [rt.jar:1.6.0_32]</p><p>&#160; at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.6.0_32]</p><p>&#160; at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) [cxf-rt-core-2.4.4.jar:2.4.4]</p><p>&#160; at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:107) [cxf-rt-core-2.4.4.jar:2.4.4]</p><p>&#160; at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) [cxf-api-2.4.4.jar:2.4.4]</p><p>&#160; at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-rt-core-2.4.4.jar:2.4.4]</p><p>&#160; at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:236) [cxf-rt-transports-http-2.4.4.jar:2.4.4]</p><p>&#160; at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:88)</p><p>&#160; at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:164)</p><p>&#160; at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:90)</p><p>&#160; at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:221) [cxf-rt-transports-http-2.4.4.jar:2.4.4]</p><p>&#160; at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:141) [cxf-rt-transports-http-2.4.4.jar:2.4.4]</p><p>&#160; at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]</p><p>&#160; at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:138)</p><p>&#160; at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140) [jbossws-spi.jar:2.1.0.Final]</p><p>&#160; at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]</p><p>&#160; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]</p><p>&#160; at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]</p><p>&#160; at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]</p><p>&#160; at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]</p><p>&#160; at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]</p><p>&#160; at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]</p><p>&#160; at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]</p><p>&#160; at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]</p><p>&#160; at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]</p><p>&#160; at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]</p><p>&#160; at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]</p><p>&#160; at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]</p><p>&#160; at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]</p><p>&#160; at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_32]</p><p>Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://10.21.101.175:3306/jbpm5</p><p>&#160; at java.sql.DriverManager.getConnection(Unknown Source) [rt.jar:1.6.0_32]</p><p>&#160; at java.sql.DriverManager.getConnection(Unknown Source) [rt.jar:1.6.0_32]</p><p>&#160; at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.getConnection(DriverManagerConnectionProviderImpl.java:173) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>&#160; at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:276) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>&#160; at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:297) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]</p><p>&#160; ... 69 more</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>14:29:46,310 INFO&#160; [eu.discoveryreply.serviceLayer.jbpm.wiHandlers.MoveFileHandler] (http-localhost-127.0.0.1-8080-1) This is MoveFileHandler</p><p>14:29:46,311 INFO&#160; [eu.discoveryreply.serviceLayer.jbpm.wiHandlers.MoveFileHandler] (http-localhost-127.0.0.1-8080-1) SourcePath: D:\RAS-Test\workingbox</p><p>14:29:48,096 INFO&#160; [eu.discoveryreply.applicationLayer.actionHandler.jBpmWorkflowActionHandler] (Thread-1 (HornetQ-client-global-threads-2023845472)) Request sent</p><p>14:48:11,440 INFO&#160; [org.jboss.as.osgi] (MSC service thread 1-7) JBAS011942: Stopping OSGi Framework</p><p>14:48:11,443 INFO&#160; [org.jboss.as.messaging] (MSC service thread 1-7) JBAS011605: Unbound messaging object to jndi name java:/topic/test</p><p>14:48:11,446 INFO&#160; [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Pausing Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080</p><p>14:48:11,448 INFO&#160; [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Stopping Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080</p><p>14:48:11,451 INFO&#160; [org.apache.catalina.core.StandardContext] (MSC service thread 1-8) Container org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/] has not been started</p><p>14:48:11,449 INFO&#160; [org.jboss.as.messaging] (MSC service thread 1-2) JBAS011605: Unbound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/787612#787612">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>