ShrutikaDhoka ShrutikaDhoka - 1 year ago 88
Java Question

Bean creation issue on websphere

I am getting the below exception while creating bean

I am using IBM Websphere 8.5.5.
Context initialization failed:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eqSaml11TicketValidator' defined in class path resource [META-INF/eQSecurityClient.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError

Answer Source

The class you are trying to create cannot be instantiated by the JVM. The error message ExceptionInInitializerError can have several reasons

The constructor of the class failed with an exception

At least one class or instance initialisation failed, e.g.

public class Test {
    private static int num = 1/(1-1); // Throws Exception
    private Object object = new SomeObject(); // if new SomeObject() throws exception

Another reason could be that you are missing a class on your classpath that this class or any class used by this class including parent classes require.

If the exception happens in you code, you could try to wrap the creation of the object in a try/catch block and print the cought exception including it's cause. The cause will most likely show the real reason of the failure.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download