ClassCastException when RMI callback via HTTP tunneling

Hello,
I have a typical stock quote type of weblogic RMI application running WLS
6.0. If I use T3 for client to register its stub on the server side, the
server callback works fine. I use standard jndi lookup to find the server,
if I simply switch the provider_url form:
env.put(Context.PROVIDER_URL, "t3://192.168.1.5:7001");
to
env.put(Context.PROVIDER_URL, "http://192.168.1.5:7001");
the client can still connect to server and register itself, but server
callback fails:
this client method: qClient.setFreshData(vList) generates the following
error:
java.lang.ClassCastException: ocsmon.wServerThread
at weblogic.servlet.logging.CLFLogger.log(CLFLogger.java:65)
at
weblogic.servlet.logging.LogManagerHttp.log(LogManagerHttp.java:293)
at weblogic.servlet.internal.HttpServer.log(HttpServer.java:670)
at
weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:
851)
at
weblogic.rjvm.http.HTTPServerJVMConnection.sendMsg(HTTPServerJVMConnection.j
ava:361)
at
weblogic.rjvm.MsgAbbrevJVMConnection.sendOutMsg(MsgAbbrevJVMConnection.java:
367)
at
weblogic.rjvm.MsgAbbrevJVMConnection.sendMsg(MsgAbbrevJVMConnection.java:173
at
weblogic.rjvm.ConnectionManager.sendMsg(ConnectionManager.java:482)
at weblogic.rjvm.RJVMImpl.send(RJVMImpl.java:419)
at
weblogic.rjvm.MsgAbbrevOutputStream.flushAndSendRaw(MsgAbbrevOutputStream.ja
va:114)
at
weblogic.rjvm.MsgAbbrevOutputStream.flushAndSend(MsgAbbrevOutputStream.java:
122)
at
weblogic.rjvm.MsgAbbrevOutputStream.sendRecv(MsgAbbrevOutputStream.java:144)
at
weblogic.rmi.internal.AbstractOutboundRequest.sendReceive(AbstractOutboundRe
quest.java
:84)
at
ocsmon.QuoteClientInterface_WLStub.setFreshData(QuoteClientInterface_WLStub.
java:218)
at ocsmon.wServerThread.run(wQuoteServer.java:350)
ocsmon.wServerThread is the thread spawned on the server side that obtains
the qClient stub from the server's registry and calls the refreshQuotes
method on it. 'vList' is a Vector of Strings containing the quotes.
What went wrong?
thanks
-Alan

Hello,
I have a typical stock quote type of weblogic RMI application running WLS
6.0. If I use T3 for client to register its stub on the server side, the
server callback works fine. I use standard jndi lookup to find the server,
if I simply switch the provider_url form:
env.put(Context.PROVIDER_URL, "t3://192.168.1.5:7001");
to
env.put(Context.PROVIDER_URL, "http://192.168.1.5:7001");
the client can still connect to server and register itself, but server
callback fails:
this client method: qClient.setFreshData(vList) generates the following
error:
java.lang.ClassCastException: ocsmon.wServerThread
at weblogic.servlet.logging.CLFLogger.log(CLFLogger.java:65)
at
weblogic.servlet.logging.LogManagerHttp.log(LogManagerHttp.java:293)
at weblogic.servlet.internal.HttpServer.log(HttpServer.java:670)
at
weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:
851)
at
weblogic.rjvm.http.HTTPServerJVMConnection.sendMsg(HTTPServerJVMConnection.j
ava:361)
at
weblogic.rjvm.MsgAbbrevJVMConnection.sendOutMsg(MsgAbbrevJVMConnection.java:
367)
at
weblogic.rjvm.MsgAbbrevJVMConnection.sendMsg(MsgAbbrevJVMConnection.java:173
at
weblogic.rjvm.ConnectionManager.sendMsg(ConnectionManager.java:482)
at weblogic.rjvm.RJVMImpl.send(RJVMImpl.java:419)
at
weblogic.rjvm.MsgAbbrevOutputStream.flushAndSendRaw(MsgAbbrevOutputStream.ja
va:114)
at
weblogic.rjvm.MsgAbbrevOutputStream.flushAndSend(MsgAbbrevOutputStream.java:
122)
at
weblogic.rjvm.MsgAbbrevOutputStream.sendRecv(MsgAbbrevOutputStream.java:144)
at
weblogic.rmi.internal.AbstractOutboundRequest.sendReceive(AbstractOutboundRe
quest.java
:84)
at
ocsmon.QuoteClientInterface_WLStub.setFreshData(QuoteClientInterface_WLStub.
java:218)
at ocsmon.wServerThread.run(wQuoteServer.java:350)
ocsmon.wServerThread is the thread spawned on the server side that obtains
the qClient stub from the server's registry and calls the refreshQuotes
method on it. 'vList' is a Vector of Strings containing the quotes.
What went wrong?
thanks
-Alan

Similar Messages

  • [Fwd: JMS publishing via http-tunneling]

    "Jeffrey S. Hair" wrote:
    Does anyone know of way to speed up WL JMS publishing via http-tunneling?
    We have a server that is publishing messages to JMS rather frequently (1/200 millisecs). We then
    have several applications and applets subscribed for this topic. The applications work great and get
    all of the messages quite fast (using t3 protocol).
    However, the applet, running on the other side of a firewall, and connected to the server over a 28k
    modem, receives the updates rather slowly since the messages need tunneled through http. In fact, so
    many updates are being published that the applet continually falls behind. If we stopped the updates
    or slowed down the updates, the applet would eventually catch up and reflect the latest message.
    The sessions in the applet were created using AUTO_ACKNOWLEDGE. I've since changed them to use
    CLIENT_ACKNOWLEDGE and allow for 15 seconds of messages to be processed before acknowledging. This
    improved the speed but the applet still falls behind to some degree. When the publishing slows down,
    the applet now at least catches up.
    As a side note, does anyone know of a way to view the contents of the JMS queue?
    Thanx,
    jsh
    Jeffrey S. Hair
    Sr. System Architect, FNX Limited[email.eml]

    Which web server are you using?
    Both iWS6.0 SP2 or iWS Fast-track 4.1 works with iMQ.
    But earler versions of iWS6.0 do not and we have no
    control of that.

  • POA crashes when streaming contacts via HTTP

    Hi,
    streaming messages and calendar items as RFC 822 works like a charm.
    But when streaming contacts of an address book via HTTP the POA crashes?
    Is this a known issue or is it possible at all to stream address book items?
    My environment:
    Groupwise 8.0.0 on Windows 2003 Server (german)
    Thank you in advance,
    Thilo

    There is no support to stream contacts.
    I'll create a bug to prevent processing of contacts
    in the streaming code (which will prevent the crash).
    Preston
    >>> On Monday, May 30, 2011 at 1:35 PM, Thilo Brüßhaber<[email protected]>
    wrote:
    > Hi,
    >
    > streaming messages and calendar items as RFC 822 works like a charm.
    > But when streaming contacts of an address book via HTTP the POA crashes?
    > Is this a known issue or is it possible at all to stream address book
    items?
    >
    > My environment:
    > Groupwise 8.0.0 on Windows 2003 Server (german)
    >
    > Thank you in advance,
    > Thilo

  • Get InitialContext for P4-connection via Http tunneling

    Hi,
    I have to use an Http tunnel to access my integration J2EE engine.
    Now, I want to create a P4-connection. It doesn't work. No InitialContext will be returned.
    I can open the VisualAdmin on the http tunneling port. But in the connection GUI I can select 'Http tunneling' as connection type. Is there any setting, i.e. property, for the InitialContext to signal that Http tunneling should be used ?
    Regards,
    Astrid

    Hi Astrid,
    yes, you need ot use TransportLayerQueue property of the InitialContext to specify that you need Http Tunneling as the transport layer. See <a href="http://help.sap.com/saphelp_nw04/helpdata/en/c8/5bc0417951cf17e10000000a155106/frameset.htm">this</a> page for description.
    Did you use that already?
    Regards,
    Ivo

  • ConnectionClosedException when POSTing images via HTTPS

    Greetings,
    I am trying to send images to a server from my Verizon BlackBerry 8330 using an HTTPS connection. I am performing the following steps:
    HttpsConnection https = (HttpsConnection)Connector.open("https://myserver");
    https.setRequestMethod(HttpsConnection.POST);
    https.setRequestProperty("Content-Type", "image/jpg");
    FileConnection file = (FileConnection)Connector.open("file:///filename", Connector.READ_WRITE);
    InputStream is = file.openInputStream();
    OutputStream os = https.openOutputStream();
    byte[] b = new byte[1024];
    for(int i; (i = is.read(b)) != -1;) {
    os.write(b, 0, i);
    int code = https.getResponseCode();I am receiving a ConnectionClosedException when I call getResponseCode() after the final write() to the OutputStream, but I can't think of anything in my code that is closing the connection.
    Does anyone know what could be causing the connection to be closed between the time that I open the connection and finish writing to its OutputStream?
    Thank you.

    Greetings,
    I am trying to send images to a server from my Verizon BlackBerry 8330 using an HTTPS connection. I am performing the following steps:
    HttpsConnection https = (HttpsConnection)Connector.open("https://myserver");
    https.setRequestMethod(HttpsConnection.POST);
    https.setRequestProperty("Content-Type", "image/jpg");
    FileConnection file = (FileConnection)Connector.open("file:///filename", Connector.READ_WRITE);
    InputStream is = file.openInputStream();
    OutputStream os = https.openOutputStream();
    byte[] b = new byte[1024];
    for(int i; (i = is.read(b)) != -1;) {
    os.write(b, 0, i);
    int code = https.getResponseCode();I am receiving a ConnectionClosedException when I call getResponseCode() after the final write() to the OutputStream, but I can't think of anything in my code that is closing the connection.
    Does anyone know what could be causing the connection to be closed between the time that I open the connection and finish writing to its OutputStream?
    Thank you.

  • Is forcing Http tunneling mode possible ?

    Hello,
    in order to make some tests between 2 PC on the same intranet, I would like to know if it's possible to force RMI to use http tunneling, and to choose the mode : http-to-port or http-to-cgi ?
    If possible, please tell me how.
    Many thanks in advance.
    C. BREZAK

    RMI depends on custom socket factories (sun.rmi.transport.proxy.RMIHttpToPortSocketFactory, sun.rmi.transport.proxy.RMIHttpToCGISocketFactory) for carrying out the HTTP tunneling of RMI request if normal way of establishing a connection with the remote object fails. If no particular RMI socket factory is set in RMI application, RMI runtime chooses the RMIMasterSocketFactory() for creating client and server sockets. This socket factory maintains a list of socket factories which should be tried in order in establishing a successful connection with the remote object. This list includes RMIDirectSocketFacotry and HTTP tunneling socket factories mentioned above if http.proxyHost proerty is set.
    You can force HTTP tunneling by explicitly setting default socket factory (RMISocketFactory.setSocketFactory(...)) to sun.rmi.transport.proxy.RMIHttpToPortSocketFactory in the client application. If this fails you can try setting default socket factory to RMIHttpToCGISocketFactory. It may not be possible trying these two options in the same instance of the program, because setSocketFactory() does not allow you to change the already defined default factory to the new one. This may not be elegant solution.
    -- Srinath Mandalapu

  • Dont think RMi is HTTP tunneling through proxy firewall

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

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

  • "DEADLOCK" when showing dialog from RMI-callback.

    Hi!
    Today is the 10th day (full time) that I've been searching for a solution in Java Forums and Internet, but I couldn't find anything that helps me. Help is extremely appreciated, otherwise I'll go crazy! :-)
    The problem is that RMI-callback thread "somehow blocks" the Event Dispatch Thread.
    I want to do following:
    1) I push the button in the client (btDoSomething)
    (MOUSE_RELEASED,(39,14),button=1,modifiers=Button1,clickCount=1 is automatically pushed onto EventQueue)
    2) btDoSomethingActionPerformed is invoked
    3) inside of it I make a call to RMI-server (server.doSomething())
    4) from this server method I invoke RMI-callback back to the client (client.askUser())
    5) in the callback I want to display a question to the user (JOptionPane.showConfirmDialog)
    6) user should answers the question
    7) callback returns to server
    8) client call to the server returns
    9) btDoSomethingActionPerformed returns and everybody is happy :-)
    This works normally in normal Client, that means, while a button is pushed, you can show Dialogs, but with RMI callback I get problems.
    I just made a small client-server sample to simulate real project. What I want to achieve is that client invokes server method, server method does something, but if server method doesn't have enough information to make the decision it needs to do call back to the client and wait for input, so the user gets an JOptionPane.
    Here is my callback method:
        /** this is the remote callback method, which is invoked from the sevrer */
        public synchronized String askUser() throws java.rmi.RemoteException {
            System.out.println("askUser() thread group: " + Thread.currentThread().getThreadGroup());
            System.out.println("callback started...");
            try {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        System.out.println("My event started...");
                        JOptionPane.showConfirmDialog(parentFrame, "Are you OK?", "Question", JOptionPane.YES_NO_OPTION);
                        System.out.println("My event finished.");
            }catch (Exception e) {
                e.printStackTrace();
            try {
                Thread.currentThread().sleep(10000);
            }catch (Exception e) {
                e.printStackTrace();
            System.out.println("callback finished.");
            return "Yo!"; // just return anything
        }Here in this sample I let the callback thread sleep for 10 seconds, but in real project I let it sleep infinitely and I want to wake it up after the user has answered JOptionPane. But I have the DEADLOCK, because event queue is waiting for callback to finish and doesn't schedule the "showing dialog" event which contains the command for waking up the callback thread.
    I looked very precisely when the event queue starts again to process events: it is precisely then when btDoSomethingActionPerformed is finished.
    When I'm not accessing GUI inside of the callback, this callback mechanism works perfectly, but as soon as I want to show the dialog from inside of the RMI-callback method, the "AWT Event Dispatch Queue" is somehow frozen until RMI-callback thread is finished (and in turn btDoSomethingActionPerformed terminates) . I cannot explain this weird behaviour!!!
    If I don't use SwingUtilities.invokeLater (I know this shoudn't be done outside of Event Dispatch Thread), but access the GUI directy, my JOptionPane is shown, but is not painted (it is blank gray) until callback thread returns.
    Why showing (or painting) of dialog is not done until btDoSomethingActionPerformed is finished?
    I also tried to spawn a new Thread inside of main RMI-callback thread, but nothing changed.
    I also tried the workaround from some older posting to use myInvokeLater:
        private final static ThreadGroup _applicationThreadGroup = Thread.currentThread().getThreadGroup();
        public void myInvokeLater(final Runnable code) {
            (new Thread(_applicationThreadGroup, new Runnable() {
                public void run() { SwingUtilities.invokeLater(code); }
            ).start();
        }but this didn't help either.
    Then I tried to spawn a new Thread directly from the Client's constructor, so that I'm sure that it belongs to the main appplication thread group. I even started that thread there in the constructor and made it wait for the callback. When callback came in, it would wake up that sleeping thread which should then show the dialog. But this did't help either.
    Now I think that it is IMPOSSIBLE to solve this problem this way.
    Spawning a new Process could work I think, but I'm not really sure if I want do to that.
    I know I could make a solution where server method is invoked and if some information is missing I can raise custom exception, provide the input on client side and call the same server mathod again with this additional data, but for that I need to change server RMI interfaces, etc... to fit in this concept. I thought callback would much easier, but after almost 10 days of trying the callback...I almost regreted it :-(
    Is anyone able to help?
    Thank you very much!
    Please scroll down for the complete sample (with build and run batch files), in case someone wants to try it. Or for the time being for your convenience you can download the whole sample from
    http://www.onlineloop.com/~tornado/download/rmi_callback_blocks_gui.zip
    ######### BEGIN CODE ####################################
    package callbackdialog;
    public interface ICallback extends java.rmi.Remote {
        public String askUser() throws java.rmi.RemoteException;
    package callbackdialog;
    public interface IServer extends java.rmi.Remote {
        public void doSomething() throws java.rmi.RemoteException;
    package callbackdialog;
    import java.rmi.Naming;
    public class Server {
        public Server() {
            try {
                IServer s = new ServerImpl();
                Naming.rebind("rmi://localhost:1099/ServerService", s);
            } catch (Exception e) {
                System.out.println("Trouble: " + e);
        public static void main(String args[]) {
            new Server();
    package callbackdialog;
    import java.rmi.Naming;
    public class ServerImpl extends java.rmi.server.UnicastRemoteObject implements IServer {
        // Implementations must have an explicit constructor
        // in order to declare the RemoteException exception
        public ServerImpl() throws java.rmi.RemoteException {
            super();
        public void doSomething() throws java.rmi.RemoteException {
            System.out.println("doSomething started...");
            try {
                // ask the client for the "missing" value via RMI callback
                ICallback client = (ICallback)Naming.lookup("rmi://localhost/ICallback");
                String clientValue = client.askUser();
                System.out.println("Got value from callback: " + clientValue);
            }catch (Exception e) {
                e.printStackTrace();
            System.out.println("doSomething finished.");
    package callbackdialog;
    import java.rmi.server.RemoteStub;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.registry.Registry;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.Naming;
    import javax.swing.JOptionPane;
    import javax.swing.SwingUtilities;
    import javax.swing.JFrame;
    public class Client extends javax.swing.JFrame implements ICallback {
        private final JFrame parentFrame = this;
        private Registry mRegistry = null;
        private RemoteStub remoteStub = null;
        private IServer server = null;
        private final static ThreadGroup _applicationThreadGroup = Thread.currentThread().getThreadGroup();
        /** Creates new form Client */
        public Client() {
            initComponents();
            System.out.println("Client constructor thread group: " + Thread.currentThread().getThreadGroup());
            try {
                server = (IServer)Naming.lookup("rmi://localhost/ServerService");
                // register client to the registry, so the server can invoke callback on it
                mRegistry = LocateRegistry.getRegistry("localhost", 1099);
                remoteStub = (RemoteStub)UnicastRemoteObject.exportObject((ICallback)this);
                Registry mRegistry = LocateRegistry.getRegistry("localhost", 1099);
                mRegistry.bind("ICallback", remoteStub);
            }catch (java.rmi.AlreadyBoundException e) {
                try {
                    mRegistry.unbind("ICallback");
                    mRegistry.bind("ICallback", remoteStub);
                }catch (Exception ex) {
                    // ignore it
            }catch (Exception e) {
                e.printStackTrace();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            java.awt.GridBagConstraints gridBagConstraints;
            secondTestPanel = new javax.swing.JPanel();
            btDoSomething = new javax.swing.JButton();
            getContentPane().setLayout(new java.awt.GridBagLayout());
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("RMI-Callback-GUI-problem sample");
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    formWindowClosing(evt);
            secondTestPanel.setLayout(new java.awt.GridBagLayout());
            btDoSomething.setText("show dialog");
            btDoSomething.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    btDoSomethingActionPerformed(evt);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 3;
            gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 0);
            secondTestPanel.add(btDoSomething, gridBagConstraints);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 1;
            gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
            gridBagConstraints.weightx = 1.0;
            gridBagConstraints.weighty = 1.0;
            getContentPane().add(secondTestPanel, gridBagConstraints);
            pack();
        private void btDoSomethingActionPerformed(java.awt.event.ActionEvent evt) {                                             
            System.out.println(java.awt.EventQueue.getCurrentEvent().paramString());
            try {
                server.doSomething(); // invoke server RMI method, which will do the client RMI-Callback
                                      // in order to show the dialog
            }catch (Exception e) {
                e.printStackTrace();
        private void formWindowClosing(java.awt.event.WindowEvent evt) {                                  
            try {
                mRegistry.unbind("ICallback");
            }catch (Exception e) {
                e.printStackTrace();
            setVisible(false);
            dispose();
            System.exit(0);
        /** this is the remote callback method, which is invoked from the sevrer */
        public synchronized String askUser() throws java.rmi.RemoteException {
            System.out.println("askUser() thread group: " + Thread.currentThread().getThreadGroup());
            System.out.println("callback started...");
            try {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        System.out.println("My event started...");
                        JOptionPane.showConfirmDialog(parentFrame, "Are you OK?", "Question", JOptionPane.YES_NO_OPTION);
                        System.out.println("My event finished.");
            }catch (Exception e) {
                e.printStackTrace();
            try {
                Thread.currentThread().sleep(10000);
            }catch (Exception e) {
                e.printStackTrace();
            System.out.println("callback finished.");
            return "Yo!"; // just return anything
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    Client client = new Client();
                    client.setSize(500,300);
                    client.setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton btDoSomething;
        private javax.swing.JPanel secondTestPanel;
        // End of variables declaration
    1_build.bat
    javac -cp . -d . *.java
    rmic callbackdialog.ServerImpl
    rmic callbackdialog.Client
    pause
    2_RunRmiRegistry.bat
    rmiregistry
    pause
    3_RunServer.bat
    rem java -classpath .\ Server
    java callbackdialog.Server
    pause
    4_RunClient.bat
    java callbackdialog.Client
    pause
    ######### END CODE ####################################

    I can understand that only partially, because SwingUtilities.invokeLater puts(redirects) my runnable object directly into AWT thread. The only conclusion I can draw from all things that I have tried until now , is that SwingUtilities.invokeLater(<showing the dialog>) invoked from a RMI thread somehow have lower "priority" than events coming directly from the AWT-thread and therefore it is held back until normal awt event completes (in this case BUTTON_RELEASED).
    But what I don't understand is the fact that the dialog is not shown even If I create and start a new thread from the client's constructor. This thread has nothing to do with RMI as it is in the main thread group:
        private BlockingObject dialogBlocker = new BlockingObject();
        private BlockingObject blocker = new BlockingObject();
        public Client() {
            initComponents();
            (new Thread() {
                public void run() {
                    try {
                        dialogBlocker.sleep(0);
                        System.out.println("My event started...");
                        JOptionPane.showConfirmDialog(parentFrame, "Are you OK?", "Question", JOptionPane.YES_NO_OPTION);
                        blocker.wake();
                        System.out.println("My event finished.");
                    }catch (Exception e) {
                        e.printStackTrace();
            }).start();
            ...Callback is then only used to wake up this thread which should display the dialog:
        public Object askUser() throws java.rmi.RemoteException {
            System.out.println("callback started...");
            dialogBlocker.wake();
            blocker.sleep(0);
            System.out.println("callback finished.");
            return userChoice; // return anything I don't care for now
    class BlockingObject {
        public void sleep(long timeout) {
            synchronized(this){
                try {
                    wait(timeout);
                }catch (InterruptedException e) {}
        public void wake() {
            synchronized(this){
                notifyAll();
        }In this case the dialog is shown, but it is NOT painted, so I have deadlock again. Why it is not painted?!?
    Haven't I uncouple it from RMI-Thread?
    But perhaps I'm looking at the wrong side of the whole thing.
    If I invoke server.doSomething (as ejp proposed) in a separate thread, then everything is fine (except that I cannot use this solution in my project :-( ).
    It seems that the whole problem is NOT AT ALL related to callback itself, but rather to the fact that if client invokes remote call, even dialogs can't be shown until the rmi call returns to the client.
    Thank you, Drindilica

  • HTTP tunneling T3 when using WebStart - java.security.AccessControlException: access denied

    Hi !
    WLS version: 5.1 with SP10
    Server OS: NT4
    Client distr.: Java WebStart
    Client OS: Windows 2000
    I get the following exception when I try to create a T3 connection
    (tunnelled through HTTP) to my WLS server:
    java.security.AccessControlException: access denied
    (java.util.PropertyPermission proxyHost read)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
    at java.lang.System.getProperty(Unknown Source)
    at weblogic.net.http.HttpClient.resetProperties(HttpClient.java:62)
    at weblogic.net.http.HttpClient.openServer(HttpClient.java:186)
    at weblogic.net.http.HttpClient.<init>(HttpClient.java:85)
    at weblogic.net.http.HttpClient.New(HttpClient.java:117)
    at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:97)
    at
    weblogic.net.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1
    44)
    at weblogic.socket.JVMSocketHTTPClient.sendMsg(JVMSocketHTTPClient.java:260)
    at weblogic.socket.JVMAbbrevSocket.sendOutMsg(JVMAbbrevSocket.java:348)
    at weblogic.socket.JVMAbbrevSocket.sendMsg(JVMAbbrevSocket.java:237)
    at weblogic.rjvm.ConnectionManager.sendMsg(ConnectionManager.java:420)
    at weblogic.rjvm.RJVMImpl.send(RJVMImpl.java:564)
    at
    weblogic.rjvm.MsgAbbrevOutputStream.flushAndSendRaw(MsgAbbrevOutputStream.ja
    va:155)
    at
    weblogic.rjvm.MsgAbbrevOutputStream.flushAndSend(MsgAbbrevOutputStream.java:
    163)
    at
    weblogic.rjvm.MsgAbbrevOutputStream.sendRecv(MsgAbbrevOutputStream.java:186)
    at
    weblogic.rmi.internal.BasicOutgoingRequest.sendRecv(BasicOutgoingRequest.jav
    a:23)
    at
    weblogic.rmi.extensions.AbstractRequest.sendReceive(AbstractRequest.java:73)
    at
    com.unitor.message.server.UserInformationServiceBeanHomeImpl_WLStub.create(U
    serInformationServiceBeanHomeImpl_WLStub.java:151)
    at
    com.unitor.message.server.UserInformationServiceBeanHomeImpl_ServiceStub.cre
    ate(UserInformationServiceBeanHomeImpl_ServiceStub.java:121)
    at
    com.unitor.message.beans.gui.MessageLogic.getUserInformationService(MessageL
    ogic.java:230)
    at
    com.unitor.message.beans.gui.MessageLogic.addUserInformation(MessageLogic.ja
    va:186)
    at com.unitor.message.beans.gui.MessageLogic.<init>(MessageLogic.java:104)
    at
    com.unitor.message.beans.gui.MessageApplication.internalStartApplication(Mes
    sageApplication.java:64)
    at
    com.unitor.ifs.util.gui.UnitorApplication.startApplication(UnitorApplication
    .java:167)
    at
    com.unitor.ifs.util.gui.DesktopApplication$ApplicationLoader.run(DesktopAppl
    ication.java:676)
    at
    com.unitor.ifs.util.gui.DesktopApplication.startApplication(DesktopApplicati
    on.java:303)
    at
    com.unitor.ifs.util.gui.UnitorDesktopAppStarter$SwingEventCall.run(UnitorDes
    ktopAppStarter.java:294)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    The strange thing is that I can connect to my server if I run the client on
    NT4 !!!
    I solved the problem by modifying my local java.policy file with the
    following settings:
    // Test with HTTP tunnelling. 18.10.2001
    [email protected]
    permission java.util.PropertyPermission "proxyHost", "read";
    permission java.util.PropertyPermission "proxyPort", "read";
    permission java.util.PropertyPermission "http.proxyHost", "read";
    permission java.util.PropertyPermission "http.proxyPort", "read";
    permission java.net.SocketPermission "*","connect,resolve";
    // Test with HTTP tunnelling. 18.10.2001
    [email protected]
    Have someone else experienced the same or similar problems ?
    How can I make sure that the client gets access to read the properties
    http.proxyHost, http.proxyPort, proxyHost and proxyPort without telling the
    users of the client application to modify their java.policy files ?
    Any leads will be greatly appreciated !
    Regards
    Sten Richard

    This is in reply to the first post. I don't know what happened after.
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission sun.arch.data.model read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:167)
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:151)
         at org.eclipse.swt.internal.C.<clinit>(C.java:21)
    If you read the above trace from bottom to top, it shows none of you classes, only classes from that Eclipse library, which seems to loadLibrary() a native DLL. In order to do this, it needs to call System.getProperty( "sun.arch.data.model" ). This call is not allowed from un unsigned applet. So I guess you need to sign the applet and this problem will go away. Many other problems may follow. Just read very very carefully all the related documentation, which I did not.

  • Office Web Apps - Preview not appearing when acccessing via HTTPS

    I have installed Sharepoint 2013 and Office Web Apps, set the wopibinding, and set the wopizone to be https-external. Everything seems to work fine if accessing the web app using HTTP (can open, edit, preview office web app (WAC) documents)... but if
    I access via HTTPS then I run into a mixed content error when trying to preview the WAC documents... I can open them and edit them without issue using office web apps inside the browser though just not preview.
    If I select "New document" it also takes a while to load and displays a blank pop up window... assume it must be related
    Error message:
    XMLHttpRequest cannot load http://xxxx.org.nz/Docs/_layouts/15/inplview.aspx?List={6E…65723B96E}&ViewCount=1&IsXslView=TRUE&IsCSR=TRUE&IsRibbon=TRUE&Cmd=EcbView.
    No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://xxxxxx' is therefore not allowed access.
    [blocked] The page at 'https://xxxxx.org.nz/xx.aspx' was loaded over HTTPS, but ran insecure content from 'http://xxxxxx/Docs/_layouts/15/WopiFrame.aspx?sourced…%20big%20wide%20inter%20web%2Edocx&action=interactivepreview&wdSmallView=1':
    this content should also be loaded over HTTPS.

    Hi  ,
    Before you configure SharePoint 2013 to use Office Web Apps Server via HTTPS, make sure that you have set up Office Web Apps Server by following the steps in Deploy
    a single-server Office Web Apps Server farm that uses HTTPS or Deploy a multi-server, load-balanced Office Web Apps Server farm
    that uses HTTPS.
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Getting error when connecting to url via https

    I am connecting to a url via https. Everything seems to work when I open the connnect as follows.
    conn = (HttpsURLConnection)theURL.openConnection();
    //Set the proper connections properties
    conn.setRequestMethod("POST");
    conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
    conn.setDoOutput(true);
    conn.setDoInput(true);
    But when I try to send data with the following code:
    StringBuffer sendThis = new StringBuffer();
    sendThis.append( URLEncoder.encode("uid=", "UTF-8") );
    sendThis.append( URLEncoder.encode("This is the UID", "UTF-8") );
    /* PrintWriter pout = new PrintWriter( new OutputStreamWriter( conn.getOutputStream(), "8859_1"), true);
    pout.print (sendThis.toString());
    pout.flush();
    I get an error that says "could not find trusted certificate"
    Could not find trusted certificate
    javax.net.ssl.SSLHandshakeException: Could not find trusted certificate
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.a(DashoA6275)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(DashoA62
    75)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(DashoA6275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275)
    at java.io.OutputStream.write(OutputStream.java:58)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA6275)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA6275)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
    (DashoA6275)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:562)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Dash
    oA6275)
    What am I missing ?
    thanks in advance.
    kris.

    You have to make sure that the cert for the CA which signed the server's
    certificate is in your keystore (cacerts) file.
    Check out 'keytool' and the JSSE readme.
    Cheers,
    Billy.

  • RMI/Http Tunnelling

    Hi
    I m developing an intranet application. Using the following flow
    applet->servlet->bean->database->servlet->applet.
    For this flow to take place, should i be using rmi or http tunnelling. There is a lot of interaction between the client and the server database, so i m confused what option will be effiecient? and y

    Hi
    I m developing an intranet
    ping an intranet application. Using the following
    flow
    applet->servlet->bean->database->servlet->applet.
    For this flow to take place, should i
    place, should i be using rmi or http tunnelling.
    There is a lot of interaction between the client and
    the server database, so i m confused what option will
    be effiecient? and yJust curious! Shouldn't a servlet+DAO serve the purpose?

  • EEM - puts action fails in EEM applet/script when called via HTTP

    I have an EEM script which produces some diagnostic output.  The script is written to be initiated by "event manager run" and is running in sync mode.  Script uses "puts" into stdout to produce the output.  Everything is working fine, except when script is initiated via HTTP/HTTPS I get no output.
    To reproduce the issue I have created the following applet:
    event manager applet TEST1
    event none sync yes
    action 1 puts nonewline "SOMETEXT"
    Here is output from command line (tested from console and telnet):
    router#event manager run TEST1
    SOMETEXT
    router#
    When applet is called via HTTP using http://router/level/15/exec/-/event/manager/run/TEST1/CR URL the output is empty.  The test message goes to the console versus to HTTP reply.
    So it looks like the stdout is not redirected to HTTP session successfully.
    Any advice on why it is happening, or better yet how to fix it would be apprecaited.

    Thank you.  This is also what I was thinking.  As you probably already know I have opened a TAC case on the matter.

  • Help needed in HTTP Tunneling - urgent

    Hi all,
    I urgently need a working code sample of a client which sends requests to a server that redirects the request to an RMI server via RMI servlet.
    Does any of you familiar of such a code sample?
    Thanks

    I'm sorry, but HTTP Tunneling is not working for me. I must have done something wrong.
    Let me describe my configuration:
    I have a server behind NAT router which connected to apache2 and tomcat 4.1 web servers. The apache2 and tomcat are not connected between them.
    I deployed war file on tomcat which contains the servlet for the HTTP Tunneling which its code is:
    public class RmiHttpTunnelerServlet extends HttpServlet
        public void init(ServletConfig config) throws ServletException
            super.init(config);
            System.out.println("Simplified RMI Servlet Handler loaded successfully.");
        public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
            try
                String queryString = req.getQueryString();
                String command, param;
                int delim = queryString.indexOf("=");
                if (delim == -1)
                    command = queryString;
                    param = "";
                else
                    command = queryString.substring(0, delim);
                    param = queryString.substring(delim + 1);
                if (command.equalsIgnoreCase("forward"))
                    try
                        ServletForwardCommand.execute(req, res, param);
                    catch (ServletClientException e)
                        returnClientError(res, "client error : " + e.getMessage( ));
                        e.printStackTrace();
                    catch (ServletServerException e)
                        returnServerError(res, "internal server error : " + e.getMessage());
                        e.printStackTrace();
                else
                    returnClientError(res, "invalid command: " + command);
            catch (Exception e)
                returnServerError(res, "internal error: " + e.getMessage());
                e.printStackTrace();
        public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
            returnClientError(res, "GET Operation not supported: Can only forward POST requests.");
        public void doPut(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
            returnClientError(res, "PUT Operation not supported: Can only forward POST requests.");
        public String getServletInfo()
            return "Simplified RMI Call Forwarding Servlet Servlet.<br>\n ";
        private static void returnClientError(HttpServletResponse res, String message) throws IOException
            res.sendError(HttpServletResponse.SC_BAD_REQUEST,
                          "<HTML><HEAD><TITLE>Java RMI Client Error < / TITLE > < / HEAD > < BODY > " +
                          "<H1>Java RMI Client Error</H1>" + message + "</BODY></HTML>");
            System.err.println(HttpServletResponse.SC_BAD_REQUEST + "Java RMI Client Error" + message);
        private static void returnServerError(HttpServletResponse res,
                                              String message) throws IOException
            res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                          "<HTML><HEAD>< TITLE > Java RMI Server Error < / TITLE > < / HEAD > < BODY > " +
                          "<H1>Java RMI Server Error < / H1 > " + message + " < / BODY > < / HTML > ");
            System.err.println(HttpServletResponse.SC_INTERNAL_SERVER_ERROR + "Java RMI Server Error : " + message);
        }There is also a utility class:
    public class ServletForwardCommand {
        public static void execute(HttpServletRequest request, HttpServletResponse response, String stringifiedPort)
            throws ServletClientException, ServletServerException, IOException {
            int port = convertStringToPort(stringifiedPort);
            Socket connectionToLocalServer = null;
            try {
                connectionToLocalServer = connectToLocalServer(port);
                forwardRequest(request, connectionToLocalServer);
                forwardResponse(response, connectionToLocalServer);
            } finally {
                if (null != connectionToLocalServer) {
                    connectionToLocalServer.close();
        private static int convertStringToPort(String stringfiedPort) throws ServletClientException {
            int returnValue;
            try {
                returnValue = Integer.parseInt(stringfiedPort);
            } catch (NumberFormatException e) {
                throw new ServletClientException("invalid port number: " + stringfiedPort);
            if (returnValue <= 0 || returnValue > 0xFFFF) {
                throw new ServletClientException("invalid port: " + returnValue);
            if (returnValue < 1024) {
                throw new ServletClientException("permission denied for port: " + returnValue);
            return returnValue;
        private static Socket connectToLocalServer(int port) throws ServletServerException {
            Socket returnValue;
            try {
                returnValue = new Socket(InetAddress.getLocalHost(), port);
            } catch (IOException e) {
                throw new ServletServerException("could not connect to " + "local port");
            return returnValue;
        private static void forwardRequest(HttpServletRequest request, Socket connectionToLocalServer)
            throws IOException, ServletClientException, ServletServerException {
            byte buffer[];
            DataInputStream clientIn = new DataInputStream(request.getInputStream());
            buffer = new byte[request.getContentLength()];
            try {
                clientIn.readFully(buffer);
            } catch (EOFException e) {
                throw new ServletClientException("unexpected EOF " + "reading request body");
            } catch (IOException e) {
                throw new ServletClientException("error reading request" + " body");
            DataOutputStream socketOut = null;
            // send to local server in HTTP
            try {
                socketOut = new DataOutputStream(connectionToLocalServer.getOutputStream());
                socketOut.writeBytes("POST / HTTP/1.0\r\n");
                socketOut.writeBytes("Content-length: " + request.getContentLength() + "\r\n\r\n");
                socketOut.write(buffer);
                socketOut.flush();
            } catch (IOException e) {
                throw new ServletServerException("error writing to server");
        private static void forwardResponse(HttpServletResponse response, Socket connectionToLocalServer)
            throws IOException, ServletClientException, ServletServerException {
            byte[] buffer;
            DataInputStream socketIn;
            try {
                socketIn = new DataInputStream(connectionToLocalServer.getInputStream());
            } catch (IOException e) {
                throw new ServletServerException("error reading from " + "server");
            String key = "Content-length:".toLowerCase();
            boolean contentLengthFound = false;
            String line;
            int responseContentLength = -1;
            do {
                try {
                    line = socketIn.readLine();
                } catch (IOException e) {
                    throw new ServletServerException("error reading from server");
                if (line == null) {
                    throw new ServletServerException("unexpected EOF reading server response");
                if (line.toLowerCase().startsWith(key)) {
                    responseContentLength = Integer.parseInt(line.substring(key.length()).trim());
                    contentLengthFound = true;
            while ((line.length() != 0) &&
                (line.charAt(0) != '\r') && (line.charAt(0) != '\n'));
            if (!contentLengthFound || responseContentLength < 0)
                throw new ServletServerException("missing or invalid content length in server response");
            buffer = new byte[responseContentLength];
            try {
                socketIn.readFully(buffer);
            } catch (EOFException e) {
                throw new ServletServerException("unexpected EOF reading server response");
            } catch (IOException e) {
                throw new ServletServerException("error reading from server");
            response.setStatus(HttpServletResponse.SC_OK);
            response.setContentType("application/octet-stream");
            response.setContentLength(buffer.length);
            try {
                OutputStream out = response.getOutputStream();
                out.write(buffer);
                out.flush();
            } catch (IOException e) {
                throw new ServletServerException("error writing response");
    }I checked also with packets monitoring tool, I couldn't see any http transportation.
    Any help will be appreciated.

  • RMI callbacks with no replica aware stubs in a cluster?

    We would like to use either an RMI ping mechanism or an RMI callback in an upcoming project but are limited to 1.1 and 1.2 JRE's. I don't believe generating a replica aware proxy is an option for us given those constraints, no support for dynamic proxies. So we have a remote server object that we would ideally like to be clusterable that we can register a callback interface with. How can we accomplish this given our client limitations with weblogic 8.1 RMI? Any options?

    Yep you speak no lies. Of course once I thought about it some more I realized the error of assuming one could register a jdk rmi object with a weblogic rmi object. JRMP vs T3?. Not good.
    We still like using plain jane RMI w/in weblogic. I can register my UnicastRemoteObject stub with a normal RMI object on the server and it can callback and deliver messages. It will also send heartbeats periodically. If the heartbeat isn't heard from in awhile we re-register through http. The advantage of this is that the http session has failed over to another box and the web tier manages the rmi registration for me. The client can remain ignorant of any RMI lookups, which are tedious when not using JNDI or the cluster aware proxy.
    All of this to get back a few seconds and keep a few thousand clients from polling through a servlet every second. Argh JDK 1.1.
    Thanks for hammering that final point in.

Maybe you are looking for

  • Some app issues

    I have a problem with maps and an app. Maps seems to have the compass backwards.  It shows me facing east when I'm pointing west on the maps screen.  I did the compass calibration and it still shows the opposite direction. Also I did reset my phone b

  • Nokis asha 225 feed back problem

    Hello there. I have just received a new mobile phone for work - Nokia 225 dual sim. A few days later I got this message - see in the attachment and I can't get rid of it! It asks me to "Rate your NOKIA 225". Unfortunately I have already rated it 5 ti

  • How do I roll a ball along both x and y axis?

    I am trying to roll a 2D ball in 3D space that only moves on the x and y axis through a maze. I would like it to be rotating 360 degrees based on the curcumference so it looks like it is rolling no matter if it is moving along the x or y axis. I feel

  • Apache/Tomcat Access denied????

    hello. I am trying3 to run. Apache 1.3.26 and tomcat 4.0 together on Windows 2000 Pro and have had no luck. I configured the httpd.conf file with these statements and the corresponding files are in the correct directories <statements> # Load mod_jk L

  • Changing default Type in Type dropdown of DDL Files only of Generate Server

    Hello, When I try to generate a Server Model Definition, the default type of the Type dropdown list of "DDL Files Only" is "Oracle8.1". I would like to set it by default at Oracle9i. Is that possible? Thank you for your answers. Nicolas.