Returning remote reference

Hi everybody, I'm having quite some trouble with RMI, everytime I try to return a reference to a Remote object on my server I get the usual "unmarshalling return" error. Problem is that my Object I'm trying to return actually implements the Remote interface:
public interface Bank extends Remote {
     public Account create_account (String name) throws BankException, RemoteException;
};the Implementation looks like this:
public class BankImpl implements Bank {
     public Account create_account (String name) throws BankException {
          Account k = new AccountImpl(name);
          return k;
}Again the interface and Implementation:
public interface Account extends Remote {
    public Account(String name);
public class AccountImpl implements Account, Remote  {
     private String name = null;
     AccountImpl(String name){
          this.name = name;
};I'm quite stuck here, is there something I'm missing??? I thought that function whose return type is some implementation of the Remote interface will automatically get passed by reference with an automatically generated stub.

It seems to me that having to actually extend the UnicastRemoteObject is quite a limitation.You don't have to. I gave you that as the simplest solution. If you don't extend UnicastRemoteObject, you have to export the object yourself with UnicastRemoteObject.exportObject(). Use the overload where you specify a port number, even if it's only zero (= any).
And somehow I'm unable to cast the generated Proxies to my Interfaces.
Actually I can only let my extend the "Remote" interface in my interfaces and them implement my Account interface and extend "UnicastRemoteObject" in the implementations and still it won't work.What happens? You'll have to show us the code ... btw is there something missing back there?
Still think I'm missing something...For sure. RMI works.

Similar Messages

  • Rmi remote reference lookup very slow in web start application

    I have a little problem with the RMI communication in a web start test application.
    It is a very simple program in which the client calls a remote object that returns a String.
    Everything seems to be working fine when i'm running/debugging the client app in eclipse, but when i package my client project into a jar file and run it as a web start application (i'm providing the jnlp on a local webserver) the remote reference lookup takes about 15 seconds.
    basically, what my client does is this:
    Registry registry = LocateRegistry.getRegistry(address);
    ServerTransaction st= (ServerTransaction) registry.lookup(name);
    String result = st.test();
    The server code looks like this:
    String name = "ServerTransaction";
    ServerTransaction engine = new DefaultServerTransaction();
    ServerTransaction stub = (ServerTransaction) UnicastRemoteObject.exportObject(engine, 0);
    Registry registry = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
    registry.rebind(name, stub);
    The server runs as a normal stand alone java application on my local machine as well.
    And here the content of the jnlp file for the client application:
    <resources>
         <jar href="WSTest.jar"/>
         <jar href="WSTestServer.jar"/>
         <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
         <property name="serverAddress" value="127.0.0.1" />
    </resources>
    <security>
         <all-permissions/>
    </security>
    <application-desc main-class="test.WSTest"/>
    As i said, the whole thing works when run as a normal java application as well as with web start, with the difference that the remote reference lookup takes about 15 seconds with web start.
    Can anyone tell me how i could go about this?

    Meanwhile, i tried the same thing at home on my xp machine (i use vista at work), and even though my test at home basically does the same thing (invoking a simple remote method that just returns "hello world") it worked pretty fast, contary to the 15 second hang on vista.
    So i can't really say where the problem is...
    I also found these two rmi properties
    sun.rmi.transport.connectionTimeout (1.1.6 and later)
    The value of this property represents the period (in milliseconds) for which socket connections may reside in an "unused" state, before the Java RMI runtime will allow those connections to be freed (closed). The default value is 15000 milliseconds (15 seconds).
    and
    sun.rmi.transport.proxy.connectTimeout (1.1 and later)
    The value of this property represents the maximum length of time (in milliseconds) that the Java RMI runtime will wait for a connection attempt (createSocket) to complete, before attempting to contact the server using HTTP. This property is only used when the http.proxyHost property is set and the value of java.rmi.server.disableHttp is false. The default value is 15000 milliseconds (15 seconds).
    Hoping it would help (totally clueless) i tried to set these as system properties via System.setProperty(...) to a lower value (if that even works this was - please correct me if i am totally wrong here) but it didn't help.

