Domanda

Ho un'applicazione web che distribuisce bene come un file EAR. Ma quando provo per ricorrere ad esso in forma esplosa non riesce in questo modo:

17:13:17,305 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=app.ear/#app-persistence state=Create
java.lang.RuntimeException: could not find relative path: lib/persistence-jpa.jar
    at org.jboss.jpa.deployment.PersistenceUnitDeployment.getRelativeURL(PersistenceUnitDeployment.java:208)
    at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:267)
.
.
.
Caused by: java.lang.RuntimeException: could not find child 'lib/persistence-jpa.jar' on 'FileHandler@4348388[path= context=file:/home/petteri/bin/jboss-5.1.0.GA/server/standard/deploy/ real=file:/home/petteri/bin/jboss-5.1.0.GA/server/standard/deploy/]'
    at org.jboss.jpa.deployment.PersistenceUnitDeployment.getRelativeURL(PersistenceUnitDeployment.java:203)

Il persistence.xml assomiglia a questo:

<persistence
    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"
    version="1.0">

    <persistence-unit name="app-persistence">
        <jta-data-source>java:/app</jta-data-source>
        <jar-file>lib/persistence-jpa.jar</jar-file>
        <properties>

 ... some hibernate stuff ...

        </properties>
    </persistence-unit>
</persistence>

Tutte le idee? Grazie!

È stato utile?

Soluzione

Qual è la struttura di directory del server. Si dovrebbe avere deploy / lib / persistenza-jpa.jar / in modo che questo funzioni.

Caused by: java.lang.RuntimeException: could not find child 'lib/persistence-jpa.jar' on
     'FileHandler@4348388[path= context=file:/home/petteri/bin/jboss-5.1.0.GA/server/standard
    /deploy/ real=file:/home/petteri/bin/jboss-5.1.0.GA/server/standard/deploy/]'  

sta dicendo che quel file / cartella non si trova ..

Altri suggerimenti

La struttura delle cartelle dovrebbe essere:

EAR
- warfile.WAR
-
lib    - la persistenza-jpa.jar
   - L'altro file jar che contengono persistence.xml
 - enterpricejavabean.ejb

persistace.xml del file jar elemento deve essere ../ lib / persistenza-jpa.jar

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top