Hi,

I'm not sure if I understood well what you said... I tried to replace
blueprint by a spring config. So, just migrating and reformating
appropriately the blueprint.xml to beans.xml.

The error I get is slightly different :

09:32:51,428 | ERROR | //activemq/input | DefaultErrorHandler              |
?                                   ? | 68 - org.apache.camel.camel-core -
2.6.0 | Failed delivery for exchangeId:
ID-oniryx-mike-41918-1300954049964-2-2. Exhausted after delivery attempt: 1
caught: java.lang.RuntimeException: Error occurred.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause:
java.net.ConnectException: Connection timed out
java.lang.RuntimeException: Error occurred.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause:
java.net.ConnectException: Connection timed out
at
com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:49)[224:org.apache.servicemix.bundles.ibatis-sqlmap:2.3.4.726_3]
at
com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:63)[224:org.apache.servicemix.bundles.ibatis-sqlmap:2.3.4.726_3]
at
org.apache.camel.component.ibatis.IBatisComponent.createSqlMapClient(IBatisComponent.java:89)[225:org.apache.camel.camel-ibatis:2.6.0]
at
org.apache.camel.component.ibatis.IBatisComponent.getSqlMapClient(IBatisComponent.java:104)[225:org.apache.camel.camel-ibatis:2.6.0]
at
org.apache.camel.component.ibatis.IBatisEndpoint.getSqlMapClient(IBatisEndpoint.java:77)[225:org.apache.camel.camel-ibatis:2.6.0]
at
org.apache.camel.component.ibatis.IBatisProducer.doDelete(IBatisProducer.java:152)[225:org.apache.camel.camel-ibatis:2.6.0]
at
org.apache.camel.component.ibatis.IBatisProducer.process(IBatisProducer.java:55)[225:org.apache.camel.camel-ibatis:2.6.0]
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.Pipeline.process(Pipeline.java:125)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:330)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:157)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:121)[68:org.apache.camel.camel-core:2.6.0]
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:97)[68:org.apache.camel.camel-core:2.6.0]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_22]
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)[:1.6.0_22]
at
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)[:1.6.0_22]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)[:1.6.0_22]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)[:1.6.0_22]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)[:1.6.0_22]
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_22]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_22]
at java.lang.Thread.run(Thread.java:662)[:1.6.0_22]
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.
 Cause: java.net.ConnectException: Connection timed out
at
com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:53)[224:org.apache.servicemix.bundles.ibatis-sqlmap:2.3.4.726_3]
at
com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:46)[224:org.apache.servicemix.bundles.ibatis-sqlmap:2.3.4.726_3]
... 44 more
Caused by: java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)[:1.6.0_22]
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)[:1.6.0_22]
at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)[:1.6.0_22]
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)[:1.6.0_22]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)[:1.6.0_22]
at java.net.Socket.connect(Socket.java:529)[:1.6.0_22]
at java.net.Socket.connect(Socket.java:478)[:1.6.0_22]
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)[:1.6.0_22]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)[:1.6.0_22]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)[:1.6.0_22]
at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)[:1.6.0_22]
at sun.net.www.http.HttpClient.New(HttpClient.java:306)[:1.6.0_22]
at sun.net.www.http.HttpClient.New(HttpClient.java:323)[:1.6.0_22]
at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:975)[:1.6.0_22]
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:916)[:1.6.0_22]
at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:841)[:1.6.0_22]
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1177)[:1.6.0_22]
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
com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:157)[224:org.apache.servicemix.bundles.ibatis-sqlmap:2.3.4.726_3]
at
com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50)[224:org.apache.servicemix.bundles.ibatis-sqlmap:2.3.4.726_3]
... 45 more



Why is it connecting via http ? And to what ? Is it trying to find the
SqlMapConfig.xml also ?

Mike


2011/3/24 Willem Jiang <willem.ji...@gmail.com>

