2012-04-19 7 views
0


旧式のSun Application Server 9.1から現在のGlassfish 3.1に移植したい "古い" JavaEEアプリケーションがあります。デプロイメント記述子のXMLファイルを更新しました(名前が変更され、更新されたDocType、DTDに対して検証済み、それ以外は何もありません)。私たちは、このエラーを取得GF3.1に展開しようとすると、しかし:Glassfish 3.1b41 - JDO83008:CMPコンパイルに失敗しました:クラスファイルが見つかりません

JDO83008: CMP Compilation failed: 
C:\workspace\glassfish31eclipsedefaultdomain\generated\ejb\archivetool-app-1.9.5\archivetool-ejb-1.9.5_jar\de\ems\archivetool\ejb\metadata\cd\eb\CdBean_821611534_ConcreteImpl.java:10: 
cannot access de.ems.archivetool.ejb.framework.AbstractCMPBean 
class file for de.ems.archivetool.ejb.framework.AbstractCMPBean not found 

C:\workspace\glassfish31eclipsedefaultdomain\generated\ejb\archivetool-app-1.9.5\archivetool-ejb-1.9.5_jar\de\ems\archivetool\ejb\productdata\product\eb\ProductionLibraryBean40992531_ConcreteImpl.java:416: 
cannot find symbol 

symbol : class EBSBusinessException 
location: package de.ems.archivetool.ejb.framework 

WARNUNG: JDO83004: CMP Compilation failed. See log for details. 
SCHWERWIEGEND: Exception while invoking class org.glassfish.ejb.startup.EjbDeployer prepare method 
SCHWERWIEGEND: Exception while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare method 
SCHWERWIEGEND: Exception while preparing the app 
SCHWERWIEGEND: JDO83004: CMP Compilation failed. See log for details. 
org.glassfish.deployment.common.DeploymentException: JDO83004: CMP Compilation failed. See log for details. 

しかし、我々はまだ古いSUNアプリケーションサーバーにデプロイすることもできます。

アプリケーションは、4つのモジュールとビルドモジュールで構成されています。一般に、2つのEJBモジュール、1つのWARモジュールと1つのJARモジュールで構成される.earファイルは、問題なくMavenでビルドされます(UnitTestは成功します)。 (pom.xmlし、得られapplication.xml

だから、すべてが正常に構築し、私たちはGF3.1にアプリケーションを展開しようとすると、私たちは、「クラスファイルが見つかりません」エラーが発生します。見つからないクラスは、JARモジュール内にあり、EJBモジュールの基本クラスを含みます。

誰でも出発点がありますか?

よろしく、 アンドレアス

答えて

0

OK]をクリックして、googelingの時間後、私は最終的にこの問題hereに正確な答えを見つけました。 重要な部分は、次のとおりです。

で何をする必要があり

The Java EE 6 specification imposes strict rules about which JAR files are visible from an enterprise archive (EAR) file. Refer to section EE.8.3.3; specifically, application client modules should not have access to any EJB JAR file unless the application client JAR file's manifest Class-Path refers to the EJB JAR file(s) explicitly.

This is a change from GlassFish Server v2, in which application clients automatically had access to all EJB JAR files in the EAR file and all JAR files at the top level of the EAR file. To comply with the stricter specification language, GlassFish Server 3.0.1 cannot automatically provide application clients with access to these JAR files.

、Mavenのは、耳のコンテナ内のライブラリフォルダにjarファイル(および他の依存関係)を入れてみましょう。あなたの耳のpom.xmlにこれを追加することによって、この操作を行います。

<build> 
    <plugins> 
    <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-ear-plugin</artifactId> 
     <configuration> 

     //here starts the important part 
     <defaultLibBundleDir>lib</defaultLibBundleDir> 
     <archive> 
     <manifest> 
      <addClasspath>true</addClasspath> 
     </manifest> 
     </archive> 
     //end of important part 

    <modules> 
    <jarModule> 
     <groupId>gID</groupId> 
     <artifactId>aID</artifactId> 
    </jarModule> 

    //etc some more ebjs, war, ... 
    </modules> 

これは、フォルダのlibにjarファイルモジュールを置くと、すべての依存EJBは、そのMANIFEST.MFでClass-Pathエントリを取得します。

あなたが同じ問題を抱えている人に役立つことを願っています。

関連する問題