我正在使用JBOSS Developer Studio v9.0.0.GA,Spring和Hibernate开发一个独立的应用程序。以前它工作正常,我能够将WAR文件部署到EAP并设法使web服务正常工作。但是现在我在尝试这样做时遇到了错误。
这是控制台输出:
13:34:40,984 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.6.Final-redhat-1
13:34:41,089 INFO [org.jboss.msc] (main) JBoss MSC version 1.1.5.Final-redhat-1
13:34:41,140 INFO [org.jboss.as] (MSC service thread 1-6) JBAS015899: JBoss EAP 6.4.0.GA (AS 7.5.0.Final-redhat-21) starting
13:34:41,778 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found fwd-PMAP.war in deployment directory. To trigger deployment create a file called fwd-PMAP.war.dodeploy
13:34:41,792 INFO [org.xnio] (MSC service thread 1-7) XNIO Version 3.0.13.GA-redhat-1
13:34:41,794 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
13:34:41,796 INFO [org.xnio.nio] (MSC service thread 1-7) XNIO NIO Implementation Version 3.0.13.GA-redhat-1
13:34:41,836 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
13:34:41,841 INFO [org.jboss.remoting] (MSC service thread 1-7) JBoss Remoting version 3.3.4.Final-redhat-1
13:34:41,861 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 37) JBAS012615: Activated the following JSF Implementations: [main, 1.2]
13:34:41,868 INFO [org.jboss.as.connector.logging] (MSC service thread 1-1) JBAS010408: Starting JCA Subsystem (IronJacamar 1.0.31.Final-redhat-1)
13:34:41,872 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 39) JBAS011800: Activating Naming Subsystem
13:34:41,870 INFO [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013371: Activating Security Subsystem
13:34:41,884 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 46) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.
13:34:41,901 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
13:34:41,916 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
13:34:41,924 INFO [org.jboss.as.mail.extension] (MSC service thread 1-7) JBAS015400: Bound mail session [java:jboss/mail/Default]
13:34:41,925 INFO [org.jboss.as.naming] (MSC service thread 1-3) JBAS011802: Starting Naming Service
13:34:42,005 INFO [org.jboss.as.security] (MSC service thread 1-7) JBAS013370: Current PicketBox version=4.1.1.Final-redhat-1
13:34:42,102 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) JBWEB003001: Coyote HTTP/1.1 initializing on : http-localhost/127.0.0.1:8080
13:34:42,105 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) JBWEB003000: Coyote HTTP/1.1 starting on: http-localhost/127.0.0.1:8080
13:34:42,125 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "fwd-PMAP.war" (runtime-name: "fwd-PMAP.war")
13:34:42,127 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "sqljdbc42.jar" (runtime-name: "sqljdbc42.jar")
13:34:42,127 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory C:\jbdevstudio\runtimes\jboss-eap\standalone\deployments
13:34:42,139 INFO [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on 127.0.0.1:4447
13:34:42,139 INFO [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on 127.0.0.1:9999
13:34:42,151 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
13:34:42,160 INFO [org.jboss.ws.common.management] (MSC service thread 1-7) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.3.4.Final-redhat-1
13:34:42,304 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010403: Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.2)
13:34:42,314 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:jboss/datasources/SQLServer]
13:34:43,203 INFO [org.jboss.as.jpa] (MSC service thread 1-5) JBAS011401: Read persistence.xml for pmap
13:34:43,204 INFO [org.jboss.as.jpa] (MSC service thread 1-5) JBAS011401: Read persistence.xml for arba
13:34:43,433 WARN [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016012: Deployment deployment "fwd-PMAP.war" contains CDI annotations but beans.xml was not found.
13:34:43,443 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 51) JBAS011402: Starting Persistence Unit Service 'fwd-PMAP.war#arba'
13:34:43,443 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 50) JBAS011402: Starting Persistence Unit Service 'fwd-PMAP.war#pmap'
13:34:43,502 INFO [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 51) HCANN000001: Hibernate Commons Annotations {4.0.2.Final-redhat-1}
13:34:43,505 INFO [org.hibernate.Version] (ServerService Thread Pool -- 51) HHH000412: Hibernate Core {4.2.18.Final-redhat-2}
13:34:43,506 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 51) HHH000206: hibernate.properties not found
13:34:43,506 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 51) HHH000021: Bytecode provider name : javassist
13:34:43,516 INFO [org.hibernate.ejb.Ejb3Configuration] (ServerService Thread Pool -- 51) HHH000204: Processing PersistenceUnitInfo [
name: arba
...]
13:34:43,516 INFO [org.hibernate.ejb.Ejb3Configuration] (ServerService Thread Pool -- 50) HHH000204: Processing PersistenceUnitInfo [
name: pmap
...]
13:34:43,529 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 50) MSC000001: Failed to start service jboss.persistenceunit."fwd-PMAP.war#pmap": org.jboss.msc.service.StartException in service jboss.persistenceunit."fwd-PMAP.war#pmap": javax.persistence.PersistenceException: [PersistenceUnit: pmap] class or package not found
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:103)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_65]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_65]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.2.Final-redhat-1.jar:2.1.2.Final-redhat-1]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: pmap] class or package not found
at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1431)
at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:1214)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1058)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:703)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:75)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:200)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$600(PersistenceUnitServiceImpl.java:57)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:99)
... 4 more
Caused by: java.lang.ClassNotFoundException: com.fwd.pmap.domain.Campaign from [Module "org.hibernate:main" from local module loader @1e89d68 (finder: local module finder @1192d32 (roots: C:\jbdevstudio\runtimes\jboss-eap\modules,C:\jbdevstudio\runtimes\jboss-eap\modules\system\layers\base\.overlays\BZ1281963,C:\jbdevstudio\runtimes\jboss-eap\modules\system\layers\base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.6.Final-redhat-1]
at java.lang.Class.forName0(Native Method) [rt.jar:1.8.0_65]
at java.lang.Class.forName(Unknown Source) [rt.jar:1.8.0_65]
at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:170)
at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1348)
at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1420)
... 11 more
13:34:43,529 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 51) MSC000001: Failed to start service jboss.persistenceunit."fwd-PMAP.war#arba": org.jboss.msc.service.StartException in service jboss.persistenceunit."fwd-PMAP.war#arba": javax.persistence.PersistenceException: [PersistenceUnit: arba] class or package not found
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:103)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_65]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_65]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.2.Final-redhat-1.jar:2.1.2.Final-redhat-1]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: arba] class or package not found
at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1431)
at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:1214)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1058)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:703)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:75)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:200)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$600(PersistenceUnitServiceImpl.java:57)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:99)
... 4 more
Caused by: java.lang.ClassNotFoundException: com.fwd.pmap.domain.PMAPEtrekWorking from [Module "org.hibernate:main" from local module loader @1e89d68 (finder: local module finder @1192d32 (roots: C:\jbdevstudio\runtimes\jboss-eap\modules,C:\jbdevstudio\runtimes\jboss-eap\modules\system\layers\base\.overlays\BZ1281963,C:\jbdevstudio\runtimes\jboss-eap\modules\system\layers\base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.6.Final-redhat-1]
at java.lang.Class.forName0(Native Method) [rt.jar:1.8.0_65]
at java.lang.Class.forName(Unknown Source) [rt.jar:1.8.0_65]
at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:170)
at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1348)
at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1420)
... 11 more
13:34:43,533 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Operation ("deploy") failed - address: ([("deployment" => "fwd-PMAP.war")]) - failure description: {"JBAS014671: Failed services" => {
"jboss.persistenceunit.\"fwd-PMAP.war#arba\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"fwd-PMAP.war#arba\": javax.persistence.PersistenceException: [PersistenceUnit: arba] class or package not found
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: arba] class or package not found
Caused by: java.lang.ClassNotFoundException: com.fwd.pmap.domain.PMAPEtrekWorking from [Module \"org.hibernate:main\" from local module loader @1e89d68 (finder: local module finder @1192d32 (roots: C:\\jbdevstudio\\runtimes\\jboss-eap\\modules,C:\\jbdevstudio\\runtimes\\jboss-eap\\modules\\system\\layers\\base\\.overlays\\BZ1281963,C:\\jbdevstudio\\runtimes\\jboss-eap\\modules\\system\\layers\\base))]",
"jboss.persistenceunit.\"fwd-PMAP.war#pmap\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"fwd-PMAP.war#pmap\": javax.persistence.PersistenceException: [PersistenceUnit: pmap] class or package not found
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: pmap] class or package not found
Caused by: java.lang.ClassNotFoundException: com.fwd.pmap.domain.Campaign from [Module \"org.hibernate:main\" from local module loader @1e89d68 (finder: local module finder @1192d32 (roots: C:\\jbdevstudio\\runtimes\\jboss-eap\\modules,C:\\jbdevstudio\\runtimes\\jboss-eap\\modules\\system\\layers\\base\\.overlays\\BZ1281963,C:\\jbdevstudio\\runtimes\\jboss-eap\\modules\\system\\layers\\base))]"
}}
13:34:43,556 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS015859: Deployed "sqljdbc42.jar" (runtime-name : "sqljdbc42.jar")
13:34:43,556 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS015859: Deployed "fwd-PMAP.war" (runtime-name : "fwd-PMAP.war")
13:34:43,557 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.persistenceunit."fwd-PMAP.war#arba": org.jboss.msc.service.StartException in service jboss.persistenceunit."fwd-PMAP.war#arba": javax.persistence.PersistenceException: [PersistenceUnit: arba] class or package not found
service jboss.persistenceunit."fwd-PMAP.war#pmap": org.jboss.msc.service.StartException in service jboss.persistenceunit."fwd-PMAP.war#pmap": javax.persistence.PersistenceException: [PersistenceUnit: pmap] class or package not found
13:34:43,605 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
13:34:43,606 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
13:34:43,606 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.4.0.GA (AS 7.5.0.Final-redhat-21) started (with errors) in 2831ms - Started 235 of 285 services (11 services failed or missing dependencies, 62 services are lazy, passive or on-demand)
13:34:43,820 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment fwd-PMAP.war (runtime-name: fwd-PMAP.war) in 43ms
13:34:43,914 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015858: Undeployed "fwd-PMAP.war" (runtime-name: "fwd-PMAP.war")
13:34:43,915 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.deployment.unit."fwd-PMAP.war".component."com.sun.faces.config.ConfigureListener".CREATE (missing) dependents: [service jboss.deployment.unit."fwd-PMAP.war".component."com.sun.faces.config.ConfigureListener".START]
service jboss.deployment.unit."fwd-PMAP.war".component."com.sun.faces.config.ConfigureListener".START (missing) dependents: [service jboss.web.deployment.default-host./fwd-PMAP, service jboss.deployment.unit."fwd-PMAP.war".deploymentCompleteService]
service jboss.deployment.unit."fwd-PMAP.war".component."javax.faces.webapp.FacetTag".CREATE (missing) dependents: [service jboss.deployment.unit."fwd-PMAP.war".component."javax.faces.webapp.FacetTag".START]
service jboss.deployment.unit."fwd-PMAP.war".component."javax.faces.webapp.FacetTag".START (missing) dependents: [service jboss.web.deployment.default-host./fwd-PMAP, service jboss.deployment.unit."fwd-PMAP.war".deploymentCompleteService]
service jboss.deployment.unit."fwd-PMAP.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".CREATE (missing) dependents: [service jboss.deployment.unit."fwd-PMAP.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START]
service jboss.deployment.unit."fwd-PMAP.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START (missing) dependents: [service jboss.web.deployment.default-host./fwd-PMAP, service jboss.deployment.unit."fwd-PMAP.war".deploymentCompleteService]
service jboss.deployment.unit."fwd-PMAP.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".CREATE (missing) dependents: [service jboss.deployment.unit."fwd-PMAP.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START]
service jboss.deployment.unit."fwd-PMAP.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START (missing) dependents: [service jboss.web.deployment.default-host./fwd-PMAP, service jboss.deployment.unit."fwd-PMAP.war".deploymentCompleteService]
service jboss.deployment.unit."fwd-PMAP.war".component."org.apache.catalina.servlets.DefaultServlet".START (missing) dependents: [service jboss.web.deployment.default-host./fwd-PMAP, service jboss.deployment.unit."fwd-PMAP.war".deploymentCompleteService]
service jboss.deployment.unit."fwd-PMAP.war".component."org.apache.jasper.servlet.JspServlet".CREATE (missing) dependents: [service jboss.deployment.unit."fwd-PMAP.war".component."org.apache.jasper.servlet.JspServlet".START]
service jboss.deployment.unit."fwd-PMAP.war".component."org.apache.jasper.servlet.JspServlet".START (missing) dependents: [service jboss.web.deployment.default-host./fwd-PMAP, service jboss.deployment.unit."fwd-PMAP.war".deploymentCompleteService]
service jboss.deployment.unit."fwd-PMAP.war".component."org.restlet.ext.servlet.ServerServlet".CREATE (missing) dependents: [service jboss.deployment.unit."fwd-PMAP.war".component."org.restlet.ext.servlet.ServerServlet".START]
service jboss.deployment.unit."fwd-PMAP.war".component."org.restlet.ext.servlet.ServerServlet".START (missing) dependents: [service jboss.web.deployment.default-host./fwd-PMAP, service jboss.deployment.unit."fwd-PMAP.war".deploymentCompleteService]
service jboss.deployment.unit."fwd-PMAP.war".jndiDependencyService (missing) dependents: [service jboss.deployment.unit."fwd-PMAP.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START, service jboss.web.deployment.default-host./fwd-PMAP, service jboss.deployment.unit."fwd-PMAP.war".component."javax.faces.webapp.FacetTag".START]
service jboss.persistenceunit."fwd-PMAP.war#arba" (missing) dependents: [service jboss.web.deployment.default-host./fwd-PMAP, service jboss.deployment.unit."fwd-PMAP.war".component."javax.faces.webapp.FacetTag".START, service jboss.deployment.unit."fwd-PMAP.war".deploymentCompleteService]
service jboss.persistenceunit."fwd-PMAP.war#pmap" (missing) dependents: [service jboss.web.deployment.default-host./fwd-PMAP, service jboss.deployment.unit."fwd-PMAP.war".component."javax.faces.webapp.FacetTag".START, service jboss.deployment.unit."fwd-PMAP.war".deploymentCompleteService]
service jboss.web.deployment.default-host./fwd-PMAP.realm (missing) dependents: [service jboss.web.deployment.default-host./fwd-PMAP, service jboss.deployment.unit."fwd-PMAP.war".deploymentCompleteService]
JBAS014777: Services which failed to start: service jboss.persistenceunit."fwd-PMAP.war#arba"
service jboss.persistenceunit."fwd-PMAP.war#pmap"
这是我的POM文件:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.fwd</groupId>
<artifactId>fwd-PMAP</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<java.version>1.8</java.version>
<!-- Spring -->
<spring-framework.version>4.0.3.RELEASE</spring-framework.version>
<!-- Hibernate / JPA -->
<hibernate.version>4.3.5.Final</hibernate.version>
<!-- Logging -->
<logback.version>1.0.13</logback.version>
<slf4j.version>1.7.5</slf4j.version>
<log4j.version>1.2.16</log4j.version>
<restlet.version>2.3.4</restlet.version>
<jackson.version>2.7.1</jackson.version>
<groovy.version>2.4.5</groovy.version>
</properties>
<dependencies>
<!-- Spring and Transactions -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring-framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring-framework.version}</version>
</dependency>
<!-- Spring ORM support -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring-framework.version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<!-- 3cp0 -->
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>${hibernate.version}</version>
</dependency>
<!-- CSV file reader utilities -->
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>net.sf.supercsv</groupId>
<artifactId>super-csv</artifactId>
<version>2.4.0</version>
</dependency>
<!-- Copy POJO to POJO -->
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>0.7.5</version>
</dependency>
<!-- Restlet -->
<dependency>
<groupId>org.restlet.jee</groupId>
<artifactId>org.restlet</artifactId>
<version>${restlet.version}</version>
</dependency>
<dependency>
<groupId>org.restlet.jee</groupId>
<artifactId>org.restlet.ext.servlet</artifactId>
<version>${restlet.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
持久性文件:
<?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">
<!-- FWD Connection -->
<persistence-unit name="pmap" transaction-type="RESOURCE_LOCAL">
<class>com.fwd.pmap.domain.Campaign</class>
<class>com.fwd.pmap.domain.Employer</class>
<class>com.fwd.pmap.domain.ISP</class>
<class>com.fwd.pmap.domain.Ward</class>
<class>com.fwd.pmap.domain.PMAPEtrekWorking</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="javax.persistence.jdbc.url" value="jdbc:sqlserver://xxx.xxx.x.xx:xxxx;databaseName=PMAP" />
<property name="javax.persistence.jdbc.user" value="username" />
<property name="javax.persistence.jdbc.password" value="password" />
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.c3p0.min_size" value="5" />
<property name="hibernate.c3p0.max_size" value="20" />
<property name="hibernate.c3p0.timeout" value="500" />
<property name="hibernate.c3p0.max_statements" value="50" />
<property name="hibernate.c3p0.idle_test_period" value="2000" />
</properties>
</persistence-unit>
<persistence-unit name="arba" transaction-type="RESOURCE_LOCAL">
<class>com.fwd.pmap.domain.PMAPEtrekWorking</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="javax.persistence.jdbc.url" value="jdbc:sqlserver://xxx.xxx.x.xx:xxxx;databaseName=PMAP" />
<property name="javax.persistence.jdbc.user" value="username" />
<property name="javax.persistence.jdbc.password" value="password" />
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.c3p0.min_size" value="5" />
<property name="hibernate.c3p0.max_size" value="20" />
<property name="hibernate.c3p0.timeout" value="500" />
<property name="hibernate.c3p0.max_statements" value="50" />
<property name="hibernate.c3p0.idle_test_period" value="2000" />
</properties>
</persistence-unit>
</persistence>
奇怪的是,当我在家用机器上部署WAR文件(使用本地SQL Server实例)时,它运行正常。只有当我在办公室时才会发生此错误。
希望有些善良的人可以帮助我。答案 0 :(得分:0)
执行(mvn clean install)解决错误。发现我正在使用JRE而不是JDK进行开发,这就是为什么所有构建都有问题的原因。谢谢@subburoyal