[jboss-jira] [JBoss JIRA] Commented: (JBMESSAGING-1762) Jboss shutdown produce error if ServerPeer's DefaultQueueJNDIContext is set empty.
Zemian Deng (JIRA)
jira-events at lists.jboss.org
Tue Nov 17 18:10:44 EST 2009
[ https://jira.jboss.org/jira/browse/JBMESSAGING-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12495135#action_12495135 ]
Zemian Deng commented on JBMESSAGING-1762:
------------------------------------------
Here is a svn diff patch to fix this.
I have to work with Jboss4 so I used http://anonsvn.jboss.org/repos/messaging/tags/JBossMessaging_1_4_2_GA_SP1
Index: src/main/org/jboss/jms/server/DestinationJNDIMapper.java
===================================================================
--- src/main/org/jboss/jms/server/DestinationJNDIMapper.java (revision 7901)
+++ src/main/org/jboss/jms/server/DestinationJNDIMapper.java (working copy)
@@ -260,10 +260,18 @@
{
unregisterDestination((ManagedDestination)i.next());
}
+
+ String defaultName = serverPeer.getDefaultQueueJNDIContext();
+ if (!"".equals(defaultName.trim())) {
+ log.debug("Unbinding default queue JNDI context: " + defaultName);
+ initialContext.unbind(defaultName);
+ }
+ defaultName = serverPeer.getDefaultTopicJNDIContext();
+ if (!"".equals(defaultName.trim())) {
+ log.debug("Unbinding default topic JNDI context: " + defaultName);
+ initialContext.unbind(defaultName);
+ }
- initialContext.unbind(serverPeer.getDefaultQueueJNDIContext());
- initialContext.unbind(serverPeer.getDefaultTopicJNDIContext());
-
initialContext.close();
}
> Jboss shutdown produce error if ServerPeer's DefaultQueueJNDIContext is set empty.
> ----------------------------------------------------------------------------------
>
> Key: JBMESSAGING-1762
> URL: https://jira.jboss.org/jira/browse/JBMESSAGING-1762
> Project: JBoss Messaging
> Issue Type: Bug
> Components: AS Integration
> Affects Versions: 1.4.3.GA
> Environment: all platforms
> Reporter: Zemian Deng
>
> Hi there,
> I think this affect on all jboss-server that using jboss-messaging-1.4.0.SP. I verified that this happens on jboss-5.1 as well as jboss-4.2
> To reproduce it:
> 1. Open conf/deploy/jboss-messaging.sar/messaging-service.xml (jboss-4.x)
> or conf/deploy/messaging/messaging-service.xml (jboss-5.x)
> 2. Change line from
> <attribute name="DefaultQueueJNDIContext">/queue</attribute>
> To
> <attribute name="DefaultQueueJNDIContext"></attribute>
> Startup jboss server (eg: bin/run -c default). Note that it starts up without problem, but when hit CTRL+C to shutdown, you will get Exception thrown:
> 15:27:14,652 ERROR [ExceptionUtil] ServerPeer[0] stopService
> javax.naming.InvalidNameException
> at org.jnp.server.NamingServer.unbind(NamingServer.java:308)
> at org.jnp.interfaces.NamingContext.unbind(NamingContext.java:871)
> at org.jnp.interfaces.NamingContext.unbind(NamingContext.java:854)
> at javax.naming.InitialContext.unbind(InitialContext.java:416)
> at org.jboss.jms.server.DestinationJNDIMapper.stop(DestinationJNDIMapper.java:264)
> at org.jboss.jms.server.ServerPeer.stopService(ServerPeer.java:377)
> I think the cause is that it tries to unbind an empty JNDI name!
> Suggested solution:
> On DestinationJNDIMapper.java:264, check getDefaultQueueJNDIContext() for empty before calling initialContext.unbind(serverPeer.getDefaultQueueJNDIContext());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list