我开始使用Wildfly 8和Maven,但遇到了问题。

我需要进行xa数据源部署。为此,我使用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]


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

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

最佳答案

此问题已在1.0.2.Final中修复。还要注意,child resources应该如何用于XA数据源,因为它们需要在添加过程中定义的属性。

08-18 13:20