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 141330 - Error parsing project.xml (artifact-type is not valid)
Summary: Error parsing project.xml (artifact-type is not valid)
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant Project (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P1 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: REGRESSION
: 141613 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-23 13:02 UTC by Oleg Khokhlov
Modified: 2008-08-02 16:02 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test projects (355.69 KB, text/plain)
2008-07-23 14:00 UTC, Oleg Khokhlov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Khokhlov 2008-07-23 13:02:01 UTC
Impossible to open a project:
Error parsing C:\WORK\nbextra\data\TravelReservationService\TravelReservationServiceApplication\nbproject\project.xml:
cvc-type.3.1.3: The value 'CAPS.asa:sun-bpel-engine' of element 'artifact-type' is not valid.

Product Version: NetBeans IDE Dev (Build 200807230806)
Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b05
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

Checked with 20080710 - works fine.
Comment 1 Vladimir Yaroslavskiy 2008-07-23 13:48:58 UTC
Is it sierra or trunk?
Please attach the project.
Comment 2 Oleg Khokhlov 2008-07-23 14:00:58 UTC
Created attachment 65376 [details]
test projects
Comment 3 Oleg Khokhlov 2008-07-23 14:02:31 UTC
inside TravelReservationService folder - TravelReservationServiceApplication project
build from http://bits.netbeans.org/download/trunk/nightly/latest/
Comment 4 Vladimir Yaroslavskiy 2008-07-23 14:47:45 UTC
It is *comp* app project, not bpel. Reassign to right category...
Comment 5 Vladimir Yaroslavskiy 2008-07-28 12:48:02 UTC
*** Issue 141613 has been marked as a duplicate of this issue. ***
Comment 6 Jun Qian 2008-07-29 00:25:43 UTC
According to ant-project-references.xsd (defined in project.ant), element 'artifact-type' should have a type of
xsd:NCName, which compapp project's project.xml doesn't conform to.

I think we have two options here:

The easier fix is to define a new schema for compapp project's project.xml and register it in NB's ProjectXMLCatalog. 

The correct fix, though, should be changing compapp project system to make its project.xml consistent with the existing
schema. In this case, we have to take care of backward compatibility issue probably by auto-migrating old compapp projects.

Tien, any comments?
Comment 7 Tientien Li 2008-07-29 23:14:38 UTC
I don't think this is a REGRESSION, but as a result of some new project validation features added.

Anyway, since a validation has been added for this, we must replace ":" with a legal char, e.g., ".". However, I am 
not sure when the validation is done in the project open process. If it is done before the open hook, then we have to 
find another way to update old project.xml for existing projects.
Comment 8 Tientien Li 2008-07-31 15:32:48 UTC
NB6.5 added project schema validation about 2 weeks ago. The validation will block the project loading if it detects 
any error. Because SOA projects has a invalid character in its artifact-type field, all 6.1 compapp projects are now 
blocked and not loadable in 6.5. We think it will be better to allow these projects to still load in 6.5 but with a 
error badge to indicate validation problems. This way, we can introduce code to fix these validation problems 
automatically within the NetBeans. Otherwise, we will have to ask the user to manually edit the project.xml files for 
all projects created in 6.1 to fix these problems.
Comment 9 Tientien Li 2008-07-31 15:55:53 UTC
Jesse,

Will it be possible to allow projects that failed project schema validation be still loadable in 6.5 but with an error 
badge to indicate validation problems. This will allow us to auto fix the validation problems without requiring manual 
changes of 6.1 projects from our users.

Thanks,

-- 
Tientien Li

Comment 10 Jesse Glick 2008-07-31 19:34:40 UTC
ant-project-references/[12] specifies xsd:NCName as the permitted range of <artifact-type>. If you mistakenly let loose
projects into the field using an invalid artifact type value in the past, the only possible fix now is to relax the
character range (in project.ant) to permit ':', and correspondingly document AntArtifact.getType. (I don't believe the
artifact type is used in any properties files etc., so it need not be too restrictive.) If this is the case, please
reassign to ant/project.
Comment 11 Tientien Li 2008-07-31 21:12:15 UTC
Jesse,

Yes, relaxing the artifact-type definition will solve this problem. It will allow projects created in 6.1 to continue 
working in 6.5. 

Thanks,

-- 
Tientien Li

Comment 12 Jesse Glick 2008-07-31 21:54:36 UTC
Changing to xsd:token seems to let the project be opened. Please verify when you see the changeset in main.

core-main #a882b1af9145
Comment 13 Tientien Li 2008-07-31 23:50:29 UTC
Jesse, 

Great!! I have not seen this change in main yet... but will try it out when it does.  Thanks..
Comment 14 Jesse Glick 2008-08-01 17:20:53 UTC
It is in main now.
Comment 15 Tientien Li 2008-08-01 18:17:46 UTC
Yes, it works! Old projects from NB 6.1 and 6.0 are now working in 6.5 without problems. Thanks again Jesse!
Comment 16 Oleg Khokhlov 2008-08-02 14:35:40 UTC
verified in 080802
Comment 17 Quality Engineering 2008-08-02 16:02:02 UTC
Integrated into 'main-golden', available in build *200808021401* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/a882b1af9145
User: Jesse Glick <jglick@netbeans.org>
Log: #141330: permit colon (:) in AntArtifact.type XML storage.