yeas , i am annotating as follows
@Resource
private DeliveryChannel channel;
Often i am getting following error also while deploying
.....................
16:31:34,416 | ERROR | Timer-3 | BeanComponent |
on.xbean.AbstractXBeanDeployer 102 |
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.apache.servicemix.bean.BeanEndpoint#0' defined in file
[C:\apache-servicemix-3.3.1\data\smx\service-assemblies\sa-contract\version_1\sus\servicemix-bean\pojo-contract\xbean.xml]:
Cannot resolve reference to bean 'createContract' while setting bean
property 'bean'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'createContract' defined in file
[C:\apache-servicemix-3.3.1\data\smx\service-assemblies\sa-contract\version_1\sus\servicemix-bean\pojo-contract\xbean.xml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [com.ekaplus.physical.contract.CreateContract]: Constructor threw
exception; nested exception is java.lang.Error: Unresolved compilation
problems:
..........................
......................
.....................
<loc-message>Error creating bean with name
'org.apache.servicemix.bean.BeanEndpoint#0' defined in file
[C:\apache-servicemix-3.3.1\data\smx\service-assemblies\sa-contract\version_1\sus\servicemix-bean\dm-contract\xbean.xml]:
Cannot resolve reference to bean 'contractSchemaDatamapper' while setting
bean property 'bean'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'contractSchemaDatamapper' defined in file
[C:\apache-servicemix-3.3.1\data\smx\service-assemblies\sa-contract\version_1\sus\servicemix-bean\dm-contract\xbean.xml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [com.ekaplus.physical.contract.ContractSchemaDataMapper]:
Constructor threw exception; nested exception is java.lang.Error: Unresolved
compilation problems:
The import javax.annotation cannot be resolved
Resource cannot be resolved to a type
</loc-message>
<stack-trace><![CDATA[org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.apache.servicemix.bean.BeanEndpoint#0'
defined in file
[C:\apache-servicemix-3.3.1\data\smx\service-assemblies\sa-contract\version_1\sus\servicemix-bean\dm-contract\xbean.xml]:
Cannot resolve reference to bean 'contractSchemaDatamapper' while setting
bean property 'bean'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'contractSchemaDatamapper' defined in file
[C:\apache-servicemix-3.3.1\data\smx\service-assemblies\sa-contract\version_1\sus\servicemix-bean\dm-contract\xbean.xml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [com.ekaplus.physical.contract.ContractSchemaDataMapper]:
Constructor threw exception; nested exception is java.lang.Error: Unresolved
compilation problems:
The import javax.annotation cannot be resolved
Resource cannot be resolved to a type
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at
org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:86)
at
org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
at
org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:520)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.checkPendingSAs(AutoDeploymentService.java:483)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.checkPendingComponents(AutoDeploymentService.java:536)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateSharedLibrary(AutoDeploymentService.java:318)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:255)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:668)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:63)
at
org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:632)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'contractSchemaDatamapper' defined in file
[C:\apache-servicemix-3.3.1\data\smx\service-assemblies\sa-contract\version_1\sus\servicemix-bean\dm-contract\xbean.xml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [com.ekaplus.physical.contract.ContractSchemaDataMapper]:
Constructor threw exception; nested exception is java.lang.Error: Unresolved
compilation problems:
The import javax.annotation cannot be resolved
Resource cannot be resolved to a type
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
... 28 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class
[com.ekaplus.physical.contract.ContractSchemaDataMapper]: Constructor threw
exception; nested exception is java.lang.Error: Unresolved compilation
problems:
The import javax.annotation cannot be resolved
Resource cannot be resolved to a type
at
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
... 39 more
Caused by: java.lang.Error: Unresolved compilation problems:
The import javax.annotation cannot be resolved
Resource cannot be resolved to a type
at
com.ekaplus.physical.contract.ContractSchemaDataMapper.<init>(ContractSchemaDataMapper.java:25)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
... 41 more
Any idea on this???
gnodet wrote:
>
> 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
>
>
--
View this message in context:
http://www.nabble.com/Null-Channel-tp21366698p21370295.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.