didate
(Mamadou Lamarana)
19 March 2025 17:47
1
Hello Everyone,
We are trying to migrate our dhis2 from 2.37 to 2.41, but we are facing the following issue :
Mar 19 16:48:58 dev tomcat9[703]: 2025-03-19 16:48:58.699 ERROR o.g.a.w.WeavingClassFileTransformer - error weaving org/hisp/dhis/webapi/security/session/SpringHttpSessionInitializer: Unsupported class file major version 61
It looks like that this error is related to the java version. We have upgraded the java version of the lxc container to Java 17 (I think that is the required version for dhis2.41), but we still have the same issue.
Below the java version and tomcat config
Regards;
didate
Gassim
(AL-Gassim Sharaf Addin)
19 March 2025 21:01
2
Hi @didate
What’s the setenv.sh
Java_Home configured to? It needs to be pointing to the JAVA 17 you’ve installed…
didate
(Mamadou Lamarana)
21 March 2025 18:36
4
Hello @Gassim
Thank you for your response.
Do you know where this file is located ? We are using dhis2 ng-tools with lxc. I haven’t been able to find it.
Regards.
Hello @Gassim
I would like to up this topic, I’m still stuck.
@bobj could you please help ?
Regards;
1 Like
Gassim
(AL-Gassim Sharaf Addin)
21 March 2025 20:55
5
Hi @didate
I’m sorry to hear you’re still stuck. In the case that you are using ng-tools, I think it’s set up to find the Java version on its own (https://github.com/bobjolliffe/dhis2-tools-ng/commit/2f3d69eb60620d1bba8672bf89e0e73e75598aaa#diff-42073c94f645b39b5bbe4d37f6b009034f472b0e1d79c4090586681acb7f6935 )
Could you check echo $JAVA_HOME
to see that the path points to Java 17 and not a previous version?
Thanks!
Hello @didate ,
Here are the steps:
Login into the tomcat container.
Find location /etc/default/tomcat9. Under this location you can find JAVA_OPT and change it as per your version.
After changes you need to restart the containers.
Please confirm if issue is still there.
Thanks
2 Likes
didate
(Mamadou Lamarana)
22 March 2025 18:41
7
Hello @Gassim and @MohinderS
Thank you for your help. I have added the two following lines at the end of the file etc/default/tomcat9 and it finally works.
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/
JAVA_OPTS="-Djava.home=$JAVA_HOME"
Thank you all.
3 Likes
Lalaina
(Narovananahary Lalaina RAKOTOVOAVY)
28 March 2025 12:25
8
Hi @didate !
Thank you very much for these very clear tips.
2 Likes