Skip to main content



      Home
Home » Eclipse Projects » Kura » Update bundle issue(Errors when updating bundle using RestEasy library)
Update bundle issue [message #1744497] Tue, 27 September 2016 08:55 Go to next message
Eclipse UserFriend
Hello,

If I use RestEasy libraries (or alternatively Jersey libraries), when I attempt to relaunch my bundle after a update, it raises many errors like :
osgi> !SESSION 2016-09-27 12:38:33.437 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_65
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=arm, WS=gtk, NL=en_US
Command-line arguments:  -configuration /tmp/.kura/configuration -console -consoleLog

!ENTRY kura.example 4 0 2016-09-27 12:40:20.131
!MESSAGE FrameworkEvent ERROR
!STACK 0
java.io.IOException: Exception in opening zip file: /tmp/.kura/configuration/org.eclipse.osgi/bundles/73/1/bundlefile
        at org.eclipse.osgi.framework.util.SecureAction.getZipFile(SecureAction.java:291)
        at org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.basicOpen(ZipBundleFile.java:87)
        at org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.getZipFile(ZipBundleFile.java:100)
        at org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.checkedOpen(ZipBundleFile.java:73)
        at org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.getEntry(ZipBundleFile.java:245)
        at org.eclipse.osgi.baseadaptor.bundlefile.BundleFile.internalGetResourceURL(BundleFile.java:150)
        at org.eclipse.osgi.baseadaptor.bundlefile.BundleFile.getResourceURL(BundleFile.java:146)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findResourceImpl(ClasspathManager.java:361)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalResourceImpl(ClasspathManager.java:310)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalResource(ClasspathManager.java:297)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalResource(DefaultClassLoader.java:208)
        at org.eclipse.osgi.internal.loader.BundleLoader.findLocalResource(BundleLoader.java:820)
        at org.eclipse.osgi.internal.loader.BundleLoader.findResource(BundleLoader.java:624)
        at org.eclipse.osgi.internal.loader.BundleLoader.findResource(BundleLoader.java:577)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.getResource(DefaultClassLoader.java:143)
        at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:146)
        at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:120)
        at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.addClientMessageBodyReader(ResteasyProviderFactory.java:883)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:840)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:807)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1432)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1368)
        at org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(RegisterBuiltin.java:71)
        at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:31)
        at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.getProviderFactory(ResteasyClientBuilder.java:340)
        at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.build(ResteasyClientBuilder.java:348)
        at resteasy.example.RestActivator.restTest(RestActivator.java:33)
        at resteasy.example.RestActivator.start(RestActivator.java:46)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.updateWorker(AbstractBundle.java:645)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.update(AbstractBundle.java:592)
        at org.tigris.mtoolkit.iagent.internal.rpc.DefaultBundleManagerDelegate.updateBundle(DefaultBundleManagerDelegate.java:49)
        at org.tigris.mtoolkit.iagent.internal.rpc.RemoteBundleAdminImpl.updateBundle(RemoteBundleAdminImpl.java:431)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.tigris.mtoolkit.iagent.internal.pmp.InvocationThread.run(InvocationThread.java:54)
        at org.tigris.mtoolkit.iagent.internal.utils.ThreadPool$Worker.run(ThreadPool.java:179)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: /tmp/.kura/configuration/org.eclipse.osgi/bundles/73/1/bundlefile (No such file or directory)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:219)
        at java.util.zip.ZipFile.<init>(ZipFile.java:149)
        at java.util.zip.ZipFile.<init>(ZipFile.java:163)
        at org.eclipse.osgi.framework.util.SecureAction.getZipFile(SecureAction.java:274)
        ... 44 more

