[jira] [Commented] (FELIX-5205) Webconsole and text console throw IllegalStateException

2016-03-02 Thread David Jencks (JIRA)

[ 
https://issues.apache.org/jira/browse/FELIX-5205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15176008#comment-15176008
 ] 

David Jencks commented on FELIX-5205:
-

There's an obvious immediate fix but the fact that this keeps happening rather 
than being transient suggests that when a bundle stops we aren't cleaning up 
properly.  Thanks for the report.  

> Webconsole and text console throw IllegalStateException
> ---
>
> Key: FELIX-5205
> URL: https://issues.apache.org/jira/browse/FELIX-5205
> Project: Felix
>  Issue Type: Bug
>  Components: Declarative Services (SCR), Gogo Shell, Web Console
>Affects Versions: scr-2.0.2
> Environment: Mac OSX 10.11.2 Java 1.8.0_66
>Reporter: Frank Lyaruu
>Assignee: David Jencks
>
> Recently I've upgraded my application from using Karaf 3.x to Karaf 4.x. The 
> application works fine, but sometimes (I can't reproduce consistenly but it 
> happens regularly) the 'Components' tab of the webconsole throws an 
> IllegalStateException:
> Problem accessing /system/console/components. Reason:
> Server Error
> Caused by:
> java.lang.IllegalStateException: Invalid BundleContext.
>   at 
> org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
>   at 
> org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.bundleToDTO(ServiceComponentRuntimeImpl.java:345)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.holderToDescription(ServiceComponentRuntimeImpl.java:241)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.getComponentDescriptionDTOs(ServiceComponentRuntimeImpl.java:79)
>   at 
> org.apache.felix.webconsole.plugins.ds.internal.WebConsolePlugin$RequestInfo.(WebConsolePlugin.java:615)
>   at 
> org.apache.felix.webconsole.plugins.ds.internal.WebConsolePlugin.doGet(WebConsolePlugin.java:177)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
>   at 
> org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:567)
>   at 
> org.apache.felix.webconsole.internal.servlet.KarafOsgiManager.doService(KarafOsgiManager.java:78)
>   at 
> org.apache.felix.webconsole.internal.servlet.KarafOsgiManager$1.run(KarafOsgiManager.java:58)
>   at java.security.AccessController.doPrivileged(Native Method)
>   at org.apache.karaf.util.jaas.JaasHelper.doAs(JaasHelper.java:103)
>   at 
> org.apache.felix.webconsole.internal.servlet.KarafOsgiManager.service(KarafOsgiManager.java:56)
>   at 
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
>   at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
> 
> If I do a 'scr:list' in the Gogo shell, I get a similar error:
> 2016-03-02 14:48:25,065 | ERROR | nsole user karaf | ShellUtil
> | 58 - org.apache.karaf.shell.core - 4.0.4 | Exception caught while 
> executing command
> java.lang.IllegalStateException: Invalid BundleContext.
>   at 
> org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
>   at 
> org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.bundleToDTO(ServiceComponentRuntimeImpl.java:345)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.holderToDescription(ServiceComponentRuntimeImpl.java:241)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.getComponentDescriptionDTOs(ServiceComponentRuntimeImpl.java:79)
>   at org.apache.felix.scr.impl.ScrCommand.list(ScrCommand.java:248)
>   at org.apache.felix.scr.impl.ScrGogoCommand.list(ScrGogoCommand.java:64)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method)[:1.8.0_66-internal]
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_66-internal]
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_66-internal]
>   at java.lang.reflect.Method.invoke(Method.java:497)[:1.8.0_66-internal]
>   at 
> org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)[58:org.apache.karaf.shell.core:4.0.4]
> ...
> That it happens both in Gogo and Webconsole makes me think the problem is in 
> SCR. Any ideas?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (FELIX-5205) Webconsole and text console throw IllegalStateException

