我是 JBOSS 的新手,我停留在 JBOSS 7.1.1 中应用程序的基本部署中
我创建了一个带有 persistent.xml 的 webapp
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="mydummy-jpa" transaction-type="RESOURCE_LOCAL">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<jta-data-source>java:jboss/datasources/mydummyexample</jta-data-source>
<class>com.nsn.caobusiness.selfcare.entity.DummyTable</class>
<properties>
<property name="jboss.as.jpa.providerModule" value="org.jboss.as.jpa.openjpa" />
<property name="openjpa.Log" value="DefaultLevel=WARN,SQL=TRACE" />
<property name="openjpa.jdbc.DBDictionary" value="mysql(UseClobs=true)"/>
</properties>
</persistence-unit>
</persistence>
我的standalone.xml 中的数据源如下所示:
<datasource jndi-name="java:jboss/datasources/mydummyexample" pool-name="mydummyexample" enabled="true" use-java-context="true" use-ccm="true" jta="true">
<connection-url>jdbc:mysql://localhost:3306/worldonstreet</connection-url>
<driver>mysql</driver>
<security>
<user-name>root</user-name>
<password></password>
</security>
<statement>
<prepared-statement-cache-size>100</prepared-statement-cache-size>
<share-prepared-statements/>
</statement>
</datasource>
当我部署应用程序时,出现以下异常:
23:48:06,656 INFO [org.jboss.as.jpa] (MSC service thread 1-5) JBAS011401: Read persistence.xml for mydummy-jpa
23:48:08,000 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."SpringDatabaseTransaction.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."SpringDatabaseTransaction.war".INSTALL: Failed to process phase INSTALL of deployment "SpringDatabaseTransaction.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
**Caused by: javax.persistence.PersistenceException: JBAS011466:
PersistenceProvider
'org.apache.openjpa.persistence.PersistenceProviderImpl' not found**
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.lookupProvider(PersistenceUnitDeploymentProcessor.java:555)
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deployPersistenceUnit(PersistenceUnitDeploymentProcessor.java:295)
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:258)
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleWarDeployment(PersistenceUnitDeploymentProcessor.java:194)
at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:118)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
我整天都被困在这上面。非常感谢这个论坛的任何帮助。
问候,莱戈拉斯