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

Gert Vanthienen commented on FELIX-1914:
----------------------------------------

Add a *{{dev:dynamic-import}}* to enable/disable dynamic imports on a bundle in 
http://svn.apache.org/viewvc?view=revision&revision=887748
When disabling the bundle, the command will determine what packages have been 
added.

Example:
{noformat}
ka...@root> osgi:update 32 
...
Caused by: java.lang.ClassNotFoundException: org.hsqldb.jdbcDriver
        at 
org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:738)
        at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:60)
        at 
org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1650)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:399)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at 
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1130)
        ... 26 more

ka...@root> dev:dynamic-import 35
Enabling dynamic imports on bundle org.apache.servicemix.bundles.commons-dbcp 
[35]

ka...@root> osgi:update 32

ka...@root> dev:dynamic-import 35
Disabling dynamic imports on bundle org.apache.servicemix.bundles.commons-dbcp 
[35]

Additional packages wired since dynamic import was enabled:
- org.hsqldb
{noformat}

> Add a development subshell to ease troubleshooting classloading/resolution 
> issues
> ---------------------------------------------------------------------------------
>
>                 Key: FELIX-1914
>                 URL: https://issues.apache.org/jira/browse/FELIX-1914
>             Project: Felix
>          Issue Type: Improvement
>          Components: Karaf
>    Affects Versions: karaf-1.2.0
>            Reporter: Gert Vanthienen
>            Assignee: Gert Vanthienen
>             Fix For: karaf-1.4.0
>
>
> At development time, people sometimes bump into classloading or bundle 
> resolution issues.  Proposing to add a subshell with a few development tools 
> that can be used to troubleshoot these issues:
> - To solve the "unable to resolve due to constraint violation", we could 
> build a tool that discovers multiple bundles exporting the same package that 
> are needed to resolve the given bundle to give people a clue which 
> uses-constraints might be involved
> - To solve a CNFE, we could build a tool that takes a snapshot of imports, 
> enabled dynamic imports and refreshes the bundle and then checks the imported 
> packages again to see which imports were added by the dynamic import

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to