4 Replies Latest reply: Jul 28, 2011 5:18 AM by rachid kersit RSS

    Connection time out during Configuration.setResource

    Benjamin moi Newbie

      Hi,

      I'm currently trying to use JBPM 4.1 on tomcat with struts and mysql. I have a problem during the initialization of ProcessEngine. There is a connection time out exception. I think it is trying to connect to mysql but mysql is running and responding so I don't know what is going wrong.

      Tomcat Log :

      Le serveur a rencontré une erreur interne () qui l'a empêché de satisfaire la requête.
      
      exception
      
      javax.servlet.ServletException: org.jbpm.api.JbpmException:
       error: couldn't parse xml document : java.net.ConnectException: Connection timed out: connect
       org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
       org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
       org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      cause mère
      
      org.jbpm.api.JbpmException:
       error: couldn't parse xml document : java.net.ConnectException: Connection timed out: connect
       org.jbpm.pvm.internal.xml.ProblemList.getJbpmException(ProblemList.java:168)
       org.jbpm.pvm.internal.xml.ProblemList.getJbpmException(ProblemList.java:141)
       org.jbpm.pvm.internal.xml.Parse.checkErrors(Parse.java:189)
       org.jbpm.pvm.internal.cfg.JbpmConfiguration.parse(JbpmConfiguration.java:178)
       org.jbpm.pvm.internal.cfg.JbpmConfiguration.setResource(JbpmConfiguration.java:150)
       org.jbpm.api.Configuration.setResource(Configuration.java:112)
       javaclass.DAO.BillDAO.findByExample(BillDAO.java:47)
       javaclass.action.ListBillAction.execute(ListBillAction.java:29)
       org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
       org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
       org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
       org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
       org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
       org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
       org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
       org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
       org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      cause mère
      
      org.jbpm.api.JbpmException
       org.jbpm.pvm.internal.xml.ProblemList.getJbpmException(ProblemList.java:164)
       org.jbpm.pvm.internal.xml.ProblemList.getJbpmException(ProblemList.java:141)
       org.jbpm.pvm.internal.xml.Parse.checkErrors(Parse.java:189)
       org.jbpm.pvm.internal.cfg.JbpmConfiguration.parse(JbpmConfiguration.java:178)
       org.jbpm.pvm.internal.cfg.JbpmConfiguration.setResource(JbpmConfiguration.java:150)
       org.jbpm.api.Configuration.setResource(Configuration.java:112)
       javaclass.DAO.BillDAO.findByExample(BillDAO.java:47)
       javaclass.action.ListBillAction.execute(ListBillAction.java:29)
       org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
       org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
       org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
       org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
       org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
       org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
       org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
       org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
       org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      cause mère
      
      java.net.ConnectException: Connection timed out: connect
       java.net.PlainSocketImpl.socketConnect(Native Method)
       java.net.PlainSocketImpl.doConnect(Unknown Source)
       java.net.PlainSocketImpl.connectToAddress(Unknown Source)
       java.net.PlainSocketImpl.connect(Unknown Source)
       java.net.SocksSocketImpl.connect(Unknown Source)
       java.net.Socket.connect(Unknown Source)
       java.net.Socket.connect(Unknown Source)
       sun.net.NetworkClient.doConnect(Unknown Source)
       sun.net.www.http.HttpClient.openServer(Unknown Source)
       sun.net.www.http.HttpClient.openServer(Unknown Source)
       sun.net.www.http.HttpClient.<init>(Unknown Source)
       sun.net.www.http.HttpClient.New(Unknown Source)
       sun.net.www.http.HttpClient.New(Unknown Source)
       sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
       sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
       sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
       sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
       com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
       com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown Source)
       com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(Unknown Source)
       com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
       com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(Unknown Source)
       com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(Unknown Source)
       com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
       com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
       com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
       com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
       com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
       com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
       com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
       com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
       com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
       org.jbpm.pvm.internal.xml.Parser.buildDom(Parser.java:453)
       org.jbpm.pvm.internal.xml.Parser.execute(Parser.java:389)
       org.jbpm.pvm.internal.xml.Parse.execute(Parse.java:157)
       org.jbpm.pvm.internal.env.JbpmConfigurationParser.parseDocument(JbpmConfigurationParser.java:68)
       org.jbpm.pvm.internal.xml.Parser.execute(Parser.java:396)
       org.jbpm.pvm.internal.xml.Parse.execute(Parse.java:157)
       org.jbpm.pvm.internal.cfg.JbpmConfiguration.parse(JbpmConfiguration.java:178)
       org.jbpm.pvm.internal.cfg.JbpmConfiguration.setResource(JbpmConfiguration.java:150)
       org.jbpm.api.Configuration.setResource(Configuration.java:112)
       javaclass.DAO.BillDAO.findByExample(BillDAO.java:47)
       javaclass.action.ListBillAction.execute(ListBillAction.java:29)
       org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
       org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
       org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
       org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
       org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
       org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
       org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
       org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
       org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      


      jbpm.cfg:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <jbpm-configuration>
      
       <import resource="jbpm.default.cfg.xml" />
       <import resource="jbpm.tx.hibernate.cfg.xml" />
       <import resource="jbpm.jpdl.cfg.xml" />
       <import resource="jbpm.identity.cfg.xml" />
       <import resource="jbpm.businesscalendar.cfg.xml" />
       <import resource="jbpm.jobexecutor.cfg.xml" />
      
      </jbpm-configuration>
      
      

      jbpm.hibernate.cfg.xml:

      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE hibernate-configuration
       PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
       "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
      
      <hibernate-configuration>
       <session-factory>
       <!-- Enable Hibernate's automatic session context management -->
      
       <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
       <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
       <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpmdb</property>
       <property name="hibernate.connection.username">root</property>
       <property name="hibernate.connection.password"></property>
       <property name="hibernate.format_sql">true</property>
      
       <mapping resource="javaclass.beans.Bill.hbm.xml" />
       <mapping resource="javaclass.beans.Test.hbm.xml" />
       <mapping resource="javaclass.beans.User.hbm.xml" />
       <mapping resource="jbpm.repository.hbm.xml" />
       <mapping resource="jbpm.execution.hbm.xml" />
       <mapping resource="jbpm.history.hbm.xml" />
       <mapping resource="jbpm.task.hbm.xml" />
       <mapping resource="jbpm.identity.hbm.xml" />
       <mapping resource="jbpm.identity.hbm.xml" />
      
       <property name="current_session_context_class">thread</property>
       </session-factory>
      </hibernate-configuration>


      web.xml:

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
       id="WebApp_ID" version="2.5">
      
       <display-name>MonApplication</display-name>
      
       <!-- Configuration de l'action servlet -->
       <servlet>
       <servlet-name>action</servlet-name>
       <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
       <init-param>
       <param-name>config</param-name>
       <param-value>/WEB-INF/struts-config.xml</param-value>
       </init-param>
       <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
       <servlet-name>action</servlet-name>
       <url-pattern>*.do</url-pattern>
       </servlet-mapping>
      </web-app>



      Code executed

      ProcessEngine processEngine = new Configuration().setResource("jbpm.cfg.xml").buildProcessEngine();
      ExecutionService executionService = processEngine.getExecutionService();
      ProcessInstance processinstance = executionService.startProcessInstanceByKey("Custom-1");


      Thx


        • 1. Re: Connection time out during Configuration.setResource
          Ronald van Kuijk Master

          Analyse the stacktrace carefully. Your problem, is that the xml parser wants to retrieve an xsd probably from the internet. That connection fails.

          • 2. Re: Connection time out during Configuration.setResource
            Benjamin moi Newbie

            Thx. I was behind a proxy and it was'nt able to connect to http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd.
            I don't understand why it has to, but it is working by removing it or with direct internet connexion.

            Now I have different problems

            1)
            jobexecutor import in my hibernate config seems to create the following error


            org.jbpm.api.JbpmException: no command executor available in job executor
             at org.jbpm.pvm.internal.jobexecutor.JobExecutor.start(JobExecutor.java:78)
             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 org.jbpm.pvm.internal.util.ReflectUtil.invoke(ReflectUtil.java:267)
             at org.jbpm.pvm.internal.wire.operation.InvokeOperation.apply(InvokeOperation.java:39)
             at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.initialize(ObjectDescriptor.java:229)
             at org.jbpm.pvm.internal.wire.WireContext.performInitialization(WireContext.java:537)
             at org.jbpm.pvm.internal.wire.WireContext.processPendingInitializations(WireContext.java:568)
             at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:454)
             at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:441)
             at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:421)
             at org.jbpm.pvm.internal.wire.WireContext.initializeEagerObjects(WireContext.java:287)
             at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:272)
             at org.jbpm.pvm.internal.cfg.JbpmConfiguration.buildProcessEngine(JbpmConfiguration.java:132)
             at javaclass.DAO.BillDAO.findByExample(BillDAO.java:41)
             at javaclass.action.ListBillAction.execute(ListBillAction.java:29)
             at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
             at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
             at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
             at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
             at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
             at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
             at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
             at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
             at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
             at java.lang.Thread.run(Unknown Source)


            But as I don't use it I deleted the line (I think there is a problem behind it but I could't find it)

            2) Now i'm getting a new error on :
            ProcessInstance processinstance = executionService.startProcessInstanceByKey("taskformExample");


            java.lang.NullPointerException
             at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:66)
             at javaclass.DAO.BillDAO.findByExample(BillDAO.java:45)
             at javaclass.action.ListBillAction.execute(ListBillAction.java:29)
             at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
             at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
             at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
             at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
             at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
             at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
             at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
             at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
             at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
             at java.lang.Thread.run(Unknown Source)


            taskformExample appear in the console and seems to be good.
            stack variables :

            processEngine JbpmConfiguration (id=77)
             authenticatedUserIdThreadLocal ThreadLocal<T> (id=481)
             impl null
             isConfigured true
             processEngineWireContext WireContext (id=484)
             transactionWireDefinition WireDefinition (id=489)
             userCommandService null
             userProvidedEnvironmentObjectsThreadLocal ThreadLocal<T> (id=492)


            executionService ExecutionServiceImpl (id=80)
             commandService null


            I think the problem come from commandService that is null, but I don't know why.

            I didn't change the other files.

            • 3. Re: Connection time out during Configuration.setResource
              Ronald van Kuijk Master

              new problems in new topics please.

              • 4. Re: Connection time out during Configuration.setResource
                rachid kersit Newbie

                Hello,

                 

                i have the same problem but for me, i want integrate jbpm 4.4 on an application developped with the framework JSF.

                i have describe the problem on this topic http://community.jboss.org/thread/170024?tstart=0

                 

                Thanks,