cancel
Showing results for 
Search instead for 
Did you mean: 

Activity and internet connection

jtawk
Champ in-the-making
Champ in-the-making
Hi,

    I am new to Activiti and i have an issue with internet and Ibatis connection.
I cannot start Activiti without internet connection, each time i do, i get an error "Error while building ibatis SqlSessionFactory".
Why this behavior and how can i run Activiti regardless of the internet status?

Regards
13 REPLIES 13

jbarrez
Star Contributor
Star Contributor
Could you post the full stacktrace?

I'm using Activiti a lot without internet connection (eg on the train) and I have never had an issue.

jtawk
Champ in-the-making
Champ in-the-making
Hi, thanks for replying, below is what i am getting:

Caused by: org.activiti.engine.ActivitiException: Error while building ibatis SqlSessionFactory: Error creating document instance.  Cause: java.net.ConnectException: Connection timed out: connect
at org.activiti.engine.impl.db.DbSqlSessionFactory.createSessionFactory(DbSqlSessionFactory.java:136)
at org.activiti.engine.impl.db.DbSqlSessionFactory.configurationCompleted(DbSqlSessionFactory.java:116)
at org.activiti.engine.impl.cfg.ProcessEngineConfiguration.notifyConfigurationComplete(ProcessEngineConfiguration.java:249)
at org.activiti.engine.impl.cfg.ProcessEngineConfiguration.configurationComplete(ProcessEngineConfiguration.java:228)
at org.activiti.engine.impl.cfg.ProcessEngineConfiguration.buildProcessEngine(ProcessEngineConfiguration.java:212)
at com.roxana.smd.activiti.engine.impl.cfg.SmdProcessEngineConfiguration.buildProcessEngine(SmdProcessEngineConfiguration.java:75)
at com.roxana.smd.activiti.engine.impl.cfg.spring.SmdProcessEngineFactoryBean.getObject(SmdProcessEngineFactoryBean.java:78)
at com.roxana.smd.activiti.engine.impl.cfg.spring.SmdProcessEngineFactoryBean.getObject(SmdProcessEngineFactoryBean.java:1)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
… 56 more
Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: java.net.ConnectException: Connection timed out: connect
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:136)
at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:32)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:47)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:34)
at org.activiti.engine.impl.db.DbSqlSessionFactory.createSessionFactory(DbSqlSessionFactory.java:127)
… 64 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:134)
… 68 more

frederikherema1
Star Contributor
Star Contributor
I'm guessing the myBatis XMLParser is trying to validate the configuration against the dtd-schema (http://ibatis.apache.org/dtd/ibatis-3-config.dtd).

Which container do you use? Or are you just running standalone?

jtawk
Champ in-the-making
Champ in-the-making
I am using Activiti with Mysql inside spring 3.0.3.

iravanchi
Champ in-the-making
Champ in-the-making
Yes, it seems DTD download.

I'm using Spring 3.0.3 too, in Tomcat, but with H2 database.

My internet connection in the office comes and goes regularly, but I haven't had such problem with DTD validation. An when the internet is connected, it's usually very slow, so I should have noticed a delay on startup, which I haven't.

Maybe the issue is about MySQL's config?

jtawk
Champ in-the-making
Champ in-the-making
no, it's the same with H2. I guess the issue had to do with spring and iBatis configuration.

iravanchi
Champ in-the-making
Champ in-the-making
I meant the MySQL-specific XML files inside Activiti that configure the database access, not the connection configuration.

jtawk
Champ in-the-making
Champ in-the-making
This was due to a Lib conflict that was causing the XML parser to look up the doctype from the net and not from the jar.
Thanks for your help and your time.

afshad
Champ in-the-making
Champ in-the-making
This was due to a Lib conflict that was causing the XML parser to look up the doctype from the net and not from the jar.
Thanks for your help and your time.

How did you fix this??
I am getting a similar exception
Error while building ibatis SqlSessionFactory: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource org/activiti/db/mapping/entity/Attachment.xml

When trying to create a process engine as given in the user guide:
ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration()
                    .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)
                    .setJdbcUrl("jdbc:h2:mem:my-own-db;DB_CLOSE_DELAY=1000")
                    .setJobExecutorActivate(true)
                    .buildProcessEngine();