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

Jean-Baptiste Onofré commented on KARAF-3217:
---------------------------------------------

Just an update about this. IMHO it's not an issue, just maybe "bad message" 
coming from Gogo Runtime.

Let me example:

1. {{scr:*}} commands are not provided by Karaf, but directly by Felix SCR. 
They are not "Karaf command" but "old style gogo commands".

2. In order to support "old style gogo commands", Karaf use the shell compat 
layer, delegating execution to Gogo Runtime.

3. When the provided arguments (at execution) don't correspond to the command 
expectation, {{Reflective}} throws the {{Cannot coerce %s(%s) to any of %s}}. 
See 
[https://github.com/apache/felix-dev/blob/master/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Reflective.java#L204]

 

So, basically, this IllegalArgumentException will be throw when the command 
arguments and the provided arguments don't match (in number or type).

I still don't consider this as a bug, but a bad usage (provided arguments don't 
match).

We have two options:
 # On Gogo Runtime {{Reflective}}, I'm updating the 
{{IllegalArgumentException}} message to have something more "understandable", 
something like: {{Provided arguments don't match the command expected 
arguments}}.
 # I "exclude" the Felix SCR Gogo runtime command, and replace with "Karaf 
native" commands.

Anyway, I'm postponing this for next Karaf releases cycle.

> Karaf shell - scr:info - Cannot coerce info() to any of [(String)]
> ------------------------------------------------------------------
>
>                 Key: KARAF-3217
>                 URL: https://issues.apache.org/jira/browse/KARAF-3217
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 2.3.7
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>            Priority: Minor
>
> To reproduce using a vanilla karaf 2.3.7
> bin/karaf
> features:install scr
> scr:list
> scr:aaa
> scr:info
> {code}
> karaf@root> scr:info
> Error executing command: Cannot coerce info() to any of [(String)]
> karaf@root> log:tail
> 2014-09-09 11:48:49,932 | INFO  | JMX OSGi Agent   | core                     
>         | ?                                   ? | 24 - 
> org.apache.aries.jmx.core - 1.1.1 | Registering 
> org.osgi.jmx.framework.wiring.BundleWiringStateMBean to MBeanServer 
> com.sun.jmx.mbeanserver.JmxMBeanServer@7f7c3215 with name 
> osgi.core:type=wiringState,version=1.1,framework=org.apache.felix.framework,uuid=e0fc1809-e35b-4124-b942-288b4499066e
> 2014-09-09 11:48:49,933 | INFO  | JMX OSGi Agent   | core                     
>         | ?                                   ? | 24 - 
> org.apache.aries.jmx.core - 1.1.1 | Registering 
> org.osgi.jmx.framework.FrameworkMBean to MBeanServer 
> com.sun.jmx.mbeanserver.JmxMBeanServer@7f7c3215 with name 
> osgi.core:type=framework,version=1.7,framework=org.apache.felix.framework,uuid=e0fc1809-e35b-4124-b942-288b4499066e
> 2014-09-09 11:48:49,934 | INFO  | JMX OSGi Agent   | core                     
>         | ?                                   ? | 24 - 
> org.apache.aries.jmx.core - 1.1.1 | Registering 
> org.osgi.jmx.framework.PackageStateMBean to MBeanServer 
> com.sun.jmx.mbeanserver.JmxMBeanServer@7f7c3215 with name 
> osgi.core:type=packageState,version=1.5,framework=org.apache.felix.framework,uuid=e0fc1809-e35b-4124-b942-288b4499066e
> 2014-09-09 11:48:49,934 | INFO  | JMX OSGi Agent   | core                     
>         | ?                                   ? | 24 - 
> org.apache.aries.jmx.core - 1.1.1 | Registering 
> org.osgi.jmx.service.cm.ConfigurationAdminMBean to MBeanServer 
> com.sun.jmx.mbeanserver.JmxMBeanServer@7f7c3215 with name 
> osgi.compendium:service=cm,version=1.3,framework=org.apache.felix.framework,uuid=e0fc1809-e35b-4124-b942-288b4499066e
> 2014-09-09 11:48:49,934 | INFO  | JMX OSGi Agent   | core                     
>         | ?                                   ? | 24 - 
> org.apache.aries.jmx.core - 1.1.1 | Registering 
> org.osgi.jmx.framework.ServiceStateMBean to MBeanServer 
> com.sun.jmx.mbeanserver.JmxMBeanServer@7f7c3215 with name 
> osgi.core:type=serviceState,version=1.7,framework=org.apache.felix.framework,uuid=e0fc1809-e35b-4124-b942-288b4499066e
> 2014-09-09 11:48:49,935 | INFO  | JMX OSGi Agent   | core                     
>         | ?                                   ? | 24 - 
> org.apache.aries.jmx.core - 1.1.1 | Registering 
> org.osgi.jmx.framework.BundleStateMBean to MBeanServer 
> com.sun.jmx.mbeanserver.JmxMBeanServer@7f7c3215 with name 
> osgi.core:type=bundleState,version=1.7,framework=org.apache.felix.framework,uuid=e0fc1809-e35b-4124-b942-288b4499066e
> 2014-09-09 11:49:01,730 | INFO  | l Console Thread | DetailsCommandComponent  
>         | hell.scr.DetailsCommandComponent   67 | 57 - 
> org.apache.karaf.shell.scr - 2.3.7 | Activating the Apache Karaf SCR Details 
> Command
> 2014-09-09 11:49:01,738 | INFO  | l Console Thread | ListCommandComponent     
>         | f.shell.scr.ListCommandComponent   61 | 57 - 
> org.apache.karaf.shell.scr - 2.3.7 | Activating the Apache Karaf SCR List 
> Command
> 2014-09-09 11:49:01,741 | INFO  | l Console Thread | ActivateCommandComponent 
>         | ell.scr.ActivateCommandComponent   66 | 57 - 
> org.apache.karaf.shell.scr - 2.3.7 | Activating the Apache Karaf SCR Activate 
> Command
> 2014-09-09 11:49:01,743 | INFO  | l Console Thread | 
> DeactivateCommandComponent       | l.scr.DeactivateCommandComponent   66 | 57 
> - org.apache.karaf.shell.scr - 2.3.7 | Activating the Apache Karaf SCR 
> Deactivate Command
> 2014-09-09 11:49:01,757 | INFO  | l Console Thread | ScrServiceMBeanImpl      
>         | scr.internal.ScrServiceMBeanImpl   78 | 58 - 
> org.apache.karaf.management.mbeans.scr - 2.3.7 | Activating the Apache Karaf 
> SCR Service MBean
> 2014-09-09 11:49:10,839 | ERROR | l Console Thread | Console                  
>         | araf.shell.console.jline.Console  213 | 14 - 
> org.apache.karaf.shell.console - 2.3.7 | Exception caught while executing 
> command
> java.lang.IllegalArgumentException: Cannot coerce info() to any of [(String)]
>       at 
> org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:178)[14:org.apache.karaf.shell.console:2.3.7]
>       at 
> org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)[14:org.apache.karaf.shell.console:2.3.7]
>       at 
> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.7]
>       at 
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.7]
>       at 
> org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.7]
>       at 
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.7]
>       at 
> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.7]
>       at 
> org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.7]
>       at 
> org.apache.karaf.shell.console.jline.Console.run(Console.java:184)[14:org.apache.karaf.shell.console:2.3.7]
>       at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]
> {code}
> There is no scr:info command, but somehow the shell tries something different?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to