-1

jpa (eclipseLink) を使用するバンドルがあります。jarsigner でバンドルに署名しました。バンドルを Glassfish (felix) にデプロイすると、次の例外が発生します。

[#|2013-10-09T12:55:47.521+0200|INFO|glassfish3.1.2|org.glassfish.osgijpa|_ThreadID=17;_ThreadName=Thread-2;|Bundle having id 598 is a JPA bundle|#]

[#|2013-10-09T12:55:50.314+0200|INFO|glassfish3.1.2|org.glassfish.osgijpa|_ThreadID=17;_ThreadName=Thread-2;|Exploded bundle com.xy.abc [598] at /tmp/osgiapp5163833994507427221 |#]

[#|2013-10-09T12:55:52.120+0200|INFO|glassfish3.1.2|org.glassfish.osgijpa|_ThreadID=17;_ThreadName=Thread-2;|Source = /tmp/osgiapp5163833994507427221, Target = /tmp/enhanced-osgiapp5359301892972587683|#]

[#|2013-10-09T12:55:59.019+0200|INFO|glassfish3.1.2|org.glassfish.osgijpa|_ThreadID=17;_ThreadName=Thread-2;|Deleted /tmp/osgiapp5163833994507427221 |#]

[#|2013-10-09T12:56:01.719+0200|WARNING|glassfish3.1.2|org.glassfish.osgijpa|_ThreadID=17;_ThreadName=Thread-2;|Failed to enhance bundle having id 598
org.osgi.framework.BundleException: Update of bundle com.xy.abc [598] failed.
at org.apache.felix.framework.Felix.updateBundle(Felix.java:2251)
at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:962)
at org.glassfish.osgijpa.JPAExtender.updateBundle(JPAExtender.java:191)
at org.glassfish.osgijpa.JPAExtender.enhance(JPAExtender.java:175)
at org.glassfish.osgijpa.JPAExtender.access$100(JPAExtender.java:64)
at org.glassfish.osgijpa.JPAExtender$1.run(JPAExtender.java:130)
at org.glassfish.osgijpa.JPAExtender.executeTask(JPAExtender.java:203)
at org.glassfish.osgijpa.JPAExtender.bundleChanged(JPAExtender.java:139)
at org.apache.felix.framework.util.EventDispatcher$3.run(EventDispatcher.java:861)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:858)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:789)
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:514)
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4249)
at org.apache.felix.framework.Felix.installBundle(Felix.java:2881)
at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:157)
at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:138)
at org.apache.felix.gogo.command.Basic.start(Basic.java:753)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.felix.gogo.runtime.Reflective.method(Reflective.java:136)
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:469)
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:395)
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
at org.apache.felix.gogo.shell.Shell.gosh(Shell.java:164)
at org.apache.felix.gogo.shell.Shell.sh(Shell.java:178)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.felix.gogo.runtime.Reflective.method(Reflective.java:136)
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:469)
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:395)
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
at org.apache.felix.gogo.shell.Console.run(Console.java:62)
at org.apache.felix.gogo.shell.Shell.console(Shell.java:203)
at org.apache.felix.gogo.shell.Shell.gosh(Shell.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.felix.gogo.runtime.Reflective.method(Reflective.java:136)
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:469)
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:395)
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
at org.apache.felix.shell.remote.Shell.startGogoShell(Shell.java:108)
at org.apache.felix.shell.remote.Shell.run(Shell.java:81)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:221)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:176)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:288)
at java.util.jar.JarVerifier.update(JarVerifier.java:199)
at java.util.jar.JarInputStream.read(JarInputStream.java:200)
at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:100)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:78)
at java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:130)
at java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:167)
at org.apache.felix.framework.security.verifier.BundleDNParser.getCertificates(BundleDNParser.java:292)
at org.apache.felix.framework.security.verifier.BundleDNParser._getDNChains(BundleDNParser.java:240)/tmp/enhanced-osgiapp
at org.apache.felix.framework.security.verifier.BundleDNParser.checkDNChains(BundleDNParser.java:148)
at org.apache.felix.framework.SecurityProviderImpl.checkBundle(SecurityProviderImpl.java:64)
at org.apache.felix.framework.BundleImpl.addRevision(BundleImpl.java:1170)
at org.apache.felix.framework.BundleImpl.revise(BundleImpl.java:1130)
at org.apache.felix.framework.Felix.updateBundle(Felix.java:2113)
... 61 more

EclipseLink で、次のコード スニペットを見つけました。

// We need to explode the bundle if it is not a directory based deployment.
    // This is because, eclipselink enhancer can only scan file system artifacts.
    File explodedDir = makeFile(b);
    boolean dirDeployment = (explodedDir != null) ? explodedDir.isDirectory() : false;
    try {
        if (!dirDeployment) {
            explodedDir = explode(b);
        }

        // We need to make a copy of the exploded direactory where the enhanced bytes will be written to.
        final File enhancedDir = makeTmpDir("enhanced-osgiapp");
        FileUtils.copyTree(explodedDir, enhancedDir);

EclipseLink は "/tmp/enhanced-osgiapp..." フォルダーを作成し、このフォルダーは署名されていないと思います!

私は正しいですか?どうすればこれを解決できますか?

4

1 に答える 1

0

GlassFish で使用されている osgi-jpa コンポーネントに問題があることを突き止めました。コンポーネントは、JPA コンテンツのインストール済みバンドルをスキャンし、JPA エンティティを織り込みます。その後、次の 2 つのエントリが MANIFEST.MF ファイルに追加されます。

  • GlassFish-StaticallyWeaved: true
  • DynamicImport パッケージ: org.eclipse.persistence.*

私の意見では、これは GlassFish のバグです。バグ チケットを開きました: https://java.net/jira/browse/GLASSFISH-20859

回避策として、ビルド時に JPA エンティティを織り込み、バンドルが署名される前に MANIFEST.MF エントリを追加できます。この場合、osgi-jpa コンポーネントはバンドルを無視し、バンドルの署名は壊れていません。

于 2013-10-18T12:28:52.397 に答える