Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 922030 Details for
Bug 1124178
jmsQueueControl.addJNDI(String jndiName) method allows duplicate JNDI entry creation
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
DuplicateJNDI.java
DuplicateJNDI.java (text/plain), 2.21 KB, created by
Tyronne Wickramarathne
on 2014-07-29 06:16:11 UTC
(
hide
)
Description:
DuplicateJNDI.java
Filename:
MIME Type:
Creator:
Tyronne Wickramarathne
Created:
2014-07-29 06:16:11 UTC
Size:
2.21 KB
patch
obsolete
>package org.jboss.labs; > >import java.io.IOException; >import java.net.MalformedURLException; >import java.util.HashMap; >import java.util.Map; > >import javax.management.MBeanServerConnection; >import javax.management.MBeanServerInvocationHandler; >import javax.management.ObjectName; >import javax.management.remote.JMXConnector; >import javax.management.remote.JMXConnectorFactory; >import javax.management.remote.JMXServiceURL; > >import org.hornetq.api.core.management.ObjectNameBuilder; >import org.hornetq.api.jms.management.JMSQueueControl; >import org.hornetq.api.jms.management.JMSServerControl; > >public class DuplicateJNDI { > > public static void main(String[] args) { > String host = "localhost"; > int port = 9999; // management-native port > String urlString ="service:jmx:remoting-jmx://" + host + ":" + port; > JMXServiceURL serviceURL; > try { > serviceURL = new JMXServiceURL(urlString); > Map map = new HashMap(); > String[] credentials = new String[] { "admin", "jboss10)" }; > map.put("jmx.remote.credentials", credentials); > JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, map); > MBeanServerConnection connection = jmxConnector.getMBeanServerConnection(); > ObjectName objectName = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName("A"); > JMSQueueControl jmsQueueControl = (JMSQueueControl) MBeanServerInvocationHandler.newProxyInstance(connection, objectName, JMSQueueControl.class, false); > //adding duplicate JNDI names > jmsQueueControl.addJNDI("my/queue/A"); > jmsQueueControl.addJNDI("my/queue/A"); > jmsQueueControl.addJNDI("my/queue/A"); > jmsQueueControl.addJNDI("my/queue/A"); > //printing available JNDI bindings for the given destination > String[] jndiBindings = jmsQueueControl.getJNDIBindings(); > for( int c = 0; c<jndiBindings.length; c++ ){ > System.out.println(" JNDI Binding no : "+ (c+1) + " -> " + jndiBindings[c]); > } > jmxConnector.close(); > } catch (MalformedURLException e) { > e.printStackTrace(); > } catch (IOException e) { > e.printStackTrace(); > } catch (NullPointerException e) { > e.printStackTrace(); > } catch (Exception e) { > e.printStackTrace(); > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1124178
: 922030