2016-03-02 Thread David Jencks (JIRA)

 [ 
https://issues.apache.org/jira/browse/FELIX-5205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Jencks reassigned FELIX-5205:
---

Assignee: David Jencks

> Webconsole and text console throw IllegalStateException
> ---
>
> Key: FELIX-5205
> URL: https://issues.apache.org/jira/browse/FELIX-5205
> Project: Felix
>  Issue Type: Bug
>  Components: Declarative Services (SCR), Gogo Shell, Web Console
>Affects Versions: scr-2.0.2
> Environment: Mac OSX 10.11.2 Java 1.8.0_66
>Reporter: Frank Lyaruu
>Assignee: David Jencks
>
> Recently I've upgraded my application from using Karaf 3.x to Karaf 4.x. The 
> application works fine, but sometimes (I can't reproduce consistenly but it 
> happens regularly) the 'Components' tab of the webconsole throws an 
> IllegalStateException:
> Problem accessing /system/console/components. Reason:
> Server Error
> Caused by:
> java.lang.IllegalStateException: Invalid BundleContext.
>   at 
> org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
>   at 
> org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.bundleToDTO(ServiceComponentRuntimeImpl.java:345)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.holderToDescription(ServiceComponentRuntimeImpl.java:241)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.getComponentDescriptionDTOs(ServiceComponentRuntimeImpl.java:79)
>   at 
> org.apache.felix.webconsole.plugins.ds.internal.WebConsolePlugin$RequestInfo.(WebConsolePlugin.java:615)
>   at 
> org.apache.felix.webconsole.plugins.ds.internal.WebConsolePlugin.doGet(WebConsolePlugin.java:177)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
>   at 
> org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:567)
>   at 
> org.apache.felix.webconsole.internal.servlet.KarafOsgiManager.doService(KarafOsgiManager.java:78)
>   at 
> org.apache.felix.webconsole.internal.servlet.KarafOsgiManager$1.run(KarafOsgiManager.java:58)
>   at java.security.AccessController.doPrivileged(Native Method)
>   at org.apache.karaf.util.jaas.JaasHelper.doAs(JaasHelper.java:103)
>   at 
> org.apache.felix.webconsole.internal.servlet.KarafOsgiManager.service(KarafOsgiManager.java:56)
>   at 
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
>   at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
> 
> If I do a 'scr:list' in the Gogo shell, I get a similar error:
> 2016-03-02 14:48:25,065 | ERROR | nsole user karaf | ShellUtil
> | 58 - org.apache.karaf.shell.core - 4.0.4 | Exception caught while 
> executing command
> java.lang.IllegalStateException: Invalid BundleContext.
>   at 
> org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
>   at 
> org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.bundleToDTO(ServiceComponentRuntimeImpl.java:345)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.holderToDescription(ServiceComponentRuntimeImpl.java:241)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.getComponentDescriptionDTOs(ServiceComponentRuntimeImpl.java:79)
>   at org.apache.felix.scr.impl.ScrCommand.list(ScrCommand.java:248)
>   at org.apache.felix.scr.impl.ScrGogoCommand.list(ScrGogoCommand.java:64)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method)[:1.8.0_66-internal]
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_66-internal]
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_66-internal]
>   at java.lang.reflect.Method.invoke(Method.java:497)[:1.8.0_66-internal]
>   at 
> org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)[58:org.apache.karaf.shell.core:4.0.4]
> ...
> That it happens both in Gogo and Webconsole makes me think the problem is in 
> SCR. Any ideas?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [VOTE] Apache Felix Dependency Manager Release R8

2016-03-02 Thread Paul Bakker
+1 (non binding)
And nice job with the lambda api!

Cheers,

Paul

> On 02 Mar 2016, at 16:57, Carsten Ziegeler  wrote:
> 
> +1
> 
> 
> -- 
> Carsten Ziegeler
> Adobe Research Switzerland
> cziege...@apache.org



Re: [VOTE] Apache Felix Dependency Manager Release R8

2016-03-02 Thread Carsten Ziegeler
+1

 
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


Re: [VOTE] Apache Felix Dependency Manager Release R8

2016-03-02 Thread David Bosschaert
+1

David

On 2 March 2016 at 00:22, Pierre De Rop  wrote:

> Hi all,
>
> Second attempt to release Dependency Manager.
> Some new features in this release:  "configuration types" and a new
> "DM-lambda" library, which is described here:
>
>
> http://felix.staging.apache.org/documentation/subprojects/apache-felix-dependency-manager/guides/dm-lambda.html
>
> The R8 now requires the usage of a recent JAVA8 jdk (the new version has
> been built and tested with latest version 1.8.74)
>
> The following issues were solved:
>
> ** Bug
> * [FELIX-5146] - Service adapters turn on autoconf even if callbacks
> are used
> * [FELIX-5147] - Bundle Adapter auto configures class fields even if
> callbacks are used
> * [FELIX-5153] - DM4 calls stop before ungetService() on ServiceFactory
> components
> * [FELIX-5155] - Adapter/Aspect extra service dependencies injected
> twice if using callback instance
> * [FELIX-5178] - Make some component parameters as volatile
> * [FELIX-5181] - Only log info/debug if dm annotation log parameter is
> enabled
> * [FELIX-5187] - No errog log when configuration dependency callback is
> not found
> * [FELIX-5188] - No error log when a factory pid adapter update
> callback is not found
> * [FELIX-5192] - ConfigurationDependency race condition when component
> is stopped
> * [FELIX-5193] - Factory Pid Adapter race condition when component is
> stopped
> * [FELIX-5200] - Factory configuration adapter not restarted
>
> ** Improvement
> * [FELIX-5126] - Build DM using Java 8
> * [FELIX-5164] - Add support for callback instance in Aspects
> * [FELIX-5177] - Support injecting configuration proxies
> * [FELIX-5180] - Support for Java8 Repeatable Properties in DM
> annotations.
> * [FELIX-5182] - Cleanup DM samples
> * [FELIX-5201] - Improve how components are displayed with gogo shell
>
> ** New Feature
> * [FELIX-4689] - Create a more fluent syntax for the dependency manager
> builder
>
>
> You can use this UNIX script to download the release and verify the
> signatures:
>
>
> http://svn.apache.org/repos/asf/felix/trunk/dependencymanager/release/check_staged_release.sh
>
> Usage:
> sh check_staged_release.sh r8 /tmp/felix-staging
>
> This script, unlike the original Felix check_stage_release.sh, is specific
> to the new Dependency Manager release process (see FELIX-4818) and will
> download staging from https://dist.apache.org/repos/dist/dev/felix instead
> of http://repository.apache.org/content/repositories.
>
> To rebuild the DM binaries from the source, you can then refer to
>
> https://svn.apache.org/repos/asf/felix/trunk/dependencymanager/release/resources/src/README.src
>
>
> Please vote to approve this release:
>
> [ ] +1 Approve the release
> [ ] -1 Veto the release (please provide specific comments)
>
>
> Many thanks;
>
> regards;
> /Pierre
>


