RE: Client not stopping gracefully intermittely
Vikas Chopra <vvchop-/[email protected]>
| Newsgroups | gmane.comp.java.openjms.user |
|---|---|
| Message-ID | <[email protected]> |
I am glad you noticed that, When should I expect that fix. Vik --- Tim Anderson <[email protected]> wrote: > The connection threads can take a while to die. > Using your example, I'm seeing them take up to a > minute > to terminate. > > That said, it's a bit longer than I'n expecting. > I'll look at it next week. > > -Tim > > > -----Original Message----- > > From: openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > > [mailto:openjms-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] > On Behalf > > Of Vikas Chopra > > Sent: Thursday, 30 March 2006 9:09 AM > > To: [email protected] > > Subject: RE: [openjms-user] Client not stopping > gracefully > > intermittely > > > > We are facing the same problem also. We were using > > 0.7.6.1 and everything was well, but when we moved > to > > 0.7.7-alpha-3, our appserver process is not > shutting down > > gracefully, looks like some thread is in a hung > > state. We are using Tomcat 5.5.12. Even creating > a > > topic without a connection is causing the same > problem. > > > > Please tell me, what should I do to resolve that. > > > > /** > > * Initializes the Topic if not there create > the Topic > > * @throws JMSException > > * @throws MalformedURLException > > */ > > public void initializeTopic() throws > > MalformedURLException, JMSException { > > String topicName = schemaName + "_Topic"; > > String providerURL = "rmi://" + hostname + > ":" > > + portNumber + "/"; > > > > JmsAdminServerIfc admin = > > AdminConnectionFactory.create(providerURL); > > if (!admin.addDestination(topicName, > > Boolean.FALSE)) { > > logger.info("Topic : " + topicName > > + " already exists, > ignoring that ..."); > > admin.close(); > > } > > > > > > Vikas > > > > > > > > > > --- Tim Anderson <[email protected]> wrote: > > > > > Try closing the JNDI context (Context.close()) > after you've > > finished > > > with it. > > > It may be holding onto a connection. > > > > > > -Tim > > > > > > > From: Ninju Bohra > > > > > > > > Hello all, > > > > > > > > We had using 0.7.6.1 and all was reasonable > well, > > > but when we moved to > > > > 0.7.7-alpha-3 (to get the fix to bug #1214292) > we > > > are now > > > > having an issue that our client applications > are > > > not closing > > > > gracefully 90% of the time. > > > > > > > > The openJMS client is a Tomcat 5.5.12 webapp > and > > > we are using JDK > > > > 1.5.0_04-b05 on a WinXP (SP2) box. When we > ask > > > Tomcat to > > > > STOP, the web server stops, however the > process > > > does not exit > > > > due to some non-deamon threads still running. > > > Some of the > > > > threads remaining are named "RMI Reaper", > "Clock > > > Daemon", > > > > "ManagedConnectionReaper1" and others. > > > > > > > > We are using the openJMS in a non-persistent > > > non-durable > > > > publisher/subscriber mode with the embedded > RMI. > > > > > > > > Here is the code that is used to start the > > > connection: > > > > > > > > private void initalizeJMSConnection() > throws NamingException, > > > > JMSException { > > > > String topicName = schemaName + > "_Topic"; > > > > String providerURL = "rmi://" + > hostname + > > > ":" + > > > > portNumber + "/"; > > > > > > > properties.put(Context.INITIAL_CONTEXT_FACTORY, > > > > > > > "org.exolab.jms.jndi.InitialContextFactory"); > > > > properties.put(Context.PROVIDER_URL, > > > providerURL); > > > > logger.info("Trying to listen to the > > > connection named > > > > '" + topicName > > > > + "' on the > connectionFactory > > > called '" > > > > + connectionFactoryName > > > > + "' hosted on JMS located > at > > > '" > > > > + providerURL); > > > > Context jndiContext = new > > > > javax.naming.InitialContext(properties); > > > > connectionFactory = > > > (TopicConnectionFactory) > > > > jndiContext.lookup(connectionFactoryName); > > > > Topic dest = (Topic) > > > jndiContext.lookup(topicName); > > > > connection = > > > connectionFactory.createTopicConnection(); > > > > session = > > > connection.createTopicSession(false, > > > > Session.AUTO_ACKNOWLEDGE); > > > > subscriber = > > > session.createSubscriber(dest); > > > > subscriber.setMessageListener(this); > > > > connection.setExceptionListener(this); > > > > connection.start(); > > > > logger.info("JMS Connection setup > > > properly"); > > > > } > > > > > > > > > > > > And here is the code to stop/close the > connection: > > > > > > > > public void stopListening() throws > > > JMSException { > > > > if (connection != null) { > > > > connection.stop(); > > > > } > > > > if (subscriber != null) { > > > > subscriber.close(); > > > > } > > > > if (session != null) { > > > > session.close(); > > > > } > > > > if (connection != null) { > > > > connection.close(); > > > > } > > > > } > > > > > > > > When the tomcat process does NOT gracefully > stop, > > > I do a > > > > Ctrl-Break and get the follow thread dump: > > > > > > > > Mar 21, 2006 4:00:45 PM > > > org.apache.coyote.http11.Http11BaseProtocol > > > > destroy > > > > INFO: Stopping Coyote HTTP/1.1 on http-30080 > Mar > > > 21, 2006 > > > > 4:01:20 PM > > > org.apache.catalina.loader.WebappClassLoader > > > > loadClass > > > > INFO: Illegal access: this web application > > > instance has been > > > > stopped already. Could not load > > > > resoft.framework.memento.MementoContext$1. > > > > The eventual following stack trace is caus ed > by > > > an error > > > > thrown for debugging purposes as well as to > === message truncated === __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642