RE: httptunneling/callback

"Tim Anderson" <[email protected]>
Newsgroups gmane.comp.java.openjms.user
Message-ID <000701c54fe2$6273da10$387ffddc@xerces>
The stacktrace isn't much help, as it doesn't show the root cause -
which is probably an IOException. Did you truncate the stack trace?
Also make sure the webserver's public key is in your keystore.
 
If you're still having problems, try interrogating the nested exceptions to
get 
the root, and print it.
E.g:
import javax.naming.NamingException;
import java.rmi.RemoteException;
import org.exolab.jms.net.connector.ResourceException;
 
//....
try {
    Context initial = new InitialContext(....);
} catch (NamingException exception) {
    Throwable root =  getNested(exception);
    root.printStackTrace();
}
 
//....

Throwable getNested(Throwable throwable) {
    Throwable result = throwable;
    if (throwable instanceof NamingException) {
        NamingException naming = (NamingException) throwable;
        if (naming,getRootCause() != null) {
            result = getNested(naming.getRootCause());
        }
    } else if (throwable instanceof RemoteException) {
        RemoteException remote = (RemoteException) throwable;
        if (remote.detail != null) {
            result = getNested(remote.detail);
        }
    } else if (throwable instanceof ResourceException) {
        ResourceException resource = (ResourceException) throwable;
        if (resource.getTargetException() != null) {
            result = getNested(resource.getTargetException());
        }
    }
    return result;
}
 
-Tim
 

-----Original Message-----
From: openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Laszlo
Schaffer personal
Sent: Tuesday, 3 May 2005 4:59 PM
To: [email protected]
Subject: RE: [openjms-user] httptunneling/callback



The code to set ssl 

 

// test env

      String certPath;

      if (System.getProperty("javawebstart.version") != null) {

        String toPath = System.getProperty("jnlpx.home");

        logger.info("JNLPX home:" + toPath);

        certPath = CertTool.getClientCertPath(toPath, "clientcert.jar",
"client.keystore");

      }

      else {

        //

        certPath = "c:/temp/client.keystore";

      }

 

      System.setProperty("javax.net.ssl.keyStore",certPath);

      System.setProperty("javax.net.ssl.keyStorePassword","changeit");

      System.setProperty("javax.net.ssl.keyStoreType","jks");

      System.setProperty("javax.net.ssl.trustStore", certPath);

 

This is the code to obtain connection and factory

 

    Properties props = new Properties();

 

    props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.exolab.jms.jndi.InitialContextFactory");

    props.put(Context.PROVIDER_URL, url);

 

    context = new InitialContext(props);

    factory = (QueueConnectionFactory) context.lookup("ConnectionFactory");

 

and here is the exception

 

2005-05-02 13:17:07,500 ERROR TestViewController - connect:

javax.naming.CommunicationException: Failed to get registry service for URL:
https://soap.handicaddy.dk:8443/openjms-tunnel/tunnel [Root exception is
java.rmi.ConnectIOException: Failed to create connection; nested exception
is: 

            org.exolab.jms.net.connector.ConnectException: Failed to connect
to URI=https://soap.handicaddy.dk:8443/openjms-tunnel/tunnel]

            at
org.exolab.jms.jndi.InitialContextFactory.getInitialContext(InitialContextFa
ctory.java:109)

            at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)

            at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)

            at javax.naming.InitialContext.init(InitialContext.java:219)

            at javax.naming.InitialContext.<init>(InitialContext.java:195)

            at
com.actiwise.jmstest.MessageController.connect(MessageController.java:62)

            at
com.actiwise.jmstest.ui.TestViewController.connect(TestViewController.java:1
01)

            at
com.actiwise.jmstest.ui.TestViewController$1.actionPerformed(TestViewControl
ler.java:66)

            at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)

            at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButto
n.java:1839)

            at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:4
20)

            at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)

            at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener
.java:245)

            at java.awt.Component.processMouseEvent(Component.java:5100)

            at java.awt.Component.processEvent(Component.java:4897)

            at java.awt.Container.processEvent(Container.java:1569)

            at java.awt.Component.dispatchEventImpl(Component.java:3615)

            at java.awt.Container.dispatchEventImpl(Container.java:1627)

            at java.awt.Component.dispatchEvent(Component.java:3477)

            at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)

            at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)

            at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)

            at java.awt.Container.dispatchEventImpl(Container.java:1613)

            at java.awt.Window.dispatchEventImpl(Window.java:1606)

            at java.awt.Component.dispatchEvent(Component.java:3477)

            at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)

            at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:201)

            at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:151)

            at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

            at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

            at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Caused by: java.rmi.ConnectIOException: Failed to create connection; nested
