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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:50:38+00:00 2026-06-06T23:50:38+00:00

I struggeled last week with some Corba Marshalling Exceptions. The one glassfish web app

  • 0

I struggeled last week with some Corba Marshalling Exceptions. The one glassfish web app was trying to get some data from another web application on the same machine and same domain and same EAR. I found in StackOverflow the right answer. One object was not Serializable. After fixing this little problem the glassfish server got really busy doing s.t. for a while. My suspiction was that it is serializing a very large object. So my idea that only a little “pointer” is transferred from one app to the other app seems to be wrong. It copies the whole structure.

My question is now. “Is it clever to do ejb injection from one app to the other?”
I guess if i keep the objects small (“Transient” etc.) it will work fast enough. But can’t I get only access to the other object in the other app for reading some data?

Thanks for you help.

  • 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-06T23:50:39+00:00Added an answer on June 6, 2026 at 11:50 pm

    What you want to do is definitely possible. Some terminology clarifications.

    What you have is Module to Module EJB Injection using a Remote interface of the bean.

    What you want is Module to Module EJB Injection using Local interface of the bean.

    So some clarifications on terms:

    Application vs Module

    When two WAR files are in the same EAR, what you have in spec terms is one Application and two Modules.

    In all other situations (two EARs, WARs not in an EAR) you have Application to Application and that’s far harder to deal with.

    The significance is the EAR creates one classloader which will become the parent, each WAR becomes a child classloader of the EAR. As such the WAR files cannot see each other’s classes, but they can see the shared classes in the EAR. Here’s where our solution lies — more on that in a bit.

    Remote vs Local refs

    Remote refs are pass-by-value (you get a copy of the data)
    Local refs are pass-by-reference (“pointer” as you mention it)

    Note that the same annotation @EJB is used in either case and there’s no way to tell which you might have. It’s only the bean itself that determines which kind of references to expose via @Remote or @Local on either the bean class or the interfaces of the bean.

    Solution

    Because you have an EAR it is possible to move the bean (the EJB) out of the war files and into a shared jar that is placed at the root of the EAR file next to the WAR files. You must also remove the bean class and its interfaces from the WAR files for this to work.

    Then you can change the @Remote interface of the bean to @Local.

    If you do that, you will get pass-by-reference semantics and the two WAR files can share data without CORBA or anything heavy like that. They’d just be passing java objects the same way any object would be passed in java.

    If you truly did have an Application to Application situation, then indeed you would need to use @Remote and pass-by-value semantics which is of course many times slower.

    If you were also exposing this EJB to other Applications (say outside the server or in other EARs), then you can still do that by adding a second interface to the bean annotated @Remote. It’s possible and easy for a single EJB to expose @Local and @Remote interfaces (or views as we call them in the spec) as well as @WebService and REST service views.

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

Sidebar

Related Questions

Okay, this one is the reverse of the last question I struggled with... I
I've struggled with this all day, I am trying to get a random number
I have a pretty big web application that I created last year using ASP.NET
Having this problem with my android app I struggled with this for some time
I'm trying to recreate the built in messaging app's view. I need to add
I've struggled for the last couple of months to come up with some clean
I am trying to call these functions to get rid of stuff I don't
I have been banging my head against the wall trying to get Exscript installed.
We are having some issues with our data layer when large datasets are returned
I've been developing .Net pages for business web apps for the last year or

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.