Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8135863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:33:26+00:00 2026-06-06T10:33:26+00:00

I have a jar file that I want to put in the shared lib

  • 0

I have a jar file that I want to put in the shared lib of my application server (WebLogic). The jar contains some classes that are implementing interfaces that are located inside of the war deployment. And the deployment has a Spring singleton that initializes the class that is contained in the shared jar.

So what I guess happens is that class is not being able to load because interfaces are not loaded yet (they are in the deployment), and when the classloader tries to load that class it probably gets some compilation error (I don’t see it anywhere) and doesn’t load it, and when the deployment tries to instantiate something that hasn’t been loaded (shared jar) – it errors out.

So the question is what do I do here? How do I configure all this to work? I really don’t want to duplicate the jar that contains all the interfaces in the shared folder. (it is required to be one whole .war file).

Thanks.

P.S. unfortunately I don’t have any errors/exception while classloading of the domain lib (shared) folder. I have only java.lang.NoClassDefFoundError when I try to instantiate it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:33:29+00:00Added an answer on June 6, 2026 at 10:33 am

    I don’t think you want to use the shared lib directory. It sounds like you want to add a customer’s jar to a single war’s classpath without requiring them to modify the war or having multiple deliverables. I see two ways. Both require pointing at the local filesystem directly which is ordinarily a bad idea in webapps. I think it is possibly ok here because you are pointing at optional customer-supplied classes. The whole point is that this extensibility mechanism can change from outside the webapp. But it means that the customer must deploy the jar identically on all systems, manually. This can be a hassle in a cluster and it obviously requires direct filesystem access to the appserver.

    1. I don’t remember if this works, but you should be able to put a jar in the webapp’s WEB-INF/lib that has META-INF/MANIFEST.MF whose classpath points outside the war. This would have to be a known, hardcoded location. It can be a relative path which would be relative to the current working directory. This is often the appserver’s home directory or a home directory for your domain.

    2. Construct your own ClassLoader instance. It should probably be a URLClassLoader so you can have your customer provide either a directory or a single jar file. Set this classloader’s parents to be the webapp’s classloader. It can point at a location determined at runtime. The problem here is using this classloader in all the right places. I don’t know any general way to do it so I would recommend the first option.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java JAR file that is triggered by a SQL server job.
I have a dao jar file that contains all the domain objects and service
I have a JAR-file in the WEB-INF/lib directory of my project that is displayed
I have a Jar file named OuterJar.jar that contains another jar named InnerJar.jar this
I have a Java application that I want to turn into an executable jar.
I have a jar file with 30 or so classes. What I want is
I have a jar file that gets arguments from commandline and I want to
I have a program (java jar file) that I want to distribute on CDs.
I have a jar file that I would like to execute using PHP, but
We have an applet, a jar file that is stored on the desktops and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.