Trying to interrupt an RMI call

We're trying to interrupt a call to a Weblogic RMI stub via
Thread.interrupt(). Doesn't seem to work. Can someone confirm that
this will never work, or might we be doing something wrong?
Why is this posted to the performance newsgroup? We're trying to build
a web service with a guaranteed response time. The servlet makes a
backend call via RMI. Before we make the RMI call, the servlet thread
requests another thread to interrupt it if the call takes too long. If
we can't interrupt the calling thread, there are only two options I can
think of. 1) Have the servlet thread pass the request to another thread
that can block. The servlet thread then waits on a queue for a
response, and can be interrupted. 2) Don't use weblogic RMI, and build
our own transport. Yuck.
Any ideas?
-Tim

Tim Harrison wrote:
Out of curiousity, do you guarantee end to end response time or just the
time that the request will be processed on your site.Hi Rob. End-to-end, of course! We're using a Reuters network that
bypasses the internet. :)
Ok, I'm just kidding. We'll just start with the guaranteed process
time.
That's what I thought :>
>
I'd be surprised if no one else has run into this issue with RMI. A
collegue of mine is building a test with Sun RMI to see if that is
interruptable. It seems that Weblogic might be catching the interrupt
exception below the stub level. When we interrupt a thread blocked in
an RMI call, the thread returns normally (after completing), and
Thread.isInterrupted() is false. I think that means that something in
the call is reseting the status. A quick glance at the generated stub
code does not seem to indicate anything, so I'm guessing it's at a lower
level.
Well, it depends on what we are doing when you attempt to interrupt our
thread. Most likely (since it's a stub waiting for a response from the server)
the RMI thread is blocked in a socket read system call. Depending on the
operating system and how javasoft implemented it, it may or may not be
interruptable.
-- Rob
Rob Woollen
Software Engineer
BEA WebLogic
[email protected]
>
-Tim

Similar Messages

  • Connection timed out when making RMI call

    Hello,
    I am using a combination of Spring Remoting and Scheduling with Quartz Timer. Both are using RMI as a communication stack. The RMI server is located in sydney while the client is located in the US. This incurs large network lag which causes my RMI method calls to timeout. I am able to do a lookup on the RMI object and receive a stub reference to it with no problem but as soon as I try to invoke a remote method on that stub it eventually times out.
    Thinking it was truly a timeout issue I implemented a Custom socket factory for RMI using RMISocketFactory.setSocketFactory(new TimeoutSocketFactory(120000));Here is the custom TimeoutSocketFactory:
    public class TimeoutSocketFactory extends RMISocketFactory {
            private int timeout;
            private static final Logger log = Logger.getLogger(TimeoutSocketFactory.class);
            public TimeoutSocketFactory(int timeout) {
                this.timeout = timeout;
            public Socket createSocket(String host, int port) throws IOException {
                log.debug("Creating timeout socket with value - " + timeout);
                Socket ret = getDefaultSocketFactory().createSocket(host, port);
                ret.setSoTimeout(timeout);
                return ret;
            public ServerSocket createServerSocket(int port) throws IOException {
                ServerSocket ss = getDefaultSocketFactory().createServerSocket(port);
                ss.setSoTimeout(timeout);
                return ss;
    }I implemented the custom socket factory both on the RMI server and on the RMI client. This had no effect on the time outs that occured when trying to make an RMI call to the server even though the sockets were being built by this custom class (have logging in place).
    Is there something else I need to do to increase the timeout period? And how do I know if it's a server or a client issue?
    Thanks,
    Anthony Bargnesi
    [Exception StackTrace]
    java.rmi.ConnectException: Connection refused to host: 172.16.10.97; nested exception is:
         java.net.ConnectException: Connection timed out: 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.invoke(UnicastRef.java:94)
         at org.springframework.remoting.rmi.RmiInvocationWrapper_Stub.invoke(Unknown Source)
         at com.aquent.rmi.test.RMIClient.connectService(RMIClient.java:46)
         at com.aquent.rmi.test.RMIClient.main(RMIClient.java:81)
    Caused by: java.net.ConnectException: Connection timed out: 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:366)
         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 com.aquent.rmi.test.TimeoutFactory.createSocket(TimeoutFactory.java:21)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)

    Well this is a connect timeout, not a read timeout, so it has nothing to do with your socket factory, and your socket factory won't help. It's a connectivity issue. Can you ping that host from the client? Can you telnet to port 7?
    In fact no socket factory will help because there is no way of increasing the connect timeout beyond the default: you can only reduce it.

  • Not able to call BPEL web service using RMI call from different machine

    Hi,
    1. I have created a smiple Helloworld asynchoronous BPEL process
    2. I am able to call that BPEL process using java program (RMI call) which I have written in JDeveloper 10.1.3.3 and the java program is running in the embeded OCJ4 instance of JDeveloper sucessfully.
    3. Now I am trying to run the same Java program in my unix machine where oracle application is installed.
    4. I have set all the CLASSPATH for required jars which I have used in JDeveloper and also kept the jar file in Unix machine.
    5. The java codes are complied successfully.
    6. But when I am trying to run it , getting the following exception:
    bash-3.00$ java HelloworldAsyn
    name is Debkanta
    property file data are: {java.naming.provider.url=opmn:ormi://172.18.19.169:6003:home/orabpel, java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory, orabpel.platform=ias_10g, java.naming.security.principal=oc4jadmin, java.naming.security.credentials=welcome1}
    hello3
    java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NameNotFoundException: ejb/collaxa/system/DeliveryBean not found
    at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:52)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:279)
    at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)
    at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:174)
    at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:149)
    at HelloworldAsyn.main(HelloworldAsyn.java:64)
    at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:293)
    at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)
    at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:174)
    at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:149)
    at HelloworldAsyn.main(HelloworldAsyn.java:64)
    bash-3.00$
    I need to solve it urgently. Can anyone please help me.
    Is it relaed to some user access issue in unix?
    Thanks & Regards
    Deb
    Message was edited by:
    user587916

    actually , I have laready given print stataement for the data in the context property file that you can see in the output. Today I am also able to call the bpel process using the same java program from my DOS command promt(cmd). Don't understand why the problem is occuring in unix.
    please help.

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

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

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

  • RMI call to java in Oracle 8i

    We need to access stored Java classes inside the Oracle 8i (8.1.7) database using RMI from a remote machine. Is this possible? How?
    Basically we have stored PL/SQL procedures/packages we want to create interfaces for (Using JPiblisher) and access them remotely via RMI.

    We need to access stored PL/SQL packages from outside the database via RMI. That's the requirement. First we need to wrap the PL/SQL packages with Java classes (JPublisher can help us here). Then there are, in my opinion, three possible ways to achieve this:
    - direct Java RMI calls
    - CORBA
    - EJB
    Because I need to evaluate all ways, I am just trying the 1st ( I know, not scalable) way - direct RMI calls. I can do a direct RMI call from the database to an outside server. That works fine. My problem is the other way round, to call an object inside 8i. I understand that using CORBA or EJB the Oracle ORB is used (handled by the TNS Listener). Using a direct RMI call I would need to run the RMIREGISTRY program (inside or outside 8i?)...But I have no clue, how this could work.

  • Why are my current calls being interrupted by new calls?

    Why are my current calls being interrupted by new calls?
    I'm using iPhone 6 plus and reset my network settings multiple times. The issue is random.

    glic1 wrote:
    Why are my current calls being interrupted by new calls?
    I'm using iPhone 6 plus and reset my network settings multiple times. The issue is random.
    Are you saying when your on a phone call and someone else calls you it does what exactly?  Disconnect your current call with the new call?

  • Is there a way to play music on my iphone (4) without it being interrupted by phone calls?

    Is there a way to play music on my iphone 4s without it being interrupted by phone calls?

    Settings > Airplane Mode > ON

  • Error while trying to login to ecc6: Caller J2EE_ADMIN not authorized, only

    After installation fo ECC6,When I am trying to connect to visual admin,I am getting given below error.
    I am also not able to login to NWA
    Application cannot be started.
      Details:      
      com.sap.engine.services.deploy.container.ExceptionInfo: Naming error.
    System/Server/VisualAdministrationTool#Plain###Error while trying to login to ecc6: Caller J2EE_ADMIN not authorized, only role administrators is allowed to access JMX#
    #1.5#C000C0A8016400010000000001A6B16F0004A600094A9828#1308418992937#/System/Server/VisualAdministrationTool##com.sap.engine.services.adminadapter.gui.tasks.LoginTask#######Thread[Thread-13,6,main]##0#0#Error#1#/System/Server/VisualAdministrationTool#Plain###Error while trying to login to ecc6: Cannot authenticate the user.#
    #1.5#C000C0A8016400020000000001A6B16F0004A6000C292AF0#1308419041078#/System/Server/VisualAdministrationTool##com.sap.engine.services.adminadapter.gui.tasks.LoginTask#######Thread[Thread-24,6,main]##0#0#Error#1#/System/Server/VisualAdministrationTool#Plain###Error while trying to login to ecc6: Caller J2EE_ADMIN not authorized, only role administrators is allowed to access JMX#
    #1.5#C000C0A8016400030000000001A6B16F0004A6001D1853B8#1308419325187#/System/Server/VisualAdministrationTool##com.sap.engine.services.adminadapter.gui.tasks.LoginTask#######Thread[Thread-35,6,main]##0#0#Error#1#/System/Server/VisualAdministrationTool#Plain###Error while trying to login to ecc6: Caller J2EE_ADMIN not authorized, only role administrators is allowed to access JMX#
    #1.5#C000C0A8016400000000000001CA1A680004A6008F78FF48#1308421244125#/System/Server/VisualAdministrationTool##com.sap.engine.services.adminadapter.gui.tasks.LoginTask#######Thread[Thread-2,5,main]##0#0#Error#1#/System/Server/VisualAdministrationTool#Plain###Error while trying to login to ecc6: Caller J2EE_ADMIN not authorized, only role administrators is allowed to access JMX#
    #1.5#C000C0A8016400010000000001CA1A680004A600919BB068#1308421279953#/System/Server/VisualAdministrationTool##com.sap.engine.services.adminadapter.gui.tasks.LoginTask#######Thread[Thread-13,6,main]##0#0#Error#1#/System/Server/VisualAdministrationTool#Plain###Error while trying to login to ecc6: Cannot authenticate the user.#
    #1.5#C000C0A8016400020000000001CA1A680004A6009220F598#1308421288687#/System/Server/VisualAdministrationTool##com.sap.engine.services.adminadapter.gui.tasks.LoginTask#######Thread[Thread-24,6,main]##0#0#Error#1#/System/Server/VisualAdministrationTool#Plain###Error while trying to login to ecc6: Caller J2EE_ADMIN not authorized, only role administrators is allowed to access JMX#
    #1.5#C000C0A8016400030000000001CA1A680004A60097A70598#1308421381359#/System/Server/VisualAdministrationTool##com.sap.engine.services.adminadapter.gui.tasks.LoginTask#######Thread[Thread-35,6,main]##0#0#Error#1#/System/Server/VisualAdministrationTool#Plain###Error while trying to login to ecc6: Cannot authenticate the user.#
    #1.5#C000C0A8016400040000000001CA1A680004A6009867E880#1308421394000#/System/Server/VisualAdministrationTool##com.sap.engine.services.adminadapter.gui.tasks.LoginTask#######Thread[Thread-46,6,main]##0#0#Error#1#/System/Server/VisualAdministrationTool#Plain###Error while trying to login to ecc6: Cannot authenticate the user.#
    #1.5#C000C0A8016400000000000001402EEB0004A600E643EE28#1308422700265#/System/Server/VisualAdministrationTool##com.sap.engine.services.adminadapter.gui.tasks.LoginTask#######Thread[Thread-2,5,main]##0#0#Error#1#/System/Server/VisualAdministrationTool#Plain###Error while trying to login to ecc6: Caller J2EE_ADMIN not authorized, only role administrators is allowed to access JMX#
    Any help would be highly appreciated.
    Thanks
    Sukrut

    Hello,
    If you have a installation of dual stack(ABAP + JAVA) system.. check in SU01 transaction if SAP_J2EE_ADMIN role is assigned to the J2EE_ADMIN user. If not, please assign it.
    For only JAVA stack systems, default administrator user is Administrator.
    thanks
    ashish

  • Hey how are you guys listen i have an iphone 4s the one i use with the H20 CARRIEr and i trying to enable the option call forwarding and when i type tho number i go back and i notice to the call forwarding it turning off as soon i back to the main menu ?

    hey how are you guys listen i have an iphone 4s the one i use with the H20 CARRIEr and i trying to enable the option call forwarding and when i type tho number i go back and i notice to the call forwarding it turning off as soon i back to the main menu ?

    There are a lot of posts in the forums today with people having problems with iMessage.   There was also a published outage yesterday, so it's possible there are still some issues that may be impacting you both.
    I would just wait it out - I'm sure it will be sorted out soon.

  • How can I interrupt the blocking call when call timeout?

    Hi,Guys
    I wrote an application server(daemon process) to talk with oracle server
    continuous which used oracle9 OCCI lib, each 5 min it executes the procedure
    on the DB server.
    Now I have come cross a problem:
    If the network is blocked, app server will blocked at occi call and would
    never pass, and no exception was catched :-(
    for e.g.
    1. Oracle server reboot without shutdown oracle process
    2. udp broadcast message storm blocked the connection between app server and
    oracle DB.
    I consider maybe it's because OCCI using the blocking mode of connection
    that caused this problem.
    How can I interrupt the blocking call when call timeout?

    Manage the timeout using a separate thread. When the timeout happens, issue a break on the OCCI connection. There is no direct way as of now. You need to do this to break a OCCI connection.
    retrieve the OCI handle from the OCCI handle (e.g. using Connection::getOCIServer or Connection::getOCIServiceContext methods) and issue a OCIBreak on it. Do not forget to allocate a error handle which should be passed to OCIBreak call.

  • RMI Call  not working

    the application we are developing first reads from a com port and then sends the message read to a rmi server.the server has to communicate with a client.the basic rmi calls were working initially.once the code for a listener for the port was added,the remote method cannot be invoked.what we're actually doing is this-in the listener,we invoke an instance of the server and then the server makes the rmi call.at this point,it gets stuck without any errors.we find that client has been registered with the server,there's no problem with that.we're completely at see as to where the error lies and dont know the right approach to solve the problem.any help will be most welcome.

    Perhaps you should start here:
    http://www.angelfire.com/dc/shish/answers.html

  • Is it allowed to make a rmi call from within an ejb??

    Hello,
    Am I allowed to make a rmi call from within an ejb such as:
    String host = "localhost";
    RemoteObject ro = (RemoteObject) Naming.lookup("rmi://"+host+"/MonServeur");
    ro.myMethod();
    package pack;
    import java.rmi.Naming;
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    public class MyRemoteObject extends UnicastRemoteObject implements RemoteObject {
        public MyRemoteObject() throws RemoteException {
        public void myMethod() throws RemoteException {
            System.out.println("toto");
        public static void main(String[] args) {
            try {
                RemoteObject ro = new MyRemoteObject();
                Naming.rebind("MonServeur", ro);
            } catch (Exception ex) {
                ex.printStackTrace();
    }Is it allowed by the spec?
    Is it good design?
    Thanks in advance,
    Julien Martin.

    Allowed - yes
    Good design - no, in my opinion.

  • Hang of RMI call when LAN connection removed

    I have a client server application with comms using RMI across a TCP/IP LAN. We are in test at the moment and one of the tests is to ensure that when the LAN connection is removed, the client application handles it correctly.
    We have discovered that if we pull the LAN whilst an RMI call is in progress, the call never returns, even if we subsequently plug the LAN back in. Why should this be? I would have expected a RemoteException as soon as I pull the LAN out. How come the thread gets deadlocked?
    Note that we are running JRE 1.2 on the client (they are soon to be updated but it's 1400 remote, unattended sites so it's an expensive process to update to a recent JRE).
    Thanks
    Mat

    Thanks ejp - couple of dollars coming your way. Be a couple more if you (or anyone else) can help further.
    Firstly, how would I set this property in the code?
    Secondly, would it be set in the client or the factory (yes we do have one)? If it's in the factory, will that help me from the client side (that's where I need it to work). I looked up the responseTimeout property and it looks like this is more for the server to close incoming connections. The problem I have is on the client side - I need the client (i.e. that is making the RMI call via an exported remote object) to be able to kill off a call that has going too long (for instance because it can't detect the closed TCP connection).
    Maybe I've misunderstood the documentation I've found but that's how I read it.
    Thanks again!
    Mat

  • CVP call server logs - Hi All, I am trying to figure out whether caller party(End User) hangup the call first or UCCE Agent

    CVP call server logs
     Hi All,
    I am trying to figure out whether caller party(End User) hangup the call first or UCCE Agent.
    Attaching CVP call server Logs& UCCE TCD& Route Call Details for your reference.

    From the CVP logs, it can be determined which side disconnected the call first. For each call, CVP keeps track each call leg. From Inbound Gateway to CVP is INBOUND leg, rest are OUTBOUND leg. You can then look at which leg the SIP BYE message is received first.
    Since you have very basic log enabled, you will not see the exact SIP message. But it can be determined by the outcome of the message. Here is the snippet of the log during the disconnect:
    Line 3766: 3083689: 10.180.245.43: Sep 12 2014 12:21:11.293 -0700: %CVP_8_5_SIP-7-CALL:  {Thrd=DIALOG_CALLBACK.6} CALLGUID = CBCCDD8539E811E4A3E2CCEF48565980 LEGID = CC65CE04-39E811E4-87DFD7D1-64B198F2 - [INBOUND] DURATION (msecs) = 25610 - DIALOG TERMINATED. Reason: Q.850;cause=16
    Line 3768: 3083690: 10.180.245.43: Sep 12 2014 12:21:11.293 -0700: %CVP_8_5_SIP-7-CALL:  {Thrd=DIALOG_CALLBACK.6} Sending BUS MSG:>>HEADERS: (JMSType)=MsgBus:CALL_STATE_EVENT (JMSDestination)=Topic(CVP.SIP.CC.EVENT) (JMSTimestamp)=1410549671293 >>BODY: callguid=CBCCDD8539E811E4A3E2CCEF48565980 RouterCallKey=6472 RouterCallKeySent=true causecode=1 timezone=America/Los_Angeles RouterCallKeySequenceNumber=0 version=CVP_8_5 labeltype=1 RouterCallKeyDay=151099 calldate=Fri Sep 12 12:21:11 PDT 2014 label=190376 localOffset=-420 eventid=6 calllegid=CC65CE04-39E811E4-87DFD7D1-64B198F2  >>STATE: isTabular=false isWriteable=true cursor=-1  
    The first Termination message came on the INBOUND leg which is the PSTN. That means, PSTN side disconnected the call first.
    Hope this helps.
    Abu

  • I am trying to make a Shell call to Firefox in the C:\Program Files (x86)\Mozilla FireFox\ directory and LabView shell call gives an error.

    I am trying to make a Shell call to Firefox in the C:\Program Files (x86)\Mozilla FireFox\ directory and LabView shell call gives an errors. I can go to the DOS shell and make the call fine, but Labview Shell gives several errors. Anyone know how to get around the directory issue with Program Files (x86) directory name having the space in it and the (x86) that DOS does not seem to like?
    Solved!
    Go to Solution.

    You need to use quotes.

Maybe you are looking for