[jira] [Commented] (FELIX-5204) IllegalStateException when using custom URL handlers for bundles

2016-03-02 Thread Guillaume Nodet (JIRA)

[ 
https://issues.apache.org/jira/browse/FELIX-5204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15175719#comment-15175719
 ] 

Guillaume Nodet commented on FELIX-5204:


We use the Mina SSHD server in Karaf.
The problem happens when we restart the framework without restarting the JVM.  
The reason is that the javax.crypto package has some internal cache about 
Cipher providers.  The providers are cached by the protection domain source 
code url.

See 
http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/9b8c96f96a0f/src/share/classes/javax/crypto/JceSecurityManager.java#l79

Here's what happens:
  * the JVM starts, the OSGi framework starts, the SSH bundle is installed with 
a {{mvn:org.apache.sshd/sshd-core/1.0.0}} url (the url handler is an OSGi url 
handler, so provided by a pax-url bundle)
  * when the SSH server starts, the JceSecurityManager caches the Cipher 
provider with this url
  * the framework is restarted
  * when the SSH server starts again, the JceSecurityManager calls {{get}} on 
the cache indexed by the URL, but the URL in the cache is no longer valid and 
the {{URLHandlersStreamHandlerProxy.equals}} throws the exception indicated

This obviously only happen when the bundle is installed with a 
{{mvn:org.apache.sshd/sshd-core/1.0.0}} and not a 
{{file:system/org/apache/sshd/sshd-core/1.0.0/sshd-core-1.0.0.jar}} url.

I think it's a bad idea that the BundleProtectionDomain uses a URL which may 
not be valid after the framework is shutdown. My initial thinking was to use 
the jar bundle revision path instead, something like 
{{file:data/cache/bundle32/11.0/bundle.jar}}.
It seems that's the way Equinox works fwiw.
Especially, if the bundle is updated, I think the 2 code source should be 
different, and using the original location used to install / update the url 
does not bring this guarantee.  Using the bundle revision instead seems cleaner 
to me.

> IllegalStateException when using custom URL handlers for bundles
> 
>
> Key: FELIX-5204
> URL: https://issues.apache.org/jira/browse/FELIX-5204
> Project: Felix
>  Issue Type: Bug
>  Components: Framework
>Affects Versions: framework-5.4.0
>Reporter: Guillaume Nodet
>Assignee: Guillaume Nodet
> Fix For: framework-5.6.0
>
>
> The following exception can happen after having restarted the whole framework.
> {code}
> java.lang.IllegalStateException: Stream handler unavailable.
>   at 
> org.apache.felix.framework.URLHandlersStreamHandlerProxy.getDefaultPort(URLHandlersStreamHandlerProxy.java:180)
>   at java.net.URLStreamHandler.sameFile(URLStreamHandler.java:407)
>   at 
> org.osgi.service.url.AbstractURLStreamHandlerService.sameFile(AbstractURLStreamHandlerService.java:131)
>   at java.net.URLStreamHandler.equals(URLStreamHandler.java:333)
>   at 
> org.osgi.service.url.AbstractURLStreamHandlerService.equals(AbstractURLStreamHandlerService.java:81)
>   at 
> org.apache.felix.framework.URLHandlersStreamHandlerProxy.equals(URLHandlersStreamHandlerProxy.java:163)
>   at java.net.URL.equals(URL.java:870)
>   at 
> java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:940)
>   at 
> javax.crypto.JceSecurityManager.getCryptoPermission(JceSecurityManager.java:124)
>   at javax.crypto.Cipher.getConfiguredPermission(Cipher.java:2587)
>   at javax.crypto.Cipher.initCryptoPermission(Cipher.java:700)
>   at javax.crypto.Cipher.chooseProvider(Cipher.java:863)
>   at javax.crypto.Cipher.init(Cipher.java:1396)
>   at javax.crypto.Cipher.init(Cipher.java:1327)
>   at org.apache.sshd.common.cipher.BaseCipher.init(BaseCipher.java:60)
>   at org.apache.karaf.shell.ssh.SshUtils.buildCiphers(SshUtils.java:89)
>   at 
> org.apache.karaf.shell.ssh.Activator.createSshServer(Activator.java:183)
>   at org.apache.karaf.shell.ssh.Activator.doStart(Activator.java:111)
>   at 
> org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:233)
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
> {code}
> The problems seems to be that the ProtectionDomain of the classes loaded from 
> bundles do use the URL handler as their code source.  This means that any 
> access to those URL will throw IllegalStateException after the framework has 
> been shutdown.
> The protection domain should use the url the jar from the filesystem for the 
> code source url instead.