>
> The IBatisComponent is using DefaultResourceLoader to load the resource, it
> will try to use the thread context classloader to load the resource. It's
> looks like the blueprint doesn't set the thread context classloader with
> your bundle classloader.
>
> Can you try to define the Spring.xml to try again, if I remember right
> Spring DM will set the thread context classloader with the bundle
> classloader when it create the application context.
>
> Willem
>
>
> On 3/23/11 10:24 PM, Michael Dewitte wrote:
>
>> Hello,
>>
>> I've got some hard time trying to use a route using ibatis component and
>> deployed on karaf (in fact, servicemix).
>>
>> I made a bundle, using blueprint, in which I placed my blueprint and the
>> config files for ibatis.
>>
>> Deploy is just fine, but  soon as the route is activated (dropping a file
>> into the "input" directory), I got an exception :
>>
>> java.io.FileNotFoundException: class path resource [SqlMapConfig.xml]
>> cannot
>> be opened because it does not exist
>> at
>>
>> org.springframework.core.io..getInputStream(ClassPathResource.java:158)[56:org.springframework.core:3.0.5.RELEASE]
>>
>> at
>>
>> org.apache.camel.component.ibatis.IBatisComponent.createSqlMapClient(IBatisComponent.java:88)[225:org.apache.camel.camel-ibatis:2.6.0]
>> at
>>
>> org.apache.camel.component.ibatis.IBatisComponent.getSqlMapClient(IBatisComponent.java:104)[225:org.apache.camel.camel-ibatis:2.6.0]
>> at
>>
>> org.apache.camel.component.ibatis.IBatisEndpoint.getSqlMapClient(IBatisEndpoint.java:77)[225:org.apache.camel.camel-ibatis:2.6.0]
>>
>> The structure of the jar is as follow :
>> |-SqlMapConfig.xml
>> |-Users.xml (the maps definitions)
>> |-OSGI-INF
>>    |-blueprint
>>         |-blueprint.xml
>> |-META-INF
>>    |MANIFEST.MF
>>
>>
>> Here is my SqlMapConfig.xml :
>> -----------------------------------------------
>> <sqlMapConfig>
>> <transactionManager type="JDBC" commitRequired="false">
>> <dataSource type="SIMPLE">
>>  <property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/>
>> <property name="JDBC.ConnectionURL"
>> value="jdbc:mysql://localhost:3306/forem_1"/>
>>  <property name="JDBC.Username" value="root"/>
>> <property name="JDBC.Password" value="mysql"/>
>>  </dataSource>
>> </transactionManager>
>>
>> <sqlMap resource="User.xml"/>
>> </sqlMapConfig>
>>
>> Here is my Users.xml :
>> ----------------------------------------------
>> <sqlMap>
>> <delete id="deleteUser">
>>     delete from transfert_outbound where correlationId = 2
>>   </delete>
>> </sqlMap>
>>
>> Here is my blueprint.xml :
>> ----------------------------------------------
>> <blueprint
>>     xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
>>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>     xsi:schemaLocation="
>>       http://www.osgi.org/xmlns/blueprint/v1.0.0
>>       http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd";>
>>
>>     <camelContext xmlns="http://camel.apache.org/schema/blueprint";>
>>       <route>
>>         <from uri="file:activemq/input"/>
>>         <to uri="file:activemq/output"/>
>>
>>         <setBody>
>>           <simple>
>>             NEW FileMovedEvent(file: ${file:name}, timestamp:
>> ${date:now:hh:MM:ss.SSS})
>>           </simple>
>>         </setBody>
>>         <to uri="log:events"/>
>>      <to uri="ibatis:deleteUser?statementType=Delete"/>
>>       </route>
>>     </camelContext>
>> </blueprint>
>>
>>
>> and here is my pom.xml
>> ------------------------------------
>> <?xml version="1.0" encoding="UTF-8"?>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
>> http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
>> http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/maven-v4_0_0.xsd";>
>>
>>     <modelVersion>4.0.0</modelVersion>
>>
>>     <parent>
>>         <groupId>org.apache.servicemix.features</groupId>
>>         <artifactId>features</artifactId>
>>         <version>4.3.0</version>
>>     </parent>
>>
>>     <groupId>testing.servicemix.example</groupId>
>>     <artifactId>ibatistest</artifactId>
>>     <packaging>bundle</packaging>
>>     <version>1.0-SNAPSHOT</version>
>>     <name>iBatis test</name>
>>
>> <properties>
>>     <!-- Camel -->
>>         <camel-version>2.6.0</camel-version>
>> </properties>
>>
>>   <dependencies>
>>     <dependency>
>>       <groupId>org.apache.camel</groupId>
>>       <artifactId>camel-core</artifactId>
>>       <version>${camel-version}</version>
>>     </dependency>
>>     <dependency>
>>       <groupId>org.apache.camel</groupId>
>>       <artifactId>camel-spring</artifactId>
>>       <version>${camel-version}</version>
>>     </dependency>
>>     <dependency>
>>       <groupId>org.apache.camel</groupId>
>>       <artifactId>camel-ibatis</artifactId>
>>       <version>${camel-version}</version>
>>     </dependency>
>>   </dependencies>
>>
>>     <build>
>>         <plugins>
>>             <plugin>
>>                 <groupId>org.apache.felix</groupId>
>>                 <artifactId>maven-bundle-plugin</artifactId>
>>                 <configuration>
>>                     <instructions>
>>
>>  <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
>>
>>  <Import-Package>*,org.apache.camel.osgi</Import-Package>
>>
>>  <Private-Package>org.apache.servicemix.examples.camel</Private-Package>
>>                     </instructions>
>>                 </configuration>
>>             </plugin>
>>         </plugins>
>>
>>     </build>
>>
>> </project>
>>
>> Any clue ???
>>
>> Thx in advance,
>>
>> Mike
>>
>>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>         http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
>

Reply via email to