RE: openjms0.7.7 / postgres problem
"Laszlo Schaffer personal" <laszlo.schaffer-HYXu6/[email protected]>
| Newsgroups | gmane.comp.java.openjms.user |
|---|---|
| Message-ID | <000001c58919$14b04050$7201a8c0@safhome> |
Hello!
This is a quite big application hereby I send only a part of the class that
maybe can cause this exception (I have to notice however that my application
did not get any exception "only" the openjms log contains the error message
So there is chatserver (part of an sms/mms service) that is communicat with
its clients through jms, A client connect to the server sending message ,
then it periodically sends ping message and the server responds also a
similar message (that contains status info...etc)
Two receiver thread is runnin on the server side one gets/sends sms from two
dedicated queues (in/out) (sent by another application) another gets/sends
service messages from/to the clients
So there is a generic part of the application (the transport layer is
separated so the application core does not have any information about the
transport method..etc)
Here is run method of the thread (runs 2 instances) (note there is able to
get messages using the jms callback function (depends on the configuration)
but in this case I configured the 'poll' feature (however I tested with
callbacking also with the same result)
I have to notice however it seems the applications (messages are being
transferred) works but the jms server drops the messages
I have tested with 0.7.6 also
Using TCP connection :
Apps works no error message at the jms console
Using HTTPS
Apps did not work (I have sent the exception in another mail in this
week)
With 0.7.7 (with postgres 8.x)
TCP,HTTPS works but the jms drops this message
(with derby) not worked (see previous mail)
so here is code
/** Main processing method for the QReceiver object */
public void run() {
try {
while (receiver != null &&!ownerThread.isInterrupted()) {
if (!enableCallback) {
try {
Message message = receiver.receive(100);
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);
}
}
}
catch (InterruptedException iex) {
logger.warn("interrupted");
}
catch (Exception ex) {
logger.error("run:", ex);
fireMessageArrived(new ReceiverEvent(this,ex));
}
finally {
logger.debug("thread is died");
}
}
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. július 14. 15:33
To: [email protected]
Subject: RE: [openjms-user] openjms0.7.7 / postgres problem
Can you post code that reproduces the problem?
> -----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: Thursday, 14 July 2005 11:03 PM
> To: [email protected]
> Subject: RE: [openjms-user] openjms0.7.7 / postgres problem
>
> Hello,
>
> I have the following problem with 0.7.7
>
> JMS has been configured with https using tunnel... database
> set back to derby
>
> There is a server application that runs as a normal webapp
> (chatserver) (runs in the same tomcat instance as
> openjms-tunnel) Client app is connecting to the jms server
> also with https
>
openjms.xml
(text/xml, 2.5 KB)
<?xml version="1.0"?>
<Configuration>
<!-- Optional. This represents the default configuration -->
<ServerConfiguration host="safhome" embeddedJNDI="true"/>
<Connectors>
<Connector scheme="https">
<ConnectionFactories>
<ConnectionFactory name="ConnectionFactory"/>
</ConnectionFactories>
</Connector>
<Connector scheme="tcp">
<ConnectionFactories>
<QueueConnectionFactory name="TCPQueueConnectionFactory"/>
<TopicConnectionFactory name="TCPTopicConnectionFactory"/>
</ConnectionFactories>
</Connector>
<!--
<Connector scheme="rmi">
<ConnectionFactories>
<QueueConnectionFactory name="RMIQueueConnectionFactory"/>
<TopicConnectionFactory name="RMITopicConnectionFactory"/>
</ConnectionFactories>
</Connector>
-->
</Connectors>
<HttpsConfiguration webServerHost="safhome" webServerPort="8443" port="3030" servlet="/openjms-tunnel/tunnel"/>
<!-- <HttpConfiguration webServerHost="soap.handicaddy.dk" port="3030" servlet="/openjms-tunnel/tunnel"/> -->
<DatabaseConfiguration>
<RdbmsDatabaseConfiguration
driver="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/openjms"
user="postgres"
password="postgres"/>
<!--
maxActive="10"
maxIdle="5"
evictionInterval="3600"
testQuery="select current_date"
-->
</DatabaseConfiguration>
<!-- Required
<DatabaseConfiguration>
<RdbmsDatabaseConfiguration
driver="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:openjmsdb;create=true"
user="openjms"
password="openjms"/>
</DatabaseConfiguration>
-->
<!-- Required -->
<AdminConfiguration script="${openjms.home}/bin/startup.sh"/>
<!-- Optional. If not specified, no destinations will be created -->
<AdministeredDestinations>
<AdministeredQueue name="testin"/>
<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>
openjms.log
(application/octet-stream, 7.5 KB)
09:58:30.593 ERROR [https-server://safhome:3030/[server]-Worker-2] - Failed to execute updateMessageHandle for handle=ID:8ad65678-bd54-1004-8519-0be299b084de, destination id=2, consumer id=2 09:58:38.515 ERROR [https-server://safhome:3030/[server]-Worker-3] - Failed to execute updateMessageHandle for handle=ID:8ae2827c-bd54-1004-8746-905a111fee79, destination id=3, consumer id=3 09:58:38.531 ERROR [https-server://safhome:3030/[server]-Worker-2] - Failed to execute removeMessageHandle for handle=ID:8ae2827c-bd54-1004-8746-905a111fee79 destination id=3 consumer id=3 09:58:38.562 ERROR [https-server://safhome:3030/[server]-Worker-2] - Cannot remove message=ID:8ae2827c-bd54-1004-8746-905a111fee79 09:58:54.500 ERROR [https-server://safhome:3030/[server]-Worker-5] - Failed to execute updateMessageHandle for handle=ID:8afaebb4-bd54-1004-8746-905a111fee79, destination id=3, consumer id=3 09:59:06.812 ERROR [https-server://safhome:3030/[server]-Worker-3] - Failed to execute updateMessageHandle for handle=ID:8b0da0c4-bd54-1004-8519-0be299b084de, destination id=2, consumer id=2 09:59:06.859 ERROR [https-server://safhome:3030/[server]-Worker-5] - Failed to execute removeMessageHandle for handle=ID:8b0da0c4-bd54-1004-8519-0be299b084de destination id=2 consumer id=2 09:59:10.500 ERROR [https-server://safhome:3030/[server]-Worker-2] - Failed to execute updateMessageHandle for handle=ID:8b1352f8-bd54-1004-8746-905a111fee79, destination id=3, consumer id=3 09:59:18.828 ERROR [https-server://safhome:3030/[server]-Worker-2] - Failed to execute updateMessageHandle for handle=ID:8b1fe748-bd54-1004-8519-0be299b084de, destination id=2, consumer id=2 09:59:18.859 ERROR [https-server://safhome:3030/[server]-Worker-5] - Failed to execute removeMessageHandle for handle=ID:8b1fe748-bd54-1004-8519-0be299b084de destination id=2 consumer id=2 09:59:22.500 ERROR [https-server://safhome:3030/[server]-Worker-5] - Failed to execute updateMessageHandle for handle=ID:8b258590-bd54-1004-8746-905a111fee79, destination id=3, consumer id=3 09:59:22.593 ERROR [https-server://safhome:3030/[server]-Worker-4] - Failed to execute updateMessageHandle for handle=ID:8b25a6c4-bd54-1004-8519-0be299b084de, destination id=2, consumer id=2 09:59:22.609 ERROR [https-server://safhome:3030/[server]-Worker-1] - Failed to execute removeMessageHandle for handle=ID:8b25a6c4-bd54-1004-8519-0be299b084de destination id=2 consumer id=2 09:59:37.734 ERROR [https-server://safhome:3030/[server]-Worker-4] - Failed to execute updateMessageHandle for handle=ID:8b3c8d44-bd54-1004-8746-905a111fee79, destination id=3, consumer id=3 09:59:38.640 ERROR [https-server://safhome:3030/[server]-Worker-3] - Failed to execute updateMessageHandle for handle=ID:8b3e13e4-bd54-1004-8746-905a111fee79, destination id=3, consumer id=3 09:59:39.531 ERROR [https-server://safhome:3030/[server]-Worker-3] - Failed to execute updateMessageHandle for handle=ID:8b3f2554-bd54-1004-8746-905a111fee79, destination id=3, consumer id=3 09:59:42.000 ERROR [https-server://safhome:3030/[server]-Worker-2] - Failed to execute updateMessageHandle for handle=ID:8b432910-bd54-1004-8746-905a111fee79, destination id=3, consumer id=3 09:59:46.843 ERROR [https-server://safhome:3030/[server]-Worker-3] - Failed to execute updateMessageHandle for handle=ID:8b4ab25c-bd54-1004-8746-905a111fee79, destination id=3, consumer id=3 09:59:46.906 ERROR [https-server://safhome:3030/[server]-Worker-1] - Failed to execute updateMessageHandle for handle=ID:8b4ac328-bd54-1004-8519-0be299b084de, destination id=2, consumer id=2 09:59:55.109 ERROR [https-server://safhome:3030/[server]-Worker-2] - Failed to execute updateMessageHandle for handle=ID:8b575390-bd54-1004-8519-0be299b084de, destination id=2, consumer id=2 10:00:15.187 ERROR [https-server://safhome:3030/[server]-Worker-4] - Failed to execute updateMessageHandle for handle=ID:8b75d9a0-bd54-1004-8519-0be299b084de, destination id=2, consumer id=2 10:00:47.234 ERROR [https-server://safhome:3030/[server]-Worker-4] - Failed to execute updateMessageHandle for handle=ID:8ba6dc1c-bd54-1004-8519-0be299b084de, destination id=2, consumer id=2 10:00:47.328 ERROR [https-server://safhome:3030/[server]-Worker-1] - Failed to execute removeMessageHandle for handle=ID:8ba6dc1c-bd54-1004-8519-0be299b084de destination id=2 consumer id=2 10:00:51.281 ERROR [https-server://safhome:3030/[server]-Worker-5] - Failed to execute updateMessageHandle for handle=ID:8bacfed0-bd54-1004-8519-0be299b084de, destination id=2, consumer id=2 10:00:51.375 ERROR [https-server://safhome:3030/[server]-Worker-3] - Failed to execute removeMessageHandle for handle=ID:8bacfed0-bd54-1004-8519-0be299b084de destination id=2 consumer id=2 10:00:51.390 ERROR [https-server://safhome:3030/[server]-Worker-3] - Cannot remove message=ID:8bacfed0-bd54-1004-8519-0be299b084de 10:01:03.171 ERROR [https-server://safhome:3030/[server]-Worker-3] - Failed to execute updateMessageHandle for handle=ID:8bbf1c50-bd54-1004-8519-0be299b084de, destination id=2, consumer id=2 10:01:03.203 ERROR [https-server://safhome:3030/[server]-Worker-4] - Failed to execute removeMessageHandle for handle=ID:8bbf1c50-bd54-1004-8519-0be299b084de destination id=2 consumer id=2 10:01:03.203 ERROR [https-server://safhome:3030/[server]-Worker-4] - Cannot remove message=ID:8bbf1c50-bd54-1004-8519-0be299b084de 10:01:11.000 ERROR [https-server://safhome:3030/[server]-Worker-2] - Failed to execute updateMessageHandle for handle=ID:8bcaf4bc-bd54-1004-8746-905a111fee79, destination id=3, consumer id=3 10:01:11.015 ERROR [https-server://safhome:3030/[server]-Worker-1] - Failed to execute removeMessageHandle for handle=ID:8bcaf4bc-bd54-1004-8746-905a111fee79 destination id=3 consumer id=3 10:01:11.218 ERROR [https-server://safhome:3030/[server]-Worker-2] - Failed to execute updateMessageHandle for handle=ID:8bcb4214-bd54-1004-8519-0be299b084de, destination id=2, consumer id=2 10:01:11.281 ERROR [https-server://safhome:3030/[server]-Worker-1] - Failed to execute removeMessageHandle for handle=ID:8bcb4214-bd54-1004-8519-0be299b084de destination id=2 consumer id=2 10:01:11.296 ERROR [https-server://safhome:3030/[server]-Worker-1] - Cannot remove message=ID:8bcb4214-bd54-1004-8519-0be299b084de 10:01:14.953 ERROR [https-server://safhome:3030/[server]-Worker-5] - Failed to execute updateMessageHandle for handle=ID:8bd11db0-bd54-1004-8746-905a111fee79, destination id=3, consumer id=3 10:01:23.265 ERROR [https-server://safhome:3030/[server]-Worker-2] - Failed to execute updateMessageHandle for handle=ID:8bddde24-bd54-1004-8519-0be299b084de, destination id=2, consumer id=2 10:01:40.421 ERROR [https-server://safhome:3030/[server]-Worker-2] - Failed to execute updateMessageHandle for handle=ID:8bf7f570-bd54-1004-8746-905a111fee79, destination id=3, consumer id=3 10:08:59.250 ERROR [tcp://safhome:3035/[server]-Worker-3] - Failed to execute updateMessageHandle for handle=ID:8e95abec-bd54-1004-84c8-95f1e6f29363, destination id=7, consumer id=7 10:09:44.453 ERROR [tcp://safhome:3035/[server]-Worker-3] - Failed to execute updateMessageHandle for handle=ID:8eda9d24-bd54-1004-84c8-95f1e6f29363, destination id=7, consumer id=7 10:09:44.484 ERROR [tcp://safhome:3035/[server]-Worker-4] - Failed to execute removeMessageHandle for handle=ID:8eda9d24-bd54-1004-84c8-95f1e6f29363 destination id=7 consumer id=7 10:09:46.921 ERROR [tcp://safhome:3035/[server]-Worker-3] - Failed to execute updateMessageHandle for handle=ID:8ede5900-bd54-1004-84c8-95f1e6f29363, destination id=7, consumer id=7 10:09:47.390 ERROR [tcp://safhome:3035/[server]-Worker-2] - Failed to execute updateMessageHandle for handle=ID:8edf26dc-bd54-1004-8c41-fc604cc2cb2e, destination id=6, consumer id=6
QReceiver.java
(text/x-java, 5.6 KB)
/* * Project...: FOLFCHAT * * Details...: Core * * Copyright.: (C) 2005 Actiwise Consulting Kft * */ package com.actiwise.folfchat.transport; import java.util.*; import javax.jms.*; import com.actiwise.folfchat.message.MsgCore; import org.apache.log4j.*; /** * JMS based class for receiving messages from a queue * * @author <a href="mailto:laszol.schaffer-HYXu6/[email protected]">Laszlo Schaffer</a> * @since 2005. április 18. */ public class QReceiver extends Transport implements ExceptionListener, IReceiver, MessageListener, Runnable { QueueReceiver receiver; transient Vector receiverListeners = new Vector(); private Logger logger = Logger.getLogger(this.getClass()); private boolean enableCallback; private static final int MAX_JMSEXCEPTION=10; private int jms_exception_count; private Thread ownerThread; /** * @link dependency */ /*# ReceiverEvent lnkReceiverEvent; */ /** * Register the destination object using this selector * * @param destinationName String * @param selector String * @param serverUniqName String must be a uniq name for DurableTopicSubscribers! * @param noLocal boolean only for DurableTopicSubscribers! * @param enableCallback boolean * @throws Exception */ public void initSession(String destinationName, String selector, String serverUniqName, boolean noLocal, boolean enableCallback) throws Exception { logger.info(" initSession:init"); this.enableCallback = enableCallback; if (selector != null) { logger.info("initSession:" + selector); } session = queueConnection.createQueueSession( false, Session.CLIENT_ACKNOWLEDGE); destination = (javax.jms.Queue) context.lookup(destinationName); receiver = ( (QueueSession) session).createReceiver( (javax.jms.Queue) destination, selector); queueConnection.setExceptionListener(this); if (enableCallback) { logger.debug("callback is enabled"); receiver.setMessageListener(this); } ownerThread = new Thread(this); ownerThread.start(); } /** * interrupt */ public synchronized void interrupt() { try { ownerThread.interrupt(); } catch (Exception ex) { logger.error("interrupt:", ex); } } /** * onMessage event Push the incoming message into the static synchronized message buffer * * @param message Message it should be ObjectMessage! */ public void onMessage(Message message) { try { message.acknowledge(); logger.debug("message arrived :" + message.toString()); fireMessageArrived(new ReceiverEvent(this, message)); } catch (Exception ex) { logger.error("onMessage :", ex); fireMessageArrived(new ReceiverEvent(this,ex)); } } /** * onException event Push the exception into the exception buffer * * @param jMSException JMSException */ public void onException(JMSException jMSException) { try { logger.error("JMS exception occured ", jMSException.getLinkedException()); fireMessageArrived(new ReceiverEvent(this, jMSException)); } catch (Exception ex) { logger.error("onException :" + ex); } } /** * Adds the specified Receiver listener to receive Receiver events from this component. * If listener l is null, no exception is thrown and no action is performed. * * @param l Contains the ReceiverListener for ReceiverEvent data. */ public synchronized void addReceiverListener(ReceiverListener l) { if (!receiverListeners.contains(l)) { receiverListeners.add(l); } } /** * Removes the specified Receiver listener so that it no longer receives Receiver events * from this component. This method performs no function, nor does it throw an * exception, if the listener specified by the argument was not previously added to this * component. If listener l is null, no exception is thrown and no action is performed. * * @param l Contains the ReceiverListener for ReceiverEvent data. */ public synchronized void removeReceiverListener(ReceiverListener l) { if (receiverListeners.contains(l)) { receiverListeners.remove(l); } } /** Main processing method for the QReceiver object */ public void run() { try { while (receiver != null &&!ownerThread.isInterrupted()) { if (!enableCallback) { try { Message message = receiver.receive(100); 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); } } } catch (InterruptedException iex) { logger.warn("interrupted"); } catch (Exception ex) { logger.error("run:", ex); fireMessageArrived(new ReceiverEvent(this,ex)); } finally { logger.debug("thread is died"); } } /** * Fires a new ReceiveEvent * * @param event ReceiverEvent */ protected void fireMessageArrived(ReceiverEvent event) { if (receiverListeners != null) { Vector listeners = receiverListeners; int count = listeners.size(); for (int i = 0; i < count; i++) { ( (ReceiverListener) listeners.elementAt(i)).messageArrived(event); } } } }