You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by gnanda1 <gi...@hotmail.com> on 2010/08/09 18:34:46 UTC

getting reference to a jbi context

Hi All,
I  am using smx4.2.
 I am deploying it as a OSGi bundle and passing context as below

	 
	
	
Inside the CommandProcessor class I ahve
		private ComponentContext context;
	public void setContext(javax.jbi.component.ComponentContext context) {
		  this.context = context;
		}
I am getting exception as below

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No bean named 'context' is defined
	at
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:387)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:971)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:246)
	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)


	Here is my xbean.xml





	
		
		

		
			
				classpath:com.pf.management.resourcemanager.properties
				
				file:///${karaf.home}/etc/com.pf.application.properties
				
			
		
	


	 
	
	
	


	
	




Please suggest

-- 
View this message in context: http://servicemix.396122.n5.nabble.com/getting-reference-to-a-jbi-context-tp2269067p2269067.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: getting reference to a jbi context

Posted by Freeman Fang <fr...@gmail.com>.
I think I answered you in "sending a message to a jbi endpoint from a  
custom MBean"

Freeman
On 2010-8-10, at 上午12:52, gnanda1 wrote:

>
> Sorry... the xbean.xml file was not pasted properly. Here it is..
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:amq="http://activemq.apache.org/schema/core"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns:osgi="http://www.springframework.org/schema/osgi"
> xmlns:bean="http://servicemix.apache.org/bean/1.0"
> 	xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:mb="urn:com.pf.management"
> 	xmlns:sm="http://servicemix.apache.org/config/1.0"
> 	xsi:schemaLocation="http://www.springframework.org/schema/beans
> 	http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>  http://activemq.apache.org/schema/core
>  http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd
>  http://activemq.apache.org/camel/schema/spring
>   http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
>  http://www.springframework.org/schema/osgi
>  http://www.springframework.org/schema/osgi/spring-osgi.xsd
>  	http://www.springframework.org/schema/context
> 		http://www.springframework.org/schema/context/spring-context.xsd
> 		http://servicemix.apache.org/config/1.0
> 		   http://servicemix.apache.org/bean/1.0
>   http://servicemix.apache.org/bean/1.0/servicemix-bean.xsd">
>
>
> 	<bean
> 	
> class 
> = 
> "org 
> .springframework.beans.factory.config.PropertyPlaceholderConfigurer">
> 		<!-- <property name="ignoreResourceNotFound" value="true"/>-->
> 		<property name="systemPropertiesModeName"
> value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
>
> 		<property name="locations">
> 			<list>
> 				<value>classpath:com.pf.management.resourcemanager.properties
> 				</value>
> 				<value>file:///${karaf.home}/etc/com.pf.application.properties
> 				</value>
> 			</list>
> 		</property>
> 	</bean>
>
> <bean id="commandprocessor"  
> class="com.pf.management.CommandProcessor">
> 	 <property name="context"  ref="context" />
> 	
> 	</bean>
> 	
>
>
> 	<!-- use this special class to register the endpoints with the NMR  
> -->
> 	<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
>
>
> </beans>
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/getting-reference-to-a-jbi-context-tp2269067p2269085.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: getting reference to a jbi context

Posted by gnanda1 <gi...@hotmail.com>.
Sorry... the xbean.xml file was not pasted properly. Here it is..
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:bean="http://servicemix.apache.org/bean/1.0"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:mb="urn:com.pf.management"
	xmlns:sm="http://servicemix.apache.org/config/1.0"
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
	http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://activemq.apache.org/schema/core 
  http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd   
  http://activemq.apache.org/camel/schema/spring
   http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
  http://www.springframework.org/schema/osgi 
  http://www.springframework.org/schema/osgi/spring-osgi.xsd
  	http://www.springframework.org/schema/context
		http://www.springframework.org/schema/context/spring-context.xsd
		http://servicemix.apache.org/config/1.0 
		   http://servicemix.apache.org/bean/1.0
   http://servicemix.apache.org/bean/1.0/servicemix-bean.xsd">


	<bean
	
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<!-- <property name="ignoreResourceNotFound" value="true"/>-->
		<property name="systemPropertiesModeName"
value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />

		<property name="locations">
			<list>
				<value>classpath:com.pf.management.resourcemanager.properties
				</value>
				<value>file:///${karaf.home}/etc/com.pf.application.properties
				</value>
			</list>
		</property>
	</bean>

<bean id="commandprocessor" class="com.pf.management.CommandProcessor">
	 <property name="context"  ref="context" />
	
	</bean>
	


	<!-- use this special class to register the endpoints with the NMR -->
	<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />


</beans>
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/getting-reference-to-a-jbi-context-tp2269067p2269085.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.