Wildfly DuplicateServiceException

前端 未结 3 470
忘了有多久
忘了有多久 2021-01-04 07:05

I have created simple EAR application using Maven archetype: wildfly-javaee7-webapp-ear-blank-archetype/8.2.0.Final

http://s17.postimg.org/cy8zbpiu7/Zrzut_ekranu_z_2

相关标签:
3条回答
  • 2021-01-04 07:15

    It's simple. You was registered Datasource twice - in server config (check standalone.xml) and in Przychodnia-ds.xml. Would you like to prefer only one place.

    0 讨论(0)
  • 2021-01-04 07:19

    I think that the problem here is about the dupplication of the datasource entries

    Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.data-source.java:jboss/datasources/PostgreSql/Przychodnia is already registered
    

    have a look on this post Advanced JAX-WS Security with Wildfly step by step

    try to find standalone.xml located in %WILDFLY_HOME%/standalone/configuration

    <subsystem xmlns="urn:jboss:domain:datasources:2.0">
    <datasources>
    <datasource jta="true" jndi-name="java:jboss/datasources/PostgreSql/Przychodnia" pool-name="ecoleDS" enabled="true" use-ccm="true">
        <connection-url>jdbc:postgresql://localhost:5432/Przychodnia</connection-url>
        <driver-class>com.mysql.jdbc.Driver</driver-class>
        <driver>your postgres-connector</driver>
        <security>
            <user-name></user-name>
            <password>****</password>
        </security>
        <validation>
            <validate-on-match>false</validate-on-match>
            <background-validation>false</background-validation>
        </validation>
        <timeout>
            <set-tx-query-timeout>false</set-tx-query-timeout>
            <blocking-timeout-millis>0</blocking-timeout-millis>
            <idle-timeout-minutes>0</idle-timeout-minutes>
            <query-timeout>0</query-timeout>
            <use-try-lock>0</use-try-lock>
            <allocation-retry>0</allocation-retry>
            <allocation-retry-wait-millis>0</allocation-retry-wait-millis>
        </timeout>
        <statement>
            <share-prepared-statements>false</share-prepared-statements>
        </statement>
    </datasource>
    

    0 讨论(0)
  • 2021-01-04 07:27

    in your ../wildfly-X.X.X/standalone/configuration/standalone.xml you'll se the following:

    <deployments>
        <deployment name="your_file.war" runtime-name="your_file.war">
            <fs-archive path=".../your_file.war"/>
        </deployment>
        ...
    </deployments>
    

    This causes the DuplicateServiceException. Just remove it.

    0 讨论(0)
提交回复
热议问题