How is the channel injected ? Did you tag it with the @Resource annotation ?
On Fri, Jan 9, 2009 at 09:03, brijesh <[email protected]> wrote: > > my code in bean as follows > > > public void onMessageExchange(MessageExchange exchange) throws > MessagingException { > > if (exchange.getStatus() == ExchangeStatus.ACTIVE) { > logger.debug("## Received exchange with status > ACTIVE:ContractSchemaDataMapper " + exchange); > System.out.println("## Received exchange with status > ACTIVE:ContractSchemaDataMapper " + exchange); > InOut inOut = (InOut)exchange; > NormalizedMessage normalizedMessage = inOut.getInMessage(); > String outMessage = processXml(normalizedMessage); > //String outMessage ="<sample>this is sample xml</sample>"; > normalizedMessage.setContent(new StringSource(outMessage)); > MessageUtil.transferInToOut(inOut, inOut); > channel.send(inOut); > } else{ > logger.debug("## Received exchange but status not ACTIVE: " + > exchange); > } > } > > when i am sending the channel , channel,send(inOut), I am getting null > pointer > > xbean config as follows > > > <beans xmlns="http://www.springframework.org/schema/beans" > xmlns:bean="http://servicemix.apache.org/bean/1.0" > xmlns:eka="http://ekaplus.com/contract" > xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://servicemix.apache.org/bean/1.0 > http://servicemix.apache.org/schema/servicemix-bean-3.2.3.xsd > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> > > <bean:endpoint service="eka:createContractDataMapper" > endpoint="endpointDM" bean="#contractSchemaDatamapper"/> > > <bean id="contractSchemaDatamapper" > class="com.ekaplus.physical.contract.ContractSchemaDataMapper"/> > > </beans> > > > my eip xbean as follows , i am routing it from eip config as follows > > <beans xmlns:eip="http://servicemix.apache.org/eip/1.0" > xmlns:eka="http://ekaplus.com/contract" > xmlns="http://www.springframework.org/schema/beans" > xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://servicemix.apache.org/eip/1.0 > http://servicemix.apache.org/schema/servicemix-eip-3.2.3.xsd > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> > > <eip:static-routing-slip service="eka:contractBeanRouter" > endpoint="contractBeanRouterEP"> > <eip:targets> > <eip:exchange-target service="eka:createContractDataMapper" /> > <eip:exchange-target service="eka:createContract" /> > </eip:targets> > </eip:static-routing-slip> > > > > </beans> > > > regards > > Brijesh N K > > > > > > > > gnodet wrote: >> >> Can you paste your bean code please and the xml configuration of the >> endpoint ? >> The channel is injected before the bean is used, so it might be a >> concurrency issue ... >> >> On Fri, Jan 9, 2009 at 06:59, brijesh <[email protected]> wrote: >>> >>> Hello , >>> >>> I am getting the null channel in smx bean component, following is stack >>> trace , >>> this problem is not very consistent, some time its working fine. >>> >>> I am using smx version 3.3.1 >>> >>> Any idea on this ? following is stack trace >>> >>> java.lang.NullPointerException >>> at >>> com.ekaplus.physical.contract.ContractSchemaDataMapper.onMessageExchange(ContractSchemaDataMapper.java:65) >>> at >>> org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:226) >>> at >>> org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:212) >>> at >>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:600) >>> at >>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:554) >>> at >>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:510) >>> at >>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60) >>> at >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623) >>> at >>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172) >>> at >>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168) >>> at >>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) >>> at java.lang.Thread.run(Thread.java:595) >>> INFO - PhaseInterceptorChain - Interceptor has thrown >>> exception, >>> unwinding now >>> org.apache.cxf.interceptor.Fault >>> at >>> org.apache.servicemix.cxfbc.CxfBcConsumer$JbiPostInvokerInterceptor.handleMessage(CxfBcConsumer.java:722) >>> at >>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:226) >>> at >>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89) >>> at >>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:295) >>> at >>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:258) >>> at >>> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70) >>> at >>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) >>> at >>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) >>> at >>> org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49) >>> at >>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) >>> at org.mortbay.jetty.Server.handle(Server.java:324) >>> at >>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) >>> at >>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879) >>> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741) >>> at >>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213) >>> at >>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403) >>> at >>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) >>> at >>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522) >>> Caused by: java.lang.NullPointerException >>> at >>> com.ekaplus.physical.contract.ContractSchemaDataMapper.onMessageExchange(ContractSchemaDataMapper.java:65) >>> at >>> org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:226) >>> at >>> org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:212) >>> at >>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:600) >>> at >>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:554) >>> at >>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:510) >>> at >>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60) >>> at >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623) >>> at >>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172) >>> at >>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168) >>> at >>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) >>> at java.lang.Thread.run(Thread.java:595) >>> >>> >>> thanks >>> >>> Brijesh N K >>> -- >>> View this message in context: >>> http://www.nabble.com/Null-Channel-tp21366698p21366698.html >>> Sent from the ServiceMix - User mailing list archive at Nabble.com. >>> >>> >> >> >> >> -- >> Cheers, >> Guillaume Nodet >> ------------------------ >> Blog: http://gnodet.blogspot.com/ >> ------------------------ >> Open Source SOA >> http://fusesource.com >> >> > > -- > View this message in context: > http://www.nabble.com/Null-Channel-tp21366698p21367783.html > Sent from the ServiceMix - User mailing list archive at Nabble.com. > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com
