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 142545 - Unable to create a web application
Summary: Unable to create a web application
Status: RESOLVED DUPLICATE of bug 140905
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 6.x
Hardware: Sun Windows ME/2000
: P3 blocker (vote)
Assignee: David Konecny
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2008-08-01 08:57 UTC by dpkumar
Modified: 2008-08-07 16:26 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Message.log (47.95 KB, text/plain)
2008-08-01 08:58 UTC, dpkumar
Details
screen shot (3.04 MB, text/plain)
2008-08-01 09:00 UTC, dpkumar
Details
Correct screen shot (3.04 MB, image/gif)
2008-08-01 09:03 UTC, dpkumar
Details
log with failure (118.09 KB, text/plain)
2008-08-04 23:58 UTC, Lukas Jungmann
Details
log with success (test fails a bit later) (151.29 KB, text/plain)
2008-08-05 00:00 UTC, Lukas Jungmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dpkumar 2008-08-01 08:57:02 UTC
NB Build:NetBeans IDE Build 200807310201
JDK Build:jdk1.6.0
OS: Microsoft Windows Server 2003 Service Pack1(I couldn't find Win 2003 in the OS list, so I mentioned as Win 2000)

Steps:
-Install NB-Dev IDE
-Select File>New Project>JAVA EE>EnterPrise Application>Next>Next>Finish

ISSUE: 
On selecting FINISH button, it shows message in the application creation wizard "cvc-complex-type.4: Attribute 'id' must
appear on element 'root'" and its incomplete.
-Attaching screen shot and message .log for this issue.
Comment 1 dpkumar 2008-08-01 08:58:12 UTC
Created attachment 66266 [details]
Message.log
Comment 2 dpkumar 2008-08-01 09:00:29 UTC
Created attachment 66267 [details]
screen shot
Comment 3 dpkumar 2008-08-01 09:03:43 UTC
Created attachment 66268 [details]
Correct screen shot
Comment 4 Vince Kraemer 2008-08-03 04:58:21 UTC
I just tried build 200808021401... and could not replicate the behavior.

I tested on Vista, though...  
Comment 5 David Konecny 2008-08-04 02:20:37 UTC
Has this worked for you in older dev builds? If yes, do you remember build number of your previous dev build?

For a while now dev build is checking validity of project.xml file during project opening. In your case newly generated
WAR project does not seem to have required "id" attribute on "root" tag (child of "source-roots" tag). Which is strange
because looking at the code the tag and attribute are always generated with fixed value.

Does creation of other project types (J2SE, EJB, AppClient) work fine or not? The IDE.log file shows you are using
"1.6.0-b105" version of JDK. Could you try to reproduce the problem on newer JDK like 1.6.0_06 please?

Could you also please try creating Web App project individually and not as part of EAR proj? Thanks.
Comment 6 dpkumar 2008-08-04 05:24:33 UTC
NB build:netbeans-trunk-nightly-200807300201,netbeans-trunk-nightly-200807311401,netbeans-trunk-nightly-200808010201 and
netbeans-trunk-nightly-200808021401.
JDK:jdk1.6.0_06
OS:Microsoft Windows Server 2003 Service Pack1

According to your suggestion i installed jdk1.6.0_06 and tried with above mentioned NB builds. Now I am able to create
all types of project(Web, EAR, EJB, App-Client and JAVA Applications) with out hitting any issues.
Comment 7 David Konecny 2008-08-04 06:00:48 UTC
I thought that might be the case as error itself does not make any sense and must be a problem in XML Schema validator.
Comment 8 Lukas Jungmann 2008-08-04 17:02:58 UTC
This issue happens very often in functional tests we have. Jindro, can you add some links to results to this issue,
please? Thanks.

see also issue 142230
Comment 9 David Konecny 2008-08-04 22:47:26 UTC
Please file new issue for your test problem unless the error message is 

  "cvc-complex-type.4: Attribute 'id' must appear on element 'root'"

Validation of project.xml can fail for different reasons (some of them recently fixed) and these are unique often
unrelated issues. Nothing mentioned in issue 142230 is relevant to this problem. As I said earlier XML produced in this
instance is valid if newer JDK is used - reporter was running 1.6.0-b105 which I think is quite dated.
Comment 10 David Konecny 2008-08-04 22:49:09 UTC
Also problems related to project.xml validation should not be random - the same test case on the same platform should
always fail or always pass.
Comment 11 Lukas Jungmann 2008-08-04 23:56:50 UTC
hmmm, comparing two logs from tests on one machine using same JDK just now:

>System Info: 
  Product Version         = NetBeans Platform Dev (Build 20080801021000)
  Operating System        = SunOS version 5.10 running on sparc
  Java; VM; Vendor        = 1.6.0_05; Java HotSpot(TM) Client VM 10.0-b19; Sun Microsystems Inc.
  Runtime                 = Java(TM) SE Runtime Environment 1.6.0_05-b13

tests are starting by creation of a new web project - this happens in setup method iff a project required by tests does
not exist yet and info about this is being logged - look for: "INFO [org.netbeans.modules.ws.qaf.WebServicesTestBase]:
Creating project in:"

in one of the log, I can see: "cvc-complex-type.4: Attribute 'id' must appear on element 'root'" in the other I can't.

So the question is: Why project creation fails in some suites and not in the others? note - hardware & software
configuration is the same, the way how a project is being created too. (it succeed in websvc.kit, webvalidation tests,
it does not succeed websvc.restkit, web.jsf)

re jdk1.6.0-b105: "1.6: DOM level 1 documents cannot be validated with a Schema, works with 1.5"[1] has been fixed in
jdk1.6.0_02 according to Java SE release notes[2]

[1]: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6531160
[2]: http://java.sun.com/javase/6/webnotes/ReleaseNotes.html#160_02
Comment 12 Lukas Jungmann 2008-08-04 23:58:57 UTC
Created attachment 66536 [details]
log with failure
Comment 13 Lukas Jungmann 2008-08-05 00:00:53 UTC
Created attachment 66537 [details]
log with success (test fails a bit later)
Comment 14 David Konecny 2008-08-05 03:28:35 UTC
Thanks Lukas, this one is quite tricky. I know the cause but I'm not sure what's the conclusion. Adding Jesse as he may
know better.

I was able to reproduce XML schema validation error

  cvc-complex-type.4: Attribute 'id' must appear on element 'root'

when running web.jsf functional tests. It is false alarm because project.xml does contain id attribute on root element.
Why web.jsf test suite is failing and other suites pass? Because web.jsf has ide10/modules/org-netbeans-libs-xerces.jar
on its classpath and somehow (?) this parser gets preference over JDK's one. But (to make it more complicated) only on
JDK 1.6 - on 1.5 everything seems to work fine. Compare following:
* attached restkit.log.txt contains false validation exception which is coming from
org.apache.xerces.impl.xs.XMLSchemaValidator
* wskit.log.txt on the other hand contains valid validation exception but that one is coming from JDK's
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator

Fixing classpath of web.jsf functional tests should resolve the problem (although I'm not sure how because xerces is
added to classpath automatically as a resolution of some other module dependencies). I wonder though what's the proper
fix and how to make sure the same problem will not happen somewhere else again.
Comment 15 David Konecny 2008-08-06 04:53:56 UTC
Only testing is impacted not end user -> P3.
Comment 16 Jesse Glick 2008-08-06 15:19:48 UTC
Likely the same as issue #140905, though due to using a buggy standalone version of Xerces rather than using a JDK
bundling a buggy embedded version of Xerces. Probably needs centralized fix in either XMLUtil.validate or ProjectXMLCatalog.

*** This issue has been marked as a duplicate of 140905 ***
Comment 17 Lukas Jungmann 2008-08-06 15:37:30 UTC
I tried to avoid dep. on xercers in some tests in 78036fea39c4 for now
Comment 18 Quality Engineering 2008-08-07 16:26:43 UTC
Integrated into 'main-golden', available in build *200808071401* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/78036fea39c4
User: Lukas Jungmann <jungi@netbeans.org>
Log: IZ #142545: remove xerces from tests cp