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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:36:16+00:00 2026-05-24T10:36:16+00:00

I have a Glassfish v2.1.1 cluster setup. I deployed an EAR file consisting a

  • 0

I have a Glassfish v2.1.1 cluster setup. I deployed an EAR file consisting a single stateless bean to stand alone server. It has an IIOP port 3752.

My client application which will be communicating with this bean is deployed on cluster. When i lookup bean’s name, i get NameNotFoundException. Code looks as below:

Properties props = new Properties();

props.setProperty("java.naming.factory.initial",    "com.sun.enterprise.naming.SerialInitContextFactory");

props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");

props.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");


if (logger.isDebugEnabled()) {

  logger.debug("Looking for bean from location : " + PropertiesService.instance().getSchedulerOrbHost() + ":"

                + PropertiesService.instance().getSchedulerOrbPort());

}


props.setProperty("org.omg.CORBA.ORBInitialHost",     PropertiesService.instance().getSchedulerOrbHost());

props.setProperty("org.omg.CORBA.ORBInitialPort",     PropertiesService.instance().getSchedulerOrbPort());


InitialContext context = null;


try {

context = new InitialContext(props);

} catch (NamingException e) {

e.printStackTrace();

}

String beanName = "test.OperationControllerRemote";

OperationControllerRemote remote = (OperationControllerRemote) context.lookup(beanName);

Note that i checked JNDI tree and name “test.OperationControllerRemote” is there.

Any opinions please?

  • 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-24T10:36:16+00:00Added an answer on May 24, 2026 at 10:36 am

    Here are the ways I have got it to work with a GF 2.1.1 cluster and a Swing client. I’m currently going with the Standalone option because of client launch speed, but the ACC might work for you.

    Standalone

    The way you’re doing it is considered standalone.

    http://glassfish.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB

    http://blogs.oracle.com/dadelhardt/entry/standalone_iiop_clients_with_glassfish

    ACC

    Another way to approach this is to launch the client with the ACC. This means packaging the client code into the ear as an Application Client and either launching using the JNLP method or manually installing a bundled ACC (mini glassfish really) on client machines. In GF 2.1, either way works ok, but both are pretty fat and JNLP method can make startup times a bit longer. Supposedly in GF 3.1 they’ve reworked the ACC and it starts up faster. Something that may not be obvious is that with the ACC you get the list of servers in the cluster provided automatically at client startup.

    http://blogs.oracle.com/theaquarium/entry/java_ee_clients_with_or

    http://download.oracle.com/docs/cd/E18930_01/html/821-2418/beakv.html#scrolltoc

    http://download.oracle.com/docs/cd/E18930_01/html/821-2418/gkusn.html

    Lookups

    Either of the above ways provides RMI/CORBA failover and load balancing for the client.

    Either way, when you have the right dependencies on your classpath and the com.sun.appserv.iiop.endpoints system property set (like node1:33700,node2:33701), you’ll only need the no-args InitialContext because Glassfish’s stuff autoregisters their connection properties, etc as described in the first link:

    new InitialContext()
    

    And lookups will work. For my remote session beans (EJB 3.0) I typically do it like:

    @Stateless(mappedName="FooBean")
    public class FooBean implements FooBeanRemote {}
    
    @Remote
    public interface FooBeanRemote {}
    

    then in client code:

    FooBeanRemote foo = (FooBeanRemote) ctx.lookup("FooBean");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a Java EE-based web application running on a Glassfish app server cluster.
I have a Filter implementation that has worked previously in a single instance Glassfish
I have glassfish installed on a server with a JMS ConnectionFactory set up jms/MyConnectionFactory
We have Glassfish application server running in Linux servers. Each Glassfish installation hosts 3
I have Glassfish 3 server and have added Quercus 4.0.7 to to be able
I am trying to configure clustering in glassfish 3.1.1 server. I have made clusters
I am using MyEclipse, and I have a local Glassfish server controlled by the
i have an spring web application (on glassfish server) that use JDBC connection pool.
We have a JSF 2.0 application running under Glassfish 3.1.1 which has been moved
I have a preinstalled Glassfish domain, and I want to change the server certificate

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.