Bug 916793 - bundle creation fails even when using a valid version string
Summary: bundle creation fails even when using a valid version string
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Provisioning
Version: JON 3.1.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER01
: JON 3.2.0
Assignee: John Mazzitelli
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 916790
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-28 22:35 UTC by Larry O'Leary
Modified: 2018-11-30 19:26 UTC (History)
1 user (show)

Fixed In Version:
Clone Of: 916790
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
bundle_version.png (90.29 KB, image/png)
2013-10-01 14:03 UTC, Armine Hovsepyan
no flags Details
bundle_version2.png (119.18 KB, image/png)
2013-10-01 14:03 UTC, Armine Hovsepyan
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 321303 0 None None None Never

Description Larry O'Leary 2013-02-28 22:35:37 UTC
+++ This bug was initially created as a clone of RHQ Bug #916790 +++

Created attachment 704013 [details]
see the version string in this bundle's recipe - this causes the error

If I have a bundle whose version string is "3.13.1.201302221022", the bundle fails to be created.

Recipe snippet:

    <rhq:bundle name="Test Version String"
                version="3.13.1.201302221022"
                description="a small bundle with a small.properties file">

The bundle upload wizard gives error:

[Distribution File] Failed to upload bundle distribution file
javax.ejb.EJBException: java.lang.NumberFormatException: For input string: "201302221022"

server log:

17:21:58,004 ERROR [org.jboss.ejb3.invocation] (http--0.0.0.0-7080-1) JBAS014134: EJB Invocation failed on component BundleManagerBean for method public abstract org.rhq.core.domain.bundle.BundleVersion org.rhq.enterprise.server.bundle.BundleManagerLocal.createBundleVersion(org.rhq.core.domain.auth.Subject,int,java.lang.String,java.lang.String,java.lang.String,java.lang.String) throws java.lang.Exception: javax.ejb.EJBException: java.lang.NumberFormatException: For input string: "201302221022"
...
Caused by: java.lang.NumberFormatException: For input string: "201302221022"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) [rt.jar:1.7.0_11]
	at java.lang.Integer.parseInt(Integer.java:495) [rt.jar:1.7.0_11]
	at java.lang.Integer.<init>(Integer.java:677) [rt.jar:1.7.0_11]
	at org.apache.maven.artifact.versioning.ComparableVersion.parseItem(ComparableVersion.java:427) [rhq-core-util-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at org.apache.maven.artifact.versioning.ComparableVersion.parseVersion(ComparableVersion.java:413) [rhq-core-util-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at org.apache.maven.artifact.versioning.ComparableVersion.<init>(ComparableVersion.java:322) [rhq-core-util-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT]
	at org.rhq.enterprise.server.bundle.BundleManagerBean.createBundleVersion(BundleManagerBean.java:496) [rhq-enterprise-server-ejb3.jar:4.7.0-SNAPSHOT]

Looks like a bug in ComparableVersion.

Comment 1 John Mazzitelli 2013-02-28 22:57:52 UTC
target release is 3.2 ... we don't have a 3.2 branch yet (right?). This fix is in master. See https://bugzilla.redhat.com/show_bug.cgi?id=916790#c1

"fixed ComparableVersion so it treats long numbers as strings (which is what they probably are meant to be treated as anyway, as in a timestamp such as 201302221030 which refers to 10:30 AM on February 22, 2013.

git commit to master: 8beb34b"

If we have a JON 3.2 branch, that's the commit we need to cherry pick

Comment 2 John Mazzitelli 2013-02-28 22:58:31 UTC
setting to MODIFIED since I think we wait to put it in ON_QA until it reaches a QA build

Comment 3 Larry O'Leary 2013-09-06 14:30:54 UTC
As this is MODIFIED or ON_QA, setting milestone to ER1.

Comment 4 Armine Hovsepyan 2013-10-01 14:02:37 UTC
verified

please get verification screen-shots attached.

Comment 5 Armine Hovsepyan 2013-10-01 14:03:07 UTC
Created attachment 805988 [details]
bundle_version.png

Comment 6 Armine Hovsepyan 2013-10-01 14:03:36 UTC
Created attachment 805989 [details]
bundle_version2.png


Note You need to log in before you can comment on or make changes to this bug.