Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jpa 使用eclipselink的符号包_Jpa_Glassfish_Osgi_Apache Felix - Fatal编程技术网

Jpa 使用eclipselink的符号包

Jpa 使用eclipselink的符号包,jpa,glassfish,osgi,apache-felix,Jpa,Glassfish,Osgi,Apache Felix,我有一个使用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:5

我有一个使用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…”文件夹,但该文件夹没有签名


我正确吗?我如何解决这个问题呢?

我将问题追溯到GlassFish使用的osgi jpa组件。该组件扫描已安装的捆绑包中的JPA内容,并编织JPA实体。之后,将以下两个条目添加到MANIFEST.MF文件中:

  • 玻璃鱼:真的吗
  • DynamicImport包:org.eclipse.persistence*
在我看来,这是一种玻璃鱼虫。我开了一张虫子票:

作为一种解决方法,JPA实体可以在构建时编织,MANIFEST.MF条目可以在捆绑包签名之前添加。在这种情况下,OSGiJPA组件会忽略包,并且包的签名不会被破坏