Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 321634

Summary: Plan schema does not support plans with a 2+ digit version components
Product: [RT] Virgo Reporter: Kyle Smith <kylesm>
Component: unknownAssignee: Steve Powell <zteve.powell>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: glyn.normington
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on:    
Bug Blocks: 311155    

Description Kyle Smith CLA 2010-08-03 13:24:47 EDT
Build Identifier: 2.1.0.M02-incubation

I created a new plan for some Oracle JDBC bundles and since the bundles were version 11.2.0, I created the plan as 11.2.0.  I dropped the plan in the pickup directory and got the following errors:


[2010-08-03 11:45:58.312] fs-watcher                   <HD0002E> Hot deploy failed for file 'com.oracle.jdbc.plan'. org.eclipse.virgo.kernel.deployer.core.DeploymentException: Failed to read plan descriptor
	at org.eclipse.virgo.kernel.install.artifact.internal.StandardInstallArtifactTreeInclosure.createInstallTree(StandardInstallArtifactTreeInclosure.java:129)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.doInstall(PipelinedApplicationDeployer.java:140)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.install(PipelinedApplicationDeployer.java:123)
	at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:187)
	at org.eclipse.virgo.kernel.deployer.hot.HotDeploymentFileSystemListener.deploy(HotDeploymentFileSystemListener.java:174)
	at org.eclipse.virgo.kernel.deployer.hot.HotDeploymentFileSystemListener.onChange(HotDeploymentFileSystemListener.java:78)
	at org.eclipse.virgo.util.io.FileSystemChecker.notifyListeners(FileSystemChecker.java:245)
	at org.eclipse.virgo.util.io.FileSystemChecker.check(FileSystemChecker.java:166)
	at org.eclipse.virgo.kernel.deployer.hot.WatchTask.run(WatchTask.java:58)
	at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.RuntimeException: Failed to read plan descriptor
	at org.eclipse.virgo.kernel.artifact.plan.PlanReader.read(PlanReader.java:85)
	at org.eclipse.virgo.kernel.install.artifact.internal.PlanInstallArtifactTreeFactory.getPlanDescriptor(PlanInstallArtifactTreeFactory.java:106)
	at org.eclipse.virgo.kernel.install.artifact.internal.PlanInstallArtifactTreeFactory.constructInstallArtifactTree(PlanInstallArtifactTreeFactory.java:85)
	at org.eclipse.virgo.kernel.install.artifact.internal.StandardInstallArtifactTreeInclosure.constructInstallArtifactTree(StandardInstallArtifactTreeInclosure.java:155)
	at org.eclipse.virgo.kernel.install.artifact.internal.StandardInstallArtifactTreeInclosure.createInstallTree(StandardInstallArtifactTreeInclosure.java:123)
	... 9 common frames omitted
Caused by: org.xml.sax.SAXParseException: cvc-pattern-valid: Value '11.2.0' is not facet-valid with respect to pattern '\d(.\d(.\d(.([\w_-])+)?)?)?' for type '#AnonType_versionplan'.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2776)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
	at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
	at org.eclipse.virgo.kernel.artifact.plan.PlanReader.readDocument(PlanReader.java:93)
	at org.eclipse.virgo.kernel.artifact.plan.PlanReader.read(PlanReader.java:81)
	... 13 common frames omitted

I then edited the plan version and changed it to "1.2.0" and it deployed correctly:

[2010-08-03 11:53:27.533] fs-watcher                   <HD0001I> Hot deployer processing 'MODIFIED' event for file 'com.oracle.jdbc.plan'. 
[2010-08-03 11:53:27.572] fs-watcher                   <DE0000I> Installing plan 'com.oracle.jdbc.plan' version '1.2.0'. 
[2010-08-03 11:53:27.611] fs-watcher                   <DE0000I> Installing bundle 'redacted.external.ojdbc6.wrapper' version '11.2.0.0'. 
[2010-08-03 11:53:27.628] fs-watcher                   <DE0000I> Installing bundle 'redacted.external.ons.wrapper' version '11.2.0.0'. 
[2010-08-03 11:53:27.640] fs-watcher                   <DE0000I> Installing bundle 'redacted.external.simplefan.wrapper' version '11.2.0.0'. 
[2010-08-03 11:53:27.668] fs-watcher                   <DE0000I> Installing bundle 'redacted.external.ucp.wrapper' version '11.2.0.0'. 
[2010-08-03 11:53:27.812] fs-watcher                   <DE0001I> Installed bundle 'redacted.external.ojdbc6.wrapper' version '11.2.0.0'. 
[2010-08-03 11:53:27.816] fs-watcher                   <DE0001I> Installed bundle 'redacted.external.ons.wrapper' version '11.2.0.0'. 
[2010-08-03 11:53:27.820] fs-watcher                   <DE0001I> Installed bundle 'redacted.external.simplefan.wrapper' version '11.2.0.0'. 
[2010-08-03 11:53:27.826] fs-watcher                   <DE0001I> Installed bundle 'redacted.external.ucp.wrapper' version '11.2.0.0'. 
[2010-08-03 11:53:27.830] fs-watcher                   <DE0001I> Installed plan 'com.oracle.jdbc.plan' version '1.2.0'. 
[2010-08-03 11:53:27.840] fs-watcher                   <DE0004I> Starting plan 'com.oracle.jdbc.plan' version '1.2.0'. 
...

