Reg: Lookup

Hi,
Can any one send me the steps how to use the lookup in ODI.
I have got source, source/lookup and target.
Thanks,
Gvel

Becker,
In that case you specify your join condition to de executed on Stage or Target environnement. In first case the target-based lookup tabe will be loaded into Stage area in order to be joined. In the other case the join will be done directly on Target environnement, while inserting/updating the Target Table.
Shamil

Similar Messages

  • Registry.lookup() return Remote object from different ip address

    I've got this error using
    Registry reg = LocateRegistry.getRegistry(serverName, Registry.REGISTRY_PORT);
    service = (ILogin) reg.lookup("service");and when I use debugger I've got this
    RegistryImpl_Stub[UnicastRef [liveRef: [endpoint:[10.240.161.66:1099](remote),objID:[0:0:0, 0]]]]
    Proxy[ILogin,RemoteObjectInvocationHandler[UnicastRef [liveRef: [endpoint:[10.240.161.54:2074](remote),objID:[-4308ea07:116adade605:-7fff, 9133145996543447416]]]]]Why the Registry return a service from different IP address ?
    I've run this code for several times and it works. But today it cannot connect to the RMIServer.
    Any idea ?

    Thanks, i found my missing prppertis is
    // optional. Defaults to localhost. Only needed if web server is running
    // on a different host than the appserver
    props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
    // optional. Defaults to 3700. Only needed if target orb port is not 3700.
    props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
    to set the port and host back

  • RMI call back - How to refer to the client project from the server project?

    Hi, I am working on an RMI assignment which basically needs me to use the RMI call back for the server to notify the clients.
    I have 2 projects , one for the client and another for the server.
    In the client project, I have a client interface and the main client class implements this interface.
    In the server project, I have a server interface and a class that implements this interface.
    I can use the server interface in the client project's code by adding the server project in the path of the client project. it lets me use the server interface in the code if I put "import.." statement.
    But the issue is I can not do the same to access the client interface from within the server project's code. Since that will be a circular reference, the compiler does not let me use the client interface from within the server's code. This is putting me in a great difficulty and I am stuck here. What should I do so that I can use the client interface and the compiler won't complain?
    Thanks for any help..
    Regards.. js

    Let me explain what I tried: I manually generated stub class of the client using the Eclipse IDE as mentioned in my previous message. The StockMSClient_Stub.class got created in my client project.
    The common project has the 2 interfaces - one from the client and one from the server.
    I have added reference to the common project from the client and server projects to use the interfaces.
    With the above mentioned in place, when I run the server project, the registry binding of the server objects is very fine. But I am getting error in the applet at the line where I am passing the client object to the method provided by the server interface. The following is the code snippet in the applet where I am getting the error.
    specifically the line: String response = objs.login(userId, password, smsClient);     ====================
    public void login() {
                Registry reg = null;
                String userId = "test";
                String password = "test";
                this.smsClient = new StockMSClient();
                try {
         reg = LocateRegistry.getRegistry(rmiHost,rmiPort);
                          UserInterface obj = (UserInterface) reg.lookup(rmiStrings
                                                                                                                        [1]);
         User u = obj.find(userId);
         if (u == null) {
              System.out.println("This user is not valid");
         } else {
                         UnicastRemoteObject.exportObject(smsClient);
         reg = LocateRegistry.getRegistry(rmiHost, rmiPort);
         LoginLogoutInterface objs = (LoginLogoutInterface) reg
                                   .lookup(rmiStrings[0]);
                        //getting error at the following line.
                        String response = objs.login(userId, password, smsClient);     
                         System.out.println("response :" + response);
               } catch (AccessException ae) {
                       System.out.println(ae);
               } catch (NotBoundException nbe) {
                      System.out.println(nbe);
               } catch (RemoteException re) {
                      System.out.println(re);
    } //end login()====================
    Error is:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: sms.rmi.graphics.StockMSClient_Stub (no security manager: RMI class loader disabled)================
    I don't know why this is happening..Please help.
    thanks & regards, js
    Message was edited by:
    jsitaraman

  • Dont think RMi is HTTP tunneling through proxy firewall

    Hi Guys,
    Does anyone know how to monitor if RMI is using the option toHTTP tunnel through a proxy ???
    Many of clients sit behind firewalls/proxies that enable HTTP only. I thought RMI would, as a default, use HTTP tunneling POST, RESPONSe methods to get through, but it does not.
    Would that case be insted of using Naming.lokup("RMIServer"); that i should use
    Registry reg = LocateRegistry.getResgistry(serverAddress, serverPort);
    reg.lookup("RMIServer");
    Any help would be greatly appreciated.

    RMI doesn't have an option like that. Sockets do, and you get it for any socket including RMI by setting socksProxyHost and socksProxyPort.
    The RMI HTTP tunnelling thing happens when there is an HTTP server at the server side. which redirects the request to an RMI server via rmi-cgi.cgi or the RMI servlet. It's automatic, as a fallback, and you can enforce its use via a system property which you can find in the Javadoc Guide to Features/Remote Method Invocation/Useful java.rmi system properties.

  • Cannot invoke remote method

    can you please tell whatis wrong in the program.
    //the interface
    package com.nanotech.nanopos.synchronize.actions.user;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    import java.security.Key;
    import org.w3c.dom.Document;
    public interface ISyncUser extends Remote {
        public void updateUsers(Document d, Key keyEncryptKey) throws RemoteException;
    }// the object
    package com.nanotech.nanopos.synchronize.actions.user;
    import com.nanotech.framework.Framework;
    import com.nanotech.nanopos.user.bl.IUserBO;
    import com.nanotech.nanopos.user.bl.UserBO;
    import com.nanotech.nanopos.user.delegate.IUserDelegate;
    import java.rmi.MarshalledObject;
    import java.rmi.RemoteException;
    import java.rmi.activation.Activatable;
    import java.rmi.activation.ActivationID;
    import java.security.Key;
    import javax.crypto.SecretKey;
    import javax.crypto.SecretKeyFactory;
    import javax.crypto.spec.DESedeKeySpec;
    import org.apache.xml.security.encryption.XMLCipher;
    import org.apache.xml.security.utils.EncryptionConstants;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public class SyncUser extends Activatable implements ISyncUser{
        Document d;
        public SyncUser(ActivationID id, MarshalledObject data) throws RemoteException {
            super(id, 0);
        public void updateUsers(Document doc, Key keyEncryptKey) throws RemoteException {
            try {
                d = decryptFile(doc,keyEncryptKey);
                Element  root1 = d.getDocumentElement();
                NodeList nusers = root1.getChildNodes();
                Framework nanoFramework = Framework.getInstance();
                IUserDelegate userDelegate = (IUserDelegate) nanoFramework.getBean("userDelegate");
                for(int j=0; j < nusers.getLength(); j++){
                    Node n = nusers.item(j);
                    String s = n.getAttributes().getNamedItem("status").getNodeValue();
                    NodeList nl = n.getChildNodes();
                    IUserBO user = new UserBO();
                    user.setUserId(nl.item(0).getFirstChild().getNodeValue());
                    user.setUserName(nl.item(1).getFirstChild().getNodeValue());
                    user.setPassword(nl.item(2).getFirstChild().getNodeValue());
                    user.setRights(Integer.parseInt(nl.item(3).getFirstChild().getNodeValue()));
                    user.setStatus("S");
                    if(s.equalsIgnoreCase("A")){
                        userDelegate.addUser(user);
                    }else if(s.equalsIgnoreCase("E")){
                        userDelegate.updateUser(user);
                    }else if(s.equalsIgnoreCase("D")){
                        userDelegate.deleteUser(user.getUserId());
            } catch (Exception ex) {
                ex.printStackTrace();
        public Document decryptFile(Document doc, Key EncryptKey) throws Exception{
            // load the encrypted file into a Document
            Document document = doc;
            org.apache.xml.security.Init.init();
            // get the encrypted data element
            String namespaceURI = EncryptionConstants.EncryptionSpecNS;
            String localName = EncryptionConstants._TAG_ENCRYPTEDDATA;
            Element encryptedDataElement =
                    (Element)document.getElementsByTagNameNS(namespaceURI,
                    localName).item(0);
            // Load the key encryption key.
            String jceAlgorithmName = "DESede";
            // File kekFile = new File(fileName);
            DESedeKeySpec keySpec = new DESedeKeySpec(EncryptKey.getEncoded());
            SecretKeyFactory skf =  SecretKeyFactory.getInstance(jceAlgorithmName);
            SecretKey key = skf.generateSecret(keySpec);
            Key keyEncryptKey = key;
            // initialize cipher
            XMLCipher xmlCipher = XMLCipher.getInstance();
            xmlCipher.init(XMLCipher.DECRYPT_MODE, null);
            xmlCipher.setKEK(keyEncryptKey);
            // do the actual decryption
            xmlCipher.doFinal(document, encryptedDataElement);
            return document;
    //server
    package com.nanotech.nanopos.synchronize.actions.server;
    import com.nanotech.nanopos.synchronize.actions.user.ISyncUser;
    import java.net.MalformedURLException;
    import java.rmi.MarshalledObject;
    import java.rmi.Naming;
    import java.rmi.RMISecurityManager;
    import java.rmi.RemoteException;
    import java.rmi.activation.Activatable;
    import java.rmi.activation.ActivationDesc;
    import java.rmi.activation.ActivationException;
    import java.rmi.activation.ActivationGroup;
    import java.rmi.activation.ActivationGroupDesc;
    import java.rmi.activation.ActivationGroupID;
    import java.rmi.activation.UnknownGroupException;
    import java.util.Properties;
    public class SyncUserServer {
        public SyncUserServer(){
            try {
                System.setSecurityManager(new RMISecurityManager());
                Properties props = new Properties();
                props.put("java.security.policy", "com/nanotech/nanopos/synchronize/actions/security/security.policty");
                ActivationGroupDesc.CommandEnvironment ace = null;
                ActivationGroupDesc exampleGroup = new ActivationGroupDesc(props, ace);
                ActivationGroupID agi =
                        ActivationGroup.getSystem().registerGroup(exampleGroup);
                String location =  "file:com/nanotech/nanopos/synchronize/actions/user/";
                MarshalledObject data = null;
                ActivationDesc desc = new ActivationDesc
                        (agi, "com.nanotech.nanopos.synchronize.actions.user.SyncUser",location, data);
                ISyncUser syncUser = (ISyncUser)Activatable.register(desc);
                System.out.println("Got the stub for SyncUser");
                Naming.rebind("SyncUser1", syncUser);
                System.out.println("Exported from registration");
            } catch (RemoteException ex) {
                ex.printStackTrace();
            } catch (UnknownGroupException ex) {
                ex.printStackTrace();
            } catch (MalformedURLException ex) {
                ex.printStackTrace();
            } catch (ActivationException ex) {
                ex.printStackTrace();
    }//the client
    package com.nanotech.nanopos.synchronize.actions.user;
    import com.nanotech.framework.Framework;
    import com.nanotech.framework.action.IAction;
    import com.nanotech.nanopos.controller.NanoPOSController;
    import com.nanotech.nanopos.user.bl.IUserBO;
    import com.nanotech.nanopos.user.delegate.IUserDelegate;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    import java.util.ArrayList;
    import java.util.Iterator;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.TransformerFactoryConfigurationError;
    import org.w3c.dom.Attr;
    import org.w3c.dom.DOMException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import java.security.Key;
    import javax.crypto.SecretKey;
    import javax.crypto.KeyGenerator;
    import org.apache.xml.security.keys.KeyInfo;
    import org.apache.xml.security.encryption.XMLCipher;
    import org.apache.xml.security.encryption.EncryptedData;
    import org.apache.xml.security.encryption.EncryptedKey;
    public class UserSyncAction implements IAction {
        public void execute(Object controller) throws Exception {
            NanoPOSController nanoPOSController = (NanoPOSController) controller;
            Framework nanoFramework = Framework.getInstance();
            IUserDelegate userDelegate = (IUserDelegate) nanoFramework.getBean("userDelegate");
            ArrayList users = userDelegate.getAllUnSyncUsers();
            try {
                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                DocumentBuilder db = dbf.newDocumentBuilder();
                org.w3c.dom.Document d = db.newDocument();
                Element root =  d.createElement("nanoPOS");
                Iterator i =  users.iterator();
                while(i.hasNext()){
                    Element user = d.createElement("user");
                    IUserBO  userBO = (IUserBO) i.next();
                    Element userId = d.createElement("userid");
                    Element userName = d.createElement("username");
                    Element password = d.createElement("password");
                    Element rights = d.createElement("rights");
                    userId.appendChild(d.createTextNode(userBO.getUserId()));
                    userName.appendChild(d.createTextNode(userBO.getUserName()));
                    password.appendChild(d.createTextNode(userBO.getPassword()));
                    rights.appendChild(d.createTextNode(userBO.getRights().toString()));
                    user.appendChild(userId);
                    user.appendChild(userName);
                    user.appendChild(password);
                    user.appendChild(rights);
                    Attr status = d.createAttribute("status");
                    status.setValue(userBO.getStatus());
                    user.setAttributeNode(status);
                    root.appendChild(user);
                d.appendChild(root);
                Registry reg = LocateRegistry.getRegistry();
                ISyncUser syncUser = (ISyncUser) reg.lookup("SyncUser");
                syncUser.updateUsers(encryptFile(d),keyEncryptKey);
            } catch (DOMException ex) {
                ex.printStackTrace();
            } catch (ParserConfigurationException ex) {
                ex.printStackTrace();
            } catch (TransformerFactoryConfigurationError ex) {
                ex.printStackTrace();
        private Key GenerateSymmetricKey() throws Exception {
            String jceAlgorithmName = "AES";
            KeyGenerator keyGenerator =
                    KeyGenerator.getInstance(jceAlgorithmName);
            keyGenerator.init(128);
            return keyGenerator.generateKey();
        private  SecretKey GenerateKeyEncryptionKey() throws Exception {
            String jceAlgorithmName = "DESede";
            KeyGenerator keyGenerator =
                    KeyGenerator.getInstance(jceAlgorithmName);
            SecretKey keyEncryptKey = keyGenerator.generateKey();
            return keyEncryptKey;
        private void storeKeyFile(Key keyEncryptKey) throws IOException {
            byte[] keyBytes = keyEncryptKey.getEncoded();
            File keyEncryptKeyFile = new File("keyEncryptKey");
            FileOutputStream outStream = new FileOutputStream(keyEncryptKeyFile);
            outStream.write(keyBytes);
            outStream.close();
            System.out.println("Key encryption key stored in: "
                    + keyEncryptKeyFile.toURL().toString());
    Key keyEncryptKey;
        public Document encryptFile(Document d) throws Exception{
            org.apache.xml.security.Init.init();
            // generate symmetric key
            Key symmetricKey = GenerateSymmetricKey();
            // Get a key to be used for encrypting the symmetric key
            keyEncryptKey = GenerateKeyEncryptionKey();
            // Write the key to a file
            storeKeyFile(keyEncryptKey);
            // initialize cipher
            XMLCipher keyCipher =
                    XMLCipher.getInstance(XMLCipher.TRIPLEDES_KeyWrap);
            keyCipher.init(XMLCipher.WRAP_MODE, keyEncryptKey);
            // encrypt symmetric key
            EncryptedKey encryptedKey = keyCipher.encryptKey(d, symmetricKey);
            // specify the element to encrypt
            Element elementToEncrypt = d.getDocumentElement();
            // initialize cipher
            XMLCipher xmlCipher =
                    XMLCipher.getInstance(XMLCipher.AES_128);
            xmlCipher.init(XMLCipher.ENCRYPT_MODE, symmetricKey);
            // add key info to encrypted data element
            EncryptedData encryptedDataElement =
                    xmlCipher.getEncryptedData();
            KeyInfo keyInfo = new KeyInfo(d);
            keyInfo.add(encryptedKey);
            encryptedDataElement.setKeyInfo(keyInfo);
            // do the actual encryption
            boolean encryptContentsOnly = true;
            xmlCipher.doFinal(d,elementToEncrypt,encryptContentsOnly);
            return d;
    }//policy file
    grant {
    Permission java.security.AllPermission;
    //command used to run the program
    first i start the rmiregistryby the following command
    start rmiregisry
    the rmid deamon
    start rmid -J-Djava.security.policy=com\nanotech\nanopos\synchronize\actions\security\security.policy
    when i arn the program i getting the following exception
    java.rmi.activation.ActivateFailedException: activation failed; nested exception is:
    java.rmi.activation.ActivationException: Activatable object must provide an activation constructor; nested exception is:
    java.lang.NoSuchMethodException: com.nanotech.nanopos.synchronize.actions.user.SyncUser.<init>(java.rmi.activation.ActivationID, java.rmi.MarshalledObject)
    at sun.rmi.server.ActivatableRef.activate(ActivatableRef.java:285)
    at sun.rmi.server.ActivatableRef.invoke(ActivatableRef.java:114)
    at com.nanotech.nanopos.synchronize.actions.user.SyncUser_Stub.updateUsers(Unknown Source)
    at com.nanotech.nanopos.synchronize.actions.user.UserSyncAction.execute(UserSyncAction.java:86)
    at com.nanotech.nanopos.controller.NanoPOSController.actionPerformed(NanoPOSController.java:582)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
    at java.awt.Component.processMouseEvent(Component.java:5488)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
    at java.awt.Component.processEvent(Component.java:5253)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1766)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Caused by: java.rmi.activation.ActivationException: Activatable object must provide an activation constructor; nested exception is:
    java.lang.NoSuchMethodException: com.nanotech.nanopos.synchronize.actions.user.SyncUser.<init>(java.rmi.activation.ActivationID, java.rmi.MarshalledObject)
    at sun.rmi.server.ActivationGroupImpl.newInstance(ActivationGroupImpl.java:273)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
    at java.rmi.activation.ActivationGroup_Stub.newInstance(Unknown Source)
    at sun.rmi.server.Activation$ObjectEntry.activate(Activation.java:1277)
    at sun.rmi.server.Activation$GroupEntry.activate(Activation.java:972)
    at sun.rmi.server.Activation$ActivatorImpl.activate(Activation.java:243)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
    at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:179)
    at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
    at $Proxy17.activate(Unknown Source)
    at java.rmi.activation.ActivationID.activate(ActivationID.java:96)
    at sun.rmi.server.ActivatableRef.activate(ActivatableRef.java:258)
    ... 28 more
    Caused by: java.lang.NoSuchMethodException: com.nanotech.nanopos.synchronize.actions.user.SyncUser.<init>(java.rmi.activation.ActivationID, java.rmi.MarshalledObject)
    at java.lang.Class.getConstructor0(Class.java:2647)
    at java.lang.Class.getDeclaredConstructor(Class.java:1953)
    at sun.rmi.server.ActivationGroupImpl$1.run(ActivationGroupImpl.java:228)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.server.ActivationGroupImpl.newInstance(ActivationGroupImpl.java:222)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)

    i have done what u have said no i am getting following exception.
    java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
    java.io.EOFException
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:203)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
    at sun.rmi.server.ActivatableRef.invoke(ActivatableRef.java:124)
    at com.nanotech.nanopos.synchronize.actions.user.SyncUser_Stub.updateUsers(Unknown Source)
    at com.nanotech.nanopos.synchronize.actions.user.UserSyncAction.execute(UserSyncAction.java:85)
    at com.nanotech.nanopos.controller.NanoPOSController.actionPerformed(NanoPOSController.java:582)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
    at java.awt.Component.processMouseEvent(Component.java:5488)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
    at java.awt.Component.processEvent(Component.java:5253)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1766)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Caused by: java.io.EOFException
    at java.io.DataInputStream.readByte(DataInputStream.java:243)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
    ... 29 more
    also on the rmid console i am getting the following exception.
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:Exception in thread "RMI TCPConnection(2)-192.168.0.4" java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.0.4:1630 accept,resolve)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at java.security.AccessController.checkPermission(AccessController.java:427)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at java.lang.SecurityManager.checkAccept(SecurityManager.java:1157)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.checkAcceptPermission(TCPTransport.java:560)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at sun.rmi.transport.tcp.TCPTransport.checkAcceptPermission(TCPTransport.java:208)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at sun.rmi.transport.Transport$1.run(Transport.java:152)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at java.security.AccessController.doPrivileged(Native Method)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at java.lang.Thread.run(Thread.java:595)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:Exception in thread "RMI TCPConnection(2)-192.168.0.4" java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.0.4:1641 accept,resolve)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:at java.security.AccessController.checkPermission(AccessController.java:427)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:at java.lang.SecurityManager.checkAccept(SecurityManager.java:1157)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.checkAcceptPermission(TCPTransport.java:560)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:at sun.rmi.transport.tcp.TCPTransport.checkAcceptPermission(TCPTransport.java:208)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:at sun.rmi.transport.Transport$1.run(Transport.java:152)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:at java.security.AccessController.doPrivileged(Native Method)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    Sat Jul 01 16:07:32 GMT+05:00 2006:ExecGroup-1:err:at java.lang.Thread.run(Thread.java:595)
    Sat Jul 01 16:06:24 GMT+05:00 2006:ExecGroup-0:err:at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    Message was edited by:
    abdulKhaliq
    Message was edited by:
    abdulKhaliq

  • How to compile package which contain class outside the package

    I am writing a JDBC driver.
    I have the following package structure in the folder:
    MyDriver
        |_manager.jar
        |_com
               |_ jdbc
                       |_ HXDriver
                       |_ HXConnection
                       |_ HXResultSet
                       |_ HXStatementIn manager.jar, there is a remote object Interaface(Manager.java) which I need to use inside HXConnection.
    My question is how to compile(or/and how to set the classpath)so that I can compile the 4 classes inside jdbc package.
    I tried this:
    C:\MyDriver>javac -cp .;manager.jar com/hx/jdbc/*.java
    However, this does not work, compiler says it cannot find Manager
    Please help me.
    Cheers

    D:\380 Project\Driver>javac -cp .;manager.jar com\hx\jdbc\*.java
    com\hx\jdbc\HXConnection.java:21: cannot find symbol
    symbol  : class Manager
    location: class com.hx.jdbc.HXConnection
            private Manager manager;
                    ^
    com\hx\jdbc\HXStatement.java:18: cannot find symbol
    symbol  : class Manager
    location: class com.hx.jdbc.HXStatement
            private Manager manager;
                    ^
    com\hx\jdbc\HXStatement.java:20: cannot find symbol
    symbol  : class Manager
    location: class com.hx.jdbc.HXStatement
            public HXStatement(Manager manager){
                               ^
    com\hx\jdbc\HXConnection.java:41: cannot find symbol
    symbol  : class Manager
    location: class com.hx.jdbc.HXConnection
                            manager = (Manager)reg.lookup("manager");
                                       ^

  • Problem connecting RMI-Server using a servlet

    Hi All..
    I have a RMI-client server model woring fine in AIX box.I am currently in a need to create one web client(may be with servlet or JSP).
    I wrote a sample servlet which try to connect to the RMI server. But when I run the servlet Its simply try to connect and then wait for unlimited time,not even print any exception/error.
    Both my RMI sevrer and Tomcat are in the same box.
    I am sending the servlet code for your reference.
    import java.rmi.*;
    import java.rmi.registry.Registry;
    import java.rmi.registry.LocateRegistry;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import ir77.mon.engine.*;
    public class WebClient extends HttpServlet
    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    XmlServerIntf xmlServerIntf = null;
    PrintWriter out = res.getWriter();
    res.setContentType("text/plain");
    try{
    out.println("Connecting to server......");
    //Seems this one is sufficient.(either this code or the below one)
    //String strServerUrl = "rmi://" + "192.168.100.22" + "/ir77.mon.engine";
    //xmlServerIntf = (XmlServerIntf) Naming.lookup(strServerUrl);
    //Try with this one also
    Registry reg = LocateRegistry.getRegistry("192.168.100.22", 2004);
    xmlServerIntf = (XmlServerIntf) reg.lookup("rmi://192.168.100.22/ir77.mon.engine");
    out.println("Connected to server");
    catch (Exception e){
    System.out.println("Exception in WebClient"+e);
    when I run the servlet in the browser with "http://192.168.100.22:8080/WebClient" its simply prints " Connecting to server......" and waits.
    Note : 192.168.100.22 - where my rmi server starts and 2004 -where I created by rmiregistry.I created it using LocateRegistry.createRegistry(2004);
    I have tried starting tomcat with "-security" option too but no responds as well.
    Do I have to provide some grant permission in catlina.policy file?If yes what?
    currently I have tried with giving all permission..
    Do I need to change the RMI server code?
    Any help will be highly appreciated....

    Hi genady,
    Oh....Ya I like to...I thought no body was interested...as I didn't get any reply from anybody....
    Well The first thing is that with the look up method in the servlet
    it should be like :
    Registry reg = LocateRegistry.getRegistry("ip address of the rmi server", port number);
    RMIServerInterface = (type cast with RMIServerInterface) reg.lookup("rmi binding string");
    Now you are able to get the server interface object & you can call any method.
    Next you have to provide the grant permission in the catalina.policy file to the folder where you have your application like....
    grant codeBase "file:${catalina.home}/webapps/ROOT/WEB-INF/classes/-" {
    permission java.security.AllPermission;
    Or you can give specific permissions also.
    Finally you have to run the tomcat as : $catalina.sh start -security
    Note: One more thing you have to keep in mind that's the structure of your application. ie com.mon.yourapp.......u have to create the same structure in tomcat's classes folder .
    Its done...........

  • Starting and stopping an RMI server

    I'm trying to figure out how to best stop and start my server.
    My server class has two executions. One for starting and one for stopping.
    Start Steps:
    1) create my remote object ( an extension of UnicastRemoteObject )
    2) create a registry ( LocateRegistry.create() )
    3) bind my remote object
    When I run this start method of my RMI server class, everything get's set up. I'm not doing any sort of waiting loop or anything to determine the lifecycle of my server. My understanding is that my rmiregistry, and my registered remote object, will continue to be available indefinitely. Perhaps this is incorrect.
    Stop Steps:
    When I want to stop the server, I'm calling my stop method. This is another invocation of my server class, so it's a separate JVM. In this stop method I want to do the following steps:
    1) get the registry that I created earlier, by port number
    2) get my remote object via reg.lookup()
    3) unbind my remote obect ( reg.unbind() )
    4) unexport my remote object ( UnicastRemoteObject.unexport ( myRemoteObj, true ) )
    My concerns here are whether this makes sense. Does the unexport method work like this? i.e. from a remote handle to the object -- I'm not in the local JVM when the stop method runs. Also, does the rmiregistry "just die" at this point? It's not holding anything and when my method exits there's no reference to it anywhere. Except maybe in client code . . .

    My understanding is that my rmiregistry, and my registered remote object, will continue to be available indefinitely. Perhaps this is incorrect.That's correct as long as you store static references to them both in the server JVM.
    My concerns here are whether this makes sense. Does the unexport method work like this? i.e. from a remote handle to the objectNo. You have to have the actual remote object. You could make shutdown() an RMI method itself.
    Also, does the rmiregistry "just die" at this point?No, you have to unexport that as well.

  • NoRouteToHostException

    I've seen a few other threads with this issue, but I'm not quite sure why I'm having the issue.
    I'm running the RMI server and client on the same linux box. The server starts up on port 1099 and binds the object without issue.
    I start the client and can list the available objects, but when I attempt to invoke one of the mehtods, I get the NoRouteToHostException.
    I updated the CouponServicesLinkImpl default constructor to call the super constructor with 1099, but I think this is overkill.
    Any thoughts?
    Client Code
        public static void testClient() throws Exception
            Registry reg = LocateRegistry.getRegistry("localhost");
            String[] list = reg.list();
            System.out.println( list[0] );  // <<----successfully lists "CouponServices"
            CouponServicesLink link = (CouponServicesLink)reg.lookup("CouponServices");
            System.out.println( link.toString() );  // <<----Shows Proxy[ISPRemote,RemoteObjectInvocationHandler[UnicastRef [liveRef: [endpoint:[XX.XX.XX.XX:1099](remote),objID:[-536e44f3:129a950f14b:-7fff, -8506899594546368628]]]]]
            link.invokeRetrieveProcessAsRecords();  // <<-----thorows java.rmi.ConnectIOException: Exception creating connection to: XX.XX.XX.XX; nested exception is:        java.net.NoRouteToHostException: No route to host
            link.cleanup();
        }Server Code:
                System.out.println( "creating registry @ 1099");
                Registry registry = LocateRegistry.createRegistry(1099);
                System.out.println( "Creating object for registry");
                CouponServicesLink stub = (CouponServicesLink)new CouponServicesLinkImpl();
                System.out.println( "Binding CouponServices");
                registry.rebind( "CouponServices", stub);
                System.out.println( "Waiting for Clients");
            } catch (Exception e) {
                System.err.println("exception:");
                e.printStackTrace();
            }

    Gotcha. That corrected the issue and I appreciate the resource information.
    Is there an explanation about why the RMI server logic can properly serve the listings without the hostname property, but cannot serve the objects without it? Or is that just "the way it is".

  • RMI connection refused

    Hello to all,
    I have created and completed an RMI chat application and tested it on my localhost. It worked all right.
    Now I want to make it live i.e. run it through internet.
    Is it same as running on localhost only we have to change the IP address for locating registry.
    I have done that and uploaded the server file on host, also I have the IP address of that host.
    I have replaces localhost whit the give IP address but connection refused exception is thrown.
    I have located the registry on the server through IP address then when I use
    Registry reg=LocateRegistry("xx.xx.xx.xxx");
    System.out.println("1");
    chatAppIF chatStub=(chatAppIF)Naming.lookup("rmi://xx.xx.xx.xxx:xxxx/service");
    System.out.println("2");
    int i=chatStub.logMeIn(user,pass);
    System.out.println("3");Output screen shows
    1
    2
    Client exception: java.rmi.ConnectException: Connection refused to host: xx.xx.xx.xxx; nested exception is:
            java.net.ConnectException: Connection refused: connectWhile when i use
    Registry reg=LocateRegistry("xx.xx.xx.xxx");
    System.out.println("1");
    chatAppIF stub=(chatAppIF)reg.lookup("service");
    System.out.println("2");
    int i=chatStub.logMeIn(user,pass);
    System.out.println("3");it give output as
    1
    Client exception: java.rmi.ConnectException: Connection refused to host: xx.xx.xx.xxx; nested exception is:
            java.net.ConnectException: Connection refused: connectIs there is difference between naming.lookup() and reg.lookup() method?
    I think Naming.lookup() finds the registry but cannot find the method logMeIn() while reg.lookup() has no success.
    anyway why the connection is refused?

    The argument to Naming.bind()/rebind()/unbind() and Naming.lookup() is a URI of the form rmi://hostname[:port]/path.
    The argument to Registry.bind()/rebind()/unbind() and Registry.lookup() is just the path part.
    The data returned by Naming.list() is an array of URIs.
    The data returned by Registry.list() is an array of paths.
    In other words Naming.list() returns items which can be used as arguments to Naming.lookup(), and Registry.list() returns items which can be used as arguments to Registry.lookup().
    The reason is that when you construct a Registry, via LocateRegistry.getRegistry(), you supply the host and port at that point, so specifying it again in the bind/lookup string would be redundant. There's nothing stopping you doing that but the resulting name won't be compatible with what Naming.bind() would have done.

  • Using Applets and RMI on WL6 - Error marshaling transport header; nested exception is:  - java.io.EOFException

    I have a project that I am porting from WL5.1 to WL6. It was working fine
    in WL5.1
    but cannot get it working in WL6. So, I went back to the HelloWorld
    example to
    see if I could get it working. The problem I am having is basically getting
    applet to
    talk to a server via RMI. The applet works fine alone and RMI works fine
    alone.
    I can't get the applet to talk to the server via RMI.
    I am trying to get the "HelloWorld" applet example in WL6 working with RMI.
    I previously had the same app working in WL5.1 with SP9 but cannot get it
    working in WL6.
    I am running WebLogic Server 6.0 with SP2.
    I have registered a startup class in the WebLogic console
    named "HelloServer". When starting up the server, it states
    that the HelloImpl class has been registered as "HelloServer".
    When starting up the client applet I get the following error:
    java.rmi.MarshalException: Error marshaling transport header; nested
    exception is:
    java.io.EOFException
    These are two different methods of looking up the same object.
    The exception occurs at the "lookup" method call in both cases.
    "myserver" is the name of my machine that WL is running on.
    7001 is the port that WL is using.
    Registry reg = LocateRegistry.getRegistry("myserver", 7001);
    obj = (Hello)reg.lookup("HelloServer");
    or...
    obj = (Hello)weblogic.rmi.Naming.lookup("rmi://" +
    getCodeBase().getHost() + ':' + port + "/HelloServer");
    I previously ran this same program under WL5.1 SP9 and everything works
    fine.
    I defined the startupClass in the weblogic.properties file in WL5.1
    Can anyone tell my what is causing this exception and how to correct the
    problem?
    Thanks
    Terry Antle

    "Terry Antle" <[email protected]> writes:
    These are two different methods of looking up the same object.
    The exception occurs at the "lookup" method call in both cases.
    "myserver" is the name of my machine that WL is running on.
    7001 is the port that WL is using.
    Registry reg = LocateRegistry.getRegistry("myserver", 7001);
    obj = (Hello)reg.lookup("HelloServer");
    or...
    obj = (Hello)weblogic.rmi.Naming.lookup("rmi://" +
    getCodeBase().getHost() + ':' + port + "/HelloServer");
    I previously ran this same program under WL5.1 SP9 and everything works
    fine.
    I defined the startupClass in the weblogic.properties file in WL5.1
    Can anyone tell my what is causing this exception and how to correct the
    problem?I don't know what the problem is but you shouldn't be using either of
    these methods for looking up RMI objects - you should use JNDI instead.
    Thanks
    andy

  • Unmarshalling arguments Problem

    I'm new to RMI. I opened the rmi registry on windows , tried to run my server , but every time I run this server I get the exception:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
            java.lang.ClassNotFoundException: rmi.MyRemoteServer
            at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:396)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
            at sun.rmi.transport.Transport$1.run(Transport.java:159)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    .........Here is the code of my Remote Interface:
    package rmi;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface MyRemoteServer extends Remote{
        String sayHi() throws RemoteException;
    }and here is the code of my simple Server:
    package rmi;
    import java.rmi.RemoteException;
    public class Server  implements MyRemoteServer{
        public String sayHi() {
            return "Hi , I'm the fuckin' server.";
        public Server() throws RemoteException{
        super();
    }I searched for the answer and I noticed there is something called code base, Is this my problem ,If any one has an idea please let me know.

    Thanks I used c , and it worked , but when I tried to run the client I got an exception:
    java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:5000 connect,resolve)
            at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
            at java.security.AccessController.checkPermission(AccessController.java:546)
            at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
            at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)and here is the code of the client:
    package rmiclient;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    public class Client {
        public static void main(String[] args) {
           if(System.getSecurityManager()==null){
           System.setSecurityManager(new SecurityManager());
            try{
            Registry reg = LocateRegistry.getRegistry(5000);
            MyRemoteServer server = (MyRemoteServer) reg.lookup("HelloServer");
                System.out.println(server);
            }catch(Exception e){
            e.printStackTrace();
    }do you know what should I do?

  • RMI Doesn't Work Over Firewall

    Hi,I need urgent help!!! I am writing a RMI server which will be hosted behind the firewall and the client could be anyone. I started my RMI server but I have problem connecting to it. Here's my codes:
    If you look at the Client.java class, my code got as far as:
    Registry reg = LocateRegistry.getRegistry("216.16.45.33", 2001);
    I could get the registry but the lookup of "MyServer" failed. I encounter, the "java.rmi.ConnectException: Connection refused" at the Client side.
    More info:
    I am using Linksys router and I have already set the router to forward all traffics at port 2001 and 2999 to go to the computer that hosts the RMI server. Can someone point me to the right direction? THANKS GUYS!!!!
    ----FixedPortRMISocketFactory.java----
    import java.rmi.server.RMISocketFactory;
    import java.net.Socket;
    import java.net.ServerSocket;
    import java.io.IOException;
    public class FixedPortRMISocketFactory extends RMISocketFactory {     
    public ServerSocket createServerSocket(int port) throws IOException {
    port = (port == 0 ? 2999: port); //use some arbitrary fixed port.
    return new ServerSocket(port);
    public Socket createSocket(String host, int port) throws IOException {          
    return new Socket(host, port);
    ----End of MyRMIServer .java----
    ----MyRMIServer .java----
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.RMISecurityManager;
    import java.rmi.server.RMISocketFactory;
    import java.rmi.Naming;
    import java.rmi.registry.Registry;
    import java.rmi.registry.LocateRegistry;
    public class MyRMIServer extends UnicastRemoteObject implements HelloWorldIf {
    public boolean helloWorld() throws RemoteException {
    return "hello world";
    public static void main(String[] args) {
    if (System.getSecurityManager() == null) {
    // Create and install the security manager
    System.setProperty("java.security.policy","java.policy");
    System.setSecurityManager(new RMISecurityManager());
    try {     
    RMISocketFactory.setSocketFactory(new FixedPortRMISocketFactory());
    String host = "rmi://216.16.45.33:2001 + "/MyServer";
    MyRMIServer server = new MyRMIServer ();
    Registry reg = LocateRegistry.createRegistry(2001);
    Naming.rebind(host, server);
    System.out.println("MyServerbound on localhost");
    } catch (Exception e) {
    System.out.println("Error trying to bind MyServer.");
    e.printStackTrace();
    ----End of MyRMIServer .java----
    ----Client .java----
    import java.rmi.*;
    import java.rmi.registry.Registry;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.server.RMISocketFactory;
    public class Client {
    public static void main(String[] args) {
    if (System.getSecurityManager() == null) {
    System.setProperty("java.security.policy","java.policy");
    System.setSecurityManager(new RMISecurityManager());
    try {
    Registry reg = LocateRegistry.getRegistry("216.16.45.33", 2001);          
    HelloWorldIf server = (HelloWorldIf)reg.lookup("MyServer");
    System.out.println("****String got from server: " + server.helloWorld());
    } catch (Exception e) {
    System.out.println("****Exception looking for server.");
    ----End of Client .java----
    ----java.policy----
    grant {
    permission java.security.AllPermission;
    ----End of java.policy----

    On what platform (Linux or windows) your server is running?
    And more important, what IP address this server has?
    When it tries to bind object to IP that is not set to this machine, then it fails. RMI server does not say any error or something...
    I had the same problem. I added second interface (linux command):
    ifconfig eth0 xxx.xxx.xxx.xxx
    where xxx.xxx.xxx.xxx is my public IP.

  • REG: RFC lookup

    Hi all,
                 In my scenario i need to use RFC lookup for the receiver system . Can u guys suggest me a method how to implement the RFC lookup.
    Thanks,
    Siva.

    Hi,
    Check this blogs for the steps:
    1)Use this crazy piece for any RFC Mapping Lookups!
    2)The specified item was not found.
    Regards,
    Ramya Iyer

  • Reg : RFC Lookups

    Hi..
    Now i have a scenario for u instead :
    this is what gimme a solid realistic approach : 
    i have records in this format lets say :
    RecordID   ordertype
    900           0305
    900           0305
    920           DS01
    900           0304
    900           0305
    920           DS02
    Now here is what i have look into :
    for all 900's whose Ordertype is same i have to make a call and then to decide to create/change by an RFC Lookup, with this RFC Lookup i have to then decide on which IDOC i have to map to . So that means i have to sort all the records of 900's based on ordertype with in the mapping itself and then make a call to IDOC .
    I am not expecting whether to use XSLT / Java mapping ,  I can only use custom functions. Lemme know whatz the best approach?
    for all 920's its not that complex but all 920 goes to one IDOC.
    Any clue?
    regards..sankar

    Hi Michal,
    >>>>>I'd go with Shravan's approach for sure
    please send link for this, i do not have shravan's approach?
    Hope you got my problem: or else see follow:
    I am outlining the scenarios here :
    I have a flat file with a following type of records:
    RecordID   ordertype
    900           0305    ..............................
    900           0305    .............................
    920           DS01 .............................
    900           0304 .........................................
    900           0305 .....................................
    920           DS02 .......................
    930    -->not concerned with these type of records
    Now here is what i have look into :
    for all 900's whose Ordertype is same i have to make a call and then to decide to create/change by an RFC Lookup, with this RFC Lookup (i.e. i have to group all the records with ordertype same ) i have to then decide on which IDOC i have to map to .
    i.e. For all 900's with one ordertype if i find that there exists an OPEN_PO then i have to call one IDOC with one set of values along with values returned from that RFC
    if its OPEN_PO is blan that i should send values to another IDOC
    for all 920 records i have to call another IDOC .
    I am not expecting whether to use XSLT / Java mapping ,  I can only use custom functions.  well lemme know whatz the best approach?
    Please help
    thanks,
    regards
    sankar

Maybe you are looking for

  • CS4 Installation Problem on Mac - Error 2

    I have tried for several hours to make the new install of Adobe CS4 work. The Lightroom2 install worked fine. Background: I have a macbook pro, OS/X 10.5.7, enough avail disk space. I had a trial version of LR2 and full CS2. I have done the following

  • Change Sender of Mail for PO pdf layout

    Dear All, We send PO layout via mail to the vendors .For this process , we use standard program SAPFM06P . According to standard program , the sender of mail is creation of PO ,however , We need to change the sender . Is there any way to change the s

  • Guyz!!! Help Needed Very Urgent.

    I am not able to upload my cap file into jcop31 card using omni key reader,wat should i do? What can be the problem.Please analyse. /term "winscard:4|OMNIKEY CardMan 5x21 0"--Opening terminal /card -a a000000003000000 -c com.ibm.jc.CardManagerresetCa

  • IPhoto folders vs albums

    Some iPhoto tutorials show how to first create a folders, and then create albums in these folders.  Why do you need folders. Can you simply create albums of photos??

  • Invoking a web service through a client

    According to examples on e-docs.bea.com , a client is invoking a web service by writing a build.xml for itself and then deploying his code.It seems funny that a client is first deploying his code through ant to generate stubs and then invoking the we