[Design of JCA on JBoss] - Re: DeploymentInfo/Template MCF
by vickyk
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
18 years, 1 month
[Design of EJB 3.0] - Re: Empty @Remote on bean class
by scott.stark@jboss.org
The AnnotationMetaDataDeployer was assuming metadata complete unless there was a jboss metadata that was not marked as complete. Because there was no jboss.xml/ejb-jar.xml the ejb3 test is not being processed.
| [starksm@succubus ejb3]$ jar -tf output/test-lib/ejbthree1146.jar
| org/jboss/ejb3/test/ejbthree1146/TestBean.class
| org/jboss/ejb3/test/ejbthree1146/TestBeanBase.class
| org/jboss/ejb3/test/ejbthree1146/TestRemoteBusinessInterface.class
|
I added a metaDataCompleteIsDefault property to the AnnotationMetaDataDeployer so that you can set that to false to have a deployment without a JBossMetaData instance to be processed.
| <bean name="AnnotationMetaDataDeployer"
| class="org.jboss.deployment.AnnotationMetaDataDeployer">
| <property name="metaDataCompleteIsDefault">false</property>
| </bean>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110428#4110428
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110428
18 years, 1 month