--
This message was sent by Atlassian JIRA
(v6.3

[jira] [Created] (FELIX-5205) Webconsole and text console throw IllegalStateException

2016-03-02 Thread Frank Lyaruu (JIRA)
Frank Lyaruu created FELIX-5205:
---

 Summary: Webconsole and text console throw IllegalStateException
 Key: FELIX-5205
 URL: https://issues.apache.org/jira/browse/FELIX-5205
 Project: Felix
  Issue Type: Bug
  Components: Declarative Services (SCR), Gogo Shell, Web Console
Affects Versions: scr-2.0.2
 Environment: Mac OSX 10.11.2 Java 1.8.0_66
Reporter: Frank Lyaruu


Recently I've upgraded my application from using Karaf 3.x to Karaf 4.x. The 
application works fine, but sometimes (I can't reproduce consistenly but it 
happens regularly) the 'Components' tab of the webconsole throws an 
IllegalStateException:

Problem accessing /system/console/components. Reason:

Server Error
Caused by:

java.lang.IllegalStateException: Invalid BundleContext.
at 
org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
at 
org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114)
at 
org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.bundleToDTO(ServiceComponentRuntimeImpl.java:345)
at 
org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.holderToDescription(ServiceComponentRuntimeImpl.java:241)
at 
org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.getComponentDescriptionDTOs(ServiceComponentRuntimeImpl.java:79)
at 
org.apache.felix.webconsole.plugins.ds.internal.WebConsolePlugin$RequestInfo.(WebConsolePlugin.java:615)
at 
org.apache.felix.webconsole.plugins.ds.internal.WebConsolePlugin.doGet(WebConsolePlugin.java:177)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at 
org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:567)
at 
org.apache.felix.webconsole.internal.servlet.KarafOsgiManager.doService(KarafOsgiManager.java:78)
at 
org.apache.felix.webconsole.internal.servlet.KarafOsgiManager$1.run(KarafOsgiManager.java:58)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.karaf.util.jaas.JaasHelper.doAs(JaasHelper.java:103)
at 
org.apache.felix.webconsole.internal.servlet.KarafOsgiManager.service(KarafOsgiManager.java:56)
at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)


If I do a 'scr:list' in the Gogo shell, I get a similar error:

2016-03-02 14:48:25,065 | ERROR | nsole user karaf | ShellUtil  
  | 58 - org.apache.karaf.shell.core - 4.0.4 | Exception caught while 
executing command
java.lang.IllegalStateException: Invalid BundleContext.
at 
org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
at 
org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114)
at 
org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.bundleToDTO(ServiceComponentRuntimeImpl.java:345)
at 
org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.holderToDescription(ServiceComponentRuntimeImpl.java:241)
at 
org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.getComponentDescriptionDTOs(ServiceComponentRuntimeImpl.java:79)
at org.apache.felix.scr.impl.ScrCommand.list(ScrCommand.java:248)
at org.apache.felix.scr.impl.ScrGogoCommand.list(ScrGogoCommand.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)[:1.8.0_66-internal]
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_66-internal]
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_66-internal]
at java.lang.reflect.Method.invoke(Method.java:497)[:1.8.0_66-internal]
at 
org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)[58:org.apache.karaf.shell.core:4.0.4]
...

That it happens both in Gogo and Webconsole makes me think the problem is in 
SCR. Any ideas?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FELIX-5205) Webconsole and text console throw IllegalStateException

2016-03-02 Thread Frank Lyaruu (JIRA)

[ 
https://issues.apache.org/jira/browse/FELIX-5205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15175736#comment-15175736
 ] 

Frank Lyaruu commented on FELIX-5205:
-

If this happens, it keeps happening until I restart the app. After that, about 
50 % chance it will happen again.