  • EJB Handle return remote ref fails??

    Having a problem getting a remote reference on an EJB using a handle. Create a remote ref to an EJB and store three items and display said items - okay
    Get a handle to the remote ref and serialize and store - okay
    Deserialize - okay
    Cast to remote ref - NOT okay wants a home ref?
    This example is, by and large, similar to the example in section 6.8 of the EJB 2.0 Spec.
    Need to know why I cannot get the remote ref returned? Is there an OC4J issue? Please let me know when you can as would like to use this in a class.
    THANKS - Ken Cooper
    public class CartClient {
    public static void main(String[] args) {
    CartClient cartClient = new CartClient();
    try {
    Context context = getInitialContext();
    CartHome cartHome = (CartHome) PortableRemoteObject.narrow(context.lookup(
    "Cart"), CartHome.class);
    Cart cart;
    // Use one of the create() methods below to create a new instance
    cart = cartHome.create();
    // Call any of the Remote methods below to access the EJB
    // cart.getItems( );
    // cart.addItems( java.lang.String p );
    cart.addItems("Truck");
    cart.addItems("Car");
    cart.addItems("Boat");
    System.out.println(cart.getItems());
    // Serialize and store in C:\cartHandle
    Handle cartHandle = cart.getHandle();
    FileOutputStream out = new FileOutputStream("C:/cartHandle");
    ObjectOutputStream so = new ObjectOutputStream(out);
    so.writeObject(cartHandle);
    so.flush();
    System.out.println("Serialized");
    // Deserialize from C:\cartHandle
    FileInputStream in = new FileInputStream("C:/cartHandle");
    ObjectInputStream si = new ObjectInputStream(in);
    cartHandle = (Handle) si.readObject();
    System.out.println("DeSerialized");
    Cart cart2 = (Cart) PortableRemoteObject.narrow(cartHandle.getEJBObject(),
    Cart.class);
    System.out.println("Second: " + cart2.getItems());
    } catch (Throwable ex) {
    ex.printStackTrace();
    private static Context getInitialContext() throws NamingException {
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    env.put(Context.PROVIDER_URL,
    "ormi://localhost:23891/current-workspace-app");
    return new InitialContext(env);
    OUTPUT AND ERROR FROM EXECUTION
    C:\JDev9031\jdk\bin\javaw.exe -ojvm -classpath C:\JDev9031\jdev\mywork\del15aug\Project4\classes;......
    Start: TruckCarBoat
    Serialized
    DeSerialized
    com.evermind.server.rmi.OrionRemoteException: Error looking up EJBHome at location 'Cart'
    javax.ejb.EJBObject com.evermind.server.ejb.StatefulSessionHandle.getEJBObject()
    StatefulSessionHandle.java:56
    void mypackage4.CartClient.main(java.lang.String[])
    CartClient.java:53 (NOTE: The highlighted line above is line 53)

    Thank you all guys for your suggests, and sorry for my (long) silence: i was at home with hard cough. I think that unfortunally the problem is more in deep. This because:
    1) at the beginnnig, in my (many) attempts I've tried to give the server url in a lot of ways:
    a) only the IP;
    b) http://<IP>;
    c) http://<IP>: <port>;
    d) http://<server-name>;
    e) http://<server-name>:<server-port>;
    b) iiop://<IP>;
    c) iiop://<IP>: <port>;
    d) iiop://<server-name>;
    e) iiop://<server-name>:<server-port>;
    In this cases, using init.put(org.omg.CORBA.ORBInitialHost,<param-value>) (init is Java Properties object), I didn't get what I would: always AppServer running on Win2000 responded me, instead of the one running on Linux.
    Using instead using init.put(Context.PROVIDER_URL,<param-value>) , in case a) I got the error message Root exception is java.net.MalformedURLException: no protocol:<IP-number>. In case b), c), d) and e) I got invalid url - connection refused error message (Invalid URL: http://gandalf.engiweb.com. Root exception is java.net.ConnectException: Connection refused: connect).
    A collegue of mine is using WebSphere and everything seems to work correctly. I'm afraid that there is a problem (of misconfiguration?) in the Borland Application Server. This is a problem, because, if I have (suppose) server gandalf running, with the correct EJB, and the server Saruman running too, but with the scorrect EJB, or the ejb container down, always respond me Saruman, not Gandalf: my tests gave me this result.
    At the moment I don't know what to do, except migrate to WebSphere, or another Application Server.
    Thank you a lot for your interest. Bye!

  • Problem calling a method in a servlet witch returns remote ejb

    Hi, I have a problem combining servlets ands ejbs, I expose my problem :
    What I have :
    1 . I have a User table into a SGBD with two attributes login and pass.
    2 . I have a UserBean linked to User table with a remote interface
    3 . I have a stateless UserSessionBean with a remote interface
    4 . I have a UserServlet linked to a jsp page which allows me to add users
    5 . I use Jboss
    What is working ?
    1 - I have a method newUser implemented in my UserSessionBean :
    public class UserSessionBean implements SessionBean {
      private SessionContext sessionContext;
      private UserRemoteHome userRemoteHome;
      public void ejbCreate() throws CreateException {
      // Initialize UserRemoteHome
      // Method to add a new user
      public UserRemote newUser(String login, String password) {
            UserRemote newUser = null;
            try {
                newUser = userRemoteHome.create(login, password);
            } catch (RemoteException ex) {
                System.err.println("Error: " + ex);
            } catch (CreateException ex) {
                System.err.println("Error: " + ex);
            return newUser;
    }2 - When I test this method with a simple client it works perfectly :
    public class TestEJB {
        public static void main(String[] args) {
            Context initialCtx;
            try {
                // Create JNDI context
                // Context initialization
                // Narrow UserSessionHome
                // Create UserSession
                UserSession session = sessionHome.create();
                // Test create
                UserRemote newUser = session.newUser("pierre", "hemici");
                if (newUser != null) {
                    System.out.println(newUser.printMe());
            } catch (Exception e) {
                System.err.println("Error: " + e);
                e.printStackTrace();
    Result : I got the newUser printed on STDOUT and I check in the User table (in the SGBD) if the new user has been created.
    What I want ?
    I want to call the newUser method from the UserServlet and use the RemoteUser returned by the method.
    What I do ?
    The jsp :
    1 - I have a jsp page where a get information about the new user to create
    2 - I put the login parameter and the password parameter into the request
    3 - I call the UserServlet when the button "add" is pressed on the jsp page.
    The Servlet :
    1 - I have a method doInsert which call the newUser method :
    public class UserServlet extends HttpServlet {
        private static final String CONTENT_TYPE = "text/html";
        // EJB Context
        InitialContext ejbCtx;
        // Session bean
        UserSession userSession;
        public void init() throws ServletException {
            try {
                // Open JNDI context (the same as TestClient context)
                // Get UserSession Home
                // Create UserSession
                userSession = userSessionHome.create();
            } catch (NamingException ex) {
                System.out.println("Error: " + ex);
            } catch (RemoteException ex) {
                System.out.println("Error: " + ex);
            } catch (CreateException ex) {
                System.out.println("Error: " + ex);
        protected void service(HttpServletRequest req, HttpServletResponse resp) throws
                ServletException, IOException {
         * Does insertion of the new user in the database.
        public void doInsert(HttpServletRequest req, HttpServletResponse resp) throws
                ServletException, IOException {
            try {
                // Get parameters to create the newUser
                String login = req.getParameter("login");
                String password = req.getParameter("password");
               // Create the newUser
                System.out.println("Calling newUser before");
                UserRemote user = userSession.newUser(login, password);
                System.out.println("Calling newUser after");
            } catch (Exception e) {
        // Clean up resources
        public void destroy() {
    Result :
    When I run my jsp page and click on the "add" button, I got the message "Calling newUser before" printed in STDOUT and the error message :
    ERROR [[userservlet]] Servlet.service() for servlet userservlet threw exception
    javax.servlet.ServletException: loader constraints violated when linking javax/ejb/Handle class
         at noumea.user.UserServlet.service(UserServlet.java:112)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Thread.java:534)
    Constat :
    I checked into my SGBD and the new user has been created.
    The error appears only when the method return Remote ejbs, if I return simples objects (Strings, int..) it works.
    What can I do to resolve this problem ?
    Thank you.

    "Why do you want to servlet to gain access to another EJB through the stateless session bean. Why cant the servlet call it directly ?"
    Because I want to access to the informations included in the entity bean UserBean (which is remote).
    You said that it is a bad design, but how can I access to my UserBean ejbs from the session bean if I don't do that ?
    For example I want a List of all users to be seen in a jsp page :
    1 - I call the method getUserList which returnsan ArrayList of UserRemote.
    2 - I iterate over the ArrayList to get the users parameters to be seen.
    As the other example (newUser), when I do
    ArrayList users = (ArrayList) userSession.getUserList(); with the simple client it works, but in the servlet I got the same error.
    But, if I call directly the findAll method (as you'are saying) in the servlet
    ArrayList users = (ArrayList) userRemoteHome.findAll(); it works...
    I think that if my servlet calls directly entity ejbs, I don't need UserSession bean anymore. Is that right ?
    I precise that my design is this :
    jsp -> servlet -> session bean -> entity bean -> sgbd
    Is that a bad design ? Do I need the session bean anymore ?
    Thank you.

  • Inclusive Free Goods Return with Reference

    Hi Gurus!
    Could you help me with my question below
    We are tring to create a sales order return with reference to a billing document. This billing document has two items where one is a standard item and the other is a inclusive free goods item.
    Example:
    1            AAA

    Hi
    When you have creating the sales order  with reference to billing document the items will be copied into the return order without any changes
    You can check the controls in the copy control VTAF
    Regards
    Damu

  • ORDERS05 - Create a Return with reference to a Sales Order

    Hi all,
    I'm trying to create a return with reference to a sales order via IDOC ORDERS05. I'm indicating referenced Sales Order number into segment E1EDK02; indicating qualifier (QUALFR = 002) and Sales order number (BELNR). By this way, I create a Customer Return but without reference.
    Which fields or segment have to be filled in order to create it correctly?
    Thanks
    Marí

    Correct...
    You need something like:
    *Get the pricing cond number.
    select single knumv from vbak into cond
      where vbeln = '0000080347'.
    if sy-subrc = 0.
    Get the pricing record which are by line item.
      select * from konv into table konv_tbl where knumv = cond.
    Loop thru them one line at a time.
      loop at konv_tbl.
       bapi_cond-itm_number = '000010'.
        bapi_cond-cond_st_no = konv_tbl-stunr.
        bapi_cond-cond_count = konv_tbl-zaehk.
    CALL FUNCTION 'BAPI_CUSTOMERRETURN_CREATE'
      EXPORTING
        RETURN_HEADER_IN               = bapi_hdr
       BUSINESS_OBJECT               = 'BUS2102'
        CONVERT                        = 'X'
      IMPORTING
        SALESDOCUMENT                 = bapi_salesdoc
       RETURN                        = BAPI_RET
      TABLES
        RETURN                        = bapi_ret_tbl
        RETURN_ITEMS_IN                = bapi_itm
        RETURN_ITEMS_INX               = bapi_itm_out
        RETURN_PARTNERS                = bapi_prtnr
        RETURN_SCHEDULES_IN            = bapi_schd_lin
        RETURN_CONDITIONS_IN           = bapi_cond.  "pricing
      ORDER_TEXT                    = bapi_text.

  • Behaviour when caching remote reference..

    In this application, whose crazy behavior I am trying to fix -
    there are 2 Message driven beans that process message out of certain queues(say, batch and realtime)
    There is a util class to which the MDB's onMessage() methods delegate. Util class in turn delegates all calls to a session bean. The session bean is accessed via a static member variable of remote reference, which is intialized during first call. Calls to session bean method can take around 2 min to complete. Given that, what will be the system behavior when there is a very huge volume of messages in One of the queues(say batch)? will each new message wait until the previous session bean call is over?
    What is a safe session bean pool size in a very high volume environment?
    TIA
    RC

    Each MDB will process its message, then go onto the next available one etc. Depending on the MDB pool size you should be able to process messages concurrently in different MDBs.
    The only thing to be careful of is that your transaction timeout is not set so low that the container thinks the MDB is blocked and rolls back the transaction.
    James
    http://logicblaze.com/
    Open Source SOA

  • Return by Reference/Return by Value

    Okay. I am suppose to create this accessor method that is not suppose to return by reference so as to protect the private variables.
    Firstly, I suppose for primitive data type I can :
    public int rtnInt() {
    int i = 0;
    int j;
    int j = i;//Primitive type creates new memory for variable
    return j; }
    Right? Or can I just return i? Will returning i result as a reference to i?
    Secondly, I am stumped on reference data type, example if I have :
    public String rtnstr() {
    String a = "a"
    String b;
    String b = a; //Can't do this right, it will just reference to the location of a?
    return b;
    So how do you actually copy a new a to and assign it to b? Oh ya, am I right to say arraycopy copies a new array and I don't have to worry about referencing?

    Noobie1987 wrote:
    Eh? So you mean to say I can just return or pass any variables, reference or primitive type, without fear of the original being modified?"Returning variables" does not pertain here, since when you return from a method, the variables are popped from from the stack and cease to exist. When you pass a variable to a method, a copy of that variable's value is used within the method. Changing the variable within the method does not affect the variable outside the method. Ever.
    But I thought 2 variables referencing the same memory location will affect each other if a change is made. AKA...
    String[] str = {0};
    String[] abc = str;
    abc[0] = 1;
    So str[0] will become 1?First, that example won't compile. Second, there is no passing of anything; just variable assignment.
    It is important to understand that variables do not contain objects. Read this: [http://www.javaranch.com/campfire/StoryPassBy.jsp]
    ~

  • Return remote button disabled

    I'm having trouble getting the Return remote control button to behave in a DVD that I'm authoring. If I set the Return button at the disc level to call a script that does some conditional jumps, then when I play the DVD in the simulator, the Return button is disabled during playback of tracks. It's also disabled when I play the DVD using Apple's DVD Player application. (The Menu button is set to call the same script and it works fine.) Similarly, if I just set the Return button to call the main menu directly, I still have the Return button disabled (get a "Not Permitted" message when playing in Apple DVD Player, for example.)
    I have looked at the User Operations at the track level, and nothing is disabled there. Is there somewhere else the source of this problem could be hiding?
    Thanks,
    --JV

    Yep... the Return button is not well implemented in DVDSP and I'd go so far as to say that you're probably better off not using it.
    The return button is designed to allow you to navigate the disc hierarchy... it is more properly called the 'go up' button... taking you from where you are back up one 'level'. In fact it really doesn't do this very well at all, and hasn't since v1. Trai Forrester wrote a pretty good article about it, but for the life of me I can't find it now.
    You'll need to find a way around the issue - like adding logical buttons on each menu to help with the navigation.

  • Java returning the reference of the current class.

    Hi,
    I want to write a method in Java to return the reference of the current class in a static manner i.e, without instantiating the class. Please help as to how to go about it.
    Thanks.

    Come on, at least point out where the guy is wrong.
    user563329 wrote:
    I want to write a method in Java to return the reference of the current class in a static manner i.e, without instantiating the class.There is no concept of a "current class" but I guess you meant "the class where the code is defined that the current thread is running now".
    However, that means that class (code) has been instantiated so your question makes no sense.
    If you want the class of the "current running code" use Object#getClass().
    You can reference a class without instantiating it but it will still be loaded. For example:
    public class TestInit {
        public static void main(String[] args) {
            System.out.println(Init.class.getSimpleName());
    class Init {
        static { System.out.println("Init init"); }
    // running it with java -verbose:class show Init is loaded but the static initializer is not run
    // loading lots of class ending with
    [Loaded TestInit from file:/C:/Projects/Dump2/Output/]
    [Loaded java.lang.Void from shared objects file]
    [Loaded Init from file:/C:/Projects/Dump2/Output/]
    Init
    [Loaded java.lang.Shutdown from shared objects file]
    [Loaded java.lang.Shutdown$Lock from shared objects file]

  • Remote reference to an RMI server

    I was going through some of the posts here and somebody mentioned : -
    "The Registry is a client that
    holds a reference to your remote object. If the remote object
    terminates, the reference remains, (as it would with any other
    client). You must manually purge the reference, (possibly with
    an unbind()).
    This is contrary to what I thought "the remote reference to an RMI server not implementing activatable remains valid as long as the server itself remains running and no longer. Is it a misunderstanding on my part?

    hi Ayesha,
    You are right
    "the remote reference to an RMI server not implementing activatable remains valid as long as the server itself remains running and no longer".

  • Remote reference is getting garbase collected

    Hi,
    I'm using Weblogic 5.1, on Windows NT.
    I have RMI remote object on the server side, and my client is an applet.
    In the applet I use JNDI to get the reference of the server object, and
    use it. The problem is after sometime ( like 10 min or so) I get
    weblogic.rmi.NoSuchObjectException
    and at the WLServer console I see
    ' <DGCServer> tried to renew lease for 1 lost reference'.
    At the server side, I bind the object using JNDI.
    I want thsi reference to be available all the time in the applet.
    any help is appreciated.
    thanks,
    Abdul.

    thanks, I will try and let you know by tomorrow.
    I tried both methods, you suggested, but i didn't get any errors. I still
    have to test the client connections and see whether they are gc'd or not.
    i gave a idletime of 1000.
    - Sam Jacob
    Iconixx Corp.
    Wei Guan <[email protected]> wrote in message
    news:[email protected]...
    set
    weblogic.rmi.dgc.idlePeriodsUntilTimeout=xxx
    in your weblogic.properties file.
    If it didn't work (I haven't tested),
    use -Dweblogic.rmi.dgc.idlePeriodsUntilTimeout=xxx in your startup script.
    Give a try and let me know.
    Cheers - Wei
    Sam <[email protected]> wrote in message
    news:[email protected]...
    how do you set this property.I think i have the same issue.
    Sam Jacob
    Iconixx Corp.
    Wei Guan <[email protected]> wrote in message
    news:[email protected]...
    You can tune up this property:
    weblogic.rmi.dgc.idlePeriodsUntilTimeout
    The default is 2. WebLogic will dereference a remote object referece
    if
    that
    reference hasn't been referenced for a period of time. The timeout
    value
    is
    determined by this property and other properties. The default idle
    timeout
    is 360 secs when idlePeriodsUntilTimeout=2. Use this formula to figurethe
    timeout: 60 x (4 + idlePeriodsUntilTimeout).
    Use at your own risk. If you set up this value too high, there will be
    unused remote reference on WebLogic server for cleaning up, which inturn
    degrade WeLogic performance.
    My 2 cents.
    Cheers - Wei
    aroshan <@cisco.com> wrote in message
    news:[email protected]...
    Hi,
    I'm using Weblogic 5.1, on Windows NT.
    I have RMI remote object on the server side, and my client is anapplet.
    In the applet I use JNDI to get the reference of the server object,and
    use it. The problem is after sometime ( like 10 min or so) I get
    weblogic.rmi.NoSuchObjectException
    and at the WLServer console I see
    ' <DGCServer> tried to renew lease for 1 lost reference'.
    At the server side, I bind the object using JNDI.
    I want thsi reference to be available all the time in the applet.
    any help is appreciated.
    thanks,
    Abdul.

  • Remote references

    Hi all,
    We have our product (RMI Client) that has references to objects that belong to various RMI servers running in different systems. This seem to spawn many RMIRenewClean and RMI ConnectionExpiration threads for each end point and they seem to still hang around for a long time.
    Obviously, there must be still some references I am holding to, which I am not aware of. Is there a way to find out which reference objects these threads are waiting to be released? Is there some RMI properties I need to set so as to get these logged somewhere?
    Thanks in advance
    Anand

    The home stub does know which host/port it was connected to, and I
    believe by default will attempt to reconnect. As long as you restarted
    the server on the same host/port, it can reconnect.
    That being said, it's probably a good practice to redo the JNDI lookup.
    -- Rob
    Emma wrote:
    I am currently investigating a problem with the reconnection of a client to the weblogic server after a server crash.
    We have a stateful session bean which provides functionality for logon and session management of the client. When the client first performs a logon, a lookup to the JNDI is done to get a remote reference to this bean's home object. Then the create method on the home interface is called to create the bean instance. If the server crashes then the reconnection code is called. This currently only contains the call to the create method and doesn't peform any JNDI lookups. I was expecting all references to be lost when the server crashed and therefore thought that this reconnection wouldn't work but it does! (The weblogic instance is not clustered) Does anyone have an explanation as to why this might happen?

  • Activatable Servers and Remote References [RMI]

    Hello everyone,
    I'm wondering if there's a way to know, on an activatable server, how many clients have an active reference to that and their id. I need to know exactly who did not renew his lease with the server, and once I know it I can remove that client from a list of logged-in client..
    example:
    client "user1" gets a remote reference of the activatable server, that adds "user1" to a logged-in-list I made (like a online userlist in a forum). suddenly user1 crashes without invoking "logout" method (and for the userlist he's still online!).
    Once the lease for user1 expires, the activatable servers decreases the remoteRef count.
    I'd like to associate the client username with the remote reference or the lease in some way, so once a client lease is not renewed I know for sure who I've to remove with the server from the online userlist..
    Hope you can understand my problem, thanks in advance
    Edited by: Guguz on 28-dic-2010 6.44

    Each time a client connects to the login server, I give him a new activatable server.A new server. Making it activatable is pointless: you're creating it dynamically per client. Only the login server needs to be activatable. It goes something like this, modulo typos:
    public interface Login extends Remote
      Session login(String username, char[] password) throws RemoteException;
    public class LoginImpl extends Activatable implements Login
    public interface Session extends Remote
      // your session API here
      void logout() throws RemoteException; // explicit logout
    public class Session extends UnicastRemoteObject implements Session, Unreferenced
      // ... implementation of your session API
      // Unreferenced.unreferenced()
      public void unreferenced()
        // Log the enforced logout via unreferenced()
        logout();
      // logout()
      public void logout()
        // Log the logout
        // call UnicastRemoteObject.unexportObject(this, true);
        // and do whatever else you have to do when a client logs out
    In the activatable unreferenced methodIn the Unreferenced.unreferenced() method
    then I can put the "logout user".And wherever else it should go.
    And this should prevent crashes right ?Wrong. It won't prevent crashes. It will detect them.

  • Goods return without reference to a Material Document or delivery note

    Hi
    Is there a way to do Goods return without a material document. Please suggest.
    The situation is that a material will go to the field (material is being maintained against a serial number profile) and let suppose that it is returned after a few years of use. Then in such a situation I need to take it back into the stock through a return delivery. But it may not be possible to track the material documnet against which GI was done few years back. SO i need to have a provision that either goods be returned with a reference of a material Document OR I should be able to track the material document in the system (through a report) using the serial number. Request you to please suggest on these two cases.
    Also we are not having procurement process in our organization. we do GR and GI only in regard to inventory movement.
    Thanks,

    Check
    Customer returns without billing reference

Maybe you are looking for