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

  • Home
  • SEARCH
  • 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 9127987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:24:25+00:00 2026-06-17T07:24:25+00:00

I’m facing class loading problem with class loading in my skinny war packaged within

  • 0

I’m facing class loading problem with class loading in my skinny war packaged within ear.
Where there are also other ejb modules packaged. Some can be loaded via spring while some not.

Imagine following scenario:

someApp.ear
|- someEJBs1.jar
|- someEJBs2.jar
...
|- someEJBsX.jar
|- someWar.war

If I try from the someWar.war to access via spring some classes present in:

  • someEJBs1.jar it works
  • but for those in someEJBs2.jar I’m getting java.lang.ClassNotFoundException.

No clue where the problem is.
My MANIFEST.MF doesn’t contain any classpath information at all.

I was already thinking if there there any way to see during runtime (maybe during debugging) the classes loaded, or possibly the classpath provided for the particular war file?

I’m running in glassfish 3.1.1 (that is a requirement, no change on this one is possible).

  • 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-17T07:24:27+00:00Added an answer on June 17, 2026 at 7:24 am

    Try the following debug functions in your code:

        //Prints the Root directory
        public static void printPWD() {
            File dir1 = new File(".");
            try {
                System.out.println("Current dir : " + dir1.getCanonicalPath());
                dir1 = null;
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    
    
         // Prints all files on the ClassPath to the system.out
    
        public static void printClasspathFiles() {
            ClassLoader sysClassLoader = ClassLoader.getSystemClassLoader();
    
            // Get the URLs
            URL[] urls = ((URLClassLoader) sysClassLoader).getURLs();
    
            for (int i = 0; i < urls.length; i++) {
                System.out.println(urls[i].getFile());
            }
        }
    
    //prints the classpath to system.out
    print printClasspath(){
           System.out.println(System.getProperty("java.class.path"));
    }
    

    To get all loaded classes, the getAllLoadedClasses Method would be useful. See Here

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

Sidebar

Related Questions

I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have been unable to fix a problem with Java Unicode and encoding. The
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

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.