It is a rather large application (300+ bundles) that works fine under Karaf 3 
(SCR 1.8.x). While I can't rule out that there is something wrong with a 
service component declaration somewhere, I'd expect scr:list / webconsole to be 
a bit more defensive and not completely break down, or at least log something.

> Webconsole and text console throw IllegalStateException
> ---
>
> Key: FELIX-5205
> URL: https://issues.apache.org/jira/browse/FELIX-5205
> Project: Felix
>  Issue Type: Bug
>  Components: Declarative Services (SCR), Gogo Shell, Web Console
>Affects Versions: scr-2.0.2
> Environment: Mac OSX 10.11.2 Java 1.8.0_66
>Reporter: Frank Lyaruu
>
> Recently I've upgraded my application from using Karaf 3.x to Karaf 4.x. The 
> application works fine, but sometimes (I can't reproduce consistenly but it 
> happens regularly) the 'Components' tab of the webconsole throws an 
> IllegalStateException:
> Problem accessing /system/console/components. Reason:
> Server Error
> Caused by:
> java.lang.IllegalStateException: Invalid BundleContext.
>   at 
> org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
>   at 
> org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.bundleToDTO(ServiceComponentRuntimeImpl.java:345)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.holderToDescription(ServiceComponentRuntimeImpl.java:241)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.getComponentDescriptionDTOs(ServiceComponentRuntimeImpl.java:79)
>   at 
> org.apache.felix.webconsole.plugins.ds.internal.WebConsolePlugin$RequestInfo.(WebConsolePlugin.java:615)
>   at 
> org.apache.felix.webconsole.plugins.ds.internal.WebConsolePlugin.doGet(WebConsolePlugin.java:177)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
>   at 
> org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:567)
>   at 
> org.apache.felix.webconsole.internal.servlet.KarafOsgiManager.doService(KarafOsgiManager.java:78)
>   at 
> org.apache.felix.webconsole.internal.servlet.KarafOsgiManager$1.run(KarafOsgiManager.java:58)
>   at java.security.AccessController.doPrivileged(Native Method)
>   at org.apache.karaf.util.jaas.JaasHelper.doAs(JaasHelper.java:103)
>   at 
> org.apache.felix.webconsole.internal.servlet.KarafOsgiManager.service(KarafOsgiManager.java:56)
>   at 
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
>   at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
> 
> If I do a 'scr:list' in the Gogo shell, I get a similar error:
> 2016-03-02 14:48:25,065 | ERROR | nsole user karaf | ShellUtil
> | 58 - org.apache.karaf.shell.core - 4.0.4 | Exception caught while 
> executing command
> java.lang.IllegalStateException: Invalid BundleContext.
>   at 
> org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)
>   at 
> org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:114)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.bundleToDTO(ServiceComponentRuntimeImpl.java:345)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.holderToDescription(ServiceComponentRuntimeImpl.java:241)
>   at 
> org.apache.felix.scr.impl.runtime.ServiceComponentRuntimeImpl.getComponentDescriptionDTOs(ServiceComponentRuntimeImpl.java:79)
>   at org.apache.felix.scr.impl.ScrCommand.list(ScrCommand.java:248)
>   at org.apache.felix.scr.impl.ScrGogoCommand.list(ScrGogoCommand.java:64)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method)[:1.8.0_66-internal]
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_66-internal]
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_66-internal]
>   at java.lang.reflect.Method.invoke(Method.java:497)[:1.8.0_66-internal]
>   at 
> org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)[58:org.apache.karaf.shell.core:4.0.4]
> ...
> That it happens both in Gogo and Webconsole makes me think the problem is in 
> SCR. Any ideas?



--
This message 

[jira] [Commented] (FELIX-5204) IllegalStateException when using custom URL handlers for bundles

2016-03-02 Thread Karl Pauls (JIRA)

[ 
https://issues.apache.org/jira/browse/FELIX-5204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15175573#comment-15175573
 ] 

Karl Pauls commented on FELIX-5204:
---

I'm not sure I completely understand what is going on just yet. There was some 
reason we did the protection domain code source the way it is. It's certainly 
possible that there is a bug somewhere which causes this issue but I'm not sure 
just using the jar url from the filesystem is the correct fix... Could you 
describe the problem in a little more depth?

