-
Bug
-
Resolution: Done
-
Minor
-
JBossAS-4.0.1 SP1
-
None
I am using the following application deployment descriptor:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
version="1.4">
<display-name>eduproj1</display-name>
<module>
<ejb>eduproj-ejb.jar</ejb>
</module>
<module>
<web>
<web-uri>eduproj.war</web-uri>
<context-root>edu</context-root>
</web>
</module>
</application>
When my application is deployed, everything is fine:
...
22:33:19,987 INFO [Server] JBoss (MX MicroKernel) [4.0.1sp1 (build: CVSTag=JBos
s_4_0_1_SP1 date=200502160314)] Started in 17s:465ms
22:33:24,844 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.1sp1/
server/default/deploy/eduproj.ear
22:33:25,265 INFO [EjbModule] Deploying TheUser
22:33:25,405 INFO [EJBDeployer] Deployed: file:/C:/jboss-4.0.1sp1/server/defaul
t/tmp/deploy/tmp23151eduproj.ear-contents/eduproj-ejb.jar
22:33:25,445 INFO [TomcatDeployer] deploy, ctxPath=/edu, warUrl=file:/C:/jboss-
4.0.1sp1/server/default/tmp/deploy/tmp23151eduproj.ear-contents/eduproj-exp.war/
22:33:25,535 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.1s
p1/server/default/deploy/eduproj.ear
But when I remove the <display-name>eduproj1</display-name> element from the
deployment descriptor:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
version="1.4">
<!-- <display-name>eduproj1</display-name> -->
<module>
<ejb>eduproj-ejb.jar</ejb>
</module>
<module>
<web>
<web-uri>eduproj.war</web-uri>
<context-root>edu</context-root>
</web>
</module>
</application>
I get the following error:
...
23:07:45,357 INFO [Server] JBoss (MX MicroKernel) [4.0.1sp1 (build: CVSTag=JBos
s_4_0_1_SP1 date=200502160314)] Started in 14s:201ms
23:07:50,214 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.1sp1/
server/default/deploy/eduproj.ear
23:07:50,234 ERROR [MainDeployer] Could not initialise deployment: file:/C:/jbos
s-4.0.1sp1/server/default/deploy/eduproj.ear
org.jboss.deployment.DeploymentException: expected one display-name tag
at org.jboss.metadata.MetaData.getUniqueChild(MetaData.java:98)
at org.jboss.deployment.J2eeApplicationMetaData.importApplicationXml(J2e
eApplicationMetaData.java:135)
at org.jboss.deployment.J2eeApplicationMetaData.importXml(J2eeApplicatio
nMetaData.java:121)
at org.jboss.deployment.EARDeployer.init(EARDeployer.java:127)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:828)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:765)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
or.java:122)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
BeanOperationInterceptor.java:131)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:305)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:481)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:204)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
loop(AbstractDeploymentScanner.java:215)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
run(AbstractDeploymentScanner.java:194)
On page 131 of the J2EE spec (j2ee-1_4-fr-spec.pdf) Figure J2EE.8-3 makes it
clear that display-name must occur 1 or more times. This says that the error
is expected.
But the actual schema definition makes it clear that display-name may occur
0 or more times.
application_1_4.xsd (line 147-158):
-----------------------------------
<xsd:complexType name="applicationType">
<xsd:annotation>
<xsd:documentation>
The applicationType defines the structure of the
application.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:group ref="j2ee:descriptionGroup"/> <----- in j2ee_1_4.xsd
j2ee_1_4.xsd (line 82-102):
---------------------------
<xsd:group name="descriptionGroup">
<xsd:annotation>
<xsd:documentation>
This group keeps the usage of the contained description related
elements consistent across J2EE deployment descriptors.
All elements may occur multiple times with different languages,
to support localization of the content.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="description"
type="j2ee:descriptionType"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element name="display-name"
type="j2ee:display-nameType"
minOccurs="0" <-------- 0 or more
maxOccurs="unbounded"/>
I also checked out the previous application_1_3.dtd. This notes that
display-name is a required element (1 and only 1):
<!ELEMENT application (icon?, display-name, description?, module+,
security-role*)>
I found the behaviour of JBoss AS to be odd because prior to this error I
believed that the description, display-name and icon deployment descriptor
elements are used almost exclusively by IDE tools (ie. irrelevant to an app
server).
Therefore:
j2ee-1_4-fr-spec.pdf Figure J2EE.8-3: 1 or more display-name
application_1_4.xsd: 0 or more display-name
application_1_3.dtd: 1 and only 1 display-name
Is there any particular reason that JBoss requires the display-name element?
Could there possibly be an error in the j2ee spec?
Do I need to RTFM?