The restriction pattern on line 88 of springsource-dm-server-plan.xsd only allows one digit per version component:

<pattern value="\d(.\d(.\d(.([\w_-])+)?)?)?"/>

Section 3.2.4 of the R4 Core spec defines a version's major/minor/micro components to be a "number" (which section 1.3.2 defines as as "digit+").  The following pattern seems to fit the bill:

<pattern value="\d+(\.\d+(\.\d+(\.([\w_-])+)?)?)?"/>

Note that the proposed pattern also addresses the fact that the periods in the original regex are not escaped, which means that strings such as "1w2z3asfd" would also validate.

Reproducible: Always

Steps to Reproduce:
1. Create a new plan with a version of the form "11.2.0"
2. Drop the plan in the pickup directory while the Virgo kernel is running
Comment 1 Steve Powell CLA 2010-08-04 10:09:33 EDT
Yup, that is clear.  How could we not have spotted that?  Thank you -- this will go in as soon as we figure out how to change the schema!!!

Incidentally, a really nice bugzilla.  I wish all bug descriptions were so clear and complete (and included the fix!!).
Comment 2 Steve Powell CLA 2010-08-04 10:30:10 EDT
Change pushed to git : org.eclipse.virgo.kernel.git.

SHA:	85b496ed8734229fa11fcf788ef534c6d319ac68
Author:	Steve Powell <spowell@vmware.com>
Date:	Wed Aug 04 2010 15:17:27 GMT+0100 (BST)
Subject:	[Bug 321634] Fix version pattern in plan schema.

It will be a short time before the public schema (at http://www.springsource.org/schema/dm-server/plan) is updated.
Comment 3 Steve Powell CLA 2010-08-04 10:30:50 EDT
See previous post.
Comment 4 Glyn Normington CLA 2010-08-04 10:48:21 EDT
I updated the public schema. Not sure how long it will take to propagate out through the various caches.
Comment 5 Steve Powell CLA 2010-08-06 04:22:12 EDT
Kyle: can you verify here that you don't see this problem anymore?
Comment 6 Kyle Smith CLA 2010-08-06 15:34:01 EDT
(In reply to comment #5)
> Kyle: can you verify here that you don't see this problem anymore?

Deploying the plan is still resulting in that exception, but it looks like the XSD on springsource.org either hasn't gotten updated yet or some proxy along the way is caching it (flushed my own browser cache and still doesn't have the fix).

Does one of the Virgo JARs have an embedded copy it might be using?
Comment 7 Steve Powell CLA 2010-08-09 04:40:29 EDT
Kyle, 
The schema is sourced from org.eclipse.virgo.kernel.artifact/src/main/resources/org/eclipse/virgo/kernel/artifact/plan/springsource-dm-server-plan.xsd
and that is updated in the latest build of the kernel.

There should be no other version anywhere except in the public address you are using.  Can you look at the address you're using in the header of the plan xml file to see which version that appears to be?

Thank you for taking the time to look at this for us.  We'll do a few experiments here also.
Steve Powell
Comment 8 Steve Powell CLA 2010-08-12 06:16:58 EDT
Tests here with the latest Kernel work fine:

[2010-08-12 11:15:18.789] fs-watcher                   <DE0000I> Installing plan 'test' version '29.19.90'. 
[2010-08-12 11:15:18.796] fs-watcher                   <DE0000I> Installing configuration 'test' version '0.0.0'. 
[2010-08-12 11:15:18.803] fs-watcher                   <DE0001I> Installed configuration 'test' version '0.0.0'. 
[2010-08-12 11:15:18.807] fs-watcher                   <DE0001I> Installed plan 'test' version '29.19.90'. 
[2010-08-12 11:15:18.813] fs-watcher                   <DE0004I> Starting plan 'test' version '29.19.90'. 
[2010-08-12 11:15:18.817] fs-watcher                   <DE0004I> Starting configuration 'test' version '0.0.0'. 
[2010-08-12 11:15:18.827] fs-watcher                   <DE0005I> Started configuration 'test' version '0.0.0'. 
[2010-08-12 11:15:18.831] fs-watcher                   <DE0005I> Started plan 'test' version '29.19.90'. 

with a simple plan that references a configuration artefact.

Closing this.