Accessing the Java EE shared library for an EAR application in weblogic

I created a shared library with some jar files on the weblogic server, now I have an EAR application and I want to use the shared library class files in my web applications present in the EAR application. So I created the weblogic-application.xml file inside my ear-app/META-INF/ and gave a link to the shared library using the following tags:

 <library-ref> <library-name>ebs_endeca_artifacts</library-name> </library-ref> 

But when I try to access class files in my application, I get java.lang.ClassNotFoundException

I also need to go to the shared library at the ear level instead of declaring individual war files in the weblogic.xml file.

If I directly place the same jar files in my ear-app/APP-INF/lib instead of using the shared library, then my application works fine without any problems.

Please help me how can I use the shared library in the ear application. I am using weblogic server 10.3.6

My shared library will look like this:

 shared-web-app/WEB-INF/web.xml shared-web-app/WEB-INF/lib/*.jar 
+7
source share
1 answer

You need banks from the shared library on your class path, because you must create an application before deploying the EAR . JDeveloper would not know where these classes are stored, so they need those with compile-time .

When preparing your application for deployment, you can create filters for files that can be added to WAR / EAR / <whatever> . Go to Application Properties β†’ Deployment and select a deployment profile. Click the Edit button, and you will be asked to display a screen from which you can filter files / libraries that can be included when creating the application.

If you do not include the shared library in the archive and have the snippet from weblogic-application.xml that you published, the WebLogic server will use the classes from the shared library.

Hope this helps. Ask everything you don’t understand as a comment. :)

+4
source

All Articles