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 5982405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:04:57+00:00 2026-05-22T22:04:57+00:00

I am new to the Java EE platform and I am building a simple

  • 0

I am new to the Java EE platform and I am building a simple JMS app. I created a class that is being sent in an ObjectMessage. My problem arose when both the client app creating the message and the MDB on the server needed access to the same class file(the class composed in the ObjectMessage). I currently have the class file in both the client library and EJB library and this is working. However I would like to have only one location for the class file where both the client and MDB can access it. I believe I need to package the entire app in a certain way, but I having a hard time figuring it out.

Any help will be greatly appreciated.

Thank you.

  • 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-05-22T22:04:58+00:00Added an answer on May 22, 2026 at 10:04 pm

    Typically most, if not all codesources (the locations from where classes are loaded) utilized by the application server’s classloaders are located within the application server installation. In case of MDBs (or EJBs) for that matter, the codesources are contained within the EJB module (the EJB JAR file) or within the application archive (the EAR file). At runtime, the container manages where and how this code source is managed (including it’s location), and there might not be a straightforward way to determine this location. In other words, it would be extremely difficult to use the deployed JARs in the container, in the classpath of your client application (assuming they are on the same machine).

    The only possible way, I could think of using the same JARs in both the client app and by the application on the server, is to have a custom classloader on the server, that is configured to read specific classes from a common shared JAR. As a best practice, the classloader should always defer loading of classes to the parent classloaders, before attempting to resolve any class.

    Your client may then, use the same shared JAR by setting the appropriate classpath (or by using the same custom classloader).

    I should warn you that writing a custom classloader is not easy for some who haven’t understood the classloading dynamics in a Java EE application server.

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

Sidebar

Related Questions

I am fairly new to Python programming, and completely new to cross-platform GUI building
I am building a facebook platform web app using GWT and hosting it on
I am absolutely new to the Android platform and have been building an application
I have a new web app that is packaged as a WAR as part
I'm not new to Java but new to the Android platform. I'm finding one
I just downloaded the Java ME Platform SDK 3.0 and created my frist Midlet
I'm new to Java. I just created my first Java application using NetBeans. Here's
We have a platform component (written in Java) that now shall be backward compatible
For a new Java web project I thought about using: Eclipse as IDE Mercurial
Almost every new Java-web-project is using a modern MVC-framework such as Struts or Spring

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.