Re: the first error, it looks like Spring is trying to inject your class 'by
type', but isn't sure which of two Process beans to use.  I only see one
from the snippet you've attached, is it possible that there's another one?

As far as the second error goes, the ids are probably case sensitive -
'Process' vs. 'process'.

On Wed, May 5, 2010 at 2:52 PM, Captain Cid <captain_...@indiatimes.com>wrote:

>
> 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: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to