> IllegalStateException when using custom URL handlers for bundles
> 
>
> Key: FELIX-5204
> URL: https://issues.apache.org/jira/browse/FELIX-5204
> Project: Felix
>  Issue Type: Bug
>  Components: Framework
>Affects Versions: framework-5.4.0
>Reporter: Guillaume Nodet
>Assignee: Guillaume Nodet
> Fix For: framework-5.6.0
>
>
> The following exception can happen after having restarted the whole framework.
> {code}
> java.lang.IllegalStateException: Stream handler unavailable.
>   at 
> org.apache.felix.framework.URLHandlersStreamHandlerProxy.getDefaultPort(URLHandlersStreamHandlerProxy.java:180)
>   at java.net.URLStreamHandler.sameFile(URLStreamHandler.java:407)
>   at 
> org.osgi.service.url.AbstractURLStreamHandlerService.sameFile(AbstractURLStreamHandlerService.java:131)
>   at java.net.URLStreamHandler.equals(URLStreamHandler.java:333)
>   at 
> org.osgi.service.url.AbstractURLStreamHandlerService.equals(AbstractURLStreamHandlerService.java:81)
>   at 
> org.apache.felix.framework.URLHandlersStreamHandlerProxy.equals(URLHandlersStreamHandlerProxy.java:163)
>   at java.net.URL.equals(URL.java:870)
>   at 
> java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:940)
>   at 
> javax.crypto.JceSecurityManager.getCryptoPermission(JceSecurityManager.java:124)
>   at javax.crypto.Cipher.getConfiguredPermission(Cipher.java:2587)
>   at javax.crypto.Cipher.initCryptoPermission(Cipher.java:700)
>   at javax.crypto.Cipher.chooseProvider(Cipher.java:863)
>   at javax.crypto.Cipher.init(Cipher.java:1396)
>   at javax.crypto.Cipher.init(Cipher.java:1327)
>   at org.apache.sshd.common.cipher.BaseCipher.init(BaseCipher.java:60)
>   at org.apache.karaf.shell.ssh.SshUtils.buildCiphers(SshUtils.java:89)
>   at 
> org.apache.karaf.shell.ssh.Activator.createSshServer(Activator.java:183)
>   at org.apache.karaf.shell.ssh.Activator.doStart(Activator.java:111)
>   at 
> org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:233)
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
> {code}
> The problems seems to be that the ProtectionDomain of the classes loaded from 
> bundles do use the URL handler as their code source.  This means that any 
> access to those URL will throw IllegalStateException after the framework has 
> been shutdown.
> The protection domain should use the url the jar from the filesystem for the 
> code source url instead.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (FELIX-5204) IllegalStateException when using custom URL handlers for bundles

2016-03-02 Thread Guillaume Nodet (JIRA)
Guillaume Nodet created FELIX-5204:
--

 Summary: IllegalStateException when using custom URL handlers for 
bundles
 Key: FELIX-5204
 URL: https://issues.apache.org/jira/browse/FELIX-5204
 Project: Felix
  Issue Type: Bug
  Components: Framework
Affects Versions: framework-5.4.0
Reporter: Guillaume Nodet
Assignee: Guillaume Nodet
 Fix For: framework-5.6.0


The following exception can happen after having restarted the whole framework.

{code}
java.lang.IllegalStateException: Stream handler unavailable.
at 
org.apache.felix.framework.URLHandlersStreamHandlerProxy.getDefaultPort(URLHandlersStreamHandlerProxy.java:180)
at java.net.URLStreamHandler.sameFile(URLStreamHandler.java:407)
at 
org.osgi.service.url.AbstractURLStreamHandlerService.sameFile(AbstractURLStreamHandlerService.java:131)
at java.net.URLStreamHandler.equals(URLStreamHandler.java:333)
at 
org.osgi.service.url.AbstractURLStreamHandlerService.equals(AbstractURLStreamHandlerService.java:81)
at 
org.apache.felix.framework.URLHandlersStreamHandlerProxy.equals(URLHandlersStreamHandlerProxy.java:163)
at java.net.URL.equals(URL.java:870)
at 
java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:940)
at 
javax.crypto.JceSecurityManager.getCryptoPermission(JceSecurityManager.java:124)
at javax.crypto.Cipher.getConfiguredPermission(Cipher.java:2587)
at javax.crypto.Cipher.initCryptoPermission(Cipher.java:700)
at javax.crypto.Cipher.chooseProvider(Cipher.java:863)
at javax.crypto.Cipher.init(Cipher.java:1396)
at javax.crypto.Cipher.init(Cipher.java:1327)
at org.apache.sshd.common.cipher.BaseCipher.init(BaseCipher.java:60)
at org.apache.karaf.shell.ssh.SshUtils.buildCiphers(SshUtils.java:89)
at 
org.apache.karaf.shell.ssh.Activator.createSshServer(Activator.java:183)
at org.apache.karaf.shell.ssh.Activator.doStart(Activator.java:111)
at 
org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:233)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
{code}

The problems seems to be that the ProtectionDomain of the classes loaded from 
bundles do use the URL handler as their code source.  This means that any 
access to those URL will throw IllegalStateException after the framework has 
been shutdown.
The protection domain should use the url the jar from the filesystem for the 
code source url instead.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [VOTE] Apache Felix Dependency Manager Release R8

