Groups > Weblogic > WebLogic Java Message Service > Re: NPE from JMS Connection Object




Re: NPE from JMS Connection Object

Re: NPE from JMS Connection Object
Thu, 15 May 2008 15:04:20 -070
Can you give me the link for the management forum, since
weblogic.developer.interest.management talks about a different topic and i could
not find .jmx newgroup.


I got the mbeanserver using the following method:

	public static void initConnection(String hostname, String portString) throws
IOException,
			MalformedURLException {
		
		String protocol = "t3";
		Integer portInteger = Integer.valueOf(portString);
		int port = portInteger.intValue();
		String jndiroot = "/jndi/";
		String mserver = "weblogic.management.mbeanservers.domainruntime";

		logger.info("protocol="+protocol);
		logger.info("hostname="+hostname);
		logger.info("port="+port);
		logger.info("jndiroot="+jndiroot);
		logger.info("mserver="+mserver);
		JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port,
jndiroot + mserver);
		
		Properties p =
ApplicationResources.getResourceAsProperties(SmartPMConstants.SMARTPM_APPLICATIO
N_RESOURCE);
		String wluser = p.getProperty(SmartPMConstants.SMARTPM_WLUSER);
		String wlpwd = p.getProperty(SmartPMConstants.SMARTPM_WLPWD);
		
		Hashtable h = new Hashtable();
		h.put(Context.SECURITY_PRINCIPAL, wluser);
		h.put(Context.SECURITY_CREDENTIALS, wlpwd);
		logger.info("user cred="+h);
		
		h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
"weblogic.management.remote");
		connector = JMXConnectorFactory.connect(serviceURL, h);
		connection = connector.getMBeanServerConnection();
Post Reply
about | contact