cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot read Spring bean from ServiceMix

josh3006
Champ in-the-making
Champ in-the-making
Hi,

I would like to read my spring.xml from a jar file which I deployed in Servicemix.
Activiti Engine is also running on the same Servicemix. Currently, I'm unable to read Spring bean.

Please find the xml below which located in META-INF

root
–META-INF
—-Spring.xml



<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:osgi="http://www.springframework.org/schema/osgi"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="
            http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/osgi
            http://www.springframework.org/schema/osgi/spring-osgi.xsd">

    <bean id="helloWorldService" class="com.bw.osgi.provider.impl.HelloWorldServiceImpl"/>

    <osgi:service ref="helloWorldService" interface="com.bw.osgi.provider.able.HelloWorldService"/>
</beans>

I'm trying to use Expression to read this bean
${helloWorldService}
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
Do you have an exception?

I'm no expert in osgi, but this sounds more like an osgi problem than an Activiti one?

josh3006
Champ in-the-making
Champ in-the-making
Please find the error stacks as below :-

It say "Unknown property used in expression" when I use the expression.

com.vaadin.event.ListenerMethod$MethodException
Cause: org.activiti.engine.ActivitiException: Unknown property used in expression
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)[210:com.vaadin:6.6.2]
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)[210:com.vaadin:6.6.2]
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)[210:com.vaadin:6.6.2]
at com.vaadin.ui.Button.fireClick(Button.java:539)[210:com.vaadin:6.6.2]
at com.vaadin.ui.Button.changeVariables(Button.java:206)[210:com.vaadin:6.6.2]
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1299)[210:com.vaadin:6.6.2]
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1219)[210:com.vaadin:6.6.2]
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:735)[210:com.vaadin:6.6.2]
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)[210:com.vaadin:6.6.2]
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)[210:com.vaadin:6.6.2]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)[109Smiley Surprisedrg.apache.geronimo.specs.geronimo-servlet_2.5_spec:1.1.2]

josh3006
Champ in-the-making
Champ in-the-making
Yes. you are right, this looks like issue with Servicemix.
I had to add my bean in applicationContext.xml in activiti-explorer
eg : \apache-tomcat-6.0.35\webapps\activiti-explorer\WEB-INF\applicationContext.xml

But I was wondering, why we need to define our bean in here ?
I already define my bean inside my jar file.. Why activiti did not find the bean

jbarrez
Star Contributor
Star Contributor
The explorer app indeed boots its engine using that spring config file, it doesn't use the ProcessEngines class. That's the reason why it doesn't pick up the engine config.