camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Camel Hive Issue
Date Wed, 06 Apr 2016 05:09:46 GMT
What version of Camel do you use?

On Tue, Apr 5, 2016 at 9:13 PM, VinothKR <vinsmailid@gmail.com> wrote:
> Hi,
>  I was trying to connect to hive through camel using jdbc and got
> IllegalMonitorStateException. In exchange i was able to see the data fetched
> from hive table but error was thrown when JDBCProducer tried to close the
> result set.
>
> *Logs:*
> Message History
> ---------------------------------------------------------------------------------------------------------------------------------------
> RouteId              ProcessorId          Processor
> Elapsed (ms)
> [uaasRoute         ] [uaasRoute         ] [direct://hivein
> ] [      3690]
> [uaasRoute         ] [setBody1          ] [setBody[constant{select * from
> uaas_cl_poc.proactive_gcplimit}]               ] [         0]
> [uaasRoute         ] [to1               ]
> [jdbc:hive-ds?resetAutoCommit=false
> ] [      3690]
>
> Exchange
> ---------------------------------------------------------------------------------------------------------------------------------------
> Exchange[
>        Id                  ID-PHX2MYMV32-54123-1459807338148-0-2
>        ExchangePattern     InOut
>        Headers
> {breadcrumbId=ID-PHX2MYMV32-54123-1459807338148-0-1, CamelRedelivered=false,
> CamelRedeliveryCounter=0}
>        BodyType            String
>        Body                select * from uaas_cl_poc.proactive_gcplimit
> ]
>
> Stacktrace
> ---------------------------------------------------------------------------------------------------------------------------------------
> java.lang.IllegalMonitorStateException
>        at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(Unknown
> Source)
>        at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.release(Unknown
> Source)
>        at java.util.concurrent.locks.ReentrantLock.unlock(Unknown Source)
>        at
> org.apache.hive.jdbc.HiveStatement.closeClientOperation(HiveStatement.java:177)
>        at
> org.apache.hive.jdbc.HiveQueryResultSet.close(HiveQueryResultSet.java:293)
>        at
> org.apache.camel.component.jdbc.JdbcProducer.closeQuietly(JdbcProducer.java:246)
>        at
> org.apache.camel.component.jdbc.JdbcProducer.doCreateAndExecuteSqlStatement(JdbcProducer.java:236)
>        at
> org.apache.camel.component.jdbc.JdbcProducer.createAndExecuteSqlStatement(JdbcProducer.java:123)
>        at
> org.apache.camel.component.jdbc.JdbcProducer.processingSqlWithoutSettingAutoCommit(JdbcProducer.java:111)
>        at
> org.apache.camel.component.jdbc.JdbcProducer.process(JdbcProducer.java:67)
>
>
> Log showing data fetched from table:
> Exception in thread "main" org.apache.camel.CamelExecutionException:
> Exception occurred during execution on the exchange:
> Exchange[ID-PHX2MYMV32-54123-1459807338148-0-2][Message:
> [{proactive_gcplimit.spend=100.0, proactive_gcplimit.pd=10.0,
> proactive_gcplimit.ead=10.0, proactive_gcplimit.lgd=12345.0,
> proactive_gcplimit.obligorid=23456, proactive_gcplimit.caseid=null,
> proactive_gcplimit.timestamp=null, proactive_gcplimit.source=0.09,
> proactive_gcplimit.sic=corp, proactive_gcplimit.final_rating=null,
> proactive_gcplimit.cid_level=null, proactive_gcplimit.mkt_code=null},
> {proactive_gcplimit.spend=90.0, proactive_gcplimit.pd=9.0,
> proactive_gcplimit.ead=9.0, proactive_gcplimit.lgd=12346.0,
> proactive_gcplimit.obligorid=23457, proactive_gcplimit.caseid=null,
> proactive_gcplimit.timestamp=null, proactive_gcplimit.source=0.01,
> proactive_gcplimit.sic=obl, proactive_gcplimit.final_rating=null,
> proactive_gcplimit.cid_level=null, proactive_gcplimit.mkt_code=null}]]
>        at
> org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1658)
>        at
> org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.java:646)
>        at
> org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:471)
>        at
> org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:133)
>        at
> org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:149)
>        at
> org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:301)
>        at
> aexp.uaas.camel.standalone.StandaloneTest.main(StandaloneTest.java:23)
> Caused by: java.lang.IllegalMonitorStateException
>        at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(Unknown
> Source)
>
>
> ----------------------------------------------------------------------------------------------------------------
>
> *Camel Route:*
> <route id="uaasRoute">
> <from uri="direct:hivein"/>
> <setBody>
> <constant>select * from uaas_cl_poc.proactive_gcplimit</constant>
> </setBody>
> <to uri="jdbc:hive-ds?resetAutoCommit=false"/>
> <to uri="mock:result"/>
> </route>
>
> *Hive Datasource Bean*
>
> <bean id="hive-driver" class="org.apache.hadoop.hive.jdbc.HiveDriver" />
>
> <bean id="hive-ds"
>         class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
> <property name="driverClass" value="org.apache.hive.jdbc.HiveDriver" />
> <property name="url"
>         value="jdbc:hive2://url" />
> <property name="username" value="uname" />
> <property name="password" value="pwd" />
> </bean>
>
> *Java Code:*
> CamelContext camel = SpringCamelContext.springCamelContext(appContext);
> ProducerTemplate template = camel.createProducerTemplate();
> camel.start();
> Object out = template.requestBody("direct:hivein","Test");
> System.out.println(out);
> camel.stop();
>
> Please assist.
> Thanks,
> Vinoth.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Hive-Issue-tp5780522.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message