[jboss-user] [Microcontainer] - directly injecting a bean in a property

bryan.kearney do-not-reply at jboss.com
Tue Mar 24 19:24:56 EDT 2009


Following the docs here:

http://www.jboss.org/file-access/default/members/jbossmc/freezone/docs/2.0.x/userGuide/ch11s03.html

I attempted to replace this xml:


  | 	<bean name="Muppet" class="org.apache.qpid.agent.Muppet" />
  | 
  | 	<bean name="Kermit" class="org.apache.qpid.agent.ManagedObject">
  | 		<property name="name">Muppet</property>
  | 		<property name="managed">
  | 			<inject bean="Muppet" />			
  | 		</property>
  | 		<property name="adapter">
  | 			<inject bean="POJOAdapter" />
  | 		</property>
  | 	</bean>
  | 

with this:


  | 	<bean name="Kermit" class="org.apache.qpid.agent.ManagedObject">
  | 		<property name="name">Muppet</property>
  | 		<property name="managed">
  |             <bean name="Muppet" class="org.apache.qpid.agent.Muppet" />			
  | 		</property>
  | 		<property name="adapter">
  | 			<inject bean="POJOAdapter" />
  | 		</property>
  | 	</bean>
  | 

But I get the following excption: 


  | Caused by: org.xml.sax.SAXException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'bean'. One of '{"urn:jboss:bean-deployer:2.0":value, "urn:jboss:bean-deployer:2.0":inject, "urn:jboss:bean-deployer:2.0":value-factory, "urn:jboss:bean-deployer:2.0":collection, "urn:jboss:bean-deployer:2.0":list, "urn:jboss:bean-deployer:2.0":set, "urn:jboss:bean-deployer:2.0":array, "urn:jboss:bean-deployer:2.0":map, "urn:jboss:bean-deployer:2.0":null, "urn:jboss:bean-deployer:2.0":this, WC[##other:"urn:jboss:bean-deployer:2.0"], "urn:jboss:bean-deployer:2.0":annotation}' is expected. 
  | 

I scanned JIRA but did not see a bug. Is the documentation correct?

-- bk



View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220780#4220780

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220780



More information about the jboss-user mailing list