Skip to content
Advertisement

Invalid version number: Version number may be negative or greater than 255

I am getting below error when I try to access a page in my application.

SEVERE: Servlet.service() for servlet [jsp] threw exception
java.lang.IllegalArgumentException: Invalid version number: Version number may be negative or greater than 255
    at com.ibm.icu.util.VersionInfo.getInstance(VersionInfo.java:191)
    at com.ibm.icu.impl.ICUDebug.getInstanceLenient(ICUDebug.java:65)
    at com.ibm.icu.impl.ICUDebug.<clinit>(ICUDebug.java:69)

I assume that it is due to some version mismatch. How can I trace the issue? The application is not mavenized and hence I am not sure how to check the issue. Atleast if I know which jarfile is giving issue then it will be good.

Advertisement

Answer

TLDR; replace your icu4j.jar file with the latest version.

This is likely caused by an older version of ICU4J in your classpath. The VersionInfo class was limited to 2-character version numbers, setting a limit to 255. Since Java 8 is now at 1.8.0_291, the 291 exceeds the 2-character limit, causing the ICU4J VersionInfo exception.

ICU-21219 is fixed in ICU4J:68.1

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement