[jboss-dev-forums] [Design of JCA on JBoss] - Re: DeploymentInfo/Template MCF
vickyk
do-not-reply at jboss.com
Wed Dec 5 03:39:21 EST 2007
What does this error mean ?
Testcase: testAddDataSource took 4.34 sec
| Caused an ERROR
| null
| javax.xml.bind.MarshalException
| - with linked exception:
| [com.sun.istack.SAXException2: unable to marshal type "org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup" as an element because it is missing an @XmlRootElement annotation]
| at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:320)
| at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:246)
| at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:96)
| at org.jboss.resource.deployers.management.DsDataSourceTemplate.writeTemplate(DsDataSourceTemplate.java:120)
| at org.jboss.resource.deployers.management.DsDataSourceTemplate.applyTemplate(DsDataSourceTemplate.java:61)
| at org.jboss.profileservice.management.ManagementViewImpl.applyTemplate(ManagementViewImpl.java:550)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java:56)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:771)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
| Caused by: com.sun.istack.SAXException2: unable to marshal type "org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup" as an element because it is missing an @XmlRootElement annotation
| at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:242)
| at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:303)
| at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:488)
| at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:317)
| at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:246)
| at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:96)
| at org.jboss.resource.deployers.management.DsDataSourceTemplate.writeTemplate(DsDataSourceTemplate.java:120)
| at org.jboss.resource.deployers.management.DsDataSourceTemplate.applyTemplate(DsDataSourceTemplate.java:61)
| at org.jboss.profileservice.management.ManagementViewImpl.applyTemplate(ManagementViewImpl.java:550)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java:56)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:771)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
| at org.jboss.remoting.Client.invoke(Client.java:1634)
| at org.jboss.remoting.Client.invoke(Client.java:548)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at AOPProxy$1.applyTemplate(AOPProxy$1.java)
| at org.jboss.test.profileservice.test.ProfileServiceUnitTestCase.testAddDataSource(ProfileServiceUnitTestCase.java:404)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at AOPProxy$1.applyTemplate(AOPProxy$1.java)
| at org.jboss.test.profileservice.test.ProfileServiceUnitTestCase.testAddDataSource(ProfileServiceUnitTestCase.java:404)
I made the following changes
1) In the start() of the org.jboss.resource.deployers.management.DsDataSourceTemplateInfo
I added attachment by calling this code
| ManagedObjectImpl mo = new ManagedObjectImpl(attachmentName);
|
| //JBAS-4671
| log.debug("Going to start in DsDataSourceTemplate");
| Object attachment = loadClass(attachmentName);
| log.debug("Added attachment in loadClass"+attachment);
| Serializable serAttachment = (java.io.Serializable)attachment;
| mo.setAttachment(serAttachment);
| log.debug("Done with attaching .");
| //JBAS-4671
2) In the writeTemplate of the DsDataSourceTemplate
Object group = mo.getAttachment();
| log.debug("Getting the name "+mo.getName());
| log.debug("Getting the attachment which is added in the DsDataSourceTemplateInfo "+group);
| if( group instanceof ManagedConnectionFactoryDeploymentGroup )
| {
| //JBAS-4671
| log.debug("------------->"+group);
| AbstractManagedObjectFactory mof = new AbstractManagedObjectFactory();
| ManagedObject dsDeploymentMO = mof.initManagedObject((Serializable)group,"DataSource", "NoTx");
| log.debug("------------->"+values.getProperties().values());
| try{
| for(ManagedProperty moprop : values.getProperties().values())
| {
| ManagedProperty moProp = dsDeploymentMO.getProperty(moprop.getName());
| if(moProp!=null)
| moProp.setValue((Serializable)moprop.getValue());
| log.debug("setting ManagedProperty "+moprop.getValue()+ "for "+moprop.getName());
| }
| }
| catch(Exception exp){
| log.debug("Eat up this "+exp);
| }
| //JBAS-4671
| }
Earlier the group was coming as null as the attachment want not added to ManagedObject in Step 1 .
Any clue what it is complaining about now ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110433#4110433
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110433
More information about the jboss-dev-forums
mailing list