2016-09-30 4 views
1

Ich versuche, eine Datenquelle in Wildfly 10 zu schaffen, um eine Verbindung mit einer PostgreSQL 9.5-Datenbank, sah ich bereits einige Tutorials im Internet und noch kann ich es nicht tun.Probleme beim Erstellen von Wildfly 10 Datenquelle

Wenn jemand mir helfen kann, werde ich sehr dankbar sein.

Dies ist die Fehlermeldung: enter code here

9:06:46,300 ERROR [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-6) Error during the deployment of java:jboss/datasources/CiberWebCopierDS: javax.resource.ResourceException: IJ031103: At least one connection property must be defined for datasource-class: org.postgresql.Driver 
    at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createConnectionFactory(LocalManagedConnectionFactory.java:108) 
    at org.jboss.jca.deployers.common.AbstractDsDeployer.deployDataSource(AbstractDsDeployer.java:772) 
    at org.jboss.jca.deployers.common.AbstractDsDeployer.createObjectsAndInjectValue(AbstractDsDeployer.java:312) 
    at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer.deploy(AbstractDataSourceService.java:371) 
    at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:149) 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 

19:06:46,305 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service org.wildfly.data-source.CiberWebCopierDS: org.jboss.msc.service.StartException in service org.wildfly.data-source.CiberWebCopierDS: WFLYJCA0033: Error during the deployment of CiberWebCopierDS 
    at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:163) 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: org.jboss.msc.service.StartException in anonymous service: WFLYJCA0032: Unable to start the ds because it generated more than one cf 
    at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:151) 
    ... 5 more 

und diese

19:06:47,988 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([ 
    ("subsystem" => "datasources"), 
    ("data-source" => "CiberWebCopierDS") 
]) - failure description: { 
    "WFLYCTL0080: Failed services" => {"org.wildfly.data-source.CiberWebCopierDS" => "org.jboss.msc.service.StartException in service org.wildfly.data-source.CiberWebCopierDS: WFLYJCA0033: Error during the deployment of CiberWebCopierDS 
    Caused by: org.jboss.msc.service.StartException in anonymous service: WFLYJCA0032: Unable to start the ds because it generated more than one cf"}, 
    "WFLYCTL0412: Required services that are not installed:" => ["org.wildfly.data-source.CiberWebCopierDS"], 
    "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined 
} 
19:06:47,990 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([ 
    ("subsystem" => "datasources"), 
    ("data-source" => "CiberWebCopierDS") 
]) - failure description: { 
    "WFLYCTL0080: Failed services" => {"org.wildfly.data-source.CiberWebCopierDS" => "org.jboss.msc.service.StartException in service org.wildfly.data-source.CiberWebCopierDS: WFLYJCA0033: Error during the deployment of CiberWebCopierDS 
    Caused by: org.jboss.msc.service.StartException in anonymous service: WFLYJCA0032: Unable to start the ds because it generated more than one cf"}, 
    "WFLYCTL0412: Required services that are not installed:" => [ 
     "org.wildfly.data-source.CiberWebCopierDS", 
     "org.wildfly.data-source.CiberWebCopierDS" 
    ], 
    "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined 
} 
19:06:48,017 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report 
WFLYCTL0186: Services which failed to start: service org.wildfly.data-source.CiberWebCopierDS: org.jboss.msc.service.StartException in service org.wildfly.data-source.CiberWebCopierDS: WFLYJCA0033: Error during the deployment of CiberWebCopierDS. 

Dies ist, wie ich die module.xml

<?xml version="1.0" encoding="UTF-8"?> 
<module xmlns="urn:jboss:module:1.3" name="com.h2database.h2"> 
    <resources> 
     <resource-root path="h2-1.3.173.jar"/> 
    </resources> 
    <dependencies> 
     <module name="javax.api"/> 
     <module name="javax.transaction.api"/> 
     <module name="javax.servlet.api" optional="true"/> 
    </dependencies> 
</module> 

dies ist die Treiberdefinition zu erstellen:

<driver name="postgres" module="org.postgresql"> 
    <datasource-class>org.postgresql.Driver</datasource-class> 
</driver> 

und dies ist die Datenquelle Definition:

<datasource jndi-name="java:jboss/datasources/CiberWebCopierDS" enabled="true" use-java-context="true" pool-name="CiberWebCopierDS"> 
    <connection-rl>jdbc:postgresql://localhost:5432/CiberWebCopierDB</connection- url> 
    <driver>postgres</driver> 
    <security> 
     <user-name>postgres</user-name> 
     <password>postgresql</password> 
    </security> 
</datasource 

>

Antwort

1

Die module.xml vorausgesetzt, Sie ist nicht für Postgres, ist es für eine h2-Datenbank ..

Versuchen Sie das folgende Modul Vergessen Sie nicht, den Treiber "postrgres" herunterzuladen, platzieren Sie ihn in modules/org/postgresql/main und ändern Sie "postgresql-YX-Z.jdbcV.jar" in den Namen des heruntergeladenen Treibers.

Der Rest Ihrer Konfiguration sieht gut aus, aber ich bin nicht so sicher über die Einstellung Datenquelle-Klasse in der Treiber-Abschnitt, ich denke, das geht in der Datenquellen-Deklaration mit Fahrer-Klasse-Element.

Fazit:

module.xml

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

Treiber Definition

<driver name="postgres" module="org.postgresql"/> 

Datenquelle Definition

<datasource jndi-name="java:jboss/datasources/CiberWebCopierDS" enabled="true" use-java-context="true" pool-name="CiberWebCopierDS"> 
    <connection-url>jdbc:postgresql://localhost:5432/CiberWebCopierDB</connection-url> 
    <driver-class>org.postgresql.Driver</driver-class> 
    <driver>postgres</driver> 
    <security> 
     <user-name>postgres</user-name> 
     <password>postgresql</password> 
    </security> 
</datasource> 

EDIT: Als Randbemerkung, ich glaube, wenn du willst o Deklarieren Sie die Datenquellenklasse im Treiberabschnitt. Sie müssen das xa-datasource-class-Element anstelle der Datenquellenklasse verwenden. Sie können es bei Bedarf auch ausprobieren.

Verwandte Themen