2

I am new to JBOSS and m stuck at basic deployment of app in JBOSS 7.1.1

I have created a webapp with persistent.xml as

<?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>


Datasource in my standalone.xml looks like :

<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>


When i deploy the application, i get following exception :

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]

I am stuck from entire day at this. Would appreciate any help from this forum.

Regards, Legolas

Sina Barghidarian
  • 450
  • 1
  • 4
  • 18
Legolas
  • 71
  • 1
  • 6
  • 4
    ahh yes, yes, the joys of spring configuration debugging... Good for me that is relatively difficult to buy a gun in my country, otherwise i would have probably shot my face off last time i had to deal with this nonsense born from the very pits of hell – lurscher Apr 07 '12 at 20:12
  • trust me.. its getting depressing for me too :( .. do you need more info from my side ?? – Legolas Apr 07 '12 at 20:16
  • 1
    what i learned from my experience is that setting spring configuration without the documentation is nearly impossible because the diagnostics messages are good for nothing... Also, probably you already did it, but have you checked if the `org.apache.openjpa.persistence.PersistenceProviderImpl` class exists in your openjpa jar libraries? – lurscher Apr 07 '12 at 20:20

1 Answers1

4

I downloaded Apache Openjpa, extracted the jars, created a module in jboss under \JBOSS_HOME>\modules\org\apache\openjpa and changed my property in persistent.xml to

  <property name="jboss.as.jpa.providerModule" value="org.apache.openjpa" />

module.xml looks like :

<module xmlns="urn:jboss:module:1.1" name="org.apache.openjpa"> 
    <resources> 
        <resource-root path="openjpa-2.2.0.jar"/> 
        <resource-root path="serp-1.13.1.jar"/> 
    </resources> 
        <dependencies> 
            <module name="javax.persistence.api"/> 
            <module name="javax.transaction.api"/> 
            <module name="javax.validation.api"/> 
            <module name="org.apache.commons.lang"/> 
            <module name="org.apache.commons.collections"/> 
            <module name="org.apache.log4j"/> 
        </dependencies> 
</module>

it finally worked. :) Thanks @lurscher for ur comments. It motivated me to carry on.

Legolas
  • 71
  • 1
  • 6