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
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.fortuna.ical4j.model.TimeZoneRegistryFactory #598
Comments
If you can provide the full stack trace I may be able to track down the cause. |
After initial deployed and accessing the application this is error
|
After accessing for second time, since due to above error, the class is not initialised getting, |
Ok, maybe check the versions of dependencies in your classpath are aligned with those in the gradle.properties: https://github.com/ical4j/ical4j/blob/master/gradle.properties It doesn't have to match exactly, but you should have slf4j-api 1.7.x, etc. |
Yeah let me check and get back |
Even Changing the slf4j version to 1.7.36(previous 1.7.28) getting same error:
Have placed the slf4j inside the particular webapp module in build.gradle file in my project |
You may also want to check if your web container has any other versions of slf4j in its classpath. LinkageError can be caused by having the same library loaded in different classloaders, so check your extension libs, etc. |
I have a doubt here, how to prevent different classloaders to load the same jar(slf). In my case, we need the jar globally across the projectand i could see the second classloader might be from the ical4j(I may be wrong here). Is there any way to restrict the classLoader from ical4j to load slf? |
If you are including slf4j in your common jars (e.g. tomcat lib directory) then don't include it with the ical4j dependency in your web app. You should only provide the jar once. |
U mean, for particular webapp to excluse this slf4j in build.gradle file? If yes, there is no entry in that particular webapp for slf4j jar. Am i missing something? |
So when you include ical4j the transitive dependencies such as slf4j will be automatically included. You need to explicitly exclude this dependency (see gradle docs for how to exclude a transitive dependency). |
I am trying to upgrade the ical4j from v1.0.3 to v3.2.5, once upgrade I am getting below error:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.fortuna.ical4j.model.TimeZoneRegistryFactory
Jave: 11.
The text was updated successfully, but these errors were encountered: