2014-12-29 3 views
0

JBoss 4.2.3에서 실행해야하는 프로젝트에서 작업 중이며 외부 리소스로 .properties 파일이 있어야합니다. JBossAS 7을 사용하여이를 수행하는 방법에 대한 간단한 설명을 발견했습니다. custom JNDI resource of type java.util.Properties 그러나이 튜토리얼은 \ configuration \ standalone.xml 구성 파일을 사용하며이 파일은 jboss AS 4.2.3에 없습니다. 어떤 조언을 찾고, 감사합니다!jboss 4 java.util.Properties 유형의 JNDI 리소스

답변

1

jboss 4.2.3은 jndi에 등록 정보 객체를 배포하는 것을 지원합니다. 그렇게하면 jndi 바인딩 서비스 관리자가 사용됩니다. XX-service.xml 파일을 만들어 deploy 폴더에 저장합니다. 예시 JNDI-service.xml이다 :

<?xml version="1.0" encoding="UTF-8"?> 
 
<!DOCTYPE server PUBLIC "-//JBoss//DTD MBean Service 4.0//EN" 
 
      "http://www.jboss.org/j2ee/dtd/jboss-service_4_0.dtd"> 
 
<server> 
 
    <mbean code="org.jboss.naming.JNDIBindingServiceMgr" 
 
     name="jboss.tests:service=JNDIBindingServiceMgr"> 
 
     <attribute name="BindingsConfig" serialDataType="jbxb"> 
 
     <jndi:bindings 
 
      xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" 
 
      xmlns:jndi="urn:jboss:jndi-binding-service:1.0" 
 
      xs:schemaLocation="urn:jboss:jndi-binding-service:1.0 resource:jndi-binding-service_1_0.xsd" 
 
      > 
 
      <jndi:binding name="urls/jboss-home"> 
 
       <jndi:value type="java.net.URL">http://www.jboss.org</jndi:value> 
 
      </jndi:binding> 
 

 
      <jndi:binding name="hosts/localhost"> 
 
       <jndi:value editor="org.jboss.util.propertyeditor.InetAddressEditor"> 
 
        127.0.0.1 
 
       </jndi:value> 
 
      </jndi:binding> 
 

 
      <jndi:binding name="maps/testProps"> 
 
       <java:properties xmlns:java="urn:jboss:java-properties" 
 
        xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" 
 
        xs:schemaLocation="urn:jboss:java-properties resource:java-properties_1_0.xsd"> 
 
        <java:property> 
 
        <java:key>key1</java:key> 
 
        <java:value>value1</java:value> 
 
        </java:property> 
 
        <java:property> 
 
        <java:key>key2</java:key> 
 
        <java:value>value2</java:value> 
 
        </java:property> 
 
       </java:properties>    
 
      </jndi:binding> 
 
     </jndi:bindings> 
 
     </attribute> 
 
     <depends>jboss:service=Naming</depends> 
 
    </mbean> 
 

 
</server>

https://developer.jboss.org/wiki/JNDIBindingServiceMgr

참조
관련 문제