Problem with https connection using 0.7.6jms

"Laszlo Schaffer personal" <[email protected]>
Newsgroups gmane.comp.java.openjms.user
Message-ID <000001c583c6$ebd4c400$7201a8c0@safhome>
Hello!

I have the following problem with HTTPS connection using  0.7.6jms 

All thing (certificate, openjms-servlet, configuration, db=postgres) have
done (attached the openjms.xml) 

 

The application can establishes the jms connection successfully 

 

(Connection properties from the config file)

 

 
<queue_connection_factory>HTTPSQueueConnectionFactory</queue_connection_fact
ory>

 
<topic_connection_factory>HTTPSTopicConnectionFactory</topic_connection_fact
ory>

    <jms_url>https://safhome:8443/</jms_url>

 

There are more threads that polls different queue-s ,after approx 20 seconds
the receiver Thread drops this exception

 

2005-07-08 15:56:43,359 ERROR QReceiver - javax.jms.JMSException: Failed to
process request receiveMessage: session not found

 

Here is code that drops this exception 

 

      while (receiver != null &&!ownerThread.isInterrupted()) {

        if (!enableCallback) {

 

          try  {

            Message message = receiver.receive(100);  // hereby the
exception (session has been already opened )

 

            if (message != null) {

              message.acknowledge();

              logger.debug("message arrived :" + message.toString());

              fireMessageArrived(new ReceiverEvent(this, message));

            }

          }

          catch(JMSException jex) {

            logger.error(jex);

            if(jms_exception_count++>MAX_JMSEXCEPTION) {

              throw new Exception("Cannot continue too many JMSException");

            }

 

          }

        }

        synchronized (this) {

          wait(300);

        }

      }

 

However the application works perfect with TCP connection 

I have tried with 0.7.7 (openjms-tunnel) also, now the application runs
normally except that the openjms drops this messages  (as I have described
in a previous issue)

 

16:00:38.250 ERROR [tcp://safhome:3030/[server]-Worker-10] - Failed to
execute u pdateMessageHandle for
handle=ID:860ed1ec-bcfa-1004-8fc4-6f311302fb44,

destinati

on id=3, consumer id=4

16:00:38.343 ERROR [tcp://safhome:3030/[server]-Worker-13] - Failed to
execute u pdateMessageHandle for
handle=ID:860f0ce8-bcfa-1004-80d5-6183a17cd974,

 

Thanks for the help

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. július 8. 4:15
To: [email protected]
Subject: RE: [openjms-user] Problems configuring https connection

 

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-1 release.

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(IpcJmsSessionConne
ction.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" 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/");

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
openjms.xml (text/xml, 2.3 KB)
<?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>

	<DatabaseConfiguration>
	  <RdbmsDatabaseConfiguration
	   driver="org.postgresql.Driver"
	   url="jdbc:postgresql://localhost:5432/openjms" 
	   user="openjms" 
	   password="openjms"
	   maxActive="10"
	   maxIdle="5"
	   evictionInterval="3600"
	   testQuery="select current_date"/>
	</DatabaseConfiguration>
         
  <!-- Optional. This represents the default configuration  -->
  <ServerConfiguration  host="safhome"  embeddedJNDI="true" />


   <Connectors>
    <Connector scheme="https">
      <ConnectionFactories>
        <QueueConnectionFactory name="HTTPSQueueConnectionFactory"/>
        <TopicConnectionFactory name="HTTPSTopicConnectionFactory"/>
      </ConnectionFactories>
    </Connector>
    <Connector scheme="tcp">
      <ConnectionFactories>
        <QueueConnectionFactory name="TCPQueueConnectionFactory"/>
        <TopicConnectionFactory name="TCPTopicConnectionFactory"/>
      </ConnectionFactories>
    </Connector>
  </Connectors>

   <HttpsConfiguration host="safhome"
                      port="8443"
                      serverServlet="/openjms/OpenJMSServer"
                       adminServlet="/openjms/OpenJMSServer">
  </HttpsConfiguration>



  <!-- Required -->
  <AdminConfiguration script="${openjms.home}\bin\startup.bat" />
    
  <!-- Optional. If not specified, no destinations will be created -->
  <AdministeredDestinations>
    <AdministeredQueue name="FOLFCHAT_CLIENT_SERVICE_QUEUE"/>
    <AdministeredQueue name="FOLFCHAT_SERVER_SERVICE_QUEUE"/>
    <AdministeredQueue name="FOLFCHAT_CLIENT_SMS_QUEUE"/>
    <AdministeredQueue name="FOLFCHAT_SERVER_SMS_QUEUE"/>
    <AdministeredQueue name="FOLFCHAT_SMSCENTER_FROM_SERVER_QUEUE"/>
    <AdministeredQueue name="FOLFCHAT_SMSCENTER_TO_SERVER_QUEUE"/>
    
  </AdministeredDestinations>

  <!-- Optional. If not specified, no users will be created -->
  <Users>
    <User name="admin" password="openjms" />
    <User name="folfchat" password="folfchat" />
  </Users>

</Configuration>
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.