!ENTRY kura.example 4 0 2016-09-27 12:40:20.143
!MESSAGE FrameworkEvent ERROR
!STACK 0
java.io.IOException: Exception in opening zip file: /tmp/.kura/configuration/org.eclipse.osgi/bundles/73/1/.cp/resteasy-client-3.0.19.Final.jar
        at org.eclipse.osgi.framework.util.SecureAction.getZipFile(SecureAction.java:291)
        at org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.basicOpen(ZipBundleFile.java:87)
        at org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.getZipFile(ZipBundleFile.java:100)
        at org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.checkedOpen(ZipBundleFile.java:73)
        at org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleFile.getEntry(ZipBundleFile.java:245)
        at org.eclipse.osgi.baseadaptor.bundlefile.BundleFile.internalGetResourceURL(BundleFile.java:150)
        at org.eclipse.osgi.baseadaptor.bundlefile.BundleFile.getResourceURL(BundleFile.java:146)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findResourceImpl(ClasspathManager.java:361)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalResourceImpl(ClasspathManager.java:310)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalResource(ClasspathManager.java:297)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalResource(DefaultClassLoader.java:208)
        at org.eclipse.osgi.internal.loader.BundleLoader.findLocalResource(BundleLoader.java:820)
        at org.eclipse.osgi.internal.loader.BundleLoader.findResource(BundleLoader.java:624)
        at org.eclipse.osgi.internal.loader.BundleLoader.findResource(BundleLoader.java:577)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.getResource(DefaultClassLoader.java:143)
        at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:146)
        at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:120)
        at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.addClientMessageBodyReader(ResteasyProviderFactory.java:883)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:840)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:807)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1432)
        at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1368)
        at org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(RegisterBuiltin.java:71)
        at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:31)
        at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.getProviderFactory(ResteasyClientBuilder.java:340)
        at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.build(ResteasyClientBuilder.java:348)
        at resteasy.example.RestActivator.restTest(RestActivator.java:33)
        at resteasy.example.RestActivator.start(RestActivator.java:46)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.updateWorker(AbstractBundle.java:645)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.update(AbstractBundle.java:592)
        at org.tigris.mtoolkit.iagent.internal.rpc.DefaultBundleManagerDelegate.updateBundle(DefaultBundleManagerDelegate.java:49)
        at org.tigris.mtoolkit.iagent.internal.rpc.RemoteBundleAdminImpl.updateBundle(RemoteBundleAdminImpl.java:431)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.tigris.mtoolkit.iagent.internal.pmp.InvocationThread.run(InvocationThread.java:54)
        at org.tigris.mtoolkit.iagent.internal.utils.ThreadPool$Worker.run(ThreadPool.java:179)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: /tmp/.kura/configuration/org.eclipse.osgi/bundles/73/1/.cp/resteasy-client-3.0.19.Final.jar (No such file or directory)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:219)
        at java.util.zip.ZipFile.<init>(ZipFile.java:149)
        at java.util.zip.ZipFile.<init>(ZipFile.java:163)
        at org.eclipse.osgi.framework.util.SecureAction.getZipFile(SecureAction.java:274)
        ... 44 more
...


I attach to this post a simple example (pom-first) with this issue.

Did anyone have explanations ?

