The change is that the deployment descriptors are actually now validated
against the DTDs.
I was going to write some validating tool in the coming days that would
go through the DDs in the testsuite, validate them and find the invalid
ones.
Richard Achmatowicz wrote:
Dear All
I am encountering a parsing problem when trying to deploy a jar
containing some EJBs. The deployments is part of a test case in the AS
testsuite, which has been there for some time. It appears as though the
offending file parses correctly under Eclipse (thanks, Clebert).
Have there been changes which may account for this problem?
output from AS console:
-----------------------
10:55:20,140 ERROR [EjbParsingDeployer] Error during deployment:
jar:file:/home/rachmatowicz/jms-trunk/testsuite/output/lib/jmsra.jar!/
org.jboss.deployers.spi.DeploymentException: Error parsing meta data
META-INF/ejb-jar.xml
at
org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
at
org.jboss.deployers.plugins.deployers.helpers.ObjectModelFactoryDeployer.parse(ObjectModelFactoryDeployer.java:87)
at
org.jboss.deployers.plugins.deployers.helpers.AbstractParsingDeployer.parse(AbstractParsingDeployer.java:145)
at
org.jboss.deployers.plugins.deployers.helpers.AbstractParsingDeployer.createMetaData(AbstractParsingDeployer.java:112)
at
org.jboss.deployers.plugins.deployers.helpers.AbstractParsingDeployer.createMetaData(AbstractParsingDeployer.java:88)
at
org.jboss.deployment.EjbParsingDeployer.deploy(EjbParsingDeployer.java:95)
at
org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer.commitDeploy(AbstractSimpleDeployer.java:52)
at
org.jboss.deployers.plugins.deployer.DeployerWrapper.commitDeploy(DeployerWrapper.java:145)
at
org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:440)
at
org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:381)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:795)
at org.jboss.deployment.MainDeployer.redeploy(MainDeployer.java:570)
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:585)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(InvokerAdaptorService.java:266)
at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at
org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
at
org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at
org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:179)
at sun.reflect.GeneratedMethodAccessor114.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at
org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:816)
at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:417)
at sun.reflect.GeneratedMethodAccessor113.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse
source:
jar:file:/home/rachmatowicz/jms-trunk/testsuite/output/lib/jmsra.jar!/META-INF/ejb-jar.xml@44,18
at
org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:164)
at
org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:180)
at
org.jboss.deployers.plugins.deployers.helpers.ObjectModelFactoryDeployer.parse(ObjectModelFactoryDeployer.java:83)
... 55 more
Caused by: org.xml.sax.SAXException: The content of element type
"session" must match
"(description?,display-name?,small-icon?,large-icon?,ejb-name,home?,remote?,local-home?,local?,ejb-class,session-type,transaction-type,env-entry*,ejb-ref*,ejb-local-ref*,security-role-ref*,security-identity?,resource-ref*,resource-env-ref*)".
@
jar:file:/home/rachmatowicz/jms-trunk/testsuite/output/lib/jmsra.jar!/META-INF/ejb-jar.xml[44,18]
at
org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErrorHandler.error(SaxJBossXBParser.java:348)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at
org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:160)
... 57 more
the ejb-jar.xml file:
---------------------
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise
JavaBeans 2.0//EN" "http://java.sun.com/j2ee/dtds/ejb-ja\r_2_0.dtd">
<ejb-jar>
<description>Queue Publisher</description>
<display-name>PublisherBean</display-name>
<enterprise-beans>
<session>
<ejb-name>JMSSession</ejb-name>
<home>org.jboss.test.jmsra.bean.JMSSessionHome</home>
<remote>org.jboss.test.jmsra.bean.JMSSession</remote>
<ejb-class>org.jboss.test.jmsra.bean.JMSSessionBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
<session>
<display-name>Publisher</display-name>
<ejb-name>QueuePublisher</ejb-name>
<home>org.jboss.test.jmsra.bean.PublisherHome</home>
<remote>org.jboss.test.jmsra.bean.Publisher</remote>
<ejb-class>org.jboss.test.jmsra.bean.PublisherBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<description>A Queue ConnectionFactory</description>
<res-ref-name>jms/MyQueueConnection</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>A Queue </description>
<res-ref-name>jms/QueueName</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<ejb-ref>
<ejb-ref-name>ejb/PublisherCMP</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>org.jboss.test.jmsra.bean.PublisherCMPHome</home>
<remote>org.jboss.test.jmsra.bean.PublisherCMP</remote>
<ejb-link>PublisherCMP</ejb-link>
</ejb-ref>
</session>
<session>
<display-name>TopicPublisher</display-name>
<ejb-name>TopicPublisher</ejb-name>
<home>org.jboss.test.jmsra.bean.PublisherHome</home>
<remote>org.jboss.test.jmsra.bean.Publisher</remote>
<ejb-class>org.jboss.test.jmsra.bean.TopicPublisherBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<description>A Topic ConnectionFactory</description>
<res-ref-name>jms/MyTopicConnection</res-ref-name>
<res-type>javax.jms.TopicConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>A Topic </description>
<res-ref-name>jms/TopicName</res-ref-name>
<res-type>javax.jms.Topic</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<ejb-ref>
<ejb-ref-name>ejb/PublisherCMP</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>org.jboss.test.jmsra.bean.PublisherCMPHome</home>
<remote>org.jboss.test.jmsra.bean.PublisherCMP</remote>
<ejb-link>PublisherCMP</ejb-link>
</ejb-ref>
</session>
<session>
<display-name>QueueRec</display-name>
<ejb-name>QueueRec</ejb-name>
<home>org.jboss.test.jmsra.bean.QueueRecHome</home>
<remote>org.jboss.test.jmsra.bean.QueueRec</remote>
<ejb-class>org.jboss.test.jmsra.bean.QueueRecBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<description>A Queue ConnectionFactory</description>
<res-ref-name>jms/MyQueueConnection</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>A Queue </description>
<res-ref-name>jms/QueueName</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</session>
<entity>
<display-name>Publisher Entity</display-name>
<ejb-name>PublisherCMP</ejb-name>
<home>org.jboss.test.jmsra.bean.PublisherCMPHome</home>
<remote>org.jboss.test.jmsra.bean.PublisherCMP</remote>
<ejb-class>org.jboss.test.jmsra.bean.PublisherCMPBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>True</reentrant>
<cmp-version>1.x</cmp-version>
<cmp-field>
<description>Nr</description>
<field-name>nr</field-name>
</cmp-field>
<primkey-field>nr</primkey-field>
</entity>
<message-driven>
<ejb-name>TopicAdapter</ejb-name>
<ejb-class>org.jboss.test.jmsra.bean.TopicAdapter</ejb-class>
<message-selector></message-selector>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Topic</destination-type>
<subscription-durability>NonDurable</subscription-durability>
</message-driven-destination>
<resource-ref>
<description>A Queue ConnectionFactory</description>
<res-ref-name>jms/MyQueueConnection</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>A Queue </description>
<res-ref-name>jms/QueueName</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>TopicAdapter</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
------------------------------------------------------------------------
_______________________________________________
jboss-development mailing list
jboss-development(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-development