RMI Exceptions

Hello, I am new to java RMI,
I have written a simple program, I can run Server without problems, but when I try to run Client I get these exceptions:
Exception in thread "main" java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:13371 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)
     at java.net.Socket.connect(Socket.java:519)
     at java.net.Socket.connect(Socket.java:475)
     at java.net.Socket.<init>(Socket.java:372)
     at java.net.Socket.<init>(Socket.java:186)
     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:595)
     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.newCall(UnicastRef.java:322)
     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
     at Client.<init>(Client.java:47)
     at Client.main(Client.java:104)Here is my "Communication" interface:
import java.rmi.*;
public interface Communication extends Remote{
     public void receiveUsername(String username) throws RemoteException;
     public void receivePassword(String password) throws RemoteException;
}Here is the part of my Server class:
System.setSecurityManager(new RMISecurityManager());
try {
     address_ = (InetAddress.getLocalHost()).toString();
} catch (UnknownHostException e) {
     e.printStackTrace();
     System.exit(1);
port_ = 13371;
try {
     registry_ = LocateRegistry.createRegistry(port_);
     registry_.rebind("MyServer", this);
} catch (RemoteException e) {
     e.printStackTrace();
     System.exit(1);
System.out.println("Server succesfully started...");
System.out.println("{Address = " + address_ + ", port = " + port_ + "}");
System.out.println("Waiting for tasks...");Here is the part of my Client class:
System.setSecurityManager(new RMISecurityManager());
System.out.println("Trying to connect to " + SERVER_ADDRESS + " via " + PORT);
try {
     registry_ = LocateRegistry.getRegistry(SERVER_ADDRESS, PORT);
     server_ = (Communication) (registry_.lookup("MyServer"));
} catch (RemoteException e) {
     e.printStackTrace();
     System.exit(1);
} catch (NotBoundException e) {
     e.printStackTrace();
     System.exit(1);
}This is how I compile and run my server:
javac Server.java
rmic Server
java Server
This is how I compile and run my client:
javac Client.java
java Client
Can somebody help me to find out what I am doing wrong, and what I need to fix this?
Thanks for any help, I appreciate it.

Alright so, I have specified externally reachable ip, and I got these exceptions on server:
Exception in thread "RMI TCP Connection(idle)" java.security.AccessControlException: access denied (java.net.SocketPermission xxx.xxx.xx.xx:49926 accept,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.checkAccept(SecurityManager.java:1157)
     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.checkAcceptPermission(TCPTransport.java:636)
     at sun.rmi.transport.tcp.TCPTransport.checkAcceptPermission(TCPTransport.java:275)
     at sun.rmi.transport.Transport$1.run(Transport.java:158)
     at java.security.AccessController.doPrivileged(Native Method)
     at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
     at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
     at java.lang.Thread.run(Thread.java:619)
and exceptions on client side:
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
     java.io.EOFException
     at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:209)
     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
     at Client.<init>(Client.java:47)
     at Client.main(Client.java:104)
Caused by: java.io.EOFException
     at java.io.DataInputStream.readByte(DataInputStream.java:250)
     at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:195)
     ... 4 more

Similar Messages

  • RMI Exception in OraBPEL~OC4J_BPEL~default_island~1 log file

    Hi,
    I am facing following rmi exception in my OraBPEL~OC4J_BPEL~default_island~1 log file:
    09/04/09 19:16:50 java.lang.NullPointerException
    09/04/09 19:16:50      at com.evermind.server.rmi.RMIServer.run(RMIServer.java:464)
    09/04/09 19:16:50      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
    This exception is restricting me to call BPEL Service from java.
    I ckecked all rmi configuration but dont find exact place where the wrong configuration is.
    Your help is really appreciated,
    Rupesh.
    Edited by: user10994198 on Apr 9, 2009 7:04 AM

    Hi Rupesh,
    Please follow this link : http://orasoa.blogspot.com/2007/06/calling-bpelesb-webservice-from.html, and see this configuration will help you overcome NPE.
    Hope this helps!
    Cheers
    Anirudh Pucha

  • RMI Exception between EJB calls

    Hi folks,
    After adding some methods to an existing EJB, we are getting RMI exception,
    as follows:
    at
    weblogic.rmi.extensions.AbstractRequest.sendReceive(AbstractRequest.java:76)
    at
    omega.fidens.ventas.WFVentaSessionBeanEOImpl_WLStub.recuperarPersona(WFVenta
    SessionBeanEOImpl_WLStub.java:3328)
    Our architecture is the following
    1. A Statefull EJB, is calling a stateless EJB. The first one is
    WFVentaSessionBean, the second , VentaSessionBean.
    2. The same WF is calling another EJB, stateless also, and everything is ok.
    Any hint?
    Regards
    Ivan

    Looking at: [no sapjcorfc in java.library.path]
    it seems like the environment that has the class with the method m does not have the platform dependent part of the JCO setup.
    Try to create a standalone program on the same server that just uses JCO and see if it works first.
    Cheers,
    Kalle

  • RMI exception calling web service from proxy class

    I am getting the following error attempting to call a web service from a proxy. It appears to relate to the type of objects I am trying to send vs the type that is expected. Following the exception I am adding a copy of the control where calling the web service is sucessful, a copy of the proxy class that I am using to make this unsucessful call, and the controller.jpf that has the formBean where I am creating my objects
    Caught Exception Calling the Web Service from the Proxy. The Exception is the f
    ollowing: java.rmi.RemoteException: web service invoke failed: javax.xml.soap.SO
    APException: failed to serialize class org.openuri.www.CreateAccountCheckingReq
    uestweblogic.xml.schema.binding.SerializationException: type mapping lookup fail
    ure on class=class controls.CheckingService$anyType TypeMapping=TYPEMAPPING SIZE
    =5
    ENTRY 1:
    class: org.openuri.www.CreateAccountCheckingResponse
    xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingResponse
    ser: org.openuri.www.CreateAccountCheckingResponseCodec@c0f4da
    deser: org.openuri.www.CreateAccountCheckingResponseCodec@b1dd4
    ENTRY 2:
    class: org.openuri.www.FundingInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:FundingInfoAnonType
    ser: org.openuri.www.FundingInfoAnonTypeCodec@1d36711
    deser: org.openuri.www.FundingInfoAnonTypeCodec@13a59e
    ENTRY 3:
    class: org.openuri.www.AccountInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:AccountInfoAnonType
    ser: org.openuri.www.AccountInfoAnonTypeCodec@1de5959
    deser: org.openuri.www.AccountInfoAnonTypeCodec@bbf788
    ENTRY 4:
    class: org.openuri.www.CustomerInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:CustomerInfoAnonType
    ser: org.openuri.www.CustomerInfoAnonTypeCodec@7824f9
    deser: org.openuri.www.CustomerInfoAnonTypeCodec@1c35fe1
    ENTRY 5:
    class: org.openuri.www.CreateAccountCheckingRequest
    xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingRequest
    ser: org.openuri.www.CreateAccountCheckingRequestCodec@1cbcd7b
    deser: org.openuri.www.CreateAccountCheckingRequestCodec@11f60ce
    ; nested exception is:
    javax.xml.soap.SOAPException: failed to serialize class org.openuri.www
    .CreateAccountCheckingRequestweblogic.xml.schema.binding.SerializationException:
    type mapping lookup failure on class=class controls.CheckingService$anyType Typ
    eMapping=TYPEMAPPING SIZE=5
    ENTRY 1:
    class: org.openuri.www.CreateAccountCheckingResponse
    xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingResponse
    ser: org.openuri.www.CreateAccountCheckingResponseCodec@c0f4da
    deser: org.openuri.www.CreateAccountCheckingResponseCodec@b1dd4
    ENTRY 2:
    class: org.openuri.www.FundingInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:FundingInfoAnonType
    ser: org.openuri.www.FundingInfoAnonTypeCodec@1d36711
    deser: org.openuri.www.FundingInfoAnonTypeCodec@13a59e
    ENTRY 3:
    class: org.openuri.www.AccountInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:AccountInfoAnonType
    ser: org.openuri.www.AccountInfoAnonTypeCodec@1de5959
    deser: org.openuri.www.AccountInfoAnonTypeCodec@bbf788
    ENTRY 4:
    class: org.openuri.www.CustomerInfoAnonType
    xsd_type: ['http://www.openuri.org/']:lcl0:CustomerInfoAnonType
    ser: org.openuri.www.CustomerInfoAnonTypeCodec@7824f9
    deser: org.openuri.www.CustomerInfoAnonTypeCodec@1c35fe1
    ENTRY 5:
    class: org.openuri.www.CreateAccountCheckingRequest
    xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingRequest
    ser: org.openuri.www.CreateAccountCheckingRequestCodec@1cbcd7b
    deser: org.openuri.www.CreateAccountCheckingRequestCodec@11f60ce
    Java Control for the web service:
    package controls;
    import weblogic.webservice.context.WebServiceContext;
    * @jc:location http-url="http://localhost:7001/Checking.jws"
    * @jc:wsdl file="#CheckingWsdl"
    * @jc:handler callback="MessageHandler" operation="MessageHandler"
    public interface CheckingService extends com.bea.control.ControlExtension, com.bea.control.ServiceControl
    public static class CustomerInfo
    implements java.io.Serializable
    public java.lang.String FirstName;
    public java.lang.String LastName;
    public java.lang.String MiddleName;
    public int SSN;
    public int CustomerNumber;
    public java.util.Calendar CreationDate;
    public java.util.Calendar LastModifiedDate;
    public static class FundingInfo
    implements java.io.Serializable
    public float Amount;
    public java.util.Calendar CurrentDate;
    public int AccountNumber;
    public static class anyType
    implements java.io.Serializable
    public com.bea.xml.XmlObject[] t;
    public static class AccountInfo
    implements java.io.Serializable
    public int AccountNumber;
    public float Balance;
    public int CustomerNumber;
    public java.util.Calendar LastModifiedDate;
    public WebServiceContext context = CheckingService.context;
    * @jc:protocol form-post="false" form-get="false"
    public AccountInfo CreateAccountChecking (CustomerInfo CustomerInfo, FundingInfo FundingInfo, anyType CommonHeader);
    static final long serialVersionUID = 1L;
    /** @common:define name="CheckingWsdl" value::
    <?xml version="1.0" encoding="utf-8"?>
    <!-- @editor-info:link autogen="false" source="" -->
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:jms="http://www.openuri.org/2002/04/wsdl/jms/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://www.openuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://www.openuri.org/">
    <types>
    <s:schema targetNamespace="http://www.openuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema">
    <s:element name="CreateAccountCheckingRequest">
    <s:complexType>
    <s:sequence>
    <s:element name="CustomerInfo">
    <s:complexType>
    <s:sequence>
    <s:element name="FirstName" type="s:string" nillable="false"/>
    <s:element name="LastName" type="s:string" nillable="false"/>
    <s:element name="MiddleName" type="s:string" nillable="true"/>
    <s:element name="SSN" type="s:int"/>
    <s:element name="CustomerNumber" type="s:int"/>
    <s:element name="CreationDate" type="s:dateTime"/>
    <s:element name="LastModifiedDate" type="s:dateTime"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="FundingInfo">
    <s:complexType>
    <s:sequence>
    <s:element name="Amount" type="s:float"/>
    <s:element name="CurrentDate" type="s:dateTime"/>
    <s:element name="AccountNumber" type="s:int"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="CommonHeader" type="s:anyType"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="CreateAccountCheckingResponse">
    <s:complexType>
    <s:sequence>
    <s:element name="AccountInfo">
    <s:complexType>
    <s:sequence>
    <s:element name="AccountNumber" type="s:int"/>
         <s:element name="Balance" type="s:float"/>
         <s:element name="CustomerNumber" type="s:int"/>
         <s:element name="LastModifiedDate" type="s:dateTime"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="string" nillable="true" type="s:string"/>
    </s:schema>
    </types>
    <message name="CreateAccountCheckingSoapIn">
    <part name="parameters" element="s0:CreateAccountCheckingRequest"/>
    </message>
    <message name="CreateAccountCheckingSoapOut">
    <part name="parameters" element="s0:CreateAccountCheckingResponse"/>
    </message>
    <portType name="CheckingSoap">
    <operation name="CreateAccountChecking">
    <input message="s0:CreateAccountCheckingSoapIn"/>
    <output message="s0:CreateAccountCheckingSoapOut"/>
    </operation>
    </portType>
    <binding name="CheckingSoap" type="s0:CheckingSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="CreateAccountChecking">
    <soap:operation soapAction="http://www.openuri.org/CreateAccountChecking" style="document"/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="Checking">
    <port name="CheckingSoap" binding="s0:CheckingSoap">
    <soap:address location="http://localhost:7001/Checking.jws"/>
    </port>
    </service>
    </definitions>
    FOLLOWING IS THE PROXY CLASS THAT IS UNSUCCESSFUL
    import controls.CheckingService.anyType;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.HandlerRegistry;
    import org.openuri.CreateAccountCheckingResponseDocument.CreateAccountCheckingResponse;
    import org.openuri.www.CustomerInfoAnonType;
    import org.openuri.www.FundingInfoAnonType;
    import weblogic.jws.proxies.*;
    import weblogic.webservice.context.WebServiceContext;
    import weblogic.webservice.context.WebServiceSession;
    import weblogic.webservice.core.handler.WSSEClientHandler;
    import weblogic.webservice.tools.pagegen.result;
    import weblogic.xml.security.UserInfo;
    import weblogic.xml.security.wsse.Security;
    import weblogic.xml.security.wsse.SecurityElementFactory;
    //import weblogic.jws.proxies.WebServiceB;
    //import weblogic.jws.proxies.WebServiceB_Impl;
    //import weblogic.jws.proxies.WebServiceBSoap;
    public class CheckingWSProxy
    public static void CallWS(Controller.CreateAccountCheckingForm form)
    String user;
    String pass;
    try{
    * Instantiate the main proxy class. The proxy class has the same name as the
    * web service, with "_Impl" appended.
    Checking myservice = new Checking_Impl("http://localhost:7001/ConsumerAccountApp/schemas/CheckingService.wsdl");
    WebServiceContext context = myservice.context();
    WebServiceSession session = context.getSession();
    * Registers a handler for the SOAP message traffic.
    HandlerRegistry registry = myservice.getHandlerRegistry();
    List list = new ArrayList();
    list.add(new HandlerInfo(WSSEClientHandler.class, null, null));
    registry.setHandlerChain(new QName("Checking"), list);
    * Set the username and password token for SOAP message sent from the client, through
    * the proxy, to the web service.
    user = form.getUsername();
    pass = form.getPassword();
    UserInfo ui = new UserInfo(user, pass);
    session.setAttribute(WSSEClientHandler.REQUEST_USERINFO, ui);
    * Adds the username / password token to the SOAP header.
    SecurityElementFactory factory = SecurityElementFactory.getDefaultFactory();
    Security security = factory.createSecurity(null);
    security.addToken(ui);
    session.setAttribute(WSSEClientHandler.REQUEST_SECURITY, security);
    * Get the protocol-specific proxy class.
    CheckingSoap msg=myservice.getCheckingSoap();
    * Invoke the web service method
    msg.createAccountChecking((CustomerInfoAnonType)form.getProxyCustomerInfo(), (FundingInfoAnonType)form.getProxyFundingInfo(), (Object)form.get_CommonHeader());
    catch (Exception ex)
    System.out.println("Caught Exception Calling the Web Service from the Proxy. The Exception is the following: " + ex.toString());
    FOLLOWING IS THE FORMBEAN IN THE CONTROLLER.JPF FILE
    * FormData get and set methods may be overwritten by the Form Bean editor.
    public static class CreateAccountCheckingForm extends FormData
    private anyType _CommonHeader;
    private controls.CheckingService.FundingInfo _FundingInfo;
    private controls.CheckingService.CustomerInfo _CustomerInfo;
    private java.util.Date dOut;
    private java.util.Calendar cOut;
    private CustomerInfo proxyCustomerInfo;
    private FundingInfo proxyFundingInfo;
    private String stringDate;
    private String currentDate;
    private String lastModifiedDate;
    private String creationDate;
    private String systemMessage;
    private String username;
    private String password;
    private String accountType;
    private String trashTransferAccount;
    private String trashAccountNumber;
    private boolean secureFlag;
    public void set_CustomerInfo(controls.CheckingService.CustomerInfo _CustomerInfo)
    _CustomerInfo.CreationDate = parseDate(getCreationDate());
    _CustomerInfo.LastModifiedDate = parseDate(getLastModifiedDate());
    this._CustomerInfo = _CustomerInfo;
    public controls.CheckingService.CustomerInfo get_CustomerInfo()
    if(this._CustomerInfo == null)
    this._CustomerInfo = new controls.CheckingService.CustomerInfo();
    _CustomerInfo.CreationDate = dateNow();
    _CustomerInfo.LastModifiedDate = dateNow();              
    return this._CustomerInfo;
    public CustomerInfo getProxyCustomerInfo()
    this.proxyCustomerInfo = (CustomerInfo)this._CustomerInfo;
    return this.proxyCustomerInfo;
    public void set_FundingInfo(controls.CheckingService.FundingInfo _FundingInfo)
    _FundingInfo.CurrentDate = parseDate(getCurrentDate());
    this._FundingInfo = _FundingInfo;
    public controls.CheckingService.FundingInfo get_FundingInfo()
    if(this._FundingInfo == null)
    this._FundingInfo = new controls.CheckingService.FundingInfo();
    _FundingInfo.CurrentDate = dateNow();
    return this._FundingInfo;
    public FundingInfo getProxyFundingInfo()
    this.proxyFundingInfo = (FundingInfo)this._FundingInfo;
    return this.proxyFundingInfo;
    public void set_CommonHeader(anyType _CommonHeader)
    this._CommonHeader = _CommonHeader;
    public anyType get_CommonHeader()
    if(this._CommonHeader == null)
    this._CommonHeader = new anyType();
    return this._CommonHeader;
    public java.util.Calendar dateNow()
    this.dOut = new Date();
    Calendar cOut = this.cOut.getInstance();
    cOut.setTime(this.dOut);
    this.cOut = cOut;
    return this.cOut;
    public java.util.Calendar parseDate( String strDate )
    SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
    Calendar cOut = this.cOut;
    df4.setLenient( false );
    try
    this.dOut = df4.parse( strDate );
    } catch ( ParseException e )
    cOut.getInstance();
    cOut.setTime(dOut);
    this.cOut = cOut;
    return this.cOut;
    public void setStringDate( String stringDate )
    this.stringDate = stringDate;
    public String getStringDate()
    return this.stringDate;
    public void setCurrentDate( String currentDate )
    this.currentDate = currentDate;
    public String getCurrentDate()
    SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
    this.currentDate = df4.format(_FundingInfo.CurrentDate.getTime());
    return this.currentDate;
    public void setLastModifiedDate( String lastModifiedDate )
    this.lastModifiedDate = lastModifiedDate;
    public String getLastModifiedDate()
    SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
    this.lastModifiedDate = df4.format(_CustomerInfo.LastModifiedDate.getTime());
    return this.lastModifiedDate;
    public void setCreationDate( String creationDate )
    this.creationDate = creationDate;
    public String getCreationDate()
    SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
    this.creationDate = df4.format(_CustomerInfo.CreationDate.getTime());
    return this.creationDate;
    public void setUsername( String username )
    this.username = username;
    public String getUsername()
    return this.username;
    public void setPassword( String password )
    this.password = password;
    public String getPassword()
    return this.password;
    public void setAccountType( String accountType )
    this.accountType = accountType;
    public String getAccountType()
    return this.accountType;
    public void setTrashTransferAccount( String trashTransferAccount )
    this.trashTransferAccount = trashTransferAccount;
    public String getTrashTransferAccount()
    return this.trashTransferAccount;
    public void setTrashAccountNumber( String trashAccountNumber )
    this.trashAccountNumber = trashAccountNumber;
    public String getTrashAccountNumber()
    return this.trashAccountNumber;
    public void setSystemMessage( String systemMessage )
    this.systemMessage = systemMessage;
    public String getSystemMessage()
    return this.systemMessage;
    public void setSecureFlag( boolean secureFlag )
    this.secureFlag = secureFlag;
    public boolean getSecureFlag()
    return this.secureFlag;
    }

    This exception means that xml namespaces are different.
    Etc. soap has xml element which doesn't belong to namespace of parent xml element and namespace is set without prefix.
    I had such problem.
    Try to set namespace prefix for this element.
    Example:
    <el1>
    <el2 xmlns="http://..."/>
    </el1>
    Should be
    <el1>
    <q:el2 xmlns:q="http://..."/>
    </el1>

  • I meet a RMI Exception ,Can you help me!!

    This is the main Method:
    public static void main(String[] args) throws IOException, ActivationException, NamingException, NotBoundException
              System.out.println("Construting activiton description...");
              Properties pro=new Properties();
              pro.put("java.security.policy", new File("server.policy").getCanonicalPath());
              ActivationGroupDesc groupDesc=new ActivationGroupDesc(pro,null);
              ActivationGroupID id=ActivationGroup.getSystem().registerGroup(groupDesc);
              MarshalledObject paPara1=new MarshalledObject("This book is for Student");
              MarshalledObject paPara2=new MarshalledObject("This book is for Teacher");
              ActivationDesc desc1=new ActivationDesc(id,"BookImpl","http://localhost/download/",paPara1);
              ActivationDesc desc2=new ActivationDesc(id,"BookImpl","http://localhost/download/",paPara2);
              Product pa1=(Product) Activatable.register(desc1);
              Product pa2=(Product) Activatable.register(desc2);
              Context context=new InitialContext();
              context.bind("rmi://product1", pa1);
              context.bind("rmi://product2", pa2);
    This is error Mesage:
    Exception in thread "main" java.rmi.activation.ActivationException: unable to obtain ActivationSystem; nested exception is:
         java.rmi.ConnectException: Connection refused to host: 125.220.9.55; nested exception is:
         java.net.ConnectException: Connection refused: connect
         at java.rmi.activation.ActivationGroup.getSystem(ActivationGroup.java:453)
         at ProductActivtor.main(ProductActivtor.java:27)
    Caused by: java.rmi.ConnectException: Connection refused to host: 125.220.9.55; nested exception is:
         java.net.ConnectException: Connection refused: connect
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
         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:306)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Naming.java:84)
         at java.rmi.activation.ActivationGroup.getSystem(ActivationGroup.java:449)
         ... 1 more
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
         at java.net.Socket.connect(Socket.java:507)
         at java.net.Socket.connect(Socket.java:457)
         at java.net.Socket.<init>(Socket.java:365)
         at java.net.Socket.<init>(Socket.java:178)
         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:569)
         ... 7 more
    Can you help me? Thank you very much!!

    start rmid
    Also you need to do something better with your activatable references than just bind them. You need to serialize them to a file so that you can restart the system without redoing the registration.

  • RMI Exception

    I'm getting an ExportException coming from one class (SGJmsWriter) but not from the other classes I have that are basically the same thing. I've looked all around for a resolution to this problem, and I solved one problem where I hadn't called connection.start(), but I still have this one. Basically, I have multiple threads on the same box going to the virtual machine for JMS stuff. I have at least 2 other threads that are connecting in the same way that don't throw an exception. Any help is appreciated.
    connectionFactory = new ActiveMQConnectionFactory(
                   ActiveMQConnection.DEFAULT_USER,
                   ActiveMQConnection.DEFAULT_PASSWORD, "vm://localhost");
             connection = connectionFactory.createQueueConnection();
             connection.start();
             session = connection.createQueueSession(false,
                   QueueSession.AUTO_ACKNOWLEDGE);
             queue = session.createQueue(QUEUE_NAME);
             producer = session.createProducer(queue);
             producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
    java.rmi.server.ExportException: internal error: ObjID already in use
         at sun.rmi.transport.ObjectTable.putTarget(Unknown Source)
         at sun.rmi.transport.Transport.exportObject(Unknown Source)
         at sun.rmi.transport.tcp.TCPTransport.exportObject(Unknown Source)
         at sun.rmi.transport.tcp.TCPEndpoint.exportObject(Unknown Source)
         at sun.rmi.transport.LiveRef.exportObject(Unknown Source)
         at sun.rmi.server.UnicastServerRef.exportObject(Unknown Source)
         at sun.rmi.registry.RegistryImpl.setup(Unknown Source)
         at sun.rmi.registry.RegistryImpl.<init>(Unknown Source)
         at java.rmi.registry.LocateRegistry.createRegistry(Unknown Source)
         at org.apache.activemq.broker.jmx.ManagementContext.createConnector(ManagementContext.java:382)
         at org.apache.activemq.broker.jmx.ManagementContext.findMBeanServer(ManagementContext.java:301)
         at org.apache.activemq.broker.jmx.ManagementContext.getMBeanServer(ManagementContext.java:154)
         at org.apache.activemq.broker.jmx.ManagementContext.start(ManagementContext.java:78)
         at org.apache.activemq.broker.BrokerService.start(BrokerService.java:391)
         at org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:113)
         at org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:52)
         at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:43)
         at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:77)
         at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:227)
         at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:242)
         at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:211)
         at org.apache.activemq.ActiveMQConnectionFactory.createQueueConnection(ActiveMQConnectionFactory.java:173)
         at com.gdc4s.muos.nms.fcap.fmtds.source.SGJmsWriter.initialize(SGJmsWriter.java:130)
         at com.gdc4s.muos.nms.fcap.fmtds.source.SGJmsWriter.run(SGJmsWriter.java:167)
         at java.lang.Thread.run(Unknown Source)

    You are trying to start two Registries in the same JVM.

  • RMI Exceptions:UnmarshalException and AccessControlException

    Hi,
    While running my RMI Application, the client throws the exception:
    java.rmi.UnmarshalException:Error unmarshalling return header; nested exception is:
    java.io.EOFException
    while the server throws the following exception:
    java.security.AccessControlException: access denied (java.net.SocketPermission 1
    0.10.2.0:1325 accept,resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:267)
    at java.security.AccessController.checkPermission(AccessController.java:
    394)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:540)
    at java.lang.SecurityManager.checkAccept(SecurityManager.java:1157)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.checkAcceptPermi
    ssion(TCPTransport.java:562)
    at sun.rmi.transport.tcp.TCPTransport.checkAcceptPermission(TCPTransport
    .java:201)
    at sun.rmi.transport.Transport$1.run(Transport.java:146)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
    60)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
    .java:701)
    at java.lang.Thread.run(Thread.java:479)
    java.security.AccessControlException: access denied (java.net.SocketPermission 1
    0.10.2.0:1327 accept,resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:267)
    at java.security.AccessController.checkPermission(AccessController.java:
    394)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:540)
    at java.lang.SecurityManager.checkAccept(SecurityManager.java:1157)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.checkAcceptPermi
    ssion(TCPTransport.java:562)
    at sun.rmi.transport.tcp.TCPTransport.checkAcceptPermission(TCPTransport
    .java:201)
    at sun.rmi.transport.Transport$1.run(Transport.java:146)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
    60)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
    .java:701)
    at java.lang.Thread.run(Thread.java:479)
    java.security.AccessControlException: access denied (java.net.SocketPermission 1
    0.10.2.0:1326 accept,resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:267)
    at java.security.AccessController.checkPermission(AccessController.java:
    394)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:540)
    at java.lang.SecurityManager.checkAccept(SecurityManager.java:1157)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.checkAcceptPermi
    ssion(TCPTransport.java:562)
    at sun.rmi.transport.tcp.TCPTransport.checkAcceptPermission(TCPTransport
    .java:201)
    at sun.rmi.transport.Transport$1.run(Transport.java:146)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
    60)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
    .java:701)
    at java.lang.Thread.run(Thread.java:479)
    I would be glad to receive assistance from anyone, please.
    Best regards

    I looks like you forgot to specify the security policy:
    see http://java.sun.com/docs/books/tutorial/rmi/running.html
    Genady

  • RMI Exception in Server but ru

    Hi Guys,
    this error message i get when i run my application in my local machine
    RemoteException :java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.net.MalformedURLException: no protocol: 5.5/webapps/ROOT/WEB-INF/classes/
    But the question is the application runs well in my server
    I already copied all the .class file from my server to my local but still encounter this error//
    Anyone has any idea? maybe the java version of different application web server running application??

    Thanks, I know already
    Its because my tomcat directory path has space in between
    C:\Tomcat 5.5\......
    i already changed to C:\Tomcat5.5
    and everything works fine

  • Beginner's RMI exception

    I'm running a variation of the Core Java beginner RMI program, which throws this exception:
    java.lang.NullPointerException
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at RecordImpl_Stub.getColumnNames(Unknown Source)
    at ClientDum.<init>(ClientDum.java:22)
    at ClientDum.main(ClientDum.java:33)
    colNames = null
    The server side is verified to bind to the registry: here's the code:import java.rmi.*;
    import java.rmi.server.*;
    public class ProductServer
    {  public static void main(String args[])
       {  try
          {  System.out.println
                ("Constructing server implementations...");
             RecordImpl p1
                = new RecordImpl("user-1");
             System.out.println
                ("Binding server implementations to registry...");
             Naming.rebind("FIRST", p1);
             System.out.println
                ("Waiting for invocations from clients...");
          catch(Exception e)
          {  System.out.println("Error: " + e);
    }I know I am getting past the security policy, because I've already seen and repaired those exceptions. Any ideas? Here's the client code:import java.util.*;
    import java.io.*;
    import java.rmi.*;
    import java.rmi.server.*;
    public class ClientDum implements Constants
      Vector allRecs;   //holds all the records retrieved from the server
      String[] colNames;
      Record rec;
      String user = null;
      ClientDum()
        System.setSecurityManager(new RMISecurityManager());
        String url = "rmi://localhost/";
        try
          Record rec = (Record)Naming.lookup(url +"FIRST");
          colNames =rec.getColumnNames("user");
          allRecs =rec.getRecords();
        catch (Exception e)
        e.printStackTrace();
        System.out.println("colNames = "+colNames);
      public static void main(String[] args)
      {new ClientDum();}
    }

    ps
    all my stubs and class files are in the same directory, and my policy file is set to AllPermission. I found two previous posts describing my exception, with those suggestions given.

  • RMI Exception Propagation

    I have a distributed app implemented in RMI. Sometimes when a client invokes a function on the server using the API provided, and the function call results in an exception (NullPointer, ArrayOutOfBounds etc) the exception is propagated all the way to the client even if the client is only catching RemoteException.
    Here's what I want to do:
    Have only User-defined exceptions propagated to the client. All other exceptions, should remain at the server level where I can handle them (log them, send an alert out etc). The API has hundreds of functions and I do not like the idea of putting try/catch in all of the functions in my *Impl classes. Is there an easier way to do this? Can someone explain how exception propagation works in RMI? Can I somehow propagate only UDF exceptions to the client and have the rest stay at the server even if the client uses try{...} catch(Exception e} ?
    I have googled this issue a lot of times and have failed to find an answer to this.
    I appreciate any help at all!
    Thanks.

    Here's what I want to do:
    Have only User-defined exceptions propagated to the
    client. All other exceptions, should remain at the
    server level where I can handle them (log them, send
    an alert out etc). The API has hundreds of functions
    and I do not like the idea of putting try/catch in
    all of the functions in my *Impl classes. Is there an
    easier way to do this? Can someone explain how
    exception propagation works in RMI? Can I somehow
    propagate only UDF exceptions to the client and have
    the rest stay at the server even if the client uses
    try{...} catch(Exception e} ?Exception propagation in RMI works just as you have experienced it. Any RuntimeException, Error, RemoteException, or declared exception that happens inside the server method is propagated to the client. You can't change this. I agree with cajo's idea of using a proxy around the stub to filter for you, but this will still mean that exceptions are logged &c at the client rather than at the server. You can watch & log exceptions at the server via sun.rmi.server.stackTrace=true.

  • RMI exception problem

    Hi guys. I am developing distributed application based on RMI, but I have problem I cannot solve.
    I compile my project, generate stubs for implementation classes and then run Server class. But each time I get following errors:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
            java.lang.ClassNotFoundException: Server_Stub
            at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
            at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
            at sun.rmi.transport.Transport$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Unknown Source)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Sou
    rce)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
    ce)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)
            at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
    n Source)
            at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
            at sun.rmi.server.UnicastRef.invoke(Unknown Source)
            at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
            at java.rmi.Naming.rebind(Unknown Source)
            at Server.main(Server.java:341)I run the name server in the same folder, than all other code and all class files should be there also. Do you have any thought, why is this happening? Thanks

    Look at the stack trace. You will see:
    (a) Registry.bind(), which means you are invoking a Registry operation
    (b) ServerException, which means that whatever the exception was it happened in the server you were calling, not in your own code. In this case it happened inside the Registry's implementation of bind().
    So it is the Registry that can't find the class.

  • Primavera API Server RMI exception

    While calling the Primavera API server from a remote client, i am getting this exception:
    com.primavera.integration.network.ServiceNotBoundException: rmi/RemoteSession
    at com.primavera.integration.network.RMIInstanceFactory.getRemoteInstance(RMIInstanceFactory.java:97)
    The default port 9099 is in listening mode on the API server.
    The API server is deployed on JBOSS applications server.
    Is there some configuration that i am missing leading to this exception?
    Any inputs will be appreciated.
    Thanks.

    I have resolved this issue by making the following changes:
    1. Unlike the previous versions, the RMI standard Service Port needs to be set explicitly to a valid port value if the RMI server is going to be access through a firewall. (If the server will be accessed across a firewall, you must set this to a specific port.)
    2. This port must be different than RMI Registry port. You will use the Registry port in all your client side method calls.
    3. Setup a inbound firewall rule for both these ports RMI Standard service port as well as RMI Registry port.
    4. Bind the JBOSS on startup to 0.0.0.0 IP by using this command: run.bat -b 0.0.0.0
    5. Not sure if this is necessary: But remove all the occurances of ${jboss.bind.address} in Jboss-service.xml file.
    Hope this helps to someone who got into similar problem as myself.

  • RMI Exception - $Proxy0

    hey all,
    I am trying to create a Javacard project, such that I enable a host and an applet to
    communicate with each other. I created a simple applet, that compiles and is
    loaded on the smartcard without problems, but when I try to communicate to it
    with my host application I get an exception: "$Proxy0". has anyone idea of what
    can be wrong ?
         applet = new JCApplet(card, TABLE_APPLET_AID, 0, TABLE_APPLET_AID.length);
    // !! NOTE: THIS LINE BELOW CAUSES THE ABOVE EXCEPTION !!!
    table = (SampleInterface)RMIObjectFactory.getInitialReference(applet);
    I can give the full code, which is actually not big, if someone is more interested.
    Thanks in advance.
    Edited by: Cih on Nov 11, 2007 9:32 AM

    If you copy a class/interface to another package then it is a different class/interface.
    Put the common interface in some "shared" package.

  • IObjectManager.lookupObjectID throwing an RMI exception

    I'm having trouble with the method call IObjectManager.lookupObjectID(String UUID). Regardless of what I pass in, I get a java.rmi.RemoteException. I've even tried the following:
    om.lookupObjectID(om.lookupObjectUUID(200))
    I still get a RemoteException. All the other calls I'm using in the PRC, including IObjectManager.lookupObjectUUID, are working fine. Any thoughts/ideas? Anyone else seeing this problem?
    Thanks!
    Chris Bucchere
    http://www.bucchere.com

    Just FYI -- I finally figured out why this was happening. You need to be in the administrators group in order to call IObjectManager.lookupObjectID(String UUID).
    Regards,
    Chris Bucchere | bdg | [email protected]| http://www.bucchere.com

  • CORBA System Exception to RMI mapping for Weblogic

    Hi,
    I am in the process of porting some older code that was hosted in an Inprise AppServer
    4.1 environment to Weblogic 8.1. The existing code is catching several CORBA system
    exceptions that include the following :
    org.omg.CORBA.NO_RESPONSE
    org.omg.CORBA.UNKNOWN
    org.omg.CORBA.NO_MEMORY
    org.omg.CORBA.NO_RESOURCES
    org.omg.CORBA.OBJECT_NOT_EXIST
    As far as i understand, these exceptions will never be thrown by the Weblogic
    8.1 Server. I wanted to see if someone can guide me as to which RMI exceptions
    will be thrown by Weblogic server instead of the above mentioned CORBA exceptions
    Thanks in advance
    Muhammad

    "Muhammad Choonara" <[email protected]> writes:
    I am in the process of porting some older code that was hosted in an Inprise AppServer
    4.1 environment to Weblogic 8.1. The existing code is catching several CORBA system
    exceptions that include the following :
    org.omg.CORBA.NO_RESPONSEUnmarshallException (probably)
    org.omg.CORBA.UNKNOWNNo idea
    org.omg.CORBA.NO_MEMORYOutOfMemoryException
    org.omg.CORBA.NO_RESOURCESNo idea
    org.omg.CORBA.OBJECT_NOT_EXISTNoSuchObjectException
    >
    As far as i understand, these exceptions will never be thrown by the Weblogic
    8.1 Server. I wanted to see if someone can guide me as to which RMI exceptions
    will be thrown by Weblogic server instead of the above mentioned CORBA exceptions
    ? andy

Maybe you are looking for