camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arthanarisamy Annamalai <saran.sha...@gmail.com>
Subject Re: Handling ProducerTemplate Timeout + EJB
Date Fri, 19 Sep 2014 11:27:57 GMT
Hi Willem Jiang,

First of all thanks a lot for your reply and which gave me some insight on
ProducerTemplate threads in waiting state.

I have one more issue. 

I am invoking an EJB which is deployed in Jboss jboss-as-7.1.1.Final. Below
is piece of code i am using to invoke and EJB. 

private void sendRequest() { 
                String camelID = "jbossejb"; 
                Exchange furExchange = null; 
                Message msg = null; 
                final Employee employee = new Employee(); 
                ProducerTemplate pProducerTemplate = getProducerTemplate(); 
                Endpoint endPoint =
springCamelContext.getEndpoint("jbossejb"); 
                Future<Exchange> futurexchange = (Future<Exchange>)
pProducerTemplate 
                                .asyncSend(endPoint, new Processor() { 
                                        public void process(Exchange
exchange) throws Exception { 
                                               
exchange.getIn().setBody(employee); 
                                        } 

                                }); 
                
                
                System.out.println("futurexchange:" + futurexchange); 
                try { 
                        furExchange = futurexchange.get(15000,
TimeUnit.SECONDS); 
                } catch (InterruptedException e) { 
                        // TODO Auto-generated catch block 
                        e.printStackTrace(); 
                } catch (ExecutionException e) { 
                        // TODO Auto-generated catch block 
                        e.printStackTrace(); 
                } catch (TimeoutException e) { 
                        // TODO Auto-generated catch block 
                        e.printStackTrace(); 
                } 

                if (furExchange.getException() == null) { 
                        msg = furExchange.getOut(); 
                        String messageId =
furExchange.getIn().getMessageId(); 
                        System.out.println("In Camel MessageID -:" +
messageId); 
                        msg = furExchange.getOut(); 
                        System.out.println("Message:" + msg); 
                } else { 
                        Exception ex = furExchange.getException(); 
                        ex.printStackTrace(); 
                } 
        } 


JNDI details are below 

 <bean id="ejb" class="org.apache.camel.component.ejb.EjbComponent">  
        <property name="properties" ref="jndiProperties" />  
    </bean>  
    <util:properties id="jndiProperties">  
      <prop   
key="java.naming.factory.initial">org.jboss.naming.remote.client.InitialContextFactory</prop>
        <prop key="java.naming.provider.url">remote://localhost:4447</prop>  
          <prop key="jboss.naming.client.ejb.context">true</prop>
        <prop key="java.naming.security.principal">jboss7</prop>  
        <prop key="java.naming.security.credentials">password</prop>  
    </util:properties>  


Exception java.lang.IllegalStateException is thrown with the stack trace
below 

java.lang.IllegalStateException: No EJB receiver available for handling
[appName:,modulename:MappedEJBModule,distinctname:] combination for
invocation context org.jboss.ejb.client.EJBClientInvocationContext@508894e3 
        at
org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584) 
        at
org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119) 
        at
org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)

        at
org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136) 
        at
org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121) 
        at
org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104) 
        at com.sun.proxy.$Proxy35.receiveEmployee(Unknown Source) 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
        at java.lang.reflect.Method.invoke(Method.java:606) 
        at
org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:407) 
        at
org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:278) 
        at
org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:251) 
        at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:166) 
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105) 
        at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:67) 
        at
org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:103) 
        at
org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71) 
        at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)

        at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)

        at
org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:73) 
        at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:378) 
        at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:346) 
        at
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:242) 
        at
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:346) 
        at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:184) 
        at
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:124) 
        at
org.apache.camel.impl.DefaultProducerTemplate$13.call(DefaultProducerTemplate.java:612) 
        at
org.apache.camel.impl.DefaultProducerTemplate$13.call(DefaultProducerTemplate.java:610) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
        at java.lang.Thread.run(Thread.java:745) 


I am able to receive the response when the EJB is deployed in any other
Application Servers(IBM Websphere and Weblogic). 

Please let me know what is causing issue in Jboss. 




--
View this message in context: http://camel.465427.n5.nabble.com/Re-Handling-ProducerTemplate-Timeout-EJB-tp5749764p5756737.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message