3

When i deploy .ear file on weblogic 12c, it is giving following error.

java.lang.ClassNotFoundException: com.abc.util.CustomUtility
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:335)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:302)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:180)


<Administration Console encountered the following error: weblogic.application.WrappedDeploymentException: com.abc.util.CustomUtility
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:335)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:302)

As soon as I deploy .ear file, it is giving the above error. It's complaining about ClassNotFoundException which is a user-defined class in the project.

I see all .classes are part of .ear file. Still why this issue comes up ?

Please help me on this.

2 Answers 2

3

I've seen this problem when I have utility classes defined on several projects. The .class are in the .ear, but the app doesn't find it.

In my case the problem was solved adding the missing class project to the manifest file.

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

2 Comments

Thanks for that info. I have added .class files to jar and kept in weblogic/userdomain/lib folder. The errors are gone. As my .ear has multiple .jar files inside, i put those .jars inside weblogic/userdomain/lib folder. Working fine. Is this a right way to do?
I'm not sure if thats the best way, but you can check here http://docs.oracle.com/cd/E21764_01/web.1111/e13706/classloading.htm
0

The accepted answer didn't solve our problem. We solved it by adding the packages (of the missing classes) to the prefer-application-packages section in the weblogic-application.xml

    <!-- to load classes of the packages from application context first and not from server context.  -->
    <prefer-application-packages>
        <package-name>antlr.*</package-name>
        <package-name>org.apache.*</package-name>
        <package-name>org.hibernate.*</package-name>
        <package-name>org.springframework.*</package-name>
        <package-name>org.aopalliance.*</package-name>
        <package-name>org.objectweb.*</package-name>
        <package-name>net.sf.cglib.*</package-name>
        ...
    </prefer-application-packages>
</weblogic-application>

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.