0

ear ファイルとして正常にデプロイされる Web アプリケーションがあります。しかし、展開された形式で展開しようとすると、次のように失敗します。

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)

persistence.xml は次のようになります。

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

何か案は?ありがとう!

4

2 に答える 2

2

サーバーのディレクトリ構造は何ですか。これを機能させるには、 deploy/lib/persistance-jpa.jar/ が必要です。

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/]'  

そのファイル/ディレクトリが見つからないと言っています..

于 2009-11-17T17:29:06.940 に答える
-1

ディレクトリ構造は次のとおりです。

EAR
   - warfile.WAR
   - lib
       - persistence-jpa.jar
       - persistence.xml を含む他の jar ファイル
   - enterpricejavabean.ejb


persistace.xml ファイルの jar 要素は <jar-file>../lib/persistence-jpa.jar</jar-file> である必要があります

于 2010-11-30T09:19:57.890 に答える