2014-01-09 28 views
0

當我嘗試添加我的應用程序所需的XA數據源時,我遇到了使用jboss-as-maven-plugin執行此maven構建的問題。使用jboss-as-maven-plugin添加XA數據源失敗

錯誤信息非常不友好。添加MySQL驅動程序後,執行命令來添加數據源,與消息失敗:

Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.5.Final:add-resource (add-xa-datasource) on project great-ear: Could not execute goal add-resource. Reason: null 

這根例外,在我pom.xml

被拋出

Caused by: java.lang.IllegalArgumentException 
    at org.jboss.dmr.ModelValue.asList(ModelValue.java:128) 
    at org.jboss.dmr.ModelNode.asList(ModelNode.java:1205) 
    at org.jboss.as.plugin.deployment.resource.AddResource.resourceExists(AddResource.java:289) 
    at org.jboss.as.plugin.deployment.resource.AddResource.addCompositeResource(AddResource.java:208) 
    at org.jboss.as.plugin.deployment.resource.AddResource.processResources(AddResource.java:176) 
    at org.jboss.as.plugin.deployment.resource.AddResource.execute(AddResource.java:139) 
    ... 21 more 

下面給出的插件聲明

 <plugin> 
      <groupId>org.jboss.as.plugins</groupId> 
      <artifactId>jboss-as-maven-plugin</artifactId> 
      <version>7.5.Final</version> 

      <executions> 
       <!-- Undeploy the application on clean --> 
       <execution> 
        <id>undeploy</id> 
        <phase>clean</phase> 
        <goals> 
         <goal>undeploy</goal> 
        </goals> 
        <configuration> 
         <ignoreMissingDeployment>true</ignoreMissingDeployment> 
        </configuration> 
       </execution> 

       <!-- Deploy the JDBC library --> 
       <execution> 
        <id>deploy-driver</id> 
        <phase>install</phase> 
        <configuration> 
         <groupId>mysql</groupId> 
         <artifactId>mysql-connector-java</artifactId> 
         <name>mysql</name> 
        </configuration> 
        <goals> 
         <goal>deploy-artifact</goal> 
        </goals> 
       </execution> 


       <!-- Add an XA datasource --> 
       <execution> 
        <id>add-xa-datasource</id> 
        <phase>package</phase> 
        <goals> 
         <goal>add-resource</goal> 
        </goals> 
        <configuration> 
         <address>subsystem=datasources</address> 
         <resources> 
          <resource> 
           <address>xa-data-source=RequiredDS</address> 
           <enableResource>true</enableResource> 
           <properties> 
            <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class> 
            <jndi-name>java:jboss/datasources/RequiredDS</jndi-name> 
            <use-java-context>true</use-java-context> 
            <enabled>true</enabled> 
            <driver-name>mysql</driver-name> 
            <idle-timeout-minutes>0</idle-timeout-minutes> 
            <query-timeout>600</query-timeout> 
            <share-prepared-statements>true</share-prepared-statements> 
           </properties> 
           <resources> 
            <resource> 
             <address>xa-datasource-properties=DatabaseName</address> 
             <properties> 
              <value>schema</value> 
             </properties> 
            </resource> 
            <resource> 
             <address>xa-datasource-properties=ServerName</address> 
             <properties> 
              <value>localhost:3306</value> 
             </properties> 
            </resource> 
            <resource> 
             <address>xa-datasource-properties=User</address> 
             <properties> 
              <value>root</value> 
             </properties> 
            </resource> 
            <resource> 
             <address>xa-datasource-properties=Password</address> 
             <properties> 
              <value>root</value> 
             </properties> 
            </resource> 
           </resources> 
          </resource> 
         </resources> 
        </configuration> 
       </execution> 



       <!-- Deploy the application on install --> 
       <execution> 
        <id>deploy</id> 
        <phase>install</phase> 
        <goals> 
         <goal>deploy</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 

我執行以下目標的maven項目:jboss-as:start install

回答

1

這是一個錯誤,將在7.6.Final中修復。