2017-08-10 15 views
0

端末でサービスを実行しようとしています。それはほとんどOKです、ちょうど欠けているデフォルトのデータソースのエラーはGoogleで多くの研究の後でさえまだそこにあります。私はWildfly&Postgre:デフォルトのデータソースの問題がありません

を説明しましょう、私はこれはこれはdefaul結合

が含まれている一部のOSのstandalone.xmlあるstandalone.xmlに

<datasources> 
    <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true"> 
     <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url> 
     <driver>h2</driver> 
     <security> 
      <user-name>sa</user-name> 
      <password>sa</password> 
     </security> 
    </datasource> 
    <datasource jta="true" jndi-name="java:jboss/datasources/PostgreSQLDS" pool-name="PostgreSQLDS" enabled="true" use-java-context="true"> 
     <connection-url>jdbc:postgresql://localhost:5432/lucasmucida</connection-url> 
     <driver>postgresql</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>xxx</user-name> 
      <password>xxx</password> 
     </security> 
     <statement> 
      <prepared-statement-cache-size>32</prepared-statement-cache-size> 
      <share-prepared-statements>true</share-prepared-statements> 
     </statement> 
    </datasource> 
    <drivers> 
     <driver name="h2" module="com.h2database.h2"> 
      <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class> 
     </driver> 
     <driver name="postgresql" module="org.postgresql"> 
      <xa-datasource-class>org.postgresql.xa.PGXADataSourc</xa-datasource-class> 
     </driver> 
    </drivers> 
</datasources> 

私のデータソースであるwildfly 10.1.0

を使用しています

<subsystem xmlns="urn:jboss:domain:ee:4.0"> 
       <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement> 
       <concurrent> 
        <context-services> 
         <context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" use-transaction-setup-provider="true"/> 
        </context-services> 
        <managed-thread-factories> 
         <managed-thread-factory name="default" jndi-name="java:jboss/ee/concurrency/factory/default" context-service="default"/> 
        </managed-thread-factories> 
        <managed-executor-services> 
         <managed-executor-service name="default" jndi-name="java:jboss/ee/concurrency/executor/default" context-service="default" hung-task-threshold="60000" keepalive-time="5000"/> 
        </managed-executor-services> 
        <managed-scheduled-executor-services> 
         <managed-scheduled-executor-service name="default" jndi-name="java:jboss/ee/concurrency/scheduler/default" context-service="default" hung-task-threshold="60000" keepalive-time="3000"/> 
        </managed-scheduled-executor-services> 
       </concurrent> 
       <default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/lucasmucida" jms-connection-factory="java:jboss/DefaultJMSConnectionFactory" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/> 
      </subsystem> 

この は/モジュール/システム/層/ベース/ ORG/postgresqlの/メインフォルダ内にある私のmodule.xmlです

<?xml version="1.0" encoding="UTF-8"?> 
<module xmlns="urn:jboss:module:1.0" name="org.postgresql"> 
    <resources> 
    <resource-root path="postgresql-42.1.4.jar"/> 
    </resources> 
    <dependencies> 
    <module name="javax.api"/> 
    <module name="javax.transaction.api"/> 
    </dependencies> 
</module> 

私はshを実行する場合standalone.shそれはlucasmucidaデータベースでも、テーブルを作成しますが、エラー:

17:38:49,984 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "jpa2-1.0-SNAPSHOT.war")]) - failure description: { 
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.datasources.lucasmucida"], 
    "WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.\"jpa2-1.0-SNAPSHOT\".\"jpa2-1.0-SNAPSHOT\".DefaultDataSource is missing [jboss.naming.context.java.jboss.datasources.lucasmucida]"] 
} 
17:38:49,988 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "testeJava-1.0-SNAPSHOT.war")]) - failure description: { 
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.datasources.lucasmucida"], 
    "WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.\"testeJava-1.0-SNAPSHOT\".\"testeJava-1.0-SNAPSHOT\".DefaultDataSource is missing [jboss.naming.context.java.jboss.datasources.lucasmucida]"] 
} 

は私は、NetBeans上でそれを実行することはできません。プロジェクトを実行すると、テーブルが作成されますが、プロジェクトは展開および開始されません。

私がlocalhost:9090に行き、接続をテストすると、両方のデータソースが正常に接続しています。

私はここで何が欠けていますか?

+0

でdriver.jarを置く:JBossの:ドメイン:EE:4.0'スタンドアロンでのサブシステムを。 xml?これをどのように設定したかによって、デフォルトのバインディングの 'datasource'パラメータが削除されている可能性があります。 – stdunbar

+0

私はmny postをdefault-bindings設定で編集しました。何か問題があるかどうかわかりません – Mucida

+0

デフォルトバインディングを 'java:jboss/datasources/ExampleDS'のデフォルトのデータソースに戻してみてください。とにかくそれを変更する必要はありません。 – stdunbar

答えて

0

ちょうどあなたが `壷の内側にあなたの`デフォルト-binding`設定を確認することができ、あなたのmodule.xml場所

+0

このjar "postgresql-42.1.4.jar"はすでにそこにあります= – Mucida

関連する問題