XML Configuration error
sunls Jun 18, 2010 2:57 AMIn using of XML Configuration Module, WELD-001409 error happened.
Run Environment:JBoss6.0.0 M2,Seam XML Module Alpha1,Weld Extension Alpha1
12:55:01,828 ERROR [AbstractKernelController] Error installing to Start: name=vfsfile:/C:/opt/jboss-6.0.0.20100216-M2/se rver/default/deploy/weld-translator.war/_WeldBootstrapBean state=Create: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Injection point has ambiguous dependencies. Injection point: field translator.InjectTest.map; Qualifiers: [@javax.enterprise.inject.Default()]; Possible dependencies: [org.jboss.weld.bean-flat-ProducerMethod-test.xml.XMLCls. method getMap(), org.jboss.weld.bean-flat-ProducerMethod-test.xml.XMLCls.method getMap()] at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:268) at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:113) at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:132) at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:314) at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:300) at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:397) at org.jboss.weld.integration.deployer.env.helpers.BootstrapBean.boot(BootstrapBean.java:121) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59) at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:151) at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelCont rollerContextAction.java:257) ...
Class and configuration file:
public class XMLCls { public int data; public Map<String,String> getMap(){ Map<String,String> map = new HashMap<String,String>(); map.put("name","John"); return map; } } public class InjectTest { @Inject Map<String,String> map; ... } beans.xml: <test:XMLCls> <s:extends/> <test:getMap> <s:Produces/> </test:getMap> <test:data>200</test:data> </test:XMLCls>
But, remove flowing code from beans.xml, error did not occur.Why?
<test:data>200</test:data>