2016-03-02 Thread Joune
+1 (non binding)

Nice one Pierre, thanks!

--
http:/arjunpanday.tumblr.com 
http://www.arjunpanday.fr

On Wed, Mar 2, 2016 at 1:22 AM, Pierre De Rop 
wrote:

> Hi all,
>
> Second attempt to release Dependency Manager.
> Some new features in this release:  "configuration types" and a new
> "DM-lambda" library, which is described here:
>
>
> http://felix.staging.apache.org/documentation/subprojects/apache-felix-dependency-manager/guides/dm-lambda.html
>
> The R8 now requires the usage of a recent JAVA8 jdk (the new version has
> been built and tested with latest version 1.8.74)
>
> The following issues were solved:
>
> ** Bug
> * [FELIX-5146] - Service adapters turn on autoconf even if callbacks
> are used
> * [FELIX-5147] - Bundle Adapter auto configures class fields even if
> callbacks are used
> * [FELIX-5153] - DM4 calls stop before ungetService() on ServiceFactory
> components
> * [FELIX-5155] - Adapter/Aspect extra service dependencies injected
> twice if using callback instance
> * [FELIX-5178] - Make some component parameters as volatile
> * [FELIX-5181] - Only log info/debug if dm annotation log parameter is
> enabled
> * [FELIX-5187] - No errog log when configuration dependency callback is
> not found
> * [FELIX-5188] - No error log when a factory pid adapter update
> callback is not found
> * [FELIX-5192] - ConfigurationDependency race condition when component
> is stopped
> * [FELIX-5193] - Factory Pid Adapter race condition when component is
> stopped
> * [FELIX-5200] - Factory configuration adapter not restarted
>
> ** Improvement
> * [FELIX-5126] - Build DM using Java 8
> * [FELIX-5164] - Add support for callback instance in Aspects
> * [FELIX-5177] - Support injecting configuration proxies
> * [FELIX-5180] - Support for Java8 Repeatable Properties in DM
> annotations.
> * [FELIX-5182] - Cleanup DM samples
> * [FELIX-5201] - Improve how components are displayed with gogo shell
>
> ** New Feature
> * [FELIX-4689] - Create a more fluent syntax for the dependency manager
> builder
>
>
> You can use this UNIX script to download the release and verify the
> signatures:
>
>
> http://svn.apache.org/repos/asf/felix/trunk/dependencymanager/release/check_staged_release.sh
>
> Usage:
> sh check_staged_release.sh r8 /tmp/felix-staging
>
> This script, unlike the original Felix check_stage_release.sh, is specific
> to the new Dependency Manager release process (see FELIX-4818) and will
> download staging from https://dist.apache.org/repos/dist/dev/felix instead
> of http://repository.apache.org/content/repositories.
>
> To rebuild the DM binaries from the source, you can then refer to
>
> https://svn.apache.org/repos/asf/felix/trunk/dependencymanager/release/resources/src/README.src
>
>
> Please vote to approve this release:
>
> [ ] +1 Approve the release
> [ ] -1 Veto the release (please provide specific comments)
>
>
> Many thanks;
>
> regards;
> /Pierre
>


[jira] [Updated] (FELIX-3830) Web Console Home Page

