2017-11-14 29 views
1

jboss-as-7.1.1의 데이터 소스 하위 시스템을 통해 데이터 소스를 구성하려고합니다. Mac에 설치된 최종 서버 V 10.13.1 이미 제공 한 JDBC 드라이버jboss-as-7.1.1.Final에 데이터 소스 추가

그래서 나는 파일 standalone.xml

<server xmlns="urn:jboss:domain:1.2"> 

    <datasources> 
    <datasource jndi-name="java:jboss/datasources/MySqlDS" pool-name="MySqlDS"> 
     <connection-url>jdbc:mysql://localhost:3306/EJB3</connection-url> 
     <driver>com.mysql</driver> 
     <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation> 
     <pool> 
     <min-pool-size>10</min-pool-size> 
     <max-pool-size>100</max-pool-size> 
     <prefill>true</prefill> 
     </pool> 
     <security> 
     <user-name>test</user-name> 
     <password>test</password> 
     </security> 
     <statement> 
     <prepared-statement-cache-size>32</prepared-statement-cache-size> 
     <share-prepared-statements/> 
     </statement> 
    </datasource> 
    <drivers> 
     <driver name="com.mysql" module="com.mysql"> 
     <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class> 
     </driver> 
    </drivers> 
</datasources> 

    <extensions> 
     ... 
</server> 

에이 코드 조각을 추가하지만 실행할 때 serverI이 오류가있어 :

14:28:35,894 ERROR [org.jboss.as.server] JBAS015956: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration 
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:141) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.as.server.ServerService.boot(ServerService.java:266) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:155) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final] 
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_75] 
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[5,5] 
Message: JBAS014789: Unexpected element '{urn:jboss:domain:1.2}datasources' encountered 
    at org.jboss.as.controller.parsing.ParseUtils.unexpectedElement(ParseUtils.java:85) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_1(StandaloneXml.java:351) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:127) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:100) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final.jar:1.1.0.Final] 
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final] 
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:133) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final] 
    ... 3 more 

답변

2

standalone.xml 답답를 eady에는 데이터 소스 섹션이 있습니다.

너는 <subsystem xmlns="urn:jboss:domain:datasources:1.0"> 섹션을 찾아 거기에 더한다.