[jboss-user] [Microcontainer] - Re: Code example for a basic parsing deployer

david.lloyd@jboss.com do-not-reply at jboss.com
Wed Apr 2 10:55:46 EDT 2008

"alesj" wrote : I think you're misusing BasicXMLDeployer.

Well I certainly won't argue that.

"alesj" wrote : This one expects KernelDeployment. As the exception and code clearly say. :-)
  | So your URL must point to MC beans xml file.

Right - my -beans.xml looks like this (not using the new stuff quite yet):

<deployment xmlns="urn:jboss:bean-deployer:2.0">
  |     <bean name="RemotingMetaDataParser" class="org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer">
  |         <constructor>
  |             <parameter>org.jboss.cx.remoting.metadata.RemotingMetaData</parameter>
  |         </constructor>
  |         <property name="name">jboss-remoting.xml</property>
  |         <property name="registerWithJBossXB">true</property>
  |     </bean>
  | </deployment>

...based on previous examples given here and elsewhere.

"alesj" wrote : OK, I'm guessing here.  You have a file that is your custom xml.  And you want to get RemotingMD out.

Not quite.  I don't really care about getting my RemotingMetaData out.  I just want the container to pull the BeanMetaData from it (it implements BeanMetaDataFactory) and use it to create the actual deployment.  Adrian stated that you don't need to write a deployer if you use the JAXB annotations, and this is exactly what I'm trying to do.

"alesj" wrote : Then all you need to is to change that line
  |   |       KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(url.toString(), resolver);
  |   | 
  | to
  |   |       RemotingMD deployment = (RemotingMD) unmarshaller.unmarshal(url.toString(), resolver);
  |   | 

So I do need my own deployer after all?

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

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

More information about the jboss-user mailing list