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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:35:18+00:00 2026-05-23T02:35:18+00:00

I recently gone through a Netbeans article about how to create and Enterprise Application

  • 0

I recently gone through a Netbeans article about how to create and Enterprise Application Client that access EJB deploy on Glassfish.(Article Link Here) I have couples questions about this article.

The article exposes the EJB via a remote interface, I think this will result in application client have to make a remote invocation. There are overheads for doing this. While local interface parameters are passed by reference, remote interface parameters are passed by value, which results in parameters being copied -> this could be quite expensive.

So my question is why use remote interface here? Is it because the client machine and the Glassfish might be on different machines (different JVM). So if I say that the client code and the Glassfish server are on the same machine (same JVM), can I somehow alter the design to use local interface to avoid overheads.

Since all the codes are provided in the article, I wont post it again here. Please let me know if you still insist me post the code

  • 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-23T02:35:19+00:00Added an answer on May 23, 2026 at 2:35 am

    The EJB FAQ on the Glassfish site addresses this question, and it is quite clear that it is not possible, unless you use the embedded container:

    I have an EJB component with a Local
    interface. Can I access it from an
    Application Client or a stand-alone
    java client ?

    If the EJB component is running within
    the server, no. The EJB Local view is
    an optimized invocation path that uses
    call-by-reference semantics. It is
    only available to web components and
    EJB components that are part of the
    same application as the target EJB
    component. To access EJB components
    that are running in the server from an
    Application Client or stand-alone java
    client, you’ll need to use either a
    Remote 3.x Business interface, a 2.x
    Home interface, or web services.

    One alternative, if using GlassFish
    v3, is to use the EJB 3.1 Embeddable
    API. This allows a Java SE program to
    directly execute EJB components within
    the same JVM, without using a server
    process.

    The next question also gives a hint on why this is the reason – the Java EE specification has never explicitly specified that local interfaces MUST be accessible across multiple applications in the same JVM/container.

    Application server vendors, therefore, have never done this, except for one or two cases. Most of the reasons eventually boil down to classloaders – the EJB module has it’s own classloader (which sometimes is also the application classloader), and if the local interface has to be shared across multiple applications, then all of them must share the same classloader, or the application server must load the interface classes in a parent classloader.

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

Sidebar

Related Questions

I've recently been learning about functional programming (specifically Haskell, but I've gone through tutorials
Recently I have gone through with one simple threading program, which leads me some
There were questions on that but not recently and technology must have gone ahead
I had recently starting learning openGLES and right now I had gone through some
I have recently gone through a bunch of standalone utility apps written in VB6
Recently i had gone through Scottgu's Blog where he had jotted of Jquery Templates
Recently, I read an article entitled SATA vs. SCSI reliability . It mostly discusses
Recently I ran into this error in my web application: java.lang.OutOfMemoryError: PermGen space It's
Recently a friend and I were talking about securing stored procedure code in a
I've been learning a lot about web technologies recently and I want to put

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.