exception is: 

            org.exolab.jms.net.connector.ConnectException: Failed to connect
to URI=https://soap.handicaddy.dk:8443/openjms-tunnel/tunnel

            at org.exolab.jms.net.orb.Locator.getProxy(Locator.java:133)

            at org.exolab.jms.net.orb.Locator.getRegistry(Locator.java:101)

            at
org.exolab.jms.net.orb.DefaultORB.getRegistry(DefaultORB.java:228)

            at
org.exolab.jms.client.net.SharedORB.getRegistry(SharedORB.java:183)

            at
org.exolab.jms.jndi.InitialContextFactory.getInitialContext(InitialContextFa
ctory.java:107)

            ... 30 more

Caused by: org.exolab.jms.net.connector.ConnectException: Failed to connect
to URI=https://soap.handicaddy.dk:8443/openjms-tunnel/tunnel

            at
org.exolab.jms.net.http.AbstractHTTPManagedConnection.<init>(AbstractHTTPMan
agedConnection.java:110)

            at
org.exolab.jms.net.http.HTTPSManagedConnection.<init>(HTTPSManagedConnection
.java:76)

            at
org.exolab.jms.net.http.HTTPSManagedConnectionFactory.createManagedConnectio
n(HTTPSManagedConnectionFactory.java:124)

            at
org.exolab.jms.net.connector.DefaultConnectionPool.createManagedConnection(D
efaultConnectionPool.java:166)

            at
org.exolab.jms.net.connector.AbstractConnectionManager.allocateConnection(Ab
stractConnectionManager.java:132)

            at
org.exolab.jms.net.connector.AbstractConnectionFactory.getConnection(Abstrac
tConnectionFactory.java:167)

            at
org.exolab.jms.net.connector.AbstractConnectionManager.getConnection(Abstrac
tConnectionManager.java:200)

            at org.exolab.jms.net.orb.Locator.getProxy(Locator.java:129)

            ... 34 more

 

https://soap.handicaddy.dk:8443/openjms-tunnel/tunnel  is valid 

 

 

In case of I change the config to point to my localhost (safhome) it is
working

 

Regards

saf

-----Original Message-----
From: openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Tim Anderson
Sent: 2005. május 3. 5:53
To: [email protected]
Subject: RE: [openjms-user] httptunneling/callback

 

How are you specifying the SSL configuration in your application?

Can you attach a stack trace?

 

-----Original Message-----
From: openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Laszlo
Schaffer personal
Sent: Monday, 2 May 2005 9:42 PM
To: [email protected]
Subject: RE: [openjms-user] httptunneling/callback

Hello,

Thanks, now it is working in my local pc 

 

Url: https://safhome:8443/openjms-tunnel/tunnel

 

Config like this

 

<ServerConfiguration host="safhome" embeddedJNDI="true"/>

  <Connectors>

 

    <Connector scheme="https">

      <ConnectionFactories>

      <ConnectionFactory name="ConnectionFactory"/>

      </ConnectionFactories>

    </Connector>

….

<HttpsConfiguration webServerHost="safhome" webServerPort="8443" port="3030"
servlet="/openjms-tunnel/tunnel"/>

 

