Problem in RMI!!!

hi all,
I am having a java stored procedure in oracle 8i , the class is :-
import java.util.Hashtable;
import javax.naming.*;
import javax.rmi.*;
import javax.rmi.PortableRemoteObject ;
public class CallRMI
public static void execute()
try
Hashtable hash = new Hashtable();
hash.put(Context.PROVIDER_URL,"t3://10.11.5.23:7001");
hash.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
InitialContext init = new InitialContext(hash);
Object obj = init.lookup("CacheServer");
CacheRMI cache = (CacheRMI) PortableRemoteObject.narrow(obj,CacheRMI.class);
cache.trueCacheFlag(map);
map.clear();
catch(Exception ex){}
this class is calling a RMI on application server , but when i am compiling this class in oracle 8i its giving me the following error:-
CallRMI:5: Class javax.rmi.PortableRemoteObject not found in
import.
Can someone help me out in resolving this error.

Hi
Dont understand following statement
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
this class is calling a RMI on application server , but when i am compiling this class in oracle 8i its giving me the following error:-
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Why are you compiling this class in Oracle 8i, what JDK Version it is using? Have you put the required jar files in your classpath? I think oracle 8i uses very primitive version of JDK. That is why you are getting this compilation problem.
Can you try compiling this class with latest version (JDK 1.3.1 or higher) and see if the problem still there?
HTH
VJ

