You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by hraviprakash <ra...@asia.xchanging.com> on 2010/11/10 15:19:31 UTC

Not able to connect Oracle queue endpoint

Hi,

I want to poll a FTP Server and push the file to oracle queue. I use spring
configuration and on while running I am getting the below error.  Please let
me know whether the camel configurations are correct and let me know where
its breaking. 
<p/>
My pom.xml includes following libraries camel-core, camel-spring,
activemq-camel, xbean-spring, camel-ftp, camel-jms, junit, commons-logging,
log4j, ojdbc14, aqapi13, spring and orai18n
<p/>
My configurations are as <p/>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring
       http://camel.apache.org/schema/spring/camel-spring.xsd
       http://activemq.apache.org/schema/core
       http://activemq.apache.org/schema/core/activemq-core.xsd">

  <camelContext xmlns="http://camel.apache.org/schema/spring">
    <package>org.fusesource.camel</package>
    <route id="test">
            <from
uri="ftp://ravi@vmswinserver/ravi?password=ravi&amp;binary=true&amp;consumer.delay=60000"/>
            <to uri="oracleQueue:queue:RAVI_TEST_Q"/>
        </route>
  </camelContext>

	<!-- without the following bean instantiation, we will get an
oracle.jms.AQjmsException with each and every received message -->
    <bean id="requiredBeanForOracleAq"
class="org.apache.activemq.ActiveMQConnectionFactory" />

    <bean id="connectionFactoryOracleAQQueue"
class="oracle.jms.AQjmsFactory" factory-method="getQueueConnectionFactory">
        <constructor-arg index="0">
            <value>jdbc:oracle:thin:@172.29.174.51:1521:vmsoff</value>
        </constructor-arg>
        <constructor-arg index="1" type="java.util.Properties">
            <value></value>
        </constructor-arg>
    </bean>

    <bean id="oracleQueueCredentials"
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
        <property name="targetConnectionFactory">
            <ref bean="connectionFactoryOracleAQQueue" />
        </property>
        <property name="username">
            <value>ravi</value>
        </property>
        <property name="password">
            <value>ravi</value>
        </property>
    </bean>

    <bean id="message_converter"
class="org.springframework.jms.support.converter.SimpleMessageConverter102"/>

    <bean id="oracleQueue"
class="org.apache.camel.component.jms.JmsComponent">
        <property name="connectionFactory" ref="oracleQueueCredentials" />
        <property name="messageConverter"
ref="message_converter"></property>
   </bean>

</beans>
<p/>Exceptions<p/>
SEVERE: Caused by: [org.apache.camel.CamelExecutionException - Exception
occurred during execution o
n the exchange: Exchange[GenericFileMessage with file:
GenericFile[publish.JPG]]]
org.apache.camel.CamelExecutionException: Exception occurred during
execution on the exchange: Excha
nge[GenericFileMessage with file: GenericFile[publish.JPG]]
        at
org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1142)
        at
org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:263)
        at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBrid
ge.process(AsyncProcessorTypeConverter.java:53)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
        at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)
        at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)
        at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java
:98)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.jav
a:68)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java
:98)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

        at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)

        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java
:98)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.jav
a:68)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
        at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHand
ler.java:290)
        at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202
)
        at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
        at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java
:98)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)

        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.jav
a:68)
        at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.j
ava:313)
        at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java
:144)
        at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:110)
        at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:98)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Scheduled
ThreadPoolExecutor.java:98)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Schedule
dThreadPoolExecutor.java:181)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadP
oolExecutor.java:205)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.AbstractMethodError:
oracle.jms.AQjmsQueueConnectionFactory.createConnection(Lj
ava/lang/String;Ljava/lang/String;)Ljavax/jms/Connection;
        at
org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.doCreateConnec
tion(UserCredentialsConnectionFactoryAdapter.java:175)
        at
org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.createConnecti
on(UserCredentialsConnectionFactoryAdapter.java:150)
        at
org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
        at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:456)
        at
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.ja
va:195)
        at
org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:375)
        at
org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:320)
        at
org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:150)
        at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBrid
ge.process(AsyncProcessorTypeConverter.java:50)
        ... 38 more
-- 
View this message in context: http://camel.465427.n5.nabble.com/Not-able-to-connect-Oracle-queue-endpoint-tp3258725p3258725.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not able to connect Oracle queue endpoint

Posted by hraviprakash <ra...@asia.xchanging.com>.
I was using orai18n.jar and aqapi13.jar jars.  I removed oari18.jar and used
aqapi.jar instead of aqapi13.jar, this solved my issue and oracle jms
received the files successfully.  

Thanks for the inputs.   
-- 
View this message in context: http://camel.465427.n5.nabble.com/Not-able-to-connect-Oracle-queue-endpoint-tp3258725p3259062.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not able to connect Oracle queue endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Nov 10, 2010 at 5:54 PM, hraviprakash
<ra...@asia.xchanging.com> wrote:
>
> Thanks for the reply.  Honestly I been googling whole day and trying out
> different options and still I am not able to get the oracle queue running.
> I will look further.  Any clues on the topic would be helpful.  Any clues on
> the code that i posted would be greatfull.
> --

Are you sure you are using the right versions of the OracleAQ jars.
Its kinda like JMS API 1.0.2 or 1.1 compliant.
Looks like you got some exception on the API not matching the spring
stuff you got for user login.



> View this message in context: http://camel.465427.n5.nabble.com/Not-able-to-connect-Oracle-queue-endpoint-tp3258725p3259004.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Not able to connect Oracle queue endpoint

