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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:52:18+00:00 2026-06-16T06:52:18+00:00

I am calling EJB3 service deployed in my jBoss 4.2.3 server from a standalone

  • 0

I am calling EJB3 service deployed in my jBoss 4.2.3 server from a standalone Java program (using jnp lookup). I have made all my data object Serialized. I have successfully called methods of my EJB but I am losing data from object on client side. I debuged the EJB side within an Application Server and I can see I have data in my objects.

I am calling my EJB using following code;

public void doStuff () {

    // Component and its JNDI
    ResourceProviderServiceBeanRemote componentEJB;
    String JNDI_NAME_REMOTE = "ResourceProviderService/ResourceProviderServiceBean/remote";

    // Setup Environment
    Hashtable environment = new Hashtable();
    environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
    environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
    environment.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099"); // remote machine IP
    Context context = null;
    try {
        context = new InitialContext(environment);
        Object factoryObj = context.lookup(JNDI_NAME_REMOTE); //ejb-name
        componentEJB = (ResourceProviderServiceBeanRemote) factoryObj;

        UserContextCallBack userContext = new UserContextCallBackImpl(new UserDetails("username", "password", ""));
        componentEJB.setUserContextCallBack(userContext);

        QueryDetails query = new QueryDetails();
        query.setName("anything");
        List<String> cols = new ArrayList<String>();
        List<Row> rows = new ArrayList<Row>();
        ResponseDetails responseDetails = new ResponseDetails();
        componentEJB.doQuery(query, cols, rows, responseDetails);
        System.out.println(responseDetails);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }

}

Note: I can see data populated in ‘cols’, ‘rows’ and ‘responseDetails’ on server side but client side remain the same empty initialise objects.

Am I missing anything?

—

SJunejo

  • 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-16T06:52:19+00:00Added an answer on June 16, 2026 at 6:52 am

    It was a silly mistake, I found out that all the objects are passed by value when calling a methods on any RMI interface. I have to have some Return Type and that’s what it is missing. So I am upting my code as follows;

    // Created a new Response Object by combing all the OUT parameters as one object
    // and updated the method on EJB to accept only IN paramters
    DoQueryResponse response = componentEJB.doQuery(query);
    

    Hope this will help some one (silly) like me 🙂

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

Sidebar

Related Questions

When calling SQL Server from a client using ODBC, if a long-running query is
I am new to JPA/Hibernate. Currently using EJB3, Hibernate/JPA. I have an inheritacnce structure
calling a js function using onclick... onclick=SubmitAge(66, 'ctl00_MainContent_arTo_upAgeRange') function just calls an updatePanel from
I'm upgrading an application from an old ejb2 setup to use ejb3's using the
Calling a WCF published orchestration from a C# program usually is sub-second response time.
I am using Glassfish v3 server. Usually the DB connection with EJB3 + JPA
Calling a web service from my controller: $client = new \SoapClient(http://.../webservice/NAME_OF_PAGE.asmx?WSDL); $result = $client->EstadoHabitacionesFechas();
Calling the WriteObject Method from a background thread is not possible! Is there a
Calling Html.RenderPartial(~/Views/Payments/MyControl.ascx); from a view works if MyControl.ascx is a control that directly inherits
Calling the ajax called URL works well without ajax eg. http://localhost/ci/controller/method/param_value . But using

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.