2010-12-07 3 views
0

Comment puis-je activer l'authentification en utilisant jmx sur l'application Web de printemps?spring jmx authentication

+1

C'est beaucoup trop vague. Vous devrez faire mieux que cela si vous ne voulez pas être ignoré. – skaffman

Répondre

0

S'il vous plaît jeter un oeil ici pour une solution qui fonctionne presque pour moi:

http://forum.springsource.org/showthread.php?t=73677

La seule question non résolue est de savoir comment faire client JMX utiliser la même connexion au serveur lors de l'authentification et lorsque vous effectuez la opération sécurisée.

0
<bean id="serverConnector" class="org.springframework.jmx.support.ConnectorServerFactoryBean"> 
    <property name="objectName" value="connector:name=rmi" /> 
    <property name="serviceUrl" value="service:jmx:rmi:///jndi/rmi://:9875/jmxrmi" /> 
    <property name="environment"> 
     <map> 
      <entry key="jmx.remote.x.password.file" value="C:\Java\jdk1.7.0_79\jre\lib\management\jmxremote.password" /> 
      <entry key="jmx.remote.x.access.file" value="C:\Java\jdk1.7.0_79\jre\lib\management\jmxremote.access" /> 
     </map> 
    </property> 
</bean> 
+0

Pourriez-vous donner quelques explications à votre réponse? – bish

+0

Veuillez mettre quelques explications à OP pour votre code. –

0

SpringConfig

<bean id="annotationTestMBean" class="com.greenline.appservice.web.bean.AnnotationTestMBean"/> 

<!-- Spring JMX 配置 begin --> 
<bean id="registry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean"> 
    <property name="port" value="9875" /> 
    <property name="alwaysCreate" value="true" /> 
</bean> 
<bean id="serverConnector" class="org.springframework.jmx.support.ConnectorServerFactoryBean"> 
    <property name="objectName" value="connector:name=rmi" /> 
    <property name="serviceUrl" value="service:jmx:rmi:///jndi/rmi://192.168.214.63:9875/myconnector" /> 
    <!--jmxmp协议 
    <property name="objectName" value="connector:name=jmxmp" /> 
    <property name="serviceUrl" value="service:jmx:jmxmp://192.168.214.63:9875" /> 
    --> 
    <property name="environment"> 
     <!-- the following is only valid when the sun jmx implementation is used --> 
     <map> 
      <entry key="jmx.remote.x.password.file" value="C:\Java\jdk1.7.0_79\jre\lib\management\jmxremote.password" /> 
      <entry key="jmx.remote.x.access.file" value="C:\Java\jdk1.7.0_79\jre\lib\management\jmxremote.access" /> 
     </map> 
    </property> 
</bean> 
<context:mbean-export registration="replaceExisting"/> 
<!-- Spring JMX 配置 end--> 

vous pouvez voir l'accès & fichier de mot de passe JDK_PATH \ jre \ lib \ gestion \ jmxremote.password JDK_PATH \ jre \ lib \ gestion \ jmxremote.access

JMX et Spring Part1-3 http://www.javacodegeeks.com/2012/07/jmx-and-spring-part-1.html

oracl Applications e-Remote Management (jmx) http://docs.oracle.com/cd/E19698-01/816-7609/6mdjrf861/index.html