This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 155891 - New J2EE 1.3 enterprise app project generates invalid application.xml file
Summary: New J2EE 1.3 enterprise app project generates invalid application.xml file
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB Project (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P3 blocker with 1 vote (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-20 18:12 UTC by bkocik
Modified: 2009-11-02 11:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bkocik 2008-12-20 18:12:19 UTC
Product Version: NetBeans IDE 6.5 (Build 200811100001)
Java: 1.6.0_05; Java HotSpot(TM) 64-Bit Server VM 1.6.0_05-b13-52
System: Mac OS X version 10.5.4 running on x86_64; MacRoman; en_US (nb)

To reproduce:

1) File -> New Project
2) Java EE -> Enterprise Application
3) Accept defaults on the next screen and hit Next.
4) Choose a server (I went with GlassFish v2). Change Java EE Version to "J2EE 1.3". De-select options to create EJB and
Web Application modules (for simplicity). Click Finish.
5) Right-click on your new project, choose "Verify"

Note that verification fails with this error:

Could not verify successfully.
java.io.IOException: Deployment descriptor file META-INF/application.xml in archive [EnterpriseApplication1]. 
cvc-complex-type.2.4.b: The content of element 'application' is not complete. One of
'{"http://java.sun.com/xml/ns/j2ee":display-name, "http://java.sun.com/xml/ns/j2ee":icon,
"http://java.sun.com/xml/ns/j2ee":module}' is expected.
	at com.sun.enterprise.tools.verifier.VerificationHandler.explodeArchive(VerificationHandler.java:296)
	at com.sun.enterprise.tools.verifier.VerificationHandler.initStandalone(VerificationHandler.java:211)
	at com.sun.enterprise.tools.verifier.VerificationHandler.<init>(VerificationHandler.java:109)
	at com.sun.enterprise.tools.verifier.Verifier.verify(Verifier.java:140)
	at com.sun.enterprise.tools.verifier.Verifier.main(Verifier.java:114)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.b: The content of element 'application' is not complete.
One of '{"http://java.sun.com/xml/ns/j2ee":display-name, "http://java.sun.com/xml/ns/j2ee":icon,
"http://java.sun.com/xml/ns/j2ee":module}' is expected.
	at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:304)
	at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:226)
	at com.sun.enterprise.deployment.archivist.Archivist.readStandardDeploymentDescriptor(Archivist.java:480)
	at com.sun.enterprise.deployment.backend.J2EEModuleExploder.explodeEar(J2EEModuleExploder.java:278)
	at com.sun.enterprise.tools.verifier.VerificationHandler.explodeArchive(VerificationHandler.java:285)
	... 4 more

6) Open the application.xml file that NetBeans generated. Line two looks like this:

<application version="1.4" 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">

7) Change it to this (application_1_4.xsd becomes application_1_3.xsd):

<application version="1.4" 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_3.xsd">

8) Verify the application again. It is now valid.

Note that the application version number in the config file is also given as 1.4. I don't know if that's correct or not,
but it doesn't appear to cause an issue. Someone might wish to verify it.
Comment 1 Vince Kraemer 2008-12-20 21:37:20 UTC
yup there are problems here... but the work-arounds proposed by the user may not be valid...

1. An ear with no sub-modules is invalid. And that is OK....

2. In J2EE 1.3, the 'type' for an application.xml file is defined by a DTD, not a schema, so the proposed work-around in step 7 is a bit suspect.

3. If the IDE is supporting j2EE 1.3 ent-apps, we probably need to generate the correct application.xml.

4. if the verify command is happy, after the user applies step 7... verify has a bug...
Comment 2 bkocik 2008-12-20 22:56:26 UTC
It's entirely possible that some (or most?) of what I've written is invalid or incorrect; I only discovered this as part
of my first foray into EJB ever, so I'm very green. Sorry for any inaccuracies - you can assume that anything that looks
wrong is my doing, and you'll likely be right.
Comment 3 David Konecny 2009-04-07 00:49:27 UTC
Support for J2EE1.3 will be dropped soon so I'm hesitant to spend any time on resolving this issue. If it is critical
please speak up. Thanks.
Comment 4 Quality Engineering 2009-11-02 11:17:02 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX