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.

Similar Messages

  • 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

  • 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

  • Select Grant on local Table to the Remote Oracle User

    How Can we Give a SELECT Grant on a Specific Table to the Remote Oracle User.

    IIRC, the remote user accesses local objects via a schema on the local database. That suggests you need to grant SELECT on the local table to the local schema that the remote user connects by.

  • How to automatica​lly disable the wireless interface when the LAN interface is connected

    Hi,
    Is there a way to automatically disable the wireless interface when the LAN interface is connected on  R61s and X61s?
    Thank you!

    Hi,
    Thanks for the answer. I'm trying to deploy the profile that I've created on all my laptops. But i'm facing an issue for a while.
    When the profile is deployed on a laptop, Access Connections finds a new ethernet port and asks to assign it a profile. But the problem is that Access Connection don't allow me to assign it to my wired profile, only to my wireless profile and that doesn't make sens to me. Besides, it is written in the dialogue box that ethernet profiles are disable for the match of the new port...
    Is there any way to assign the new port to the new profile without human interaction or just how to make the wired profile available when access connection is launched and find a new ethernet connection
    Thanks in advance!

  • 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.

  • Trying to create a local instance of the remote object

    Hi,
    I have a ClassA on which I need to be able to invoke RMI calls. Problem is the interface which ClassA implements does not throw exceptions. To get around this problem I have created a wrapper class ClassWrap which has a ClassA attribute and calls made to ClassWrap are directed to this ClassA object. A facade type design I think it's called.
    ClassWrap implements Remote so it can be used as a Remote object.
    When I create an instance of ClassWrap and deploy it on a server, my client has no problem communicating with the remote ClassWrap object via a remote stub ClassWrap_Stub.
    Problem is I also want my client to be able to use a local instance of ClassWrap. Whan I try to create an instance of ClassWrap in my client I get a remote Exception ... but !! when I have a ClassWrap_Stub object in my classpath then there is no problem creating a ClassWrap object.
    Any ideas why this happens?

    What you are trying to do should work just fine. Do you have the wrapper class file in your client jar?

  • LRCC/LR6 Touchscreen issues in both the new "touch interface" and the standard interface.

    Currently there is no way to add local adjustments via a touchscreen (Acer R7, Windows 8.1). With the new features added for touch the only things that happens when I touch or swipe on the photo are setting flags, zooming, and advancing to the next photo.This is the same behavior whether I'm in the new touch interface or the standard one. I had no issues adding or editing graduated filters, radial filters, adjustment brushes, etc with the touchscreen in Lightroom 5. Also touch doesn't register within the tone curve.

    Yes, Adobe, please fix this!!!
    I have a 27" touchscreen monitor and previously had no problem applying brush adjustments in LR5 by applying my finger onto the screen, thereby giving me enhanced accuracy.  Suddenly, with LR6/LRCC, the same action yields the virtually useless result of advancing to the next image. 
    This is exceptionally stupid!

  • How to synchronize a local file with the remote copy.

    I have a local file (file.txt) inside the directory of my java application and also a copy in a remote machine. Every time I start the application I want to check if the remote copy has been updated and if yes, synchronize the local copy. If you have done this before, please let me know. Thank you very much!

    you could make a URL connection to that file, check it's lastModified date, and download if you need to update

  • 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.
              >>
              >
              >
              

  • How can I preserve the modify date of the files I transfer from my local computer to the remote webserver?

    How can I make sure the the modify date of files are not updated to the date the file was uploaded or downloaded.
    There are multiple people working on my sites and I am the only one that uses Dreamweaver.  The problem this presents is when  one of my colleagues works on an image and I want to update my local computer it changes the date of the image to the date that I downloaded it and now when I compare what I have on my local computer to what is on the server they are different modify dates.

    Dont think you can find out the date of purchase!
    Where should know this without a payment bills or sales checks.
    What you can do is to find out when the notebook was registered on the Toshiba page.
    [Toshiba Warranty Lookup |http://computers2.toshiba.co.uk/toshiba/formsv3.nsf/WarrantyEntitlementLookup?OpenForm]

  • Get a remote interface from a local instance

    hi,
    I want to construct a bean locally on a server and then I want to pass the remote interface for that constructed bean back to a client. Is this possible?
    Thanks

    Yes. Take a look at SessionContext class. You can't construct a bean yourself, as its life is managed by container.
         * Obtain an object that can be used to invoke the current bean through
         * the given business interface.
         * @param businessInterface One of the local business interfaces
         *        or remote business interfaces for this session bean.
         * @return The business object corresponding to the given business
         *         interface.
         * @exception IllegalStateException Thrown if this method is invoked
         *         with an invalid business interface for the current bean.
        <T> T getBusinessObject(Class<T> businessInterface) throws IllegalStateException;

  • How to deside weather to write local interface or remote interface

    Hi All.
    in Ejb 2.0 the concept of local and remote interface is introduced.then how to deside weather to wrire local interface or to write remote interface.
    thanks

    Here in lies the problem. That decision shouldn't be up to a developer, it should be the role of the deployer who decides this. I think they got this wrong in 2.0, its been put at the wrong level. You as the coder need to make scalability decisions about the deployment, which you shouldn't need to. One of the big stengths of the EJB's is that anyone can code them because the container does the hard work for you. That paradigm has been broken now, IMHO.
    Having said that, I was at a SUN developer day just the other day and they suggested that the local interface was mainly for fine grained entity beans and that the course grained entity beans would access the fine grained over local interfaces thus allowing a 'cheaper' implementation of relationship modeling in the entity bean layer. In this scheme of things you would then use the remote interface from session beans to access the course grain entity beans.
    Cheers,
    Peter.

  • Super interfaces on EJB 3.0 Remote interface in OC4J 10.1.3

    We are implementing (on OC4J 10.1.3) an EJB 3.0 Stateless Session Bean with 2 business interfaces (remote and local) both of which extend an inteface we have defined in our system.
    When we look up the local interface we see our interface in the bean.
    When we look up the remote interface we do not see our interface in the bean.
    Any ideas?
    Thanks,
    Ed Dirago
    Computer Sciences Corp.
    FAA TFMS System

    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

Maybe you are looking for