Posted by hraviprakash <ra...@asia.xchanging.com>.
Thanks for the reply.  Honestly I been googling whole day and trying out
different options and still I am not able to get the oracle queue running. 
I will look further.  Any clues on the topic would be helpful.  Any clues on
the code that i posted would be greatfull.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Not-able-to-connect-Oracle-queue-endpoint-tp3258725p3259004.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not able to connect Oracle queue endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You got this error
Caused by: java.lang.AbstractMethodError:
oracle.jms.AQjmsQueueConnectionFactory.createConnection(Lj
ava/lang/String;Ljava/lang/String;)Ljavax/jms/Connection;

Maybe try googling a bit. And there has been several posts at Camel
mailing list about how to use Camel with OracleAQ.
Mind that you may have to use Camel 2.4 or better because we have
fixed a couple of issues with OracleAQ not allows some API call in
JMX.



On Wed, Nov 10, 2010 at 3:19 PM, hraviprakash
<ra...@asia.xchanging.com> wrote:
>
> Hi,
>
> I want to poll a FTP Server and push the file to oracle queue. I use spring
> configuration and on while running I am getting the below error.  Please let
> me know whether the camel configurations are correct and let me know where
> its breaking.
> <p/>
> My pom.xml includes following libraries camel-core, camel-spring,
> activemq-camel, xbean-spring, camel-ftp, camel-jms, junit, commons-logging,
> log4j, ojdbc14, aqapi13, spring and orai18n
> <p/>
> My configurations are as <p/>
> <beans xmlns="http://www.springframework.org/schema/beans"
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       xsi:schemaLocation="
>       http://www.springframework.org/schema/beans
>       http://www.springframework.org/schema/beans/spring-beans.xsd
>       http://camel.apache.org/schema/spring
>       http://camel.apache.org/schema/spring/camel-spring.xsd
>       http://activemq.apache.org/schema/core
>       http://activemq.apache.org/schema/core/activemq-core.xsd">
>
>  <camelContext xmlns="http://camel.apache.org/schema/spring">
>    <package>org.fusesource.camel</package>
>    <route id="test">
>            <from
> uri="ftp://ravi@vmswinserver/ravi?password=ravi&amp;binary=true&amp;consumer.delay=60000"/>
>            <to uri="oracleQueue:queue:RAVI_TEST_Q"/>
>        </route>
>  </camelContext>
>
>        <!-- without the following bean instantiation, we will get an
> oracle.jms.AQjmsException with each and every received message -->
>    <bean id="requiredBeanForOracleAq"
> class="org.apache.activemq.ActiveMQConnectionFactory" />
>
>    <bean id="connectionFactoryOracleAQQueue"
> class="oracle.jms.AQjmsFactory" factory-method="getQueueConnectionFactory">
>        <constructor-arg index="0">
>            <value>jdbc:oracle:thin:@172.29.174.51:1521:vmsoff</value>
>        </constructor-arg>
>        <constructor-arg index="1" type="java.util.Properties">
>            <value></value>
>        </constructor-arg>
>    </bean>
>
>    <bean id="oracleQueueCredentials"
> class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
>        <property name="targetConnectionFactory">
>            <ref bean="connectionFactoryOracleAQQueue" />
>        </property>
>        <property name="username">
>            <value>ravi</value>
>        </property>
>        <property name="password">
>            <value>ravi</value>
>        </property>
>    </bean>
>
>    <bean id="message_converter"
> class="org.springframework.jms.support.converter.SimpleMessageConverter102"/>
>
>    <bean id="oracleQueue"
> class="org.apache.camel.component.jms.JmsComponent">
>        <property name="connectionFactory" ref="oracleQueueCredentials" />
>        <property name="messageConverter"
> ref="message_converter"></property>
>   </bean>
>
> </beans>
> <p/>Exceptions<p/>
> SEVERE: Caused by: [org.apache.camel.CamelExecutionException - Exception
> occurred during execution o
> n the exchange: Exchange[GenericFileMessage with file:
> GenericFile[publish.JPG]]]
> org.apache.camel.CamelExecutionException: Exception occurred during
> execution on the exchange: Excha
> nge[GenericFileMessage with file: GenericFile[publish.JPG]]
>        at
> org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1142)
>        at
> org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:263)
>        at
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBrid
> ge.process(AsyncProcessorTypeConverter.java:53)
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at
> org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)
>        at
> org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)
>        at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java
> :98)
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
>
>        at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.jav
> a:68)
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java
> :98)
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
>
>        at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
>
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java
> :98)
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
>
>        at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.jav
> a:68)
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHand
> ler.java:290)
>        at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202
> )
>        at
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
>        at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java
> :98)
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
>
>        at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.jav
> a:68)
>        at
> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.j
> ava:313)
>        at
> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java
> :144)
>        at
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:110)
>        at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:98)
>        at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>        at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
>        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Scheduled
> ThreadPoolExecutor.java:98)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Schedule
> dThreadPoolExecutor.java:181)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadP
> oolExecutor.java:205)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.AbstractMethodError:
> oracle.jms.AQjmsQueueConnectionFactory.createConnection(Lj
> ava/lang/String;Ljava/lang/String;)Ljavax/jms/Connection;
>        at
> org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.doCreateConnec
> tion(UserCredentialsConnectionFactoryAdapter.java:175)
>        at
> org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.createConnecti
> on(UserCredentialsConnectionFactoryAdapter.java:150)
>        at
> org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
>        at
> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:456)
>        at
> org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.ja
> va:195)
>        at
> org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:375)
>        at
> org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:320)
>        at
> org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:150)
>        at
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBrid
> ge.process(AsyncProcessorTypeConverter.java:50)
>        ... 38 more
> --
> View this message in context: http://camel.465427.n5.nabble.com/Not-able-to-connect-Oracle-queue-endpoint-tp3258725p3258725.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/