Similar Messages

  • Will multiple Lan cards cause problems using rmi?

    Will multiple Lan cards cause problems using rmi? If a host has two or more network cards (only one of which is Internet-enabled), how does RMI know which IP address to use? There seems to be a problem when such a client registers with an RMI service, and has a client-side callback method invoked by the server.

    You can tell RMI the address you want by defining java.rmi.server.hostname at the JVM which exports the remote object.

  • Problems with RMI tutorials using Tomcat 4.1.24

    Hi
    I have some problem when I try the rmi Hello example tutorial (http://java.sun.com/j2se/1.4.2/docs/guide/rmi/getstart.doc.html)
    When I start rmi server as follows:
    java -Djava.rmi.server.useCodebaseOnly=true -Djava.security.policy=file:E:\Rmi\Hello\mysrc\bin\policy.policy -Djav
    a.rmi.server.codebase=http://127.0.0.1/classes/ examples.hello.HelloImpl
    I got the following errors:
    HelloImpl err: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
    java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
    at java.security.AccessController.checkPermission(AccessController.java:401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
    at java.lang.SecurityManager.checkConnect(SecurityManager.java:1044)
    at java.net.Socket.connect(Socket.java:420)
    at java.net.Socket.connect(Socket.java:376)
    at java.net.Socket.<init>(Socket.java:291)
    at java.net.Socket.<init>(Socket.java:119)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at examples.hello.HelloImpl.main(HelloImpl.java:67)
    I have granted all permission in the policy file. I have put all the classes in a subfolder call classes just after the Root directoy Can someone enlighten me. Thanks.

    i don't know if it helps but i had the following problem:
    an rmi-component software plus a servlet contacting the system.
    and rmi from the servlet in tomcat did not seem to work ...
    java.rmi.MarshalException: error marshalling arguments; nested exception is:
         java.net.SocketException: Software caused connection abort: socket write error
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at net.metamagix.essence.Agents.DataAgentI_Stub.storeObjects(Unknown Source)
         at net.metamagix.essence.CAgents.ParameterSaviour.save(ParameterSaviour.java:1556)
    finaly i changed back to tomcat 4.0.x but it still was not any better, when i found out that most of the problems resulted from pathnames...
    tomcat 4.1.24 had a problem with pathnames getting too long (2k on win 2000) and tomcat 4.0 produced errors because of the blank in it's path name "Tomcat 4.0" so i made a new installation with C:\Tomcat4 as home directory and - what a surprise - things turned out fine and rmi worked.

  • Problem in Rmi in machine with two IP local & internet

    I am having problem in Rmi in machine with two interfaces local & internet
    i.e..
    if I set property java.rmi.server.hostname+ to the one with internet ip address using System.setProperty()
    I can not access Rmi through local LAN
    if I do not set the property Everything works fine in LAN but I can not access the RMI from Internet
    Pls tell me the solution

    Consider the code Here and if you can suggest in this code what changes I have to make ,I will be thankful to you
    // Class MyHelloServer
    package rmi.server;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.net.Inet4Address;
    import java.net.InetAddress;
    import java.net.MalformedURLException;
    import java.net.NetworkInterface;
    import java.net.SocketException;
    import java.rmi.*;
    import java.rmi.server.ServerNotActiveException;
    import java.util.ArrayList;
    import java.util.Enumeration;
    import javax.swing.JOptionPane;
    import rmi.bl.HelloImpl;
         public class MyHelloServer
              static public ArrayList hostList = new ArrayList();
              static String hostname=null;
              static String SERVER_PORT="9999";
              static String MULTIPLE_BIND="true";
              static{
                   startTest();
              public static void startTest(){
                   try {
                        Enumeration enum1= NetworkInterface.getNetworkInterfaces();
                        while(enum1.hasMoreElements()){
                             NetworkInterface networkInterface = (NetworkInterface)enum1.nextElement();
                             Enumeration enum2 = networkInterface.getInetAddresses();
                             while(enum2.hasMoreElements()){
                                  Object obj = enum2.nextElement();
                                  if(obj instanceof Inet4Address){
                                       if(!hostList.contains(((Inet4Address)obj).getHostAddress())){
                                       hostList.add(((Inet4Address)obj).getHostAddress());
                                            if(networkInterface.isPointToPoint()){
                                                      hostname=((Inet4Address)obj).getHostAddress();
                   }catch (SocketException e) {
                        e.printStackTrace();
                   if(hostname!=null){
                        System.setProperty("java.rmi.server.hostname", hostname);
                   System.out.println(System.getProperty("java.rmi.server.hostname")+"<<<<<< New");
              public static void main(String args[])
               try
                HelloImpl storeServer = new HelloImpl();
                int port=Integer.parseInt(SERVER_PORT);
                String host=InetAddress.getLocalHost().getHostAddress();
                 java.rmi.registry.LocateRegistry.createRegistry(port);
                if(MULTIPLE_BIND.equals("true")){ 
                    for (int i = 0; i < hostList.size(); i++) {
                         System.out.println(hostList.get(i).toString() + " <<<<IP" + i);
                         Naming.rebind("//"+hostList.get(i).toString()+":"+port+"/STORESERVER", storeServer);
                  }else{
                       Naming.rebind("//"+host+":"+port+"/"+"STORESERVER", storeServer);
                MyHelloServer.MyThread thread= new MyThread(":"+port+"/"+"STORESERVER", storeServer);
                System.out.println("Remote Server started.....");
            catch (java.net.MalformedURLException me)
                 System.out.println("Malformed URL: " + me.toString());
                 System.exit(0);
            catch (RemoteException re)
                 System.out.println("Remote exception: " + re.toString());
                 System.exit(0);
            catch (Exception e)
                 System.out.println("Error: " + e.toString());
                 System.exit(0);
         static class MyThread extends javax.swing.JPanel implements ActionListener{
                   String str="";
                   HelloImpl impl;
                   public MyThread(String text,HelloImpl storeServer){
                        this.impl=storeServer;
                        str=text;
                        int timetoWaitForCheck=15000;
                        javax.swing.Timer timer = new javax.swing.Timer(timetoWaitForCheck, this);
                        timer.start();
                          public void actionPerformed(ActionEvent ae)
                             startTest();
                             // Rebind
                                   for (int i = 0; i < hostList.size(); i++) {
                                        try {
                                            Naming.rebind("//"+hostList.get(i).toString()+str, impl);
                                       } catch (RemoteException e) {
                                            e.printStackTrace();
                                       } catch (MalformedURLException e) {
                                            e.printStackTrace();
    }

  • Problems using RMI between linux and windows.

    I have problems using RMI between linux and windows.
    This is my scenario:
    - Server running on linux pc
    - Clients running on linux and windows PCs
    When a linux client disconnect, first time that server try to call a method of this client, a rmi.ConnectException is generated so server can catch it, mark the client as disconnected and won't communicate with it anymore.
    When a windows client (tested on XP and Vista) disconnect, no exceptions are generated (I tryed to catch all the rmi exception), so server cannot know that client is disconnected and hangs trying to communicate with the windows client.
    Any ideas?
    Thanks in advance.
    cambieri

    Thanks for your reply.
    Yes, we are implementing a sort of callback using Publisher (remote Observable) and Subscribers (remote Observer). The pattern and relative code is very well described at this link: http://www2.sys-con.com/ITSG/virtualcd/java/archives/0210/schwell/index.html (look at the notifySubscribers(Object pub, Object code) function).
    Everything works great, the only problem is this: when a Publisher that reside on a Linux server try to notify something to a "dead" Subscriber that reside on a Windows PC it does't receive the usual ConnectException and so tends to hang.
    As a workaround we have solved now starting a new Thread for each update (notification), so only that Thread is blocked (until the timeout i guess) and not the entire "notifySubscribers" function (that contact all the Subscribers).
    Beside this, using the Thread seem to give us better performance.
    Is that missed ConnectException a bug? Or we are just making some mistake?
    We are using java 6 and when both client and server are Linux or Windows the ConnectException always happen and we don't have any problem.
    I hope that now this information are enough.
    Thanks again and greetings.
    O.C.

  • Problem with RMI in ADB T75 receiver

    Hi:
    I have a problem with an xlet that uses the RMI (IXC) API in the ADB T75 development settop box.
    I export an object (of type MyObject) implementing the Remote interface, and, later, I import it with no problem.
    The problem appears after importing the object, when I try to cast the imported object to the type of the exported object (type MyObject) for using it (example on page 371 of the marvelous Morris book).
    If I import the object in the same xlet where I export it (a little bit useless), the process works fine as the class of the imported object (remoteObject.getClass().getName()) is the same of the exported object.
    But, when importing the object from another xlet, doing the cast fails (ClassCastException). This time, remoteObject.getClass().getName() returns the name "stub_MyObject_ca_ba" ( "ca" is the OrgID and "ba" is the AppID of the exporting xlet). That is, the middleware is returning to the importing xlet an object of the stub class.
    The ClassCastException seems to be right, as the the superclass of the "stub_MyObject_ca_ba" is directly java.lang.Object. That is, the types of the exported object (MyObject) and the returned object (stub_MyObject_ca_ba) are not in the same hierarchy.
    Has anyone one explanation or solution?
    May be a bug of the ADB T75 settop box?
    Thanks in advance for your comments
    Liga0068

    Problem solved. This was posted by Pretorius_594 on Feb 27, 2004.
    Sorry for bothering.
    The problem was due to that I was doing a cast to the original object (MyObject). That is:
    remoteObject = lookup(...)
    MyObject importedobject = (MyObject)remoteObject.
    I saw such an example in the Morris and Smith-Chaigneau book, but, definetively, that code seems not to work (at least in the ADB receiver)
    Th right solution is to extend the Remote interface (MyRemote) and to cast the importedobject to that type. That is:
    public interface MyRemote extends Remote ...
    remoteObject = lookup(...)
    MyRemote importedobject = (MyRemote)remoteObject.
    Liga0068

  • A problem in RMI with JSP..pls help

    RMI with Java is working fine,but...
    1. I am facing a problem when i use RMI with JSP..its throwing an exception during "Naming.lookup"..here is my code snippet:
    // i have stored the ServerInf and other classes in a package and i have imported it in the jsp code....object ref is getting created but lookup is throwing an exception...thoguh RMI registry is working(started)
    <%
    try {
    ServerInf ref = (ServerInf)Naming.lookup("rmi://localhost:1098/Server_bind");
    catch (Exception ex) {
    ex.printStackTrace();
    %>
    Pls tel me the cause.
    2. If i try to use RMI with Servlet and JSP, then wen the JSP runs then, it simply calls the servlet file and displayes a lonk to it instead of executing the servlet class. pls help me with this too...below is the invoking statement:
    <form method=post action='http://localhost:8080/servlet/MyRMIservlet'>
    hello <input type=submit value=submit>

    And the exception and error message is.....

  • RMI Problem --   java.rmi.UnmarshalException:

    I am having a client and a server.... when i am trying to bring the client into server. but when i am doing it... i am getting an exception as below as...
    java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
         java.io.EOFException
         at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Unknown Source)
         at hsmsgui.rmtmgmt.RmtMgmtHandler.contactClient(RmtMgmtHandler.java:176)
         at hsmsgui.display.AddClientWzd.onFinishBtnClicked(AddClientWzd.java:488)
         at hsmsgui.display.AddClientWzd.actionPerformed(AddClientWzd.java:346)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.Dialog$1.run(Unknown Source)
         at java.awt.Dialog$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Unknown Source)
         at hsmsgui.display.AddClientAction.actionPerformed(AddClientAction.java:38)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.io.EOFException
         at java.io.DataInputStream.readByte(Unknown Source)
         ... 60 more
    can any one help me out to solve this problem.......

    Thanks for ur reply...Now i' m getting the access denied problem..
    I am able to create the rmi registry successfully on the server, Then Binding is also done successfully. but when i try to connect the client to the server the exception is thrown Please help me..
    TEST - client PC name.
    java.security.AccessControlException: access denied (java.net.SocketPermission TEST resolve)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkConnect(Unknown Source)
         at java.net.InetAddress.getAllByName0(Unknown Source)
         at java.net.InetAddress.getAllByName0(Unknown Source)
         at java.net.InetAddress.getAllByName(Unknown Source)
         at java.net.InetAddress.getByName(Unknown Source)
         at java.net.InetSocketAddress.<init>(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
         at sun.rmi.server.UnicastRef.newCall(Unknown Source)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Unknown Source)
         at hsmsgui.rmtmgmt.RmtMgmtHandler.contactClient(RmtMgmtHandler.java:176)
         at hsmsgui.display.AddClientWzd.onFinishBtnClicked(AddClientWzd.java:488)
         at hsmsgui.display.AddClientWzd.actionPerformed(AddClientWzd.java:346)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.Dialog$1.run(Unknown Source)
         at java.awt.Dialog$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Unknown Source)
         at hsmsgui.display.AddClientAction.actionPerformed(AddClientAction.java:38)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

  • The Security Problem of RMI-Applet?

    Hi,
    I used jdk1.3, Apache Jserv as the environments.
    Then I downloaded helloWorld sample from java.
    sun.com and wanted to make it work in Java Applet.
    It runs ok with HelloClient.java. However, there are
    errors when with HelloApplet.java:
    HelloApplet execption: access denied(java.net.SocketPermission
    128.104.179.36:1099 connect,resolve)...
    I ran server program as:
    java -Djava.rmi.server.codebase=http://128.104.179.36/myclasses/
    -Djava.security.policy=e:/policy examples.hello.HelloImpl
    And I copied all classes into the directory of myclasses.
    Here is my e:\policy :
    grant {
    // Allow everything for now
    permission java.security.AllPermission;
    permission java.net.SocketPermission "128.104.179.36:1099",
    "connect,accept,resolve";
    And in jserv.properties, I added
    java.rmi.server.codebase=e:\its817\Apache\Apache\htdocs\myclasses\
    Can anyone tell me what is the problem?
    Thanks very much!

    For applets you need also a policy file.
    It have to be named .java.policy and be stored in your Home Directory:
    C:\Windows\Profiles\<yourName>\.java.policy.
    Regards,
    Geri

  • Problems with RMI

    hi friends,
    I am doing my project in grid computing.I am using RMI. but sometimes what happens is when i submit the jobs to the machines and after completion when i collect the values and display the output, sometimes i am not able to get the whole image completed back.Some part of the image doesn't appear there. What might be the proble?

    The problem might be that you do not provide any details and expect us to be visionaries...

  • Problem executing RMI Methods Netbeans

    Hi everyone!
    I�m using a system Servlet+applet that communicate by RMI with Netbeans.
    The remote object, the stub and the binding are correctly created at the servlet. At the applet the reference to the remote object is ok too.
    The problem appears when I invoke a method in the remote object from the applet.
    The message the Java console throws:
    RemoteException  en soloEscribe()
    java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.1.100:1079 connect,resolve)
    soloEscribe() is the method in the remote object.
    I�m running everything locally, and I have granted allPermissions at the java.policy.
    Hope someone can help!
    Edited by: SnowyC on May 18, 2008 11:31 AM

    and one more thing I added following lines
    Context rootContext=(Context)initialNamingContext.lookup("");
    System.out.println("The Look up suceeded");
    to see whether it is able to look up the root context or not.
    I saw that it is suceeded in finding the root context and print the message also , but again failed to rebind the object .thrwing following exception
    java -classpath . -Djava.naming.factory.ini
    tial=com.sun.jndi.cosnaming.CNCtxFactory -Djava.naming.provider.url=iiop://local
    host:1050 Registry
    Inside Constructor
    The Look up suceeded
    java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can b
    e bound
    at com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(Unknown Source)
    at com.sun.jndi.cosnaming.CNCtx.rebind(Unknown Source)
    at com.sun.jndi.cosnaming.CNCtx.rebind(Unknown Source)
    at javax.naming.InitialContext.rebind(Unknown Source)
    at Registry.main(Registry.java:30

  • Weblogic problem,weblogic.rmi.extensions.RemoteRuntimeException: Unexpected

    hello,everyone.
    I have a problem.please help me.
    My application is running on weblogic 9.2. My oracle is oracle10g. system:linux redhat4.
    my weblogic's log have a problem.
    java.sql.SQLException: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception
    at weblogic.jdbc.rmi.SerialStatement.close(SerialStatement.java:109)
    at com.goldpalm.common.jdbc.DBController.releaseConn(DBController.java:273)
    at com.goldpalm.sale.team.TeamXml.exeTeamLog(TeamXml.java:762)
    at jsp_servlet._ctssale.__teamline_show._jspService(__teamline_show.java:264)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:230)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at filters.AuthFilter.doFilter(AuthFilter.java:95)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3200)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1983)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1844)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1344)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

    Hi
    Looking at the error stack trace, you are getting this error when trying to close the statement object from your own java code (not weblogic code...) - DBController.releaseConn(...)
    at com.goldpalm.common.jdbc.DBController.releaseConn(DBController.java:273)
    java.sql.SQLException: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception
    at weblogic.jdbc.rmi.SerialStatement.close(SerialStatement.java:109)
    at com.goldpalm.common.jdbc.DBController.releaseConn(DBController.java:273)
    at com.goldpalm.sale.team.TeamXml.exeTeamLog(TeamXml.java:762)
    Well check the code you have at this location. Usually the way we release/close the db resources are like first close ResultSet, then Statement, then Connection. But if you close connection first, then try to close the Statement object, it throws errors like what you see.
    I am giving 2 methods code snippet. One method is caleld like closeAll(..). This method gets called in finally block of all other db methods that does the actual db code to connect and get data etc etc.
    // Sample main method that does all db stuff...This is just code snippet only and NOT the full code. Focus on try catch finally block
    public static void getCustomerProfile(long custId) throws Exception {
         Connection aConnection = getConnection();
         CallableStatement aCallableStatement = null;
         ResultSet aResultSet = null;
         try {
              aCallableStatement = aConnection.prepareCall("{ call someFunction(?, ?) }");
              aCallableStatement.execute();
              aResultSet = (ResultSet) aCallableStatement.getObject("variable_name_from_sp");
              while(aResultSet.next()) {
                   // get all data for each record etc...
         } catch (Exception e) {
              e.printStackTrace();
              throw e;
         } finally {
              closeAll(aConnection, aCallableStatement, aResultSet);
    // While closing RS, Statment, Connection, enclose them in their own try/catch block and ofcourse check for nulls first
    public static void closeAll(Connection aConn, Statement aStmt, ResultSet aRS) {
         if (aRS != null) {
              try {
                   aRS.close();
              } catch (Exception e) {
                   System.out.println("Not Able To Close The ResultSet");
                   //e.printStackTrace();
         if (aStmt != null) {
              try {
                   aStmt.close();
              } catch (Exception e) {
                   System.out.println("Not Able To Close The Statement");
                   //e.printStackTrace();
         if (aConn != null) {
              try {
                   aConn.close();
              } catch (Exception e) {
                   System.out.println("Not Able To Close The Connection");
                   //e.printStackTrace();
    }Thanks
    Ravi Jegga

  • Problem of RMI Firewall

    Hi Friends,
    I have a problem when runing RMI currently. My java application has RMI server run on a machine called 'amach' and has rmi client run on PC. The application worked well before change of server machine 'amach' (IP: 393.188.0.12)
    But it doesn't work after server machine be as two IP address (inside machine IP: 299.177.0.14 and outside call this machine use IP: 166.155.0.12 ).
    RMI server is running normally.
    It doesn�t work use either of both IP addresses
    It shows following message when we run RMI client in IP: 166.155.0.12
    java.rmi.ConnectIOException: Exception creating connection to: 166.155.0.12; nested exception is:
         java.net.SocketException: Network is unreachable: connect)
    It shows following message when we run RMI client in IP: 299.177.0.14
    java.rmi.ConnectException: Connection refused to host: 166.155.0.12; nested exception is:
         java.net.ConnectException: Connection timed out: connect
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
    Can you help me to fix this problem?
    Many thanks.
    Hong

    RMI makes the very dubious assumption that a multi-homed server will have at least one IP address that's accessible to everybody. In your case that would be 166.155.0.12 if I've read your posting right. You should set -Djava.rmi.server.hostname=166.155.0.12 at the server JVM and your RMI clients should do Naming.looking("rmi://166.155.0.12/..."). However it all depends on the validity of the assumption above. If that isn't true you either need to talk to your netadmin or reconsider your configuration.

  • Problem executing RMI tutorial "Getting Started Using RMI"

    I am trying to execute the RMI tutorial located at http://java.sun.com/j2se/1.3/docs/guide/rmi/getstart.doc.html
    I use JDK 1.3.1, and Windows XP Pro.
    I follow the info on the URL http://java.sun.com/j2se/1.3/docs/guide/rmi/getstart.doc.html
    And all is OK, but when I try to run the server.I use the following command:
    C:\public_html\htdocs\myclasses>java -Djava.rmi.server.codebase=http://127.0.0.1
    /myclasses/ -Djava.secutiry.policy=c:\policy examples.hello.HelloImpl
    And I got this error:
    HelloImpl err: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,r
    esolve)
    java.security.AccessControlException: access denied (java.net.SocketPermission 1
    27.0.0.1:1099 connect,resolve)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkConnect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
    at sun.rmi.server.UnicastRef.newCall(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Unknown Source)
    at examples.hello.HelloImpl.main(Unknown Source)
    It seems its something with policy file, I used the one on the tutorial, but I still got error.
    Anyone could help me ?
    John

    I think it's just a typo in your command line. :)
    You're using java.secutiry.policy instead of
    java.security.policy.
    Feel the difference! :)

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

Maybe you are looking for

  • Lightroom disappears after export to Photoshop

    Am working with Lightroom 2.0 on a PowerMac G5, 4 g RAM, ATI Radeon 9800 XT, OS 10.5.4. Each time I send an image out from Lightroom for editing in Photoshop, do a SAVE in PSCS3 and try to return to Lightroom, the browser window is gone and I can't g

  • MRP list issue

    Hello, I am having issues when I run MD05 MRP list for a material. It gives me the below error. "No MRP list exists" This is a material just extended to a new plant with no stock. Is this issue because there is no stock for it and/or because its a ne

  • Wish to learn BPM

    Hello Experts, I work in SAP MDM field and I wish to learn BPM. I have a few basic questions regarding the same: 1. What is the pre-requisite to learn BPM? I mean is JAVA etc required to learn BPM? 2. Can you please brief about BPM and also links to

  • Change parsing Schema Dynamically  in 4.0

    Hi, Can I Cange Parsing Schema Dynamically in Apex 4.0 Thanks in Advance Regards, Avinash Nagawade

  • Both my cameras are not working I took it in and they reset the phone and it still continued to happen what can I do?

    Both my cameras are not working I took it in and they reset the phone and it still continued to happen what can I do?