But after that I have tried on a hosted server (this is a hosted server from
prokmu (www.prokmu.com <http://www.prokmu.com/> ) with private java (tomcat
and jdk) tomcat runs behind apache webserver

 

url: https://soap.handicaddy.dk:8443/openjms-tunnel/tunnel

 

The configuration is

 

<ServerConfiguration host="soap.handicaddy.dk" embeddedJNDI="true"/>

  <Connectors>

 

    <Connector scheme="https">

      <ConnectionFactories>

      <ConnectionFactory name="ConnectionFactory"/>

      </ConnectionFactories>

    </Connector>

….

<HttpsConfiguration webServerHost="soap.handicaddy.dk" webServerPort="8443"
port="3030" servlet="/openjms-tunnel/tunnel"/>

 

Now the app could not connect to the server 

 

But after that I tried it with http (webserverPort :80) and that is working

 

url:http://safhome/openjms-tunnel/tunnel
<http://safhome/openjms-tunnel/tunnel> 

 

Any idea?

saf

 

 

 

 

 

-----Original Message-----
From: openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Tim Anderson
Sent: 2005. április 30. 15:37
To: [email protected]
Subject: RE: [openjms-user] httptunneling/callback

 

You also need to specify the tunnel in the JNDI provider URL:

 

String url = "https://safhome:8443/openjms-tunnel/tunnel";

props.put(Context.PROVIDER_URL, url);

 

-----Original Message-----
From: openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Tim Anderson
Sent: Saturday, 30 April 2005 11:25 PM
To: [email protected]
Subject: RE: [openjms-user] httptunneling/callback

How have you deployed the tunnel?

 

Given your configuration, the WAR needs to be copied to: 

  <TOMCAT_HOME>/webapps/openjms-tunnel.war

 

 

 -----Original Message-----
From: openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Laszlo
Schaffer personal
Sent: Friday, 29 April 2005 5:43 PM
To: [email protected]
Subject: RE: [openjms-user] httptunneling/callback

Hello!

 

I have tried the https/tunneling feature.

The Tomcat5 and JMS Server have been configured as you have suggested. 

They are working fine (with jms admin I can connect to the server)

But from my test app I could not connect to the server

Here is the code 

 

props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.exolab.jms.jndi.InitialContextFactory");

//URL=https://safhome:8443

props.put(Context.PROVIDER_URL, url);

 

context = new InitialContext(props); // drop exception

 

factory = (QueueConnectionFactory) context.lookup("QueueConnectionFactory");

 

connection = factory.createQueueConnection();

connection.start();

…

 

EXCEPTION

2005-04-29 09:24:56,921 ERROR TestViewController - connect:

javax.naming.CommunicationException: Failed to get registry service for URL:
https://safhome:8443 [Root exception is java.rmi.ConnectIOException: Failed
to create connection; nested exception is: 

            org.exolab.jms.net.connector.ConnectException: Failed to connect
to URI=https://safhome:8443/]

            at
org.exolab.jms.jndi.InitialContextFactory.getInitialContext(InitialContextFa
ctory.java:109)

            at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

            at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)

            at javax.naming.InitialContext.init(InitialContext.java:223)

 

And here is my jmsconfig

 

<HttpsConfiguration webServerHost="safhome"

            webServerPort="8443"

            port="3030"

            servlet="/openjms-tunnel/tunnel"  />

 

 

   <Connectors>

      <Connector scheme="https">

         <ConnectionFactories>

             <TopicConnectionFactory name="TopicConnectionFactory" />

             <QueueConnectionFactory name="QueueConnectionFactory" />

        </ConnectionFactories>

     </Connector>

   </Connectors>

 

Any suggestion?

 

Thanks

Laszlo Schaffer

 

-----Original Message-----
From: openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Daniel Otero
Sent: 2005. április 8. 0:04
To: [email protected]
Subject: Re: [openjms-user] httptunneling/callback

 

Hi saf, what you need to do (if you are using the 0.7.7-dev version) is (if
you can wait a few days things will be simplified a bit):

On the server side:

1) place the .war in the webapps/ directory.

2) define the https connector and it's configuration like this (in the
openjms.xml):

<Connectors>
<Connector scheme="https">
<ConnectionFactories>
<TopicConnectionFactory name="TopicConnectionFactory" />
<QueueConnectionFactory name="QueueConnectionFactory" />
</ConnectionFactories>
</Connector>
</Connectors>

<HttpsConfiguration webServerHost="your.webserver.com"
webServerPort="9999"
port="3030"
servlet="/openjms-tunnel/tunnel"
/>

Note: in the next few days the TopicConnectionFactory and
QueueConnectionFactory will be replaced by a single entry like so - and the
examples should be modified accordingly:

<ConnectionFactory name="ConnectionFactory" />

On the cliet side...

1) You need to set up your keystore and run your java client with the usual
parameters (-Djavax.net.ssl.trustStore="$TSTORE"
-Djavax.net.ssl.keyStore="$KSTORE" -Djavax.net.ssl.keyStoreType="jks"
-Djavax.net.ssl.keyStorePassword="$KPASS" )

I believe the plan is to make these part of the jndi.properties file (i.e.
look in examples/basic and see 2) below). But that won't happen for a few
days...

2) The good news is that if you need to use a proxy-server to get through
the corporate firewall the properties to do this can already be specified in
the jndi.properties file like so (much like the ssl ones will probably end
up):

org.exolab.jms.net.https.proxyHost=local.proxy.com
org.exolab.jms.net.https.proxyPort=3128

if user authentication is required you can also use the following:

org.exolab.jms.net.https.proxyUser=user
org.exolab.jms.net.https.proxyPassword=password

On Apr 7, 2005, at 11:07 AM, Laszlo Schaffer personal wrote:

Hello!

 

It is possible to use MessageListener…onMessage() behind a client firewall?

I have read something about this TunnelServlet but I do not know how can I
use this?

What I need a configuration where a client there is behind a firewall (the
jms server server also) and the connection is being made using https

Recently have download and compiled the 0.7.7-dev version but how can I use
this Tunneling feature?

 

Thanks

saf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.