2016-03-02 Thread Carsten Ziegeler (JIRA)

 [ 
https://issues.apache.org/jira/browse/FELIX-3830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler updated FELIX-3830:

Labels:   (was: tdoms)

> Web Console Home Page
> -
>
> Key: FELIX-3830
> URL: https://issues.apache.org/jira/browse/FELIX-3830
> Project: Felix
>  Issue Type: Bug
>  Components: Web Console
>Reporter: Wim
>
> Please consider updating your homepage.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (FELIX-3830) Web Console Home Page

2016-03-02 Thread Carsten Ziegeler (JIRA)

 [ 
https://issues.apache.org/jira/browse/FELIX-3830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Carsten Ziegeler closed FELIX-3830.
---
Resolution: Fixed

> Web Console Home Page
> -
>
> Key: FELIX-3830
> URL: https://issues.apache.org/jira/browse/FELIX-3830
> Project: Felix
>  Issue Type: Bug
>  Components: Web Console
>Reporter: Wim
>
> Please consider updating your homepage.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (FELIX-4694) Support binding configuration to all registrations with the corresponding PID

2016-03-02 Thread Tuomas Kiviaho (JIRA)

 [ 
https://issues.apache.org/jira/browse/FELIX-4694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tuomas Kiviaho updated FELIX-4694:
--
Affects Version/s: fileinstall-3.5.0

> Support binding configuration to all registrations with the corresponding PID
> -
>
> Key: FELIX-4694
> URL: https://issues.apache.org/jira/browse/FELIX-4694
> Project: Felix
>  Issue Type: Improvement
>  Components: File Install
>Affects Versions: fileinstall-3.5.0
>Reporter: Tuomas Kiviaho
> Attachments: ConfigInstaller.patch
>
>
> Currently configurations are created without specifying bundle location so 
> there is no way to share configuration using fileinstall.  
> {{getConfiguration}} states that 
> {code}
>* ... If the
>* location parameter is {@code null}, it will be set when a Managed 
> Service
>* with the corresponding PID is registered for the first time. If the
>* location starts with {@code ?} then the configuration is bound to all
>* targets that are registered with the corresponding PID.
> {code}
> Now I'm forced to tweak the {{felix.cm.dir}} directly which is quite error 
> prone approach.
> I'd be satisfied event with a global boolean flag which would enable the 
> sharing, but I guess a more appropriate choice would be to do it per cfg. 
> Another idea would be to mimic {{felix.cm.dir}} behavior so that various 
> {{service.}} prefixed properties (not just {{service.bundleLocation}}) would 
> be removed from the dictionary itself and be used only when communicating 
> with {{ConfigurationAdmin}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (FELIX-4694) Support binding configuration to all registrations with the corresponding PID

2016-03-02 Thread Tuomas Kiviaho (JIRA)

 [ 
https://issues.apache.org/jira/browse/FELIX-4694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tuomas Kiviaho updated FELIX-4694:
--
Flags: Patch

> Support binding configuration to all registrations with the corresponding PID
> -
>
> Key: FELIX-4694
> URL: https://issues.apache.org/jira/browse/FELIX-4694
> Project: Felix
>  Issue Type: Improvement
>  Components: File Install
>Reporter: Tuomas Kiviaho
> Attachments: ConfigInstaller.patch
>
>
> Currently configurations are created without specifying bundle location so 
> there is no way to share configuration using fileinstall.  
> {{getConfiguration}} states that 
> {code}
>* ... If the
>* location parameter is {@code null}, it will be set when a Managed 
> Service
>* with the corresponding PID is registered for the first time. If the
>* location starts with {@code ?} then the configuration is bound to all
>* targets that are registered with the corresponding PID.
> {code}
> Now I'm forced to tweak the {{felix.cm.dir}} directly which is quite error 
> prone approach.
> I'd be satisfied event with a global boolean flag which would enable the 
> sharing, but I guess a more appropriate choice would be to do it per cfg. 
> Another idea would be to mimic {{felix.cm.dir}} behavior so that various 
> {{service.}} prefixed properties (not just {{service.bundleLocation}}) would 
> be removed from the dictionary itself and be used only when communicating 
> with {{ConfigurationAdmin}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (FELIX-4694) Support binding configuration to all registrations with the corresponding PID

2016-03-02 Thread Tuomas Kiviaho (JIRA)

 [ 
https://issues.apache.org/jira/browse/FELIX-4694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tuomas Kiviaho updated FELIX-4694:
--
Attachment: ConfigInstaller.patch

Here's a patch that I seem to have forgot to add back in the day. Nothing much 
to it except the file deletion enhancement to omit unnecessary config creation.

> Support binding configuration to all registrations with the corresponding PID
> -
>
> Key: FELIX-4694
> URL: https://issues.apache.org/jira/browse/FELIX-4694
> Project: Felix
>  Issue Type: Improvement
>  Components: File Install
>Reporter: Tuomas Kiviaho
> Attachments: ConfigInstaller.patch
>
>
> Currently configurations are created without specifying bundle location so 
> there is no way to share configuration using fileinstall.  
> {{getConfiguration}} states that 
> {code}
>* ... If the
>* location parameter is {@code null}, it will be set when a Managed 
> Service
>* with the corresponding PID is registered for the first time. If the
>* location starts with {@code ?} then the configuration is bound to all
>* targets that are registered with the corresponding PID.
> {code}
> Now I'm forced to tweak the {{felix.cm.dir}} directly which is quite error 
> prone approach.
> I'd be satisfied event with a global boolean flag which would enable the 
> sharing, but I guess a more appropriate choice would be to do it per cfg. 
> Another idea would be to mimic {{felix.cm.dir}} behavior so that various 
> {{service.}} prefixed properties (not just {{service.bundleLocation}}) would 
> be removed from the dictionary itself and be used only when communicating 
> with {{ConfigurationAdmin}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (FELIX-3830) Web Console Home Page

2016-03-02 Thread Wim (JIRA)

 [ 
https://issues.apache.org/jira/browse/FELIX-3830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wim updated FELIX-3830:
---
Labels: tdoms  (was: )

> Web Console Home Page
> -
>
> Key: FELIX-3830
> URL: https://issues.apache.org/jira/browse/FELIX-3830
> Project: Felix
>  Issue Type: Bug
>  Components: Web Console
>Reporter: Wim
>  Labels: tdoms
>
> Please consider updating your homepage.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)