I have a spring configuration file config.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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="Configuration" class="A">
<constructor-arg value="config.xml" />
</bean>
<bean id="process" factory-bean="Configuration" factory-method="build"
/>
<bean id="rep" factory-bean="process" factory-method="getRep" />
<bean id="exec" factory-bean="process" factory-method="getExec" />
</beans>
And web.xml
-------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<display-name>Example</display-name>
<context-param>
<param-name>tapestry.app-package</param-name>
<param-value>com.ui</param-value>
</context-param>
<filter>
<filter-name>app</filter-name>
<filter-class>org.apache.tapestry5.spring.TapestrySpringFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>app</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<description>Init Spring ApplicationContext</description>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config.xml</param-value>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</context-param>
</web-app>
---------
in my class
i am using
@Inject
private Process process;
I get exception
Caused by: java.lang.IllegalArgumentException: Spring context contains 2
beans a
ssignable to type org.Process: Configuration, process.
at
org.apache.tapestry5.internal.spring.SpringModuleDef$4$1.provide(Spri
ngModuleDef.java:258)
at
org.apache.tapestry5.internal.spring.SpringModuleDef$4$2$1.invoke(Spr
ingModuleDef.java:274)
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(Operati
onTrackerImpl.java:68)
And if I use
-----------
@Inject
@Service("Process")
private Process process;
Caused by: java.lang.RuntimeException: Service id 'Process' is not defined
by any module. Defined services: ActionRenderResponseGenerator, AjaxComp..
--
View this message in context:
http://old.nabble.com/Problem-with-spring-integration-tp28464988p28464988.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]