RMI Server as a service

I've have a very simple RMI Server that handles authentication for a Java Web Start app. This server app has been running as a standard console app and now I want to run it as a service on a Windows Server 2003 box.
I've tried Java Service Wrapper (http://wrapper.tanukisoftware.org/) and the built in tool in Windows for creating services (sc.exe) but no avail.
I'm becoming desperate and have begun peeking at full fledged application server such as JBoss and Suns application server. Those guys should be a total overkill since my tiny RMI server is as far away from J2EE as you can come.
Could someone provide me with some hints on this one? All I want is to have my server app run as a service, how hard should this be?

Dear Sacke,
Did you find anything on this front? I also need develop an RMI server and deploy it as Service (on Windows) and Daemon on Java. And I particularly dont want to use the Java Service Wrapper as it is not a pure java solution. Please let me know if you found anything on this?
Thanks,
Mehul

Similar Messages

  • RMI Server and Provider Services

    Hi Everyone,
    Can I know whats the role of Planning RMI server and Provider Services. On what specific situations do we need to restart those??
    Thanks in Advance

    Any help on this please!!

  • How to Convert an RMI Server into WINNT service

    I have an RMI Server, that looks like the following
    SimpleRMIServer.java
    import java.io.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class SimpleRMIServer
    public static void main(String[] argv) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    LocateRegistry.createRegistry(1099);
    SimpleRMIImpl implementation = new SimpleRMIImpl("SimpleRMIImpl instance");
    // SimpleRMIImpl implementation = new SimpleRMIImpl("SimpleRMIImpl instance");
    System.out.println("SimpleRMIImpl ready");
    catch (Exception e) {
    System.out.println("Exception occurred: " + e);
    the SimpleRMIImpl.java also is available. (SimpleRMIImpl.class)
    now the problem is how to convert this Server to a service.
    I have seen a java class that extends a service class have been converted to a service like the following
    TestService.java
    // TestService.java
    // (C) Copyright 1995 - 1999 Microsoft Corporation. All rights reserved.
    import java.io.*;
    import com.ms.service.*;
    public
    class TestService extends Service
    static
    // Uncomment to disable the assassin. The service will fail to respond
    // in the time specified in the last waithint for the third pause
    // event received. If the assassin is enabled (i.e. this line is commented
    // out, the default), then the service will be forcibly killed.
    //Service.disableassassin = true;
    int pausecount;
    int intcount;
    public TestService (String[] args) throws IOException
    System.out.println("Sending updated pending status");
    CheckPoint(1000);
    System.out.println("Sending running status with all controls");
    setRunning(ACCEPT_SHUTDOWN | ACCEPT_PAUSE_CONTINUE | ACCEPT_STOP);
    System.out.println("Started");
    protected
    boolean handleStop ()
    setStopping(5000);
    System.out.println("dying");
    return true;
    protected
    boolean handlePause ()
    pausecount++;
    if (pausecount == 3)
    System.out.println("pause #3, sleeping for 30 seconds, should be killed in 2+5 seconds");
    setPausing(2000);
    try
    Thread.sleep(30000);
    catch (InterruptedException e)
    System.out.println("interrupted");
    else
    System.out.println("received pause #"+pausecount+", pausing for 2 seconds");
    setPausing(5000);
    try
    Thread.sleep(2000);
    catch (InterruptedException e)
    System.out.println("interrupted");
    System.out.println("sending paused");
    setPaused();
    System.out.println("sent paused");
    return false;
    protected
    boolean handleContinue ()
    System.out.println("received continue, continuing after 2 seconds");
    setContinuing(5000);
    try
    Thread.sleep(2000);
    catch (InterruptedException e)
    System.out.println("interrupted");
    System.out.println("sending running");
    setRunning();
    System.out.println("sent running after continue");
    return false;
    protected
    boolean handleShutdown ()
    System.out.println("received shutdown, treating as stop");
    return handleStop();
    protected
    boolean handleInterrogate ()
    System.out.println("received interrogate");
    setServiceStatus(getServiceStatus());
    System.out.println("sent status for interrogate");
    intcount++;
    if (intcount == 3)
    System.out.println("received 3rd interrogate, stopping self in 5 seconds");
    try
    Thread.sleep(5000);
    catch (InterruptedException iex)
    System.out.println("interrupted");
    System.out.println("stopping");
    StopServiceEventHandler(1000);
    return false;
    using the jntsvc.exe tool, that code have been converted to an executable, then installed as a service.
    I've tried to embed the RMIServer code in the constructor for this service, but it didn't work
    Hope you have a clear understanding of what I'm saying
    any help, highly appreciated
    thanx in advance
    here is my email [email protected]
    regards

    Our second installment of "Questions from the Past"
    Dear viewer, check out Tomcat's source, I believe they implement Tomcat as a service so just follow what they did.
    Steve - your answer Guru
    Tune in next week for our third installment of "Questions from the past"

  • Java Web Services accessing rmi server

    Hi,
    I want to access the rmi server from a java web services.My java web services is running under Sun application server9.The rmi server is not using any application server.Please help me to sort out the problem.
    Bye
    Binay

    What's the problem exactly? I assume you understand that the RMI server has to run like any RMI server, it has to bind itself into a Registry; the Web server acts as an RMI client so it has to look up the Registry to get a remote reference so it can call the required remote methods.

  • How to Start Java RMI Server Application as Windows NT Service

    Hi!!,
    I have problem regarding the Installation of Java Application as NT Service this Java app in turn will start RMI Registry using LocateRegistry.createRegistry() at some specific port number. The Service is created successfully but i have problem regarding the Accessing of this Remote Object using Lookup() .(ie) I am able to get the RMI Registry Obj Refererce of the Java Rmi Application but couldn't able to Lookup for the Object registered to this Rmi Registry.I am not able to proceed after getting the Rmi Registry reference.
    So any help Regarding this is appreciated.
    Thanks in Advance.
    with regards,
    Ramakrishna M
    Mail: [email protected]

    Hello,
    I have started a Java RMI Server Application as NT Service using JNT (download it from www.eworksmart.com/JNT/ ).
    It is working fine.
    S. Navaneethakrishnan
    [email protected]

  • Attempting to use SSL over RMI from a web application to a RMI server

    Hi,
    I am attempting to use SSL over RMI to a server. The client is the web
    application that is hosted on WebLogic and that attempts to connect to the
    server. There is no client or server verification at either the client or
    the server end. The code works outside of WebLogic 7/8 but has the following
    issues when running the web application inside weblogic:
    java.rmi.ConnectException: Connection refused to host: gkhanna1; nested
    exception is:
    java.net.ConnectException: Connection refused: connect
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
    at java.net.Socket.<init>(Socket.java:268)
    at java.net.Socket.<init>(Socket.java:95)
    at
    sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketF
    actory.java:20)
    at
    sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketF
    actory.java:115)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:494)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:79)
    at
    com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.initConnection(NTLMConne
    ctionClient.java:59)
    at
    com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.getUsers(NTLMConnectionC
    lient.java:197)
    at com.hyperion.css.CSSAPIImpl.getUsers(Unknown Source)
    at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
    at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
    at jsp_servlet._jsp._app1.__app1signin._jspService(__app1signin.java:133)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:1058)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :401)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :445)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :306)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5445)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:780)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3105)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2588)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    The code at the client that initiates the connection:
    socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
    SSLSocket socket = (SSLSocket) socketFactory.createSocket(host, port);
    socket.setEnabledCipherSuites(CIPHERS);
    socket.setEnableSessionCreation(true);
    Any ideas?
    Thanks

    I don't see anything that indicates SSL was directly a factor in the
    failure.
    From the exception stack it looks like a more basic connectivity issue,
    maybe the URL for the
    RMI server is incorrect for some reason or the server was down.
    It looks like you are doing something like this:
    SSL client -> WLS server with servletA, servletA RMI client
    (com.hyperion.css) -> RMI server
    The connection failure appears to be the connection from servletA RMI client
    to the RMI server.
    Is that a correct picture?
    Tony
    "Gaurav Khanna" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I am attempting to use SSL over RMI to a server. The client is the web
    application that is hosted on WebLogic and that attempts to connect to the
    server. There is no client or server verification at either the client or
    the server end. The code works outside of WebLogic 7/8 but has thefollowing
    issues when running the web application inside weblogic:
    java.rmi.ConnectException: Connection refused to host: gkhanna1; nested
    exception is:
    java.net.ConnectException: Connection refused: connect
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
    at java.net.Socket.<init>(Socket.java:268)
    at java.net.Socket.<init>(Socket.java:95)
    at
    sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketF
    actory.java:20)
    at
    sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketF
    actory.java:115)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:494)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:79)
    at
    com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.initConnection(NTLMConne
    ctionClient.java:59)
    at
    com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.getUsers(NTLMConnectionC
    lient.java:197)
    at com.hyperion.css.CSSAPIImpl.getUsers(Unknown Source)
    at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
    at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
    at jsp_servlet._jsp._app1.__app1signin._jspService(__app1signin.java:133)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:1058)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :401)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :445)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :306)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5445)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:780)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3105)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2588)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    The code at the client that initiates the connection:
    socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
    SSLSocket socket = (SSLSocket) socketFactory.createSocket(host, port);
    socket.setEnabledCipherSuites(CIPHERS);
    socket.setEnableSessionCreation(true);
    Any ideas?
    Thanks

  • Crazy Exception blocked my RMI server

    Hi all one crazy exception is thrown when I try to start the server. Plz reply me the the possible cause and solution.
    thanks in advance
    The exception is :
    Error starting service
    java.rmi.server.ExportException: Listen failed on port: 0; nested exception is:
    java.net.SocketException: JVM_Bind (code=10055)

    You cant listen / bind on port 0. Try a different port number greater than 1024. That should work out.

  • How to get the IP address of RMI server???

    Hi:
    Is there a way to know the IP address of RMI server before client and server connect?
    I am assuming that client didn't know the IP address of the server.
    Because I know that client must hold a server reference so that client can connect to server.
    But I want my client program to find out server IP address before they connect and use this finding to connect to server.
    Is it possible?
    Thanks!

    So you KNOW that the client MUST know where the server is yet you want the client to find out where the server is?
    Simple answer: forget it.
    If you don't know where to connect to how are you ever going to connect to it?
    And if you do know you don't have to go looking it up...
    You can probably do something with JNDI, but then you're only putting off the inevitable as now you need to both know how to contact the JNDI server AND the JNDI server needs to know where the the RMI registry for the service you want to connect to is.

  • RMI server object lookup in a session bean

    Hi all,
    I am getting MarshalException when I call java.rmi.Naming.lookup() in a session
    bean. Following is the code and exception. Please note that I am using java.rmi
    package instead of weblogic.rmi and that both the session bean and RMI server
    object (a startup class) is deployed on the same machine.
    Thanks for your help in advance.
    // a simple, replica-aware session bean method
    // some code here
    try {
    MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);
    catch (Exception e) {
    // log the exception
    The exception:
    java.rmi.MarshalException: Error marshaling transport header; nested exception
    i
    s:
    java.io.EOFException
    java.io.EOFException
    at java.io.DataInputStream.readByte(DataInputStream.java:224)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:206
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:84)
    at test.mgmtop.CreateNetworkOpHandler.execute(CreateNetworkOpHandler.jav
    a:88)
    at test.mgmtop.CreateNetworkOpHandler.perform(CreateNetworkOpHandler.jav
    a:28)
    at test.ejb.MgmtServiceBean.create(MgmtServiceBean.java:57)
    at test.ejb.MgmtServiceSession_idi8yo_EOImpl.create(MgmtServiceSession_i
    di8yo_EOImpl.java:46)
    at test.ejb.MgmtServiceSession_idi8yo_EOImpl_WLSkel.invoke(Unknown Sourc
    e)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
    ef.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
    eManager.java:762)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
    a:295)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    .java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)

    Hi Pyung,
    How about trying this instead:
    InitialContext ctx = new InitialContext();
    MediatorInterface mediator = (MediatorInterface) ctx.lookup("TestMediator");
    This assumes your startup class binds the Mediator to the JNDI name "TestMediator".
    - Matt
    Pyung Yoon wrote:
    Hi all,
    I am getting MarshalException when I call java.rmi.Naming.lookup() in a session
    bean. Following is the code and exception. Please note that I am using java.rmi
    package instead of weblogic.rmi and that both the session bean and RMI server
    object (a startup class) is deployed on the same machine.
    Thanks for your help in advance.
    // a simple, replica-aware session bean method
    // some code here
    try {
    MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);
    catch (Exception e) {
    // log the exception
    The exception:
    java.rmi.MarshalException: Error marshaling transport header; nested exception
    i
    s:
    java.io.EOFException
    java.io.EOFException
    at java.io.DataInputStream.readByte(DataInputStream.java:224)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:206
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:84)
    at test.mgmtop.CreateNetworkOpHandler.execute(CreateNetworkOpHandler.jav
    a:88)
    at test.mgmtop.CreateNetworkOpHandler.perform(CreateNetworkOpHandler.jav
    a:28)
    at test.ejb.MgmtServiceBean.create(MgmtServiceBean.java:57)
    at test.ejb.MgmtServiceSession_idi8yo_EOImpl.create(MgmtServiceSession_i
    di8yo_EOImpl.java:46)
    at test.ejb.MgmtServiceSession_idi8yo_EOImpl_WLSkel.invoke(Unknown Sourc
    e)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
    ef.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
    eManager.java:762)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
    a:295)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)

  • RMI server appears to deadlock but is fine after...

    I have a RMI server that is providing services to clients on my network.
    When I run tests from the clients (an app that constatnly makes demanding method calls to the RMI server) everything runs fine.
    I have one Windows 2000 client and one Slackware Linux 10.1 client, everyone has the same version JVM. They both run the "stress test" at the same time. The Server is a Windows XP MCE on a dual core Processor, the OS has been configured to run both processors.
    Both clients run for hours (all day) and so does the server without problem. Except sometimes I come back and it looks as though my clients are expererinceing some type of deadlock and when I check the server it is sitting there not doing anything as if everything is deadlocked.
    Now the magic, at the server console I smack a few keys on the keyborad and everything jumps back into business humming along just fine.
    What the heck? I have had this happen more than once. My apps have no input facilities whatsoever except CTRL+C which I use to kill them when I'm done with my "stress test".
    I have noticed Windows clients can kinda drag everyone else down because of the way it schedules threads.
    Any ideas?
    Sean

    Sometimes thread prioroties can be used effectivly on
    Windows if you are having problems with your WINDOWS
    machines handling the threads "properly". But not
    much use really.
    For testing? OK.
    I have been developing and testing parallel threaded
    applcations and it would not be possible without a
    dual-processor machine (properly configured).
    Number of processors is irrelevant. Why do you think this makes any difference at all?
    You cannot test threaded applications on a single
    processor. Single processor runs ONE thread at a
    time. Dual-Core or dual processors can run THREADS
    in parallel. I've seen it work, beautifully. your
    threaded app may run fine on one processor BUT if you
    run it on a dual machine it may break. In computer
    science parallel computing has been around for a long
    time but the majority of people (programmers) have no
    idea about it whatsoever and there is a lot of
    misconceptions.
    I happen to have a Masters in distributed computing. I quite enjoy it. And I still insist that a dual core system is not going to do anything to your threads that a single core system won't do to your threads.
    I challenge you to write a program that can tell the number of processors present, without checking the system property. If the OS is properly written and the chipset is working as it should, your program can not tell.
    One thing I see repeated is that dual-core machines
    have liitle impact on performance because most
    applications have only a single thread. Horse
    feathers!!! Windows and any other OS is going to run
    applications in parallel!! I have noticed a nice
    improvemnet in basic operations on a dual-core
    (properly configured).
    applications don't run in parallel, threads do. adding a 2nd core may make your computer more responsive if the OS preemptive scheduler is poorly written. Otherwise its no different than adding a faster CPU.
    This is a wonderful subject (Parallel Computing, the
    new PC)and I'm hooked (bad) mainly because this area
    is almost unexplored by the masses and there is a lot
    of work (read innovation) that needs done in the next
    decade on the software end. If you like serious PC
    check out Solaris (awsome).I love it. I was working on parallel code in Linux several years back while in school. Its not unexplored really. Search for distributed computing and you will find lots of info. The thing that is new is the attempt to take advantage automagically of multi cpu by programs that were not written to take advantage.
    >
    P.S. My dual-core 1gig SATA (XPS) Dell machine just
    caught up with my PIII single CPU 512mb SCSI U-160
    (500sc)machine in total throughput. seat-of-pants
    All this swapping has to go.
    Sean
    Message was edited by:
    DataVirtueMy last dual cpu machine was a abit BP6 dual celeron. Its a nice novelty, but buying dual/cpu dual core makes no sense unless the fastest single CPU is not fast enough or the price is right. Dual-cores has come about because the CPU folks are having difficulty making the single CPUs faster. Its a cop-out really. Instead of advancing technology, they add a 2nd CPU and try to act like they did something.
    Anyone that chooses a dual-core CPU over a twice as fast single core CPU either does not understand distributed computing, or enjoys the novelty.

  • Connect Via RMI To A Remote Service?

    Has anyone connected, via RMI, to a remote service within an application module? Currently this seems to wreak havoc upon all future and current ORMI communication to and from the application server in which a model is deployed (or at least within a container). Does anyone have any idea on how to do this correctly?
    -Brian
    When a connection is initiated I get the following stack trace:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.security.AccessControlException, msg=access denied (java.net.SocketPermission ifd01-d.syd.nighthawkrad.net resolve)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.dispatchMethod(AbstractRemoteApplicationModuleImpl.java:6301)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.executeMethod(AbstractRemoteApplicationModuleImpl.java:6503)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:4744)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4995)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:4176)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2255)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.doMessage(RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.java:1902)
         at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.security.AccessControlException: access denied (java.net.SocketPermission ifd01-d.syd.nighthawkrad.net resolve)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         at java.security.AccessController.checkPermission(AccessController.java:427)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
         at java.net.InetAddress.getAllByName0(InetAddress.java:1117)
         at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
         at java.net.InetAddress.getAllByName(InetAddress.java:1061)
         at java.net.InetAddress.getByName(InetAddress.java:958)
         at java.net.InetSocketAddress.<init>(InetSocketAddress.java:124)
         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)
         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 net.nighthawk.ifd.client.communications.Communications.updateFaxViewerRMIServer(Communications.java:156)
         at net.nighthawk.talon.model.bc.autorad.QCServicesAppModuleImpl.sendReport(QCServicesAppModuleImpl.java:5560)
         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 oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.dispatchMethod(AbstractRemoteApplicationModuleImpl.java:6279)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.executeMethod(AbstractRemoteApplicationModuleImpl.java:6503)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:4744)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4995)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:4176)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2255)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.doMessage(RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.java:1902)
         at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

    Has anyone connected, via RMI, to a remote service within an application module? Currently this seems to wreak havoc upon all future and current ORMI communication to and from the application server in which a model is deployed (or at least within a container). Does anyone have any idea on how to do this correctly?
    -Brian
    When a connection is initiated I get the following stack trace:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.security.AccessControlException, msg=access denied (java.net.SocketPermission ifd01-d.syd.nighthawkrad.net resolve)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.dispatchMethod(AbstractRemoteApplicationModuleImpl.java:6301)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.executeMethod(AbstractRemoteApplicationModuleImpl.java:6503)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:4744)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4995)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:4176)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2255)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.doMessage(RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.java:1902)
         at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.security.AccessControlException: access denied (java.net.SocketPermission ifd01-d.syd.nighthawkrad.net resolve)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         at java.security.AccessController.checkPermission(AccessController.java:427)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
         at java.net.InetAddress.getAllByName0(InetAddress.java:1117)
         at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
         at java.net.InetAddress.getAllByName(InetAddress.java:1061)
         at java.net.InetAddress.getByName(InetAddress.java:958)
         at java.net.InetSocketAddress.<init>(InetSocketAddress.java:124)
         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)
         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 net.nighthawk.ifd.client.communications.Communications.updateFaxViewerRMIServer(Communications.java:156)
         at net.nighthawk.talon.model.bc.autorad.QCServicesAppModuleImpl.sendReport(QCServicesAppModuleImpl.java:5560)
         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 oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.dispatchMethod(AbstractRemoteApplicationModuleImpl.java:6279)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.executeMethod(AbstractRemoteApplicationModuleImpl.java:6503)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:4744)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4995)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:4176)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2255)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.doMessage(RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.java:1902)
         at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

  • How to set the granted permission in RMI SERVER site

    Hi everyone,
    I have developin some simple RMi program but the error message is keep on prompting out and I cant really test out what is the result. I understand I got to GRANT the permission for the RMI but I I dun really know where should I start first. I know there are code that can be implement in the sErver site, just hope some one can guide me out.
    Thank lot...
    here is the code for server:
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class myRMIServer
    public static void main(String[] argv)
    System.setSecurityManager(new RMISecurityManager());
    try
    myRMIImpl implementation = new myRMIImpl("myRMIImplInstance");
    catch (Exception e)
    System.out.println("Exception occurred: " + e);
    Where should i code the getProperties and setProperties code...

    so, what u mean is the problem occur doesnt related to coding part ?? do you think it is because I did not start the rmiRegistry, but somehow when i started the rmiRegistry, the console window is blank an it is nothing in the window. pls pls help me to solve this problem... sound easy initially but end up it is not...
    by the way, here is the code
    Interface
    public interface myRMIInterface extends java.rmi.Remote
    public java.util.Date getDate() throws java.rmi.RemoteException;
    Interface Implementation
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class myRMIImpl extends UnicastRemoteObject implements myRMIInterface
    public myRMIImpl(String name) throws RemoteException
    super();
    try
    Naming.rebind(name, this);
    catch(Exception e)
    System.out.println("Exception occurred: " + e);
    public java.util.Date getDate()
    return new java.util.Date();
    server
    import java.rmi.*;
    import java.rmi.Naming;
    import java.rmi.RMISecurityManager;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.registry.LocateRegistry;
    import java.util.Properties;
    public class myRMIServer
    public static void main(String[] argv)
    //System.setProperty("java.security.policy","C:\\workspace\\MyRMI\\java.policy");           
    //System.getProperty("java.security.policy","C:\\workspace\\MyRMI\\java.policy");
         //myRMIServer m = System.getProperties();
         //m.setProperty("java.security.policy","C:\\workspace\\MyRMI\\java.policy");
         //System.setSecurityManager(new RMISecurityManager());
    //Properties p = System.getProperties();
    //p.setProperty("java.security.policy","C:\\workspace\\MyRMI\\java.policy");
    try
    myRMIImpl implementation = new myRMIImpl("myRMIImplInstance");
    Properties p = System.getProperties();
         System.setProperty("java.security.policy","C:\\workspace\\MyRMI\\java.policy.txt");
         System.setProperty("java.rmi.server.codebase","file:///P:\\Projects\\RMIServer\\bin");
         if (System.getSecurityManager() == null) {
         System.setSecurityManager(new RMISecurityManager());
         System.out.println("Security manager registered");
         //System.out.println("Service registered");
    catch (Exception e)
    System.out.println("Exception occurred: " + e);
    here is the code, to run, I got a client one as well, but is just for displat purpose..
    thank you, guys....really appreciate ur help

  • J2EE problem while accessing RMI server

    Hi,
    I have a J2EE application in Oracle 9iAS server, I have created an application which access a RMI Server runs in a different PC, it works fine in my /dev site, I moved the same files to /test site (Same machine but different context), which also access the same RMI Server, now my application throws the following error in /test site where as it is working perfectly in /dev site.
    If you have any idea on this please let me know. Thanks in advance.
    Regards,
    Venkat
    ----------- Exception throws in server --------------------
    500 Internal Server Error
    java.lang.ClassFormatError: com/sgsap/feed/server/IFeed (Extra bytes at the end of the class file)     at java.lang.ClassLoader.defineClass0(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:493)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].naming.ContextClassLoader.findClass(ContextClassLoader.java:250)     at java.lang.ClassLoader.loadClass(ClassLoader.java:299)     at java.lang.ClassLoader.loadClass(ClassLoader.java:255)     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)     at java.lang.ClassLoader.defineClass0(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:493)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].naming.ContextClassLoader.findClass(ContextClassLoader.java:250)     at java.lang.ClassLoader.loadClass(ClassLoader.java:299)     at java.lang.ClassLoader.loadClass(ClassLoader.java:255)     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Class.java:195)     at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:654)     at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:121)     at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:918)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)     at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)     at java.rmi.Naming.lookup(Naming.java:84)     at com.sgsap.feed.client.FeedClient.getData(FeedClient.java:99)     at ReportManager.updatePostTradeFeedServerValues(ReportManager.java:998)     at ReportManager.updatePostTradeFeedValues(ReportManager.java:961)     at ReportManager.getPostTradeData(ReportManager.java:1449)     at /html/Trade/PostTradeReportExcel.jsp._jspService(/html/Trade/PostTradeReportExcel.jsp.java:84) (JSP page line 44)     at com.orionserver[Oracle9iAS (1.0.2.2) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:54)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.HttpApplication.serviceJSP(HttpApplication.java:5458)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.JSPServlet.service(JSPServlet.java:31)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:501)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:170)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:576)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:189)     at com.evermind[Oracle9iAS (1.0.2.2) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:62)

    Looks like ClassLoader tries to load different class. Check your classpath, check where are classes com/sgsap/feed/server/IFeed and if there are more than one such class, check why if your app is in /dev it is loading different class than when it is in /test.
    Other solution could be that something gone wrong while compilation. Are you sure you was not recompiling any code between testing it on /dev and on /test?
    I do not know, I am just trying to give some clues.
    Regards
    Pawel

  • [RMI] server/client, help me.

    I have done a Chat with RMI, between a server and a client machine on my network.
    The server start normaly, and the client manage to connect the server, but the server failed to connect the client.
    Can Someone explain me why?
    Here are the source files:
    *********Client Distant****************
    import java.rmi.*;
    public interface ClientDistant extends java.rmi.Remote {
    public void msg(Message m) throws RemoteException;
    **********Client DistantImplementation**************
    import java.io.*;
    import java.net.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    import java.net.MalformedURLException;
    public class ClientDistantImpl extends java.rmi.server.UnicastRemoteObject implements ClientDistant, Runnable {
    String nom;
    String nomServeur;
    /** Constructs ClientDistantImpl object and exports it on default port.
    public ClientDistantImpl(String nom, String nomServeur) throws RemoteException {
    super();
    this.nom = nom;
    this.nomServeur= nomServeur;
    Thread leThread = new Thread(this);
    leThread.start();
    /** Register ClientDistantImpl object with the RMI registry.
    * @param name - name identifying the service in the RMI registry
    * @param create - create local registry if necessary
    * @throw RemoteException if cannot be exported or bound to RMI registry
    * @throw MalformedURLException if name cannot be used to construct a valid URL
    * @throw IllegalArgumentException if null passed as name
    public static void registerToRegistry(String name, Remote obj, boolean create) throws RemoteException, MalformedURLException{
    if (name == null) throw new IllegalArgumentException("le nom doit etre non vide");
    try {
    Naming.bind(name, obj);
    } catch (AlreadyBoundException ex){
              throw new IllegalArgumentException("le nom est deja utilise");
    } catch (RemoteException ex){
    if (create) {
    Registry r = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
    r.rebind(name, obj);
    } else throw ex;
    /** Main method.
    public static void main(String[] args) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    BufferedReader entree = new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Entrez votre nom");
    String nom = entree.readLine();
    System.out.println("Entrez le nom de la machine serveur");
    String nomServeur = entree.readLine();
    ClientDistantImpl obj = new ClientDistantImpl(nom, nomServeur);
    String machineLocale = InetAddress.getLocalHost().getHostAddress();
                   System.out.println("Machine locale : "+machineLocale);
                   String[] tab = Naming.list("//"+nomServeur);
                   for(int i=0; i<tab.length; i++)
                        System.out.println(tab[i] + " est enregistre sur le registre du serveur");
    ServeurChat sc = (ServeurChat) Naming.lookup("//"+nomServeur+"/serveurChat");
    String url = "//"+machineLocale+"/"+nom;
    sc.connect(url);
    System.out.println("Entrez vos messages en terminant par FIN");
    String mess = entree.readLine();
    while(!mess.equalsIgnoreCase("FIN")) {
    Message m = new Message(url, mess);
    sc.msg(m);
    mess = entree.readLine();
    sc.disconnect(url);
              System.exit(1);
    } catch (Exception ex) {
    ex.printStackTrace();
    public void msg(Message m) throws RemoteException {
    System.out.println(m);
    public void run() {
    try {
    registerToRegistry(nom, this, true);
    } catch (Exception ex) {
    ex.printStackTrace();
              System.exit(1);
    ****************Serveur Chat********************
    import java.rmi.*;
    public interface ServeurChat extends ClientDistant {
    public void connect(String url) throws RemoteException;
    public void disconnect(String url) throws RemoteException;
    *****************Serveur Chat Implementation**********
    import java.net.*;
    import java.util.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    import java.net.MalformedURLException;
    /** Unicast remote object implementing ServeurChat interface.
    * @author Patrice Torguet
    * @version 1.0
    public class ServeurChatImpl extends UnicastRemoteObject implements ServeurChat {
    Vector clients;
    /** Constructs ServeurChatImpl object and exports it on default port.
    public ServeurChatImpl() throws RemoteException {
    super();
    clients = new Vector();
    public static void registerToRegistry(String name, Remote obj, boolean create) throws RemoteException, MalformedURLException{
    if (name == null) throw new IllegalArgumentException("registration name can not be null");
    try {
    Naming.rebind(name, obj);
    } catch (RemoteException ex){
    if (create) {
    Registry r = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
    r.rebind(name, obj);
    } else throw ex;
    /** Main method.
    public static void main(String[] args) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    String machineLocale = InetAddress.getLocalHost().getHostName();
    System.out.println("Nom du serveur = serveurChat");
    ServeurChatImpl obj = new ServeurChatImpl();
    registerToRegistry("serveurChat", obj, true);
    } catch (Exception ex) {
    ex.printStackTrace();
    public void disconnect(String url) throws RemoteException {
    clients.removeElement(url);
    public void msg(Message m) throws RemoteException {
    Enumeration e = clients.elements();
    String url = null;
    while(e.hasMoreElements()){
    try {
    url = (String) e.nextElement();
    if (!url.equalsIgnoreCase(m.url)) {
    ClientDistant cl = (ClientDistant) Naming.lookup(url);
    cl.msg(m);
    } catch(Exception ex) {
    ex.printStackTrace();
    clients.removeElement(url);
    public void connect(String url) throws RemoteException {
    clients.addElement(url);
    *************Message*********************
    import java.io.*;
    * @author Patrice Torguet
    * @version
    public class Message implements Serializable {
    String url;
    String msg;
    /** Creates new Message */
    public Message(String url, String msg) {
    this.url = url;
    this.msg = msg;
    public String toString() {
    return url + " : " + msg;
    Thx for help.

    This is the exception:
    java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
    java.net.ConnectException: Connection refused
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
    at java.net.Socket.<init>(Socket.java:268)
    at java.net.Socket.<init>(Socket.java:95)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:20)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:115)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:494)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:78)
    at ServeurChatImpl_Stub.connect(Unknown Source)
    at ClientDistantImpl.main(ClientDistantImpl.java:85)

  • RMI Server Codebase Permission Denied

    I'm having a problem trying to get my application running in a test environment. I currently have this same application up and running in an almost identical location without any issues, and I'm at a loss to understand what the problem is.
    My application is an RMI server-client setup. At the moment, I'm having trouble with solely the server portion, as I'm unable to get it to access the codebase. I start the application with the following runServer.sh file (located in /usr/local/app/app, so the $ROOT_DIR=pwd is correct):
    Line: -----
    #!/bin/bash
    ROOT_DIR=`pwd`
    JAVA_HOME=/usr/java/latest
    CLASSPATH=''
    #:: Please edit the environmental variables below so that it refers
    #:: to the location where you have distribution URL.
    DISTRIBUTION_URL=file://$ROOT_DIR
    find /usr/local/app/app/server -name '*.jar' -type f -print | while read FILE
    do
    if [ $CLASSPATH ]
    then
         CLASSPATH=$CLASSPATH:$FILE
    else
         CLASSPATH=$FILE
    fi
    echo $CLASSPATH > classpath.env
    done
    read CLASSPATH < classpath.env
    find /usr/local/app/app/import -name '*.jar' -type f -print | while read FILE
    do
    if [ $CLASSPATH ]
    then
         CLASSPATH=$CLASSPATH:$FILE
    else
         CLASSPATH=$FILE
    fi
    echo $CLASSPATH > classpath.env
    done
    read CLASSPATH < classpath.env
    find /usr/local/app/app/common -name '*.jar' -type f -print | while read FILE
    do
    if [ $CLASSPATH ]
    then
         CLASSPATH=$CLASSPATH:$FILE
    else
         CLASSPATH=$FILE
    fi
    echo $CLASSPATH > classpath.env
    done
    read CLASSPATH < classpath.env
    echo ${CLASSPATH}
    cd server
    # start /min "RMI Registry"
    $JAVA_HOME/bin/rmiregistry &
    JAVA_SECURITY="-Djava.security.policy==config/admin.policy -Djava.security.auth.login.config==config/app_jaas.config"
    IMPORT_PROPERTIES="-Dapp.import.properties=file://$ROOT_DIR/import/config/import.properties -Dapp.import.logging.properties=file://$ROOT_DIR/import/config/importlog.properties -Dapp.client.properties=file://$ROOT_DIR/client/config/client.properties"
    app_PROPERTIES="-Dapp.root=$ROOT_DIR -Dconnection.pool.properties=file://$ROOT_DIR/server/config/database.properties -Dapp.common.properties=$DISTRIBUTION_URL/common/config/common.properties -Dapp.server.properties=file://$ROOT_DIR/server/config/server.properties -Dapp.server.logging.properties=file://$ROOT_DIR/server/config/log.properties"
    echo
    echo "-------------- app Server -------------------"
    echo
    $JAVA_HOME/bin/java -ms96m -mx256m -classpath $CLASSPATH -Djava.rmi.server.codebase=file:///usr/local/app/app/common/lib/common.jar $IMPORT_PROPERTIES $JAVA_SECURITY $app_PROPERTIES -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n app.serverimpl.ServerStarter
    cd $ROOT_DIR
    Line: -----
    After running this, it fails at that last line, $JAVA_HOME/bin/java etc. Near as I can see from the error is that it cannot access the -Djava.rmi.server.codebase.
    Line: -----
    app.serverimpl.service.ServiceException:java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: access to class loader denied
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:419)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:377)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
    at app.serverimpl.service.LoginManagerServiceImpl.start(LoginManagerServiceImpl.java:52)
    at app.serverimpl.service.ServiceAdapter.start(ServiceAdapter.java:96)
    at app.serverimpl.service.ServiceManager.startup(ServiceManager.java:78)
    at app.serverimpl.ServerStarter.main(ServerStarter.java:62)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: access to class loader denied
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)
    Caused by: java.lang.ClassNotFoundException: access to class loader denied
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:445)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:182)
    at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)
    at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:264)
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:214)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1592)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1513)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1749)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
    ... 12 more
    Caused by: java.security.AccessControlException: access denied (java.io.FilePermission /usr/local/app/app/common/lib/- read)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:393)
    at java.security.AccessController.checkPermission(AccessController.java:553)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at sun.rmi.server.LoaderHandler$Loader.checkPermissions(LoaderHandler.java:1173)
    at sun.rmi.server.LoaderHandler$Loader.access$000(LoaderHandler.java:1127)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:409)
    ... 21 more
    Line: -----
    Out of growing desperation (and since it's a test VM in virtual box so I'm not really protecting anything) I've already granted full permissions to everyone for these these files in the filesystem itself - chmod -R 775 - and I've made sure that common.jar is accessible. I also double-checked the Security Policy, Djava.security.policy, and that's just a straight all permission to everything (again, I'm not protecting anything on this test).
    Line: -----
    grant {
    permission java.security.AllPermission;
    Line: -----
    What's really driving me nuts is that this exact same code is already running and working on another machine. There are no environment variables that I'm missing, and I don't see how those would relate to this problem even if I did. The directories are identical, and I've verified the location that's listed as the cause (/usr/local/app/app/common/lib/) exists and is accessible. I keep coming back to the file permissions and the security policy and I'm sure I could be missing something obvious, but I am not seeing it at all. Can anyone give me some advice on this?
    I'm running a VM in VirtualBox 4.1.4, running CentOS 5.7 32-bit. Java is JDK 1.6.0, just the basic yum install package.

    This is a .policy file problem, not a filesystem permissions problem. Run it with -Djava.security.debug=access,failure to see exactly what is going on. Basically your .policy file either doesn't grant the required FilePermission or isn't being loaded.
    NB a codebase of a local JAR file isn't going to work unless all the clients are in the same host.

Maybe you are looking for

  • Is there a way to change the i of for loop

    Hello, A Labview question. A tusk should be repeat 10 times in a for loop. so the value of i in the for loop will be changed from 0 to 9. Sometimes, some tusks may repeat one extra time. It there a way to let me change the value of i in the for loop?

  • 'what kind of error 'plzzz help

    hi all plz check the following code and error which it is givn 2 me. how shld i rectify it? not able to get what kind of error it is. *& Report  ZNBS_FI_FS10N REPORT  ZPRAC_FI_VENDORSTATEMENT. Report Title          : Display Line item balances for VE

  • Calendaro and Phone not in sync

    Gmail calendar and Droid X stopped syncing.  Gmail on my computer doesn't allow me to fix it.  I don't like to have to post it on the phone and then again on my Gmail account.  Any suggestions for this new user?

  • Process Keys in MM

    Hello, can someone please explaint the concept of process keys in MM. We are implementing Purchasing in BW and I would lke know about Process Keys. If you can point me to some documentation, that would be good. Thanks John

  • Scale Out File Server for Applications using Shared VHDX

    Just trying to get a definitive answer to the question of can we use a Shared VHDX in a SOFS Cluster which will be used to store VHDX files? We have a 2012 R2 RDS Solution and store the User Profile Disks (UPD) on a SOFS Cluster that uses "traditiona