How to lookup the remote interface in JNDI of the cluster (glassfish)

I have write a simple sessionbean:
package authority;
import javax.ejb.Stateless;
* Session Bean implementation class LoginSessionBean
@Stateless
public class LoginSessionBean implements LoginSessionBeanRemote, LoginSessionBeanLocal {
     * Default constructor.
    public LoginSessionBean() {
        // TODO Auto-generated constructor stub
    @Override
    public boolean login(String name, String password)
        boolean result = false;
        System.out.println("User: " + name + " is login with password: " + password);
        return result;
    @Override
    public LoginSessionBeanRemote create()
        // TODO Auto-generated method stub
        return this;
}And I write a simple client to test it.
package test;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
import authority.LoginSessionBean;
import authority.LoginSessionBeanRemote;
public class SessionBeanTestClient
    public static void main(String[] args)
        try
            InitialContext context = new InitialContext();
            Object obj = context.lookup(LoginSessionBean.class.getName());
            LoginSessionBeanRemote loginService = (LoginSessionBeanRemote)PortableRemoteObject.narrow(obj, LoginSessionBeanRemote.class);
            loginService.login("Jason", "password");
        catch (NamingException e)
            // TODO Auto-generated catch block
            e.printStackTrace();
}And it is OK, but after I deploy the sessionbean into a cluster with two instances on local host, it can not find the remote interface:
javax.naming.NameNotFoundException: authority.LoginSessionBean not found
     at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)Is it different for cluster (for IIOP port?), I want to test the HA solution, how could I start it?

Please look at http://otn.oracle.com/tech/java/oc4j/htdocs/oc4j-how-to.html. There is a How-To on local interface.
thanks
Debu

