Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException: Invalid version number: Version number may be negative or greater than 255 #660

Closed
Adi-raj-2021 opened this issue Jul 19, 2021 · 13 comments
Milestone

Comments

@Adi-raj-2021
Copy link

Hi Team,

I have a query related to this issue
“java.lang.IllegalArgumentException: Invalid version number: Version number may be negative or greater than 255"

Let me brief you few analysis part
As currently we are using "com.ibm.icu_3.6.1.v20070906.jar" jar in our project.
This jar is getting used in reporting tool(Birt report) of our product.

In recent months we upgraded our product java to 8.0.6.15 version but our reporting tool throws this error


Caused by: java.lang.IllegalArgumentException: Invalid version number: Version number may be negative or greater than 255
at com.ibm.icu.util.VersionInfo.getInstance(VersionInfo.java:194)
at com.ibm.icu.impl.ICUDebug.getInstanceLenient(ICUDebug.java:65)


At previous , I approached icu-support with short analysis over this issue.
we got response at that time i.e "this issue fixed in icu4j.jar(of version 68).So you can use this version of jar".

Later we analysed more and test , found we are using "com.ibm.icu_3.6.1.v20070906.jar" in the reporting tool not icu4j.jar.
Further we upgarded our java version to 8.0.6.20,8.0.6.25 & 8.0.6.30. Finally we are using java 8.0.6.30 now. And still our birt repoting tool throwing the same error which we got on 8.0.6.15 version of java.

Although the error was in Birt module so I checked with Eclipse support who managed this Birt project. But they directed me that this is an ICU4J issue.

As we analysed deeply the issue and found the source of exception is from versionInfo.class. We know there is a check placed in versionInfo.class to check the minor/macro version of java and it hardcoded as 255.
But java version start from 8.0.6.15(261) exceeding the limit of 255.It is the main source of issue.
As downgrading java version 8.0.6.10 also works here to solve this issue , but it is not good approach.
For testing scenario , we modified the code of versionInfo.java and replace the 255 check to some higher version such as 301 or 311.
And our testing results show no error afterwards.

As per your old communication i.e this issue fixed in 68 version of icu4j.jar
I tried to find out the references ,
https://unicode-org.atlassian.net/browse/ICU-21295
unicode-org/icu#1245
https://unicode-org.atlassian.net/browse/ICU-21219
https://github.com/unicode-org/icu/blob/main/icu4j/main/classes/core/src/com/ibm/icu/util/VersionInfo.java#L294

I also found one link of github which having code commits indicating the fix.
unicode-org/icu@ab08fac

At next , part of testing area we also did the same change in VersionInfo.class(com.ibm.icu_3.6.1.v20070906.jar) as provided in above link of code commit to resolve this issue.
But we found same issue occured in this testing.

This is our main concern/query
we are using this jar com.ibm.icu_3.6.1.v20070906.jar, I believe in order to fix this issue we have to place new jar of com.ibm.icu*.

*Is this code commit sufficient to resolve this issue? or any other code changes is required? as in our env this change not worked.
unicode-org/icu@ab08fac

In which version of com.ibm.icu this issue got fixed?

How we can get the fixed jar of com.ibm.icu version?

Icu4j jar of version 68/69 got release which including the fix of this issue(as communicated).
I did not found any reference which showing the release of these jars com.ibm.icu
, Can you please let us aware who is responsible for the release of newer version com.ibm.icu* jars.
Kindly let us know.

Please help us to resolve this issue, we are blocked due to it.

Thanks

@wimjongman
Copy link
Contributor

Thanks for reporting. The version of ICU that we use is too old. We need to upgrade to the latest ICU version.

@wimjongman wimjongman added this to the 4.9 milestone Jul 20, 2021
@wimjongman
Copy link
Contributor

wimjongman commented Jul 20, 2021

Please attach (not paste in comment) a full stacktrace.

@Adi-raj-2021
Copy link
Author

birt_stacktrace.txt
Please find the attached file to get full stacktrace.

Thanks

@Adi-raj-2021
Copy link
Author

Hi Team,

Just have few queries
As I checked the latest released Birt modules i.e
https://projects.eclipse.org/projects/technology.birt
https://download.eclipse.org/birt/downloads/drops/
https://download.eclipse.org/birt/downloads/drops/I-R1-4.9.0-201905231911/

May I know this issue covered in which next probable release?
What is the tracking id for this issue?
The current Birt release containing the jar named as "com.ibm.icu_63.1.0.v20181030-1705.jar" , so please let me know what version would be the next release of com.ibm.icu jar?
At what time we expect the fix for this issue ?

These information we needed, as asked by our product management team to keep track this issue to fix in our product.

Thanks

@wimjongman
Copy link
Contributor

This is the tracking issue for this fix.

The snapshot download location can be found in the README.MD: https://github.com/eclipse/birt

Instead of waiting for us to implement a new version of ICU you can also patch the source to NOT use the Version class and create a pull request.

@Adi-raj-2021
Copy link
Author

Okay.
I am not too aware how to create pull request for the same. I did not use git in past.
So can you please share the detailed steps how to do that. It will be helpful

Thanks

@ruspl-afed
Copy link
Contributor

According to the trace VersionInfo is used from com.ibm.icu.text.SimpleDateFormat that has 172 usages in our source base

@SteveSchafer-Innovent
Copy link
Contributor

SteveSchafer-Innovent commented Aug 12, 2021

As mentioned by the OP, the version currently used in https://github.com/eclipse/birt is com.ibm.icu_63.1.0.v20181030-1705. I've verified that VersionInfo.java is identical to the one in icu4j version 63.1, so the issue should be fixed in the 4.9 release.

FYI, that plugin comes from https://download.eclipse.org/eclipse/updates/4.11 which is specified in org.eclipse.birt.target.target. The most recent version of updates is 4.20, which has a more recent version of com.ibm.icu, which covers more recent versions of unicode. Perhaps it would be a good idea to upgrade to updates 4.20, if it doesn't conflict with anything. I'll give that a try.

Update: That didn't work. updates 4.20 causes a dependency on jetty 10 which isn't provisioned in p2. This is addressed in issue #621.

@ruspl-afed
Copy link
Contributor

@SteveSchafer-Innovent we have https://download.eclipse.org/tools/orbit/downloads/drops/R20190226160451/ in target, and this Orbit drop contains icu4j version 63.1
I suggest to mention what we need in our target explicitly:

...
		<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
			<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20190226160451/repository/"/>
			<unit id="com.ibm.icu" version="63.1.0"/>
...

and also add version constraints to our bundles that uses com.ibm.icu

SteveSchafer-Innovent added a commit to SteveSchafer-Innovent/birt that referenced this issue Aug 15, 2021
…umber may be negative or greater than 255 eclipse-birt#660

Specify com.ibm.icu version 63.1 in target orbit R20190226160451 location and explicitly specify icu version every place it's included in ant build scripts (it doesn't appear in any maven dependencies).

Signed-off-by: Steve Schafer <sschafer@innoventsolutions.com>
@Adi-raj-2021
Copy link
Author

Hi Team,

Please let us know if the new Birt module available for download which having the fix for this issue.
Also share the version of new Birt release.(which covering under 4.9 milestone)

Thanks

@Adi-raj-2021
Copy link
Author

If new Birt release is not available yet , what is the expected date of release?
(As per the milestone 4.9 , it showing due date 15 sept , please confirm)

@Adi-raj-2021
Copy link
Author

Hi Team,

Please confirm about the issue resolution and newer version release of Birt

Thanks

@wimjongman
Copy link
Contributor

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants