0

execution of class in a Jar file leads to error nested exception:

java.lang.NoClassDefFoundError: org/springframework/context/annotation/AnnotationConfigApplicationContext

This Jar file is part of EAR file.

It works fine in development mode in weblogic (eclipse ear project deployment assembly), but when the ear is built using ant and deployed from admin console the dependent Jars are not loaded. The dependent Jars are available on the manifest file of the Jar file and the Jar file is placed in /lib of the Ear file.

Can you please help on this ?

2 Answers 2

1

The Jars were already in the EAR but still were not getting picked up. The issue is now resolved.

The cause of issue - there were two different versions of same jar but their respective dependent jars were different. The dependent jar of of one version was missing so it was falling back to the old dependent jar due to which Spring was throwing NoSuchFieldError during deployment

Solution - This problem was resolved after adding the dependent version of Jar to classpath

Sign up to request clarification or add additional context in comments.

1 Comment

Can you describe how to added dependent version of Jar to classpath?
0

"dependent Jars are available on the manifest file of the Jar file".. that's not sufficient. The dependencies (which in your case are the missing Spring framework's packages) ought to be included in the EAR file, as well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.