Wildfly Maven插件不部署xa-datasource

时间:2014-03-20 12:39:06

标签: java maven datasource wildfly xa

我开始使用wildfly 8和maven,但我有一个问题。

我需要进行xa-datasource部署。为此,我使用了wildfly maven插件,你可以看到下面的配置:

<profiles>
        <profile>
            <id>wildfly-deploy-postgres-ds</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.wildfly.plugins</groupId>
                        <artifactId>wildfly-maven-plugin</artifactId>
                        <version>1.0.1.Final</version>
                        <executions>
                            <execution>
                                <id>deploy-postgresql</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>deploy-artifact</goal>
                                </goals>
                                <configuration>
                                    <groupId>postgresql</groupId>
                                    <artifactId>postgresql</artifactId>
                                    <name>postgresql.jar</name>
                                </configuration>
                            </execution>
                            <execution>
                                <id>add-datasource</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>add-resource</goal>
                                </goals>
                                <configuration>
                                    <address>subsystem=datasources</address>
                                    <resources>
                                        <resource>
                                            <address>xa-data-source=java:jboss/datasources/postgresDS</address>
                                            <properties>
                                                <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
                                                <jndi-name>java:jboss/datasources/postgresDS</jndi-name>
                                                <enabled>true</enabled>
                                                <driver-name>postgresql.jar</driver-name>
                                            </properties>
                                        </resource>
                                        <resource>
                                            <address>xa-data-source=java:jboss/datasources/postgresDS,xa-datasource-properties=DatabaseName</address>
                                            <properties>
                                                <value>logrdb</value>
                                            </properties>
                                        </resource>
                                        <resource>
                                            <address>xa-data-source=java:jboss/datasources/postgresDS,xa-datasource-properties=ServerName</address>
                                            <properties>
                                                <value>localhost</value>
                                            </properties>
                                        </resource>
                                        <resource>
                                            <address>xa-data-source=java:jboss/datasources/postgresDS,xa-datasource-properties=User</address>
                                            <properties>
                                                <value>logr</value>
                                            </properties>
                                        </resource>
                                        <resource>
                                            <address>xa-data-source=java:jboss/datasources/postgresDS,xa-datasource-properties=Password</address>
                                            <properties>
                                                <value>logr</value>
                                            </properties>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

在shell中执行配置文件:

mvn clean install -X -P wildfly-deploy-postgres-ds

收到这个错误:

[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.1.Final:add-resource (add-datasource) on project xya: Could not execute goal add-resource. Reason: null: IllegalArgumentException -> [Help 1]

您可以在此处查看完整的调试日志&gt; http://pastebin.com/QhvHUnc0

有谁知道这个问题的根源?谢谢!

1 个答案:

答案 0 :(得分:0)

这已在1.0.2.Final中修复。另请注意,child resources应如何用于XA数据源,因为它们需要在添加期间定义的属性。