Announcement Announcement Module
Collapse
No announcement yet.
Bad credentials - MbeanServerConnectionFactoryBean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bad credentials - MbeanServerConnectionFactoryBean

    Hi everybody. Please help me with this issue that's driving me crazy.

    Altough JConsole can connect to my spring jmx server without any problems, using the username and password I provide, I cannot connect to the same server, using my MBeanServerConnectionFactoryBean. I keep getting the "Bad credentials" error. Here is the config:

    Code:
    	<bean id="propertyConfigurer"
    		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    		<property name="locations">
    			<list>
    				<value>jmx.properties</value>
    			</list>
    		</property>
    	</bean>
    
    	<bean id="jmxServerClient"
    		class="org.springframework.jmx.support.MBeanServerConnectionFactoryBean">
    		<property name="serviceUrl"
    			value="service:jmx:rmi://localhost:9999/jndi/rmi://localhost:8335/connector" />
    		<property name="environment">
    			<props>
    				<prop key="java.naming.security.principal">
    					${jmx_username}
    				</prop>
    				<prop key="java.naming.security.credentials">
    					${jmx_password}
    				</prop>
    			</props>
    		</property>
    		<property name="connectOnStartup" value="false" />
    	</bean>
    
    	<bean id="serverClient"
    		class="ro.romtelecom.DEALER.services.jmxControlServiceImpl">
    		<property name="client" ref="jmxServerClient" />
    	</bean>
    Thank you.

  • #2
    Bad Credentials in MBeanServerConnectionFactoryBean

    Hello,

    I experienced the same problem and found a posting
    Code:
    markmail.org/message/mnwezbtizbj3uit7
    which shows a solution (removed http :// because the forum does not allow me to use it being a new forum member)

    The solution is to use "jmx.remote.credentials". I had to upgrade to spring-web version 2.5.4 because I was missing the StringUtils class, but after that it did work.

    Code:
            <property name="environment">
              <map>
                <entry key="jmx.remote.credentials">
                  <bean class=" org.springframework.util.StringUtils" factory-method="commaDelimitedListToStringArray">
                    <constructor-arg value="username,password" />
                  </bean>
                </entry>
              </map>
            </property>
    Best regards
    Arie Roy

    Comment

    Working...
    X