Similar Messages

  • SJSAS 9.1 does not expose EJB 3.0 remote Interface via JNDI

    I have successfully deployed a simple Stateful EJB 3.0 bean (CartBean, like the one in the Java EE 5 tutorial remote interface Cart) on SJSAS 9.1, located on machine host1.
    After I deployed the CartBean, I browsed the SJSAS and noticed the existence of the following JNDI entries:
    ejb/Cart
    ejb/Cart__3_x_Internal_RemoteBusinessHome__
    ejb/Cart#main.Cart
    ejb/mgmt
    ejb/myOtherEJB_2_x_bean ( +myOtherEJB_2_x_bean+ is a different 2.x bean that I have deployed as well)So, I am trying to access the remote interface of the CartBean from a remote machine, host2. The client application is a Java-standalone client.
    I am using the Interoperable Naming Service syntax: corbaname:iiop:host1:3700#<JNDI name>
    The problem is that the remote interface of the bean does NOT seem to be available via JNDI. I get the javax.naming.NameNotFoundException when I try to do a lookup like:
    corbaname:iiop:host1:3700#ejb/Cart
    On the other hand, the following lookups succeed:
    corbaname:iiop:host1:3700#ejb/mgmt
    corbaname:iiop:host1:3700#myOtherEJB_2_x_bean
    and also the following succeeds:
    corbaname:iiop:host1:3700#ejb/Cart__3_x_Internal_RemoteBusinessHome__So it seems like the Remote interface is not available via JNDI, rather only some internal SJSAS implementation (the object returned from the ejb/Cart__3_x_Internal_RemoteBusinessHome__ lookup is of type: com.sun.corba.se.impl.corba.CORBAObjectImpl
    Why is this happening? I know there used to be a bug in Glassfish, but I thought it had been fixed since 2006.
    Many thanks in advance, any help would be greatly appreciated.

    The EJB 3.0 Remote Business references are not directly stored in CosNaming. EJB 3.0 Remote references do not have the cross-vendor interoperability requirements that the EJB 2.x Remote view had.
    You can still access Remote EJB references from a different JVM as long as the client has access to SJSAS naming provider. Please see our EJB FAQ for more details :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

  • How to run a remote windows dll files and the drivers of the system using j

    Dear Friends,
    I need some valuable info regd how to run a remote windows dll files and the drivers of the system using java
    reply regd thanking you

    Please don't make duplicate posts like this.

  • In Camera Raw 8.4.1 I can open dngs from 3 years ago, but it's using the old interface and functionality not the current - how do I change this. Have rebuilt cache.

    Running Creative Cloud on an HP with 18Gb Ram - I'm working on a project using 3 yr old dngs and when I open in my up to date Camera Raw it uses the old interface with 'contrast' towards the bottom and 'recovery' below 'exposure' - how do I get Camera Raw to open with the current interface?
    Thanks for any help.
    Craig

    If you're referring to the Process version, you set that in the Camera Calibration tab of ACR.
    Also keep in mind that any images with prior adjustments will show the Process used when they were adjusted.  That can also be changed in that tab.

  • Is the remote interface implemented by some class

    Hi,
    I have a simple question, googled, no help.
    I am trying to udnerstand, where exactly is the remote interface implemented ?
    I mean, i know that it contains all the business methods which have a body in the bean.
    But is the remote interface implemented somewhere ? Is there any class which implements the Remote interface ?
    thanks
    S

    Sarvananda wrote:
    Hi,
    I have a simple question, googled, no help.look better...
    I am trying to udnerstand, where exactly is the remote interface implemented ?
    I mean, i know that it contains all the business methods which have a body in the bean. so, that's what implements it :)
    But is the remote interface implemented somewhere ? Is there any class which implements the Remote interface ?
    the bean class :)
    But the actual implementor is a class generated by the appserver that delegates to the bean class.

  • Session Bean - Why the Remote Interface?

    Hi,
    I have a stateless session bean that takes a serializable object
    as a parameter and passes it to an entity bean to persist. My question
    is: why should I put the method (addxxx) in the remote interface of my
    session bean? Why can't I just put it in the home interface so that I
    don't have to instantiate the EJB object first, then call the method?
    Any pros/cons? Thanks.
    -Linus

    You could use the Home.create() method. Generally, the home interface is
    used to manage the lifecycle of a EJB. Theoretically, you are right in your
    thinking because a stateless session bean does not preserve any state and is
    alive for the duration of a method call.
    "Linus" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I have a stateless session bean that takes a serializable object
    as a parameter and passes it to an entity bean to persist. My question
    is: why should I put the method (addxxx) in the remote interface of my
    session bean? Why can't I just put it in the home interface so that I
    don't have to instantiate the EJB object first, then call the method?
    Any pros/cons? Thanks.
    -Linus

  • By default, the 3d interface & dialog opens when the 3d option is selected. i forgot the question HA

    by default, the 3d interface & dialog opens when the 3d option is selected. (ya know, the grid on the artboard; 3d tools...etc...) I must have checked the box for it to never appear, because it doesn't appear and I'm not skilled enough with CC to operate Photoshop without it. My question is how would i enable this manually?

    I've noticed on FF29 that the "Save and Quit" "Quit" "Cancel" Option has disappeared. The normal changing of preferences in Firefox about:config below won't work.
    Type about:config into the address bar and press enter
    Accept the warning message that appears, you will be taken to a list of preferences
    Locate the preference browser.tabs.warnOnClose , if its value is set to false, double-click on it to change its value to true
    Repeat this for these 3 preferences ''browser.warnOnQuit'', ''browser.warnOnRestart'' and '''browser.showQuitWarning''
    To get the Save and Quit warning box back you have to Type about:config into the address bar and press enter
    Accept the warning message that appears, you will be taken to a list of preferences
    Right click on an open space in the preferences settings field and select a new Boolean and enter ''browser.showQuitWarning'' and click on OK, then make sure that it's set to true

  • If I use the remote with two macbooks in the same room both of them answer

    If I use the remote with two macbooks in the same room, the two of them answer. So if the person sitting near me is doing something else I interrupt them... this is quite annoying!
    Does anyone know how to solve this? Should I report it as a bug? Where?

    Hi Carito,
    It is not a bug, all you have to do is pairing them.
    Here is the link:
    http://docs.info.apple.com/article.html?artnum=302545
    and:
    http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh2275.html
    Good Luck.

  • By default, the 3d interface & dialog opens when the 3d option is selected. (ya know, the grid on th

    by default, the 3d interface & dialog opens when the 3d option is selected. (ya know, the grid on the artboard; 3d tools...etc...) I must have checked the box for it to never appear, because it doesn't appear and I'm not skilled enough with CC to operate Photoshop without it.

    I've noticed on FF29 that the "Save and Quit" "Quit" "Cancel" Option has disappeared. The normal changing of preferences in Firefox about:config below won't work.
    Type about:config into the address bar and press enter
    Accept the warning message that appears, you will be taken to a list of preferences
    Locate the preference browser.tabs.warnOnClose , if its value is set to false, double-click on it to change its value to true
    Repeat this for these 3 preferences ''browser.warnOnQuit'', ''browser.warnOnRestart'' and '''browser.showQuitWarning''
    To get the Save and Quit warning box back you have to Type about:config into the address bar and press enter
    Accept the warning message that appears, you will be taken to a list of preferences
    Right click on an open space in the preferences settings field and select a new Boolean and enter ''browser.showQuitWarning'' and click on OK, then make sure that it's set to true

  • Convert a local interface to the remote interface

    Hello *
    Is it possible to convert a local interface to the same bean's remote interface?
    Regards,
    Lukas

    Thanks for the reply.
    I have simpliefied the lookup to the following:
    Context ctx = new InitialContext();
    spiHome = (ServiceProviderBeanLocalHome) ctx.lookup ("ServiceProviderBeanEJB");
    I still get the following exception:
    javax.naming.NameNotFoundException: ServiceProviderBeanEJB not found
    at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:174)
    I looked up the deployment descriptor from J2EE RI and took the name
    to lookup from the ejb-name:
    <ejb-jar>
    <display-name>localSPIJAR</display-name>
    <enterprise-beans>
         <entity>
              <display-name>ServiceProviderBeanEJB</display-name>
              <ejb-name>ServiceProviderBeanEJB</ejb-name>
    I presume that this is the correct name to use.

  • How to keep the ethernet interface up when removing the cable?

    On 10.6 I notice that if the ethernet cable is unplugged, it will not bring the interface up. As a result, I cannot test my server without the interface attached. For instance, if en0 is 192.168.2.10 and a web server is running, the local DNS translates the web servers domain to 192.168.2.10, I cannot reach my own web server as there is no route to host. This is probably energy conservation issue, but it makes life rather unpleasant, because if the interface goes down when there is a cable problem, I also get all sorts of internal problems because of the missing host (e.g. a virtual machine looking for a DNS server on 192.168.2.10 which is suddenly unreachable).
    This was not the case with 10.5 Server and I think the last time I had this kind of behaviour was with my NeXT cube where the en0 interface would not come up without a cable attached to it and a switch.
    So, is there a way I can force OS X 10.6 to bring up the en0 interface on 192.168.2.10 no matter what?

    I have made my DNS reachable at all times by using 127.0.0.1 for the "DNS to use" in my ethernet settings in System Preferences.
    Using localhost is no go, as I am running three separate IP-addresses (three en intrerfaces) on my single RJ-45. This way, I can let several web sites for different domains listen to different IP-addresses. Furthermore, I can make sure on the router's NAT that for instance only one of those gets the port 443 traffic and that one does not get port 80 and the other way around.
    The solution I have now is a cable attached to a switch attached to nothing else. But it is inelegant, I'd rather know how to make the interfaces come up regardless what is attached to the RJ-45.

  • How do you set the remote only to work with the MacBook and not the Hi-Fi.

    I have a Hi-Fi Apple stereo hooked up to my Macbook but when I use the Apple remote, it controls both things.
    So if I am scrolling through my music in Frontrow then the volume on the Hi-Fi stereo is turning down or up depending on which way I am scrolling.
    My question is:
    How do I make the remote work with only my MacBook?

    Pair the remote with your macbook by isolating it point the remote at it while holding down the menu and next buttons. You see like a chain appear and that will mean the remote is paired. Now only the macbook will only respond to the macbooks remote. Do the same with the Hi-Fi remote and now the hi-fi will only work with the hi-fi remote.

  • Since upgrade to Windows 8, cannot save .rdp files under the Remote Desktop Connection application on the Desktop

    Since I upgraded to Windows 8, I am no longer able to save individual Remote Desktop Connection files as .rdp files. I am talking about the traditional Remote Desktop Connection application on the Desktop that was in previous Windows versions, not the
    Remote Desktop App from the Windows 8 store.
    When I try to click on the Save button I get "An error occurred while saving to file"
    When I try to click on the Save As button I get "Unable to open connection file" with the file address being where I tried to save it with the file name at the end.
    Also when I upgraded to Windows 8, my .rdp files disappeared from my Documents folder.
     I need to create different .rdp files for different programs that my employees get into on my server. Now I have to hand type all the info each time into the Programs tap on the Remote Desktop Connection window, because I can't save to an
    .rdp file.
     I like the Remote Desktop App from the Windows store but it won't let me designate specific programs to use using standard dos notation (ie c:\program files\ etc..). It just goes to my server desktop.
     I want to promote Windows 8 to my employees but I need either .rdp files for the traditional Remote Desktop Connection or the ability to open specific programs using dos notation in the Windows Store Remote Desktop App.

    I know this is an old post but others might still be having the problem. Here's what I did.
    Create a new text file and open it in notepad. Copy the below into it and edit for your environment. (IP, screen size).
    screen mode id:i:2
    desktopwidth:i:1920
    desktopheight:i:1080
    session bpp:i:24
    auto connect:i:0
    full address:s:192.168.x.x
    compression:i:0
    keyboardhook:i:2
    audiomode:i:2
    redirectdrives:i:1
    redirectprinters:i:1
    redirectcomports:i:1
    redirectsmartcards:i:1
    displayconnectionbar:i:1
    username:s:USERNAME
    domain:s:DOMAIN
    alternate shell:s:
    shell working directory:s:
    disable wallpaper:i:1
    disable full window drag:i:1
    disable menu anims:i:1
    disable themes:i:1
    bitmapcachepersistenable:i:1
    use multimon:i:0
    winposstr:s:0,3,0,0,800,600
    audiocapturemode:i:1
    videoplaybackmode:i:1
    connection type:i:7
    networkautodetect:i:1
    bandwidthautodetect:i:1
    enableworkspacereconnect:i:0
    allow font smoothing:i:0
    allow desktop com:0
    disable cursor setting:i:0
    redirectclipboard:i:1
    redirectposdevices:i:0
    drivestoredirect:s:*
    autoreconnection enabled:i:1
    authentication level:i:2
    prompt for credentials:i:0
    negotiate security layer:i:1
    remoteapplicationmode:i:0
    gatewayhostname:s:
    gatewayusagemethod:i:4
    gatewaycredentialssource:i:4
    gatewayprofileusagemethod:i:0
    promptcredentialonce:i:0
    gatewaybrokeringtype:i:0
    use redirection server name:i:0
    rdgiskdcproxy:i:0
    kdcproxyname:s:
    You don't need to worry too much about what's in here. Save the text file as
    filename.rdp then rightclick on the file and select edit. The familiar GUI rdp session editor will open. You can make changes in the GUI and
    save or save as a different session.
     Hope this helps.

  • Why in jndi tree I find the remote interface to String is so strange?

              when I view the jndi tree in weblogic server 61sp1
              I found such information:
              Bind Name: Enterprise1
              Class: class $Proxy94
              to String: ClusterableRemoteRef(10.132.0.161 [10.132.0.161])/275
              hash Code: 4568198
              Why the Class and to String like such? my license.bea
              is not a cluster version.
              

              Thanks you very much
              "Kumar Allamraju" <[email protected]> wrote:
              >EJB's are compiled with clustering options "ON". that's why you are seeing
              >a
              >ClusterableRemoteRef.
              >Don't worry, you will not be able to run WLS instances in cluster mode
              >without having a cluster license.
              >
              >--
              >--
              >Kumar
              >
              >"Eric nie" <[email protected]> wrote in message
              >news:3ca8238a$[email protected]..
              >>
              >> when I view the jndi tree in weblogic server 61sp1
              >> I found such information:
              >>
              >> Bind Name: Enterprise1
              >> Class: class $Proxy94
              >> to String: ClusterableRemoteRef(10.132.0.161 [10.132.0.161])/275
              >> hash Code: 4568198
              >>
              >> Why the Class and to String like such? my license.bea
              >> is not a cluster version.
              >>
              >
              >
              

  • Where should the interface be? (extending the Remote interface)?

    Hello,
    I've created a simple rmi server on one machine, sonsisting of two files:
    OkServer.java:
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface OkServer extends Remote {
    public String getOk() throws RemoteException;
    }OkServerImpl.java:
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface OkServer extends Remote {
    public String getOk() throws RemoteException;
    }and on another machine, I've created a client:
    import java.rmi.RMISecurityManager;
    import java.rmi.Naming;
    public class OkClient {
    public static void main (String args[]) throws Exception {
         if (args.length != 1)
         throw new RuntimeException("Syntax: OkClient <hostname>");
         System.setSecurityManager(new RMISecurityManager());
         OkServer OkSvr = (OkServer)Naming.lookup("rmi://" +
                                  args[0] + "/OkServer");
         String when = OkSvr.getOk();
         System.out.println(when);
    }Now the problem is, when I try to compile the client (only consisting the file above),
    it says of course:
    OkClient.java:36: cannot find symbol
    symbol : class OkServer
    }This is normal, right?
    Then, I should copy the interface (that is also at the server) to the client machine?
    So the interface file HAS TO BE on both the server and the client????

    If you want to install OVM with the production option then you will basically need three distinct hosts:
    a) the database host, where you install SE/EE on (XE is not for production use and not supported for production use!)
    b) install OVM Manager on any computer running OEL 5 (or later)
    c) install OVM Server on a bare metal host who's hardware is supported
    As far as the SE/EE license goes: Oracle always allows anyone to download and install their software to try it out. If you are putting your setup into production, that is not covered and demands an support contract with Oracle. And from using Oracle for many years, there will come the day when you will need it… ;)
    So long story short: grab the Oracle SE/EE installation and be familiar with it - Oracle DB that is, otherwise you'll be sitting there pulling your hair out and yell at your computer.
    Or, try the not yet released 3.2.x version of OVMM with runs against MySQL - most likely the easy way to go.

Maybe you are looking for