[英]WildFly 10 with PostgreSQL 9.4 datasource Error deploying application
我在Tomcat和Oracle或MySQL方面有很多經驗。 這是我第一次使用WildFly
和PostgreSQL
。 花了一些時間讓WildFly設置為我的PostgreSQL數據庫正確添加數據源。
但現在已經存在,我可以在WildFly管理面板上成功測試連接。 現在,當我嘗試部署並啟動我的EAR時,它失敗了, 在“org.postgresql:main”上找不到模塊 。
似乎問題出在數據源上。 可能有一個jar文件丟失了嗎? 希望有人能指導我完成這件事。
我有WildFly v10.0.0.Final和PostgreSQL v9.4。
在我的WildFly安裝中,我在PostgreSQL文件的模塊下創建了目錄。 結構是modules/org/postgres/main
我有一個module.xml
文件和該目錄中引用的jar文件。
在module.xml
包含:
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="org.postgres">
<resources>
<resource-root path="postgresql-9.4.1208.jre7.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
在standalone.xml
我有以下數據源代碼。
<xa-datasource jndi-name="java:jboss/datasources/GUN88_DS" pool-name="java:jboss/datasources/GUN88_DS" enabled="true">
<xa-datasource-property name="DatabaseName">gun88</xa-datasource-property>
<xa-datasource-property name="ServerName">localhost</xa-datasource-property>
<xa-datasource-property name="PortNumber">5432</xa-datasource-property>
<xa-datasource-property name="User">gunner</xa-datasource-property>
<xa-datasource-property name="Password">abcxyz</xa-datasource-property>
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<driver>postgres</driver>
</xa-datasource>
和
<driver name="postgres" module="org.postgres">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
在persistence.xml
包含
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1"
xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="GUN88_DS">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>java:jboss/datasources/GUN88_DS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.cache.default_cache_concurrency_strategy"
value="nonstrict-read-write" />
<!-- property name="hibernate.cache.region.factory_class"
value="org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory" / -->
<property name="hibernate.max_fetch_depth" value="1" />
</properties>
</persistence-unit>
</persistence>
當我部署EAR文件然后嘗試啟動WildFly時,我得到以下內容:
2016-08-19 12:21:06,363 INFO [org.jboss.modules] (main) JBoss Modules version 1.5.1.Final
2016-08-19 12:21:06,617 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
2016-08-19 12:21:06,701 INFO [org.jboss.as] (MSC service thread 1-8) WFLYSRV0049: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) starting
2016-08-19 12:21:06,703 DEBUG [org.jboss.as.config] (MSC service thread 1-8) Configured system properties:
awt.toolkit = sun.awt.windows.WToolkit
file.encoding = Cp1252
file.encoding.pkg = sun.io
file.separator = \
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.awt.printerjob = sun.awt.windows.WPrinterJob
java.class.path = C:\wildfly-10.0.0.Final\jboss-modules.jar
java.class.version = 52.0
java.endorsed.dirs = C:\Program Files\Java\jdk1.8.0_101\jre\lib\endorsed
java.ext.dirs = C:\Program Files\Java\jdk1.8.0_101\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
java.home = C:\Program Files\Java\jdk1.8.0_101\jre
java.io.tmpdir = C:\Users\gunner\AppData\Local\Temp\
java.library.path = C:\Program Files\Java\jdk1.8.0_101\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\ActiveState Komodo Edit 10\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Symantec.cloud\PlatformAgent\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\apache-maven-3.3.9/bin;.;;.
java.net.preferIPv4Stack = true
java.runtime.name = Java(TM) SE Runtime Environment
java.runtime.version = 1.8.0_101-b13
java.specification.name = Java Platform API Specification
java.specification.vendor = Oracle Corporation
java.specification.version = 1.8
java.util.logging.manager = org.jboss.logmanager.LogManager
java.vendor = Oracle Corporation
java.vendor.url = http://java.oracle.com/
java.vendor.url.bug = http://bugreport.sun.com/bugreport/
java.version = 1.8.0_101
java.vm.info = mixed mode
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Oracle Corporation
java.vm.specification.version = 1.8
java.vm.vendor = Oracle Corporation
java.vm.version = 25.101-b13
javax.management.builder.initial = org.jboss.as.jmx.PluggableMBeanServerBuilder
javax.xml.datatype.DatatypeFactory = __redirected.__DatatypeFactory
javax.xml.parsers.DocumentBuilderFactory = __redirected.__DocumentBuilderFactory
javax.xml.parsers.SAXParserFactory = __redirected.__SAXParserFactory
javax.xml.stream.XMLEventFactory = __redirected.__XMLEventFactory
javax.xml.stream.XMLInputFactory = __redirected.__XMLInputFactory
javax.xml.stream.XMLOutputFactory = __redirected.__XMLOutputFactory
javax.xml.transform.TransformerFactory = __redirected.__TransformerFactory
javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema = __redirected.__SchemaFactory
javax.xml.xpath.XPathFactory:http://java.sun.com/jaxp/xpath/dom = __redirected.__XPathFactory
jboss.home.dir = C:\wildfly-10.0.0.Final
jboss.host.name = lex-gunner
jboss.modules.dir = C:\wildfly-10.0.0.Final\modules
jboss.modules.system.pkgs = org.jboss.byteman
jboss.node.name = lex-gunner
jboss.qualified.host.name = lex-gunner
jboss.server.base.dir = C:\wildfly-10.0.0.Final\standalone
jboss.server.config.dir = C:\wildfly-10.0.0.Final\standalone\configuration
jboss.server.data.dir = C:\wildfly-10.0.0.Final\standalone\data
jboss.server.deploy.dir = C:\wildfly-10.0.0.Final\standalone\data\content
jboss.server.log.dir = C:\wildfly-10.0.0.Final\standalone\log
jboss.server.name = lex-gunner
jboss.server.persist.config = true
jboss.server.temp.dir = C:\wildfly-10.0.0.Final\standalone\tmp
line.separator =
logging.configuration = file:C:\wildfly-10.0.0.Final\standalone\configuration/logging.properties
module.path = C:\wildfly-10.0.0.Final\modules
org.jboss.boot.log.file = C:\wildfly-10.0.0.Final\standalone\log\server.log
org.jboss.resolver.warning = true
org.xml.sax.driver = __redirected.__XMLReaderFactory
os.arch = amd64
os.name = Windows 7
os.version = 6.1
path.separator = ;
program.name = standalone.bat
sun.arch.data.model = 64
sun.boot.class.path = C:\Program Files\Java\jdk1.8.0_101\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_101\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_101\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_101\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_101\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_101\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_101\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_101\jre\classes
sun.boot.library.path = C:\Program Files\Java\jdk1.8.0_101\jre\bin
sun.cpu.endian = little
sun.cpu.isalist = amd64
sun.desktop = windows
sun.io.unicode.encoding = UnicodeLittle
sun.java.command = C:\wildfly-10.0.0.Final\jboss-modules.jar -mp C:\wildfly-10.0.0.Final\modules org.jboss.as.standalone -Djboss.home.dir=C:\wildfly-10.0.0.Final
sun.java.launcher = SUN_STANDARD
sun.jnu.encoding = Cp1252
sun.management.compiler = HotSpot 64-Bit Tiered Compilers
sun.os.patch.level = Service Pack 1
sun.stderr.encoding = cp437
sun.stdout.encoding = cp437
user.country = US
user.dir = C:\wildfly-10.0.0.Final\bin
user.home = C:\Users\gunner
user.language = en
user.name = gunner
user.script =
user.timezone = America/New_York
user.variant =
2016-08-19 12:21:06,704 DEBUG [org.jboss.as.config] (MSC service thread 1-8) VM Arguments: -Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Dorg.jboss.boot.log.file=C:\wildfly-10.0.0.Final\standalone\log\server.log -Dlogging.configuration=file:C:\wildfly-10.0.0.Final\standalone\configuration/logging.properties
2016-08-19 12:21:08,504 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0015: Re-attempting failed deployment gun88-ear-7.0.0.ear
2016-08-19 12:21:09,605 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found gun88-ear-7.0.0.ear in deployment directory. To trigger deployment create a file called gun88-ear-7.0.0.ear.dodeploy
2016-08-19 12:21:09,627 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
2016-08-19 12:21:09,649 INFO [org.xnio] (MSC service thread 1-7) XNIO version 3.3.4.Final
2016-08-19 12:21:09,658 INFO [org.xnio.nio] (MSC service thread 1-7) XNIO NIO Implementation Version 3.3.4.Final
2016-08-19 12:21:09,695 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 38) WFLYCLINF0001: Activating Infinispan subsystem.
2016-08-19 12:21:09,725 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 33) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
2016-08-19 12:21:09,733 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 54) WFLYTX0013: Node identifier property is set to the default value. Please make sure it is unique.
2016-08-19 12:21:09,750 INFO [org.jboss.as.security] (ServerService Thread Pool -- 53) WFLYSEC0002: Activating Security Subsystem
2016-08-19 12:21:09,761 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 46) WFLYNAM0001: Activating Naming Subsystem
2016-08-19 12:21:09,775 INFO [org.wildfly.extension.io] (ServerService Thread Pool -- 37) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on your 4 available processors
2016-08-19 12:21:09,787 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 33) WFLYJCA0005: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 9.4)
2016-08-19 12:21:09,821 INFO [org.jboss.as.security] (MSC service thread 1-5) WFLYSEC0001: Current PicketBox version=4.9.4.Final
2016-08-19 12:21:09,824 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 44) WFLYJSF0007: Activated the following JSF Implementations: [main]
2016-08-19 12:21:09,824 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 56) WFLYWS0002: Activating WebServices Extension
2016-08-19 12:21:09,861 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0003: Undertow 1.3.15.Final starting
2016-08-19 12:21:09,863 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0003: Undertow 1.3.15.Final starting
2016-08-19 12:21:09,888 INFO [org.jboss.as.connector] (MSC service thread 1-3) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.3.2.Final)
2016-08-19 12:21:09,902 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) WFLYJCA0018: Started Driver service with driver-name = postgres
2016-08-19 12:21:09,903 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) WFLYJCA0018: Started Driver service with driver-name = h2
2016-08-19 12:21:09,904 INFO [org.jboss.as.naming] (MSC service thread 1-5) WFLYNAM0003: Starting Naming Service
2016-08-19 12:21:09,916 INFO [org.jboss.as.mail.extension] (MSC service thread 1-5) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
2016-08-19 12:21:10,086 INFO [org.jboss.as.ejb3] (MSC service thread 1-1) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 64 (per class), which is derived from thread worker pool sizing.
2016-08-19 12:21:10,099 INFO [org.jboss.as.ejb3] (MSC service thread 1-5) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 16 (per class), which is derived from the number of CPUs on this host.
2016-08-19 12:21:10,124 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0014: Creating file handler for path 'C:\wildfly-10.0.0.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
2016-08-19 12:21:10,899 INFO [org.jboss.remoting] (MSC service thread 1-7) JBoss Remoting version 4.0.18.Final
2016-08-19 12:21:10,910 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0012: Started server default-server.
2016-08-19 12:21:10,917 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0018: Host default-host starting
2016-08-19 12:21:11,000 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
2016-08-19 12:21:11,237 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) WFLYDS0013: Started FileSystemDeploymentService for directory C:\wildfly-10.0.0.Final\standalone\deployments
2016-08-19 12:21:11,279 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0027: Starting deployment of "gun88-ear-7.0.0.ear" (runtime-name: "gun88-ear-7.0.0.ear")
2016-08-19 12:21:11,520 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
2016-08-19 12:21:11,535 WARN [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-4) IJ020016: Missing <recovery> element. XA recovery disabled for: java:jboss/datasources/GUN88_DS
2016-08-19 12:21:11,553 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0207: Starting subdeployment (runtime-name: "gun88-logfs.war")
2016-08-19 12:21:11,554 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0207: Starting subdeployment (runtime-name: "gun88-ui.war")
2016-08-19 12:21:11,558 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) WFLYJCA0001: Bound data source [java:jboss/datasources/GUN88_DS]
2016-08-19 12:21:11,716 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-7) ISPN000128: Infinispan version: Infinispan 'Mahou' 8.1.0.Final
2016-08-19 12:21:11,983 INFO [org.jboss.ws.common.management] (MSC service thread 1-5) JBWS022052: Starting JBossWS 5.1.3.Final (Apache CXF 3.1.4)
2016-08-19 12:21:13,840 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0059: Class Path entry jaxb-api.jar in /C:/wildfly-10.0.0.Final/standalone/deployments/gun88-ear-7.0.0.ear/gun88-logfs.war/WEB-INF/lib/jaxb-core-2.2.11.jar does not point to a valid jar for a Class-Path reference.
2016-08-19 12:21:13,846 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0059: Class Path entry jaxb-core.jar in /C:/wildfly-10.0.0.Final/standalone/deployments/gun88-ear-7.0.0.ear/gun88-logfs.war/WEB-INF/lib/jaxb-impl-2.2.11.jar does not point to a valid jar for a Class-Path reference.
2016-08-19 12:21:13,852 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0059: Class Path entry lib/snakeyaml-1.13.jar in /C:/wildfly-10.0.0.Final/standalone/deployments/gun88-ear-7.0.0.ear/gun88-logfs.war/WEB-INF/lib/liquibase-core-3.4.2.jar does not point to a valid jar for a Class-Path reference.
2016-08-19 12:21:14,304 INFO [org.jboss.as.jpa] (MSC service thread 1-4) WFLYJPA0002: Read persistence.xml for GUN88_DS
2016-08-19 12:21:14,355 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.module.service."deployment.gun88-ear-7.0.0.ear".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.gun88-ear-7.0.0.ear".main: WFLYSRV0179: Failed to load module: deployment.gun88-ear-7.0.0.ear:main
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91)
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.modules.ModuleNotFoundException: org.postgresql:main
at org.jboss.modules.Module.addPaths(Module.java:1092)
at org.jboss.modules.Module.link(Module.java:1448)
at org.jboss.modules.Module.relinkIfNecessary(Module.java:1476)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:225)
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:68)
... 5 more
2016-08-19 12:21:16,239 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "gun88-ear-7.0.0.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.gun88-ear-7.0.0.ear\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.gun88-ear-7.0.0.ear\".main: WFLYSRV0179: Failed to load module: deployment.gun88-ear-7.0.0.ear:main
Caused by: org.jboss.modules.ModuleNotFoundException: org.postgresql:main"}}
2016-08-19 12:21:16,299 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "gun88-ear-7.0.0.ear" (runtime-name : "gun88-ear-7.0.0.ear")
2016-08-19 12:21:16,309 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.module.service."deployment.gun88-ear-7.0.0.ear".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.gun88-ear-7.0.0.ear".main: WFLYSRV0179: Failed to load module: deployment.gun88-ear-7.0.0.ear:main
2016-08-19 12:21:16,494 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
2016-08-19 12:21:16,495 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
2016-08-19 12:21:16,495 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started (with errors) in 10530ms - Started 314 of 604 services (4 services failed or missing dependencies, 378 services are lazy, passive or on-demand)
2016-08-19 12:21:16,546 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0208: Stopped subdeployment (runtime-name: gun88-ui.war) in 16ms
2016-08-19 12:21:16,597 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0208: Stopped subdeployment (runtime-name: gun88-logfs.war) in 68ms
2016-08-19 12:21:16,598 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0028: Stopped deployment gun88-ear-7.0.0.ear (runtime-name: gun88-ear-7.0.0.ear) in 70ms
2016-08-19 12:21:16,682 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0009: Undeployed "gun88-ear-7.0.0.ear" (runtime-name: "gun88-ear-7.0.0.ear")
2016-08-19 12:21:16,684 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.module.service."deployment.gun88-ear-7.0.0.ear".main (missing) dependents: [service jboss.deployment.unit."gun88-ear-7.0.0.ear".FIRST_MODULE_USE]
service jboss.module.service."deployment.gun88-ear-7.0.0.ear.gun88-logfs.war".main (missing) dependents: [service jboss.deployment.subunit."gun88-ear-7.0.0.ear"."gun88-logfs.war".FIRST_MODULE_USE]
service jboss.module.service."deployment.gun88-ear-7.0.0.ear.gun88-ui.war".main (missing) dependents: [service jboss.deployment.subunit."gun88-ear-7.0.0.ear"."gun88-ui.war".FIRST_MODULE_USE]
service jboss.module.spec.service."deployment.gun88-ear-7.0.0.ear.gun88-logfs.war".main (missing) dependents: [service jboss.deployment.unit."gun88-ear-7.0.0.ear".FIRST_MODULE_USE]
service jboss.module.spec.service."deployment.gun88-ear-7.0.0.ear.gun88-ui.war".main (missing) dependents: [service jboss.deployment.unit."gun88-ear-7.0.0.ear".FIRST_MODULE_USE]
WFLYCTL0186: Services which failed to start: service jboss.module.service."deployment.gun88-ear-7.0.0.ear".main
2016-08-19 12:21:21,350 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found gun88-ear-7.0.0.ear in deployment directory. To trigger deployment create a file called gun88-ear-7.0.0.ear.dodeploy
2016-08-19 12:21:57,428 INFO [org.jboss.as.server] (Thread-2) WFLYSRV0220: Server shutdown has been requested.
2016-08-19 12:21:57,450 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0010: Unbound data source [java:jboss/datasources/ExampleDS]
2016-08-19 12:21:57,450 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) WFLYJCA0010: Unbound data source [java:jboss/datasources/GUN88_DS]
2016-08-19 12:21:57,464 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0019: Host default-host stopping
2016-08-19 12:21:57,466 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0019: Stopped Driver service with driver-name = postgres
2016-08-19 12:21:57,482 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) WFLYJCA0019: Stopped Driver service with driver-name = h2
2016-08-19 12:21:57,499 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0008: Undertow HTTP listener default suspending
2016-08-19 12:21:57,502 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0007: Undertow HTTP listener default stopped, was bound to 127.0.0.1:8080
2016-08-19 12:21:57,505 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0004: Undertow 1.3.15.Final stopping
2016-08-19 12:21:57,519 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0050: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) stopped in 85ms
我一直在搜索這個錯誤幾天。 什么都沒有回來是有道理的。 我希望有人可以給我一些線索。
* 注意 *
我會稍微擴展我的解釋。 這不是一個新的應用程序。 我加入的另一位開發人員已經開發了幾個月。 問題是他使用IntelliJ作為他的IDE,我的所有經驗都是使用Eclipse。 所以我試圖將Eclipse設置為我的開發環境。
我們已經比較了所有安裝和部署控件,但找不到任何具體差異。 然而它在他的機器上運行良好。 我已經嘗試在Eclipse中運行WildFly並在桌面外部運行,並且每次都會出現相同的錯誤。
很長一段時間我無法將數據源連接到PostgreSQL(使用WildFly管理面板),但現在我得到了一個很好的連接。 我認為如果可行,我的數據源配置是好的。 只要WildFly和PostgreSQL正在討論,就沒有必要改變數據源的創建方式。
我正在使用Standalone.xml,因為根據文檔,這是默認配置文件。 如果你想使用standalone-full,你必須覆蓋start命令,這是我沒有做過的。 而且在我看來,獨立和獨立完全之間唯一真正的區別是,這個應用程序沒有使用IIOS。
我知道你在基於Java的應用程序中看到的錯誤不一定是根本原因所以我願意嘗試任何事情。 我只想了解自己在做什么,並了解原因。
*****解決方案*****
我們終於發現並解決了這個問題。 我們在persistence.xml文件和standalone.xml文件之間存在沖突。 所以我們刪除了persistence.xml文件並將所有內容放在standalone.xml中,問題就消失了。 我們處於這樣一種情況:一個小組開始這個新的開發,剛開始編碼,項目被轉移到我們的小組。 它配置Maven的方式和Hibernate的設置方式我們很久沒有找到它。 我感謝大家的興趣和評論!!!!
我一直在使用帶有posgresql-9.3的Wildfly10,直接在standalone-full.xml文件中定義數據源對我有用。 所以我希望這對你有幫助。
我在PostgreSQL文件的模塊下創建了目錄。 結構是modules / org / postgres / main
在standalone-full.xml
執行此操作,該standalone>configuration
是standalone>configuration
在<datasources>
里面的那個文件中添加這個
<datasource jndi-name="java:jboss/datasources/PAYROLL_DS" pool-name="PAYROLL_DS" enabled="true" use-java-context="true">
<connection-url>jdbc:postgresql://localhost:5432/payroll_db</connection-url>
<driver>postgresql</driver>
<security>
<user-name>test</user-name>
<password>test@123</password>
</security>
</datasource>
這是我的persistence.xml
文件
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="PAYROLL_PU" transaction-type="JTA">
<jta-data-source>java:/jboss/datasources/PAYROLL_DS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="false"/>
<property name="hibernate.case.use_query_cache" value="false"/>
<!-- 2nd level cache -->
</properties>
</persistence-unit>
</persistence>
當您通過standalone-full.xml
添加數據源時,您不需要創建module.xml
來呈現postgres
。 您只需編輯<drivers>
standalone-full.xml
添加此項
<driver name="postgresql" module="org.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
我真的鼓勵你考慮使用jboss-cli程序來做到這一點。 我喜歡使用它,因為它很容易創建一個可重現的環境,如果文件的布局發生變化,你可能會更加絕緣。
我做過的一些事情如下。 請注意,jboss-cli程序位於“bin”目錄中的Wildfly主目錄中。 我已將其添加到我的O / S命令行路徑中。
因此,對於正在運行的 Wildfly,您可以先刪除正在使用的數據源:
jboss-cli.sh --connect --command="/subsystem=datasources/data-source=yourDataSource/:remove"
並且,為了完整性,刪除PostgreSQL驅動程序:
jboss-cli.sh --connect --command="/subsystem=datasources/jdbc-driver=postgres:remove"
和模塊:
jboss-cli.sh --connect --command="module remove --name=org.postgres"
現在,添加模塊:
jboss-cli.sh --connect --command="module add --name=org.postgres --resources=<location of the pgsql jar> --dependencies=javax.api,javax.transaction.api"
和司機:
jboss-cli.sh --connect --command='/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)'
最后,數據源:
jboss-cli.sh --command="/subsystem=datasources/data-source=yourDataSource/:add(connection-url=jdbc:postgresql://${db.host}:5432/${db.name},driver-name=postgres,jndi-name=java:/jdbc/yourDataSource,password=${db.password},user-name=${db.username})"
在最后一個語句中,$ {}變量需要設置為您的環境所需的值。 請注意,這也設置了JNDI名稱 - 我保持它們相同,但這不是必需的。
一旦你運行它,你將需要停止並重新啟動Wildfly。
通過這種方式,您可以進行腳本化設置。 當你升級時,至少10.x系列應該是相同的,雖然我使用了自Wildfly 8以來的相同腳本。
您可以在此處看到有關此案例的一些擴展文檔
/tmp/postgresql-42.2.2.jar
或替換它的位置 <yourPwd>
, <yourUsrName>
, <yourDbName>
<dbHost>
, <yourDeploymentNameWarOrJarFileName>
, <yourDeploymentNameWarOrJarFileName>
你應該能夠做到如上所述的以下內容:
cd wildfly-13.0.0.Final/bin
./jboss-cli.sh --connect controller=127.0.0.1
module add --name=org.postgresql --resources=/tmp/postgresql-42.2.2.jar --dependencies=javax.api,javax.transaction.api
/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgresql",driver-class-name=org.postgresql.Driver)
data-source add --jndi-name=java:jboss/datasources/<yourDeploymentNameWarOrJarFileName> --name=<yourDbName> --connection-url=jdbc:postgresql://<dbHost>:5432/<yourDbName> --driver-name=postgres --user-name="<yourUsrName>" --password="<yourPwd>"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.