WrenSecurity / wrenam

Community fork of OpenAM, an authentication and authorization system originally developed by ForgeRock.
Other
43 stars 27 forks source link

Newer version check is broken #76

Closed fyrbach closed 1 year ago

fyrbach commented 1 year ago

A check of Wren:AM version does not work.

Following error is logged into amUpgrade debug log on every server start:

ERROR: Unable to parse date strings; current:Wren:AM 15.0.0-SNAPSHOT Build e395297f39 (2023-01-01T00:00:00Z) war version: Wren:AM 15.0.0-SNAPSHOT Build e395297f39 (2023-01-01T00:00:00Z)
java.text.ParseException: Unparseable date: "2023-01-01T00:00:00Z"
        at java.base/java.text.DateFormat.parse(DateFormat.java:399)
        at org.forgerock.openam.upgrade.VersionUtils.isVersionNewer(VersionUtils.java:88)
        at org.forgerock.openam.upgrade.VersionUtils.isVersionNewer(VersionUtils.java:68)
        at com.sun.identity.setup.AMSetupServlet.isCurrentConfigurationValid(AMSetupServlet.java:245)
        at com.sun.identity.setup.AMSetupServlet.registerListeners(AMSetupServlet.java:2069)
        at com.sun.identity.setup.AMSetupServlet.init(AMSetupServlet.java:209)

Related lines of code:

https://github.com/WrenSecurity/wrenam/blob/95425e9b5e5b538a147931c400229e73b5aff16e/pom.xml#L138-L139

https://github.com/WrenSecurity/wrenam/blob/95425e9b5e5b538a147931c400229e73b5aff16e/openam-server-only/openam-server-prepare-war.xml#L38

https://github.com/WrenSecurity/wrenam/blob/95425e9b5e5b538a147931c400229e73b5aff16e/openam-core/src/main/java/org/forgerock/openam/upgrade/VersionUtils.java#L75-L93

https://github.com/WrenSecurity/wrenam/blob/95425e9b5e5b538a147931c400229e73b5aff16e/openam-shared/src/main/java/com/sun/identity/shared/Constants.java#L1187-L1188

karelmaxa commented 1 year ago

The issue has been resolved in https://github.com/WrenSecurity/wrenam/pull/94.