Re: Problems configuring https connection

TJ Greenier <[email protected]>
Newsgroups gmane.comp.java.openjms.user
Message-ID <[email protected]>
I am using 0.7.6 right now. I plan to switch to 0.7.7 in the near future. 

Has anyone got the https connector working with version 0.7.6?

I am using publish/subscribe and am able to publish messages with an https 
connection, but my subscriber is failing. It starts up with out error, but 
if I send a message I don't receive it and if I try to change the subscriber 
to listen on a different topic it throws the following error:
javax.jms.JMSException: Failed to process request 
enableAsynchronousDelivery: session not found
at org.exolab.jms.server.mipc.IpcJmsSessionConnection.notify(
IpcJmsSessionConnection.java:122)
at org.exolab.jms.server.mipc.IpcJmsReceiver.notify(IpcJmsReceiver.java:100)
at org.exolab.jms.server.mipc.IpcServerChannel.run(IpcServerChannel.java
:161)

The error is thrown when I try to close the subscriber object. When I run 
through the debugger it looks like the session is still alive.

Any one have any thoughts on this or ideas for getting version 0.7.6 https 
connection working. The code I have written works perfectly fine with rmi or 
http connections.

Thanks in advance.
- TJ

On 7/7/05, Tim Anderson <[email protected]> wrote:
> 
> I don't have the spare cycles to look into this at the moment,
> but I'm confident you won't experience this with the 0.7.7-alpha-1release.
> Please try it out. 
> Also note that you should be using
> "org.exolab.jms.jndi.InitialContextFactory" instead of 
> "org.exolab.jms.jndi.http.SslHttpJndiInitialContextFactory"
>  -Tim
>  
>  ------------------------------
> *From:* openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:
> openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] *On Behalf Of *TJ Greenier
> *Sent:* Friday, 8 July 2005 12:49 AM
> *To:* [email protected]
> *Subject:* [openjms-user] Problems configuring https connection
> 
> Hi, I am having trouble configuring my https connection. I have 
> successfully used the default RMI configuration and have also got the http 
> connection working. So I assume that I have the open jms servlet installed 
> correctly. Basically I am getting this error message when I attempt to 
> publish a message:
> 
> javax.jms.JMSException: Failed to process request createPublisher: session 
> not found
> at org.exolab.jms.server.mipc.IpcJmsSessionConnection.notify(
> IpcJmsSessionConnection.java :122)
> at org.exolab.jms.server.mipc.IpcJmsReceiver.notify(IpcJmsReceiver.java
> :100)
> at org.exolab.jms.server.mipc.IpcServerChannel.run(IpcServerChannel.java
> :161)
> 
> I am running Tomcat 5.5 using Java 1.5. Here are some of my configuration 
> settings: 
> Tomcat server.xml file:
> <!-- Define a SSL HTTP/1.1 Connector on port 8443 
> --> 
> <Connector port="8443" maxHttpHeaderSize="8192" maxThreads="150" 
> minSpareThreads="25" maxSpareThreads="75" enableLookups="false" 
> disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" 
> clientAuth="false" sslProtocol="TLS" /> 
> 
> openjms.xml file (in its entirety):
> <?xml version="1.0" ?> 
> - <!-- 
> OpenJMS configuration:
> . RMI connectors 
> . JDBM persistency
> . embedded JNDI provider
> . embedded RMI registry, running on port 1099
> . preconfigured destinations
> 
> NOTES: this configuration shows all configuration elements relevant 
> when using an RMI connector. 
> 
> 
> --> 
> - <Configuration>
> - <!-- Optional. This represents the default configuration 
> --> 
> <ServerConfiguration host="localhost" embeddedJNDI="true" /> 
> - <!-- Required when using an RMI connector 
> --> 
> - <Connectors>
> - <Connector scheme="rmi">
> - <ConnectionFactories>
> <QueueConnectionFactory name="JmsQueueConnectionFactory" /> 
> <TopicConnectionFactory name="JmsTopicConnectionFactory" /> 
> </ConnectionFactories>
> </Connector>
> - <Connector scheme="http">
> - <ConnectionFactories>
> <QueueConnectionFactory name="HTTPQueueConnectionFactory" /> 
> <TopicConnectionFactory name="HTTPTopicConnectionFactory" /> 
> </ConnectionFactories>
> </Connector>
> - <Connector scheme="tcp">
> - <ConnectionFactories>
> <QueueConnectionFactory name="TCPQueueConnectionFactory" /> 
> <TopicConnectionFactory name="TCPTopicConnectionFactory" /> 
> </ConnectionFactories>
> </Connector>
> - <Connector scheme="https">
> - <ConnectionFactories>
> <QueueConnectionFactory name="HTTPSQueueConnectionFactory" /> 
> <TopicConnectionFactory name="HTTPSTopicConnectionFactory" /> 
> </ConnectionFactories>
> </Connector>
> </Connectors>
> - <!-- Define HTTP configuration properties 
> --> 
> <HttpConfiguration host="127.0.0.1 <http://127.0.0.1>" port="8080" 
> serverServlet="/openjms/OpenJMSServer" /> 
> - <!-- Define HTTPS configuration properties 
> --> 
> <HttpsConfiguration host="localhost" port="8443" 
> serverServlet="/openjms/OpenJMSServer" /> 
> - <!-- Required 
> --> 
> - <DatabaseConfiguration>
> <JdbmDatabaseConfiguration name="openjms.db" /> 
> </DatabaseConfiguration>
> - <!-- Required 
> --> 
> <AdminConfiguration script="${openjms.home}\bin\startup.bat" /> 
> - <!-- Optional. If not specified, no destinations will be created 
> --> 
> - <AdministeredDestinations>
> - <AdministeredTopic name="topic1">
> <Subscriber name="sub1" /> 
> <Subscriber name="sub2" /> 
> </AdministeredTopic>
> <AdministeredQueue name="queue1" /> 
> <AdministeredQueue name="queue2" /> 
> <AdministeredQueue name="queue3" /> 
> </AdministeredDestinations>
> - <!-- Optional. If not specified, no users will be created 
> --> 
> - <Users>
> <User name="admin" password="openjms" /> 
> </Users> 
> </Configuration>
> 
> 
> Here is how I am calling from my code:
> Hashtable props = new Hashtable();
> 
> System.setProperty("javax.net.ssl.trustStore", "C:\\Documents and 
> Settings\\greeniet\\.keystore");
> System.setProperty("javax.net.ssl.keyStore", "C:\\Documents and 
> Settings\\greeniet\\.keystore");
> System.setProperty("javax.net.ssl.keyStoreType", "jks");
> System.setProperty("javax.net.ssl.keyStorePassword", "changeit"); 
> 
> props.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.exolab.jms.jndi.http.SslHttpJndiInitialContextFactory");
> props.put(Context.PROVIDER_URL, "https://localhost:8443/")<https://localhost:8443/%22%29>
> ;
> 
> try {
> Context context = new InitialContext(props); 
> factory = (TopicConnectionFactory) context.lookup
> ("HTTPSTopicConnectionFactory");
> 
> } catch (NamingException e) {
> e.printStackTrace();
> System.err.println("Connection Error Received, System Will Exit");
> System.exit (0);
> }
> 
> The above code execute successfully. I get my error when I try to publish 
> a message:
> try{
> TopicSession tmpSession = connection.createTopicSession(false,
> Session.CLIENT_ACKNOWLEDGE);
> connection.start();
> Topic topic = tmpSession.createTopic(msg.getTopic());
> TopicPublisher publisher = session.createPublisher(topic);
> int delivery_mode = DeliveryMode.PERSISTENT;
> // need to copy message else destination will change, and ack will fail.
> ObjectMessage message = tmpSession.createObjectMessage(msg);
> publisher.publish(message, delivery_mode, 1, 0);
> tmpSession.close();
> } catch (JMSException exception) {
> success = false;
> exception.printStackTrace();
> System.err.println("Error Publishing Message.");
> }
> 
> The red bold line is the one the error is thrown on.
> 
> Any suggestions or help is much appreciated. And thanks in advance.
> All of the documentation on the site has been great and I have looked 
> through the mailing list archives, but I can't seem to solve this problem.
> 
> Thank you,
> T.J. Greenier
> 
>
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.