Erwan
Re: Update bundle issue [message #1744613 is a reply to message #1744497] Wed, 28 September 2016 16:40 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

How are you deploying your bundles to the framework? Are your bundles working on install but not restart? If you login to the OSGi console, the output of the ss and ls commands may be useful (for working and not working conditions).

Thanks,
--Dave
Re: Update bundle issue [message #1744726 is a reply to message #1744613] Thu, 29 September 2016 13:15 Go to previous messageGo to next message
Eclipse UserFriend
1/ I deploy my jar with Eclipse/mToolkit .

2/ My bundle works after initial install. It can be stop and restart. The updating works but after that, starting fails on
new ResteasyClientBuilder().build()


Thanks,

Erwan

EDIT :

Same errors occurs with Web deployment.

At first installing bundle is marked as Active with ss command and Active with ls.
After deinstalling and reinstalling, bundle is marked as RESOLVED with ss and doesn't appear with ls.



[Updated on: Fri, 30 September 2016 04:54] by Moderator

Re: Update bundle issue [message #1745069 is a reply to message #1744726] Tue, 04 October 2016 14:22 Go to previous messageGo to next message
Eclipse UserFriend
After reinstalling, trying starting the bundle marked as RESOLVED (start <bundle_id>). This may throw more useful errors in the console. If you don't see errors there, check both /var/log/kura-console.log and /var/log/kura.log for new errors.

Also, if you could post a link to your project it may be helpful. At the very least, I would like to see the MANIFEST.MF file and OSGI-INF directory.

--Dave
Re: Update bundle issue [message #1745136 is a reply to message #1745069] Wed, 05 October 2016 10:45 Go to previous messageGo to next message
Eclipse UserFriend
When I start bundle with start <bundle_id>, I don't have any error message on kura.log and in kura-console, I have errors that I partially reproduced in my first post. I attach to this post a complete version "kura-console.log"

I also attach to this post a bundle (kura.example-0.0.1-20160927.jar) generated by the project from my first post, which reproduces this issue with minimal feature.

Erwan
Re: Update bundle issue [message #1745246 is a reply to message #1745136] Thu, 06 October 2016 16:15 Go to previous messageGo to next message
Eclipse UserFriend
Your bundle seems far too complex to me. Kura uses a Manifest first approach for generating bundles, so I am not that familiar with BND tools, but it appears your build setup is not correct. One thing that jumps out at me is that the Include-Resource section is using hard coded paths to your local Maven repo D:\Logicie\apache-maven-3.3.9\.m2\. You may want to do some searching for BND builds to see if that helps simplify things. This appears to be a pretty good starting reference [1].

[1] http://stackoverflow.com/questions/31437865/osgi-bundle-dependencies

--Dave
Re: Update bundle issue [message #1745578 is a reply to message #1745246] Wed, 12 October 2016 12:31 Go to previous messageGo to next message
Eclipse UserFriend
I made a new bundle with a more conventional manifest (attached to this post) but sadly same errors occur on update.

Can it be due to a bad use of static variable none-released ?

Erwan

Re: Update bundle issue [message #1745800 is a reply to message #1745578] Mon, 17 October 2016 11:26 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

That looks much better. The classpath seems to be confused for some reason. In your bundle you are using:
lib/resteasy-client-3.0.19.Final.jar

But OSGi is dropping the 'lib':
/tmp/.kura/configuration/org.eclipse.osgi/bundles/73/1/.cp/resteasy-client-3.0.19.Final.jar

Have you tried stopping Kura and deleting that directory (rm -rf /tmp/.kura)?

Thanks,
--Dave
Re: Update bundle issue [message #1746213 is a reply to message #1745800] Tue, 25 October 2016 08:55 Go to previous messageGo to next message
Eclipse UserFriend
If I stop and relaunch Kura, the bundle works normally (without needed of deleting tmp folder).

But it isn't the expected behaviour for an OSGI server when you update a bundle.

Erwan
Re: Update bundle issue [message #1746247 is a reply to message #1746213] Tue, 25 October 2016 17:27 Go to previous messageGo to next message
Eclipse UserFriend
Agreed, but I was wondering if OSGi had cached some information along the way that it was reverting to when restarting the bundle. Did you at some point change the location of the lib files from being in the root of the bundle to /lib? I have not seen this behavior before, so I am not sure. I will try to run your bundle myself and see if I experience the same behavior. To make sure I re-create the problem correctly:

* Install the bundle and start, everything works
* Stop the bundle, then start the bundle and see the error
* Shutting down Kura and restarting, everything works

Thanks,
--Dave
Re: Update bundle issue [message #1746267 is a reply to message #1746247] Wed, 26 October 2016 05:30 Go to previous message
Eclipse UserFriend
The issue doesn't appear when stop et restart the bundle but when uninstall, reinstall and start.

So, in a nutshell :
* Install the bundle and start, everything works
* Stop the bundle, then start the bundle, everything works
* Uninstall, reinstall and start, then see the error
* Shutting down Kura and restarting, everything works

Erwan
Previous Topic:Making CloudClient static
Next Topic:ProcessUtil.exec can hang - needs timeout?
Goto Forum:
  


Current Time: Sun Oct 19 06:55:23 EDT 2025

Powered by FUDForum. Page generated in 0.06051 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top