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

  • Bad credentials with MBeanServerConnectionFactoryBean

    Hi. Altough I can connect with the same user and password to my jmx server using JCONSOLE, I cannot seem to manage logging in with my client. Here is the code:

    <bean id="jmxServerClient"
    class="org.springframework.jmx.support.MBeanServer ConnectionFactoryBean">
    <property name="serviceUrl"
    value="service:jmx:rmi://localhost/jndi/rmi://localhost:8335/connector" />
    <property name="environment">
    <props>
    <prop key="java.naming.security.principal">xxxxxx</prop>
    <prop key="java.naming.security.credentials">yyyyy</prop>
    </props>
    </property>
    </bean>

    The errro is "Bad credentials" ? What should I do in this case ?

  • #2
    I can't believe it. Nobody knows what is the proper way to connect to a JMX server, using the MBeanServerConnectionFactoryBean in order to supply the necessary credentials ?

    Comment


    • #3
      Here is the server configuration

      <bean id="registry"
      class="org.springframework.remoting.rmi.RmiRegistr yFactoryBean">
      <property name="port" value="8335" />
      </bean>

      <bean id="serverConnector"
      class="org.springframework.jmx.support.ConnectorSe rverFactoryBean">
      <property name="objectName" value="connector:name=rmi" />
      <property name="serviceUrl"
      value="service:jmx:rmi://localhost/jndi/rmi://localhost:8335/connector" />
      <property name="server" ref="jmxServer" />
      <property name="environment">
      <map>
      <entry key="jmx.remote.authenticator"
      value-ref="jmxRemoteAuthenticator" />
      </map>
      </property>
      </bean>

      <bean id="jmxRemoteAuthenticator"
      class="mx4j.tools.remote.PasswordAuthenticator">
      <constructor-arg>
      <bean factory-method="getInputStream"
      factory-bean="jmxRemotePasswords" />
      </constructor-arg>
      </bean>

      <bean id="resourceLoader"
      class="org.springframework.core.io.DefaultResource Loader" />

      <bean id="jmxRemotePasswords" factory-method="getResource"
      factory-bean="resourceLoader">
      <constructor-arg value="classpathasswords.txt" />
      </bean>

      Comment


      • #4
        How did you manged to connect to the above server, using MBeanServerConnectionFactoryBean and prviding the username and password in order to pass the security check ?
        Thanks.

        Comment

        Working...
        X