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 170919

Summary: Exception when adding Java Secure Channel integration to NetBeans RCP project
Product: apisupport Reporter: sflemming <sflemming>
Component: HarnessAssignee: rmichalsky <rmichalsky>
Status: RESOLVED FIXED    
Severity: blocker CC: jglick
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description sflemming 2009-08-26 10:14:41 UTC
It is not possible to add Java Secure Channel integration to a Netbeans Module in NetBeans 6.7.1.

An Exception is thrown that says in short:
org.xml.sax.SAXParseException: cvc-type.3.1.3: The value '1.8.1.0141' of element 'specification-version' is not valid.

The specification version does not seem to follow dewey notation (major.minor.micro).

Exception reported as: http://www.netbeans.org/issues/show_bug.cgi?id=159576)

Reproducible  steps:

1.) Create new Netbeans Platform Application
2.) Create new Netbeans Module
3.) Add ide11/Java Secure Channel integration to Libraries in Module Suite
4.) Add dependency to Java Secure Channel integration in created NetBeans Module
--> Exception will be thrown
Comment 1 Milan Kubec 2009-08-26 10:22:54 UTC
Issue #159576 is about "foreign-project" type, so it's different issue.
Comment 2 Milan Kubec 2009-08-26 10:30:53 UTC
Please evaluate, thanks.
Comment 3 rmichalsky 2009-08-26 11:59:39 UTC
Reproducible. The notation is ok, problem is in the leading '0' in '.0141'. XSD specifically forbids leading zero in
version numbers. Jesse, is there some reason behind it or could I relax the constraint there? 
Comment 4 Jesse Glick 2009-08-26 15:33:39 UTC
The version in the generated manifest is indeed malformed:

  OpenIDE-Module-Specification-Version: 1.8.1.0141

There are two bugs which together produce the symptom:

(1) The OIDE-M-Implementation-Version in the source manifest should probably be "0.1.41" rather than "0141" (or simply
deleted as it is pretty useless), and/or a simple OIDE-M-S-V should be given in the manifest rather than using
spec.version.base.

(2) This code in JarWithModuleAttributes:

                if (implVers != null) {
                    try {
                        Integer.parseInt(implVers);
                        specVersBase += "." + implVers;
                        edited = true;
                    } catch (NumberFormatException e) {...}
                }

should treat a string matching /0\d+/ as a non-integer (thus triggering the same logic as for a NumberFormatException).

Leaving assigned to apisupport/harness for (2); (1) should be fixed in libs.jsch/manifest.mf (no idea what IZ component
that would be).

(2) could be easily backported. Immediate workaround is just to delete ".0141" from
ide11/modules/org-netbeans-libs-jsch.jar!/META-INF/MANIFEST.MF#OpenIDE-Module-Specification-Version and continue.
Comment 5 Jesse Glick 2009-09-09 20:47:05 UTC
core-main #720d0381aeec
Comment 6 Quality Engineering 2009-09-11 21:51:03 UTC
Integrated into 'main-golden', will be available in build *200909111401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/720d0381aeec
User: Jesse Glick <jglick@netbeans.org>
Log: #170919: do not use 0\d+ as implementation versions.