You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2008/06/04 10:45:00 UTC

[jira] Created: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

ResolverUtil can't resolve class under osgi enviroment
------------------------------------------------------

                 Key: CAMEL-577
                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
             Project: Apache Camel
          Issue Type: Improvement
            Reporter: Freeman Fang


in method of 
protected void find(Test test, String packageName, ClassLoader loader) 
it try to load class  from directory or jar, it works for standalone mode.
But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case


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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43230#action_43230 ] 

Claus Ibsen commented on CAMEL-577:
-----------------------------------

Could be related to he webstart issue as well.

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>            Reporter: Freeman Fang
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Resolved: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang resolved CAMEL-577.
--------------------------------

    Resolution: Fixed

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43420#action_43420 ] 

Freeman Fang commented on CAMEL-577:
------------------------------------

Hi Claus,

Yes, I have tried it with ServiceMix 4.0 which is osgi container and it works well.

Thanks 

Freeman

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43406#action_43406 ] 

Claus Ibsen commented on CAMEL-577:
-----------------------------------

Freeman, why are you returning early if its a spring delegating bundle loader?

{code}
+    	if (loader.getClass().getName().equals("org.springframework.osgi.util.BundleDelegatingClassLoader")) {
+    		
+    		return;
+    	}
{code}

Is it because its loaded using bundles before, if so could you not return just after the loading from bundle, or move the check into that code, so its nearly the bundle stuff.

At least I think there should be some comments in the code why we return only for this osgi classloader.


> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Reopened: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Wojciech Durczynski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wojciech Durczynski reopened CAMEL-577:
---------------------------------------


> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43292#action_43292 ] 

Claus Ibsen commented on CAMEL-577:
-----------------------------------

Cheers Freeman, as you are on top of the ServiceMix and thus works with an OSGi kernel where you can test it for real.

And hopefully it fixes some of the related issues as well.

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43411#action_43411 ] 

Freeman Fang commented on CAMEL-577:
------------------------------------

Hi Claus,
You are correct
This code 
+      if (loader.getClass().getName().equals("org.springframework.osgi.util.BundleDelegatingClassLoader")) {
+    		
+    		return;
+    	}

shouldn't be in the patch at all. I forget to remove it after the change to avoid using hardcode classloader name

I will re upload a new patch soon, so for it

Freeman



> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Updated: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang updated CAMEL-577:
-------------------------------

    Attachment:     (was: CAMEL-577.patch)

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43413#action_43413 ] 

Freeman Fang commented on CAMEL-577:
------------------------------------

new patch uploaded
Thanks 

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Updated: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang updated CAMEL-577:
-------------------------------

    Attachment: CAMEL-577.patch

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Resolved: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-577.
-------------------------------

    Resolution: Fixed

Thanks Freeman, looks okay that the bundle can be identified from the log.

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43231#action_43231 ] 

Claus Ibsen commented on CAMEL-577:
-----------------------------------

I dont suppose that just removing the leading / would resolve the issue?

Freeman, can you provide a patch to fix it or any more hint/helps? Or attaching a small sample project that illustrates the bug/problem in Camel.

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>            Reporter: Freeman Fang
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Updated: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-577:
------------------------------

    Affects Version/s: 1.3.0
          Component/s: camel-core

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Updated: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang updated CAMEL-577:
-------------------------------

    Attachment:     (was: CAMEL-577.patch)

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43490#action_43490 ] 

Claus Ibsen commented on CAMEL-577:
-----------------------------------

Guillaume, thanks for reporting this.

What would be a good strategy to resolve this?

A quick idea is having a new OsgiResolverUtil class that ResolverUtil could resort to if it should load in bundle?
Since Camel detects if it should try bundle without having hard dependecy this is doable:
{code}
            Method mth = loader.getClass().getMethod("getBundle", new Class[] {});
            if (mth != null) {
                // it's osgi bundle class loader, so we need to load implementation in bundles
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Loading from osgi buindle using classloader: " + loader);
                }
                loadImplementationsInBundle(test, packageName, loader, mth);
                return;
            }
{code}

The loadImplementationsInBundle could be in the new OsgiResolverUtil so its only loaded if using OSGi bundles. And thus the class loading issue should not happend.
And we could catch the NoClassDefFoundError and output a user firendly message that org.osgi.core should be an dependency.

And how do we configure it to be optional in the camel-core pom.xml? Currently it is:
{code}
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.osgi.core</artifactId>
      <version>${felix-osgi-version}</version>
    </dependency>
{code}

Could we add 
<optional>true</optional>

BTW: The activation stuff is now also a hard dependency - i haven't seen this in pom.xml

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Work started: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-577 started by Claus Ibsen.

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Reopened: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet reopened CAMEL-577:
-----------------------------------

      Assignee:     (was: Claus Ibsen)

With the current version, there is a strong dependency from camel-core to OSGi: i.e. camel can not run without the OSGi classes in the classpath.
See the following exception: 

Caused by: java.lang.NoClassDefFoundError: org/osgi/framework/Bundle
        at org.apache.camel.spring.RouteBuilderFinder.<init>(RouteBuilderFinder.java:41)
        at org.apache.camel.spring.CamelContextFactoryBean.findRouteBuiders(CamelContextFactoryBean.java:404)
        at org.apache.camel.spring.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:189)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1288)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257)
        ... 41 more

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


Re: [jira] Updated: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by Freeman Fang <fr...@gmail.com>.
Hi Claus,

I reupload the patch.

Cheers
Freeman


Claus Ibsen wrote:
> Hi
>
> Just a very quick glimpse. I gotta do some work for the client so cant peek to much.
>
> Isn't there a stable OSGI pendency for felix that can be used instead of 1.1.0-SNAPSHOT or whatever it was?
>
> And are we sure its the spring osgi bundle classpath loader that is used all the time?
>
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> -----Original Message-----
> From: Freeman Fang [mailto:freeman.fang@gmail.com] 
> Sent: 11. juni 2008 13:00
> To: camel-dev@activemq.apache.org
> Subject: Re: [jira] Updated: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment
>
> Hi Team,
>
> Can someone review and apply this patch?
>
> Thanks
>
> Freeman
>
> Freeman Fang (JIRA) wrote:
>   
>>      [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>>
>> Freeman Fang updated CAMEL-577:
>> -------------------------------
>>
>>     Attachment: CAMEL-577.patch
>>
>>   
>>     
>>> ResolverUtil can't resolve class under osgi enviroment
>>> ------------------------------------------------------
>>>
>>>                 Key: CAMEL-577
>>>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>>>             Project: Apache Camel
>>>          Issue Type: Improvement
>>>          Components: camel-core
>>>    Affects Versions: 1.3.0
>>>            Reporter: Freeman Fang
>>>             Fix For: 1.4.0
>>>
>>>         Attachments: CAMEL-577.patch
>>>
>>>
>>> in method of 
>>> protected void find(Test test, String packageName, ClassLoader loader) 
>>> it try to load class  from directory or jar, it works for standalone mode.
>>> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
>>> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case
>>>     
>>>       
>>   
>>     
>
>
>   


RE: [jira] Updated: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Just a very quick glimpse. I gotta do some work for the client so cant peek to much.

Isn't there a stable OSGI pendency for felix that can be used instead of 1.1.0-SNAPSHOT or whatever it was?

And are we sure its the spring osgi bundle classpath loader that is used all the time?

Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Freeman Fang [mailto:freeman.fang@gmail.com] 
Sent: 11. juni 2008 13:00
To: camel-dev@activemq.apache.org
Subject: Re: [jira] Updated: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Hi Team,

Can someone review and apply this patch?

Thanks

Freeman

Freeman Fang (JIRA) wrote:
>      [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Freeman Fang updated CAMEL-577:
> -------------------------------
>
>     Attachment: CAMEL-577.patch
>
>   
>> ResolverUtil can't resolve class under osgi enviroment
>> ------------------------------------------------------
>>
>>                 Key: CAMEL-577
>>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>>             Project: Apache Camel
>>          Issue Type: Improvement
>>          Components: camel-core
>>    Affects Versions: 1.3.0
>>            Reporter: Freeman Fang
>>             Fix For: 1.4.0
>>
>>         Attachments: CAMEL-577.patch
>>
>>
>> in method of 
>> protected void find(Test test, String packageName, ClassLoader loader) 
>> it try to load class  from directory or jar, it works for standalone mode.
>> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
>> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case
>>     
>
>   


Re: [jira] Updated: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by Freeman Fang <fr...@gmail.com>.
Hi Team,

Can someone review and apply this patch?

Thanks

Freeman

Freeman Fang (JIRA) wrote:
>      [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Freeman Fang updated CAMEL-577:
> -------------------------------
>
>     Attachment: CAMEL-577.patch
>
>   
>> ResolverUtil can't resolve class under osgi enviroment
>> ------------------------------------------------------
>>
>>                 Key: CAMEL-577
>>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>>             Project: Apache Camel
>>          Issue Type: Improvement
>>          Components: camel-core
>>    Affects Versions: 1.3.0
>>            Reporter: Freeman Fang
>>             Fix For: 1.4.0
>>
>>         Attachments: CAMEL-577.patch
>>
>>
>> in method of 
>> protected void find(Test test, String packageName, ClassLoader loader) 
>> it try to load class  from directory or jar, it works for standalone mode.
>> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
>> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case
>>     
>
>   


[jira] Updated: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang updated CAMEL-577:
-------------------------------

    Attachment: CAMEL-577.patch

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43423#action_43423 ] 

Freeman Fang commented on CAMEL-577:
------------------------------------

sure, paste some log

16:10:58,355 | TRACE | pool-5-thread-1  | ResolverUtil                     | g.apache.camel.util.ResolverUtil  356 | Searching in bundle:org.apache.cxf.cxf-bundle [47]
16:10:58,365 | TRACE | pool-5-thread-1  | ResolverUtil                     | g.apache.camel.util.ResolverUtil  356 | Searching in bundle:org.springframework.bundle.spring.tx [48]
16:10:58,367 | TRACE | pool-5-thread-1  | ResolverUtil                     | g.apache.camel.util.ResolverUtil  356 | Searching in bundle:org.apache.camel.camel-core [49]
16:10:58,368 | TRACE | pool-5-thread-1  | ResolverUtil                     | g.apache.camel.util.ResolverUtil  456 | Testing for class org.apache.camel.converter.CamelConverter$1 matches criteria [annotated with @Converter]
16:10:58,369 | TRACE | pool-5-thread-1  | ResolverUtil

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43422#action_43422 ] 

Claus Ibsen commented on CAMEL-577:
-----------------------------------

Freeman, I dont suppose I could ask you to try again with TRACE level debugging in org.apache.camel.util.ResolverUtil.

I would like to see if the trace logging is useable in situations to resolve problems. Especially of the osgi logging is useable, eg. the logging of the bundle toString() itself - does it provide a good toString() implementation or do we need to log: bundleId, symbolName, and whatever can be relevant.

If you could paste the logging output here would be super great.

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Wojciech Durczynski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43797#action_43797 ] 

Wojciech Durczynski commented on CAMEL-577:
-------------------------------------------

In my apllication's bundle (the one with camel-context) I created dependency to org.apache.camel.converter package, and not to other two (stax and jaxp, because I don't use them). With this configuration I get some errors in log, such as:
12:43:42,484 DEBUG [.camel.ObjRepComponent@11773e4] org.apache.camel.util.ResolverUtil        - Searching for annotations of org.apache.camel.Converter in packages: [org.apache.camel.converter]
12:43:42,484 DEBUG [.camel.ObjRepComponent@11773e4] org.apache.camel.util.ResolverUtil        - Loading from osgi buindle using classloader: BundleDelegatingClassLoader for [Dialog orders (com.comarch.p7samples.dialorder)]
12:43:42,578 DEBUG [.camel.ObjRepComponent@11773e4] org.apache.camel.util.ResolverUtil        - Could not find class 'org/apache/camel/converter/jaxp/StaxConverter.class' in classloader: BundleDelegatingClassLoader for [Dialog orders (com.comarch.p7samples.dialorder)]. Reason: java.lang.ClassNotFoundException: org.apache.camel.converter.jaxp.StaxConverter not found from bundle [com.comarch.p7samples.dialorder]
java.lang.ClassNotFoundException: org.apache.camel.converter.jaxp.StaxConverter not found from bundle [com.comarch.p7samples.dialorder]
	at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)
	at org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at org.apache.camel.util.ResolverUtil.addIfMatching(ResolverUtil.java:477)
	at org.apache.camel.util.ResolverUtil.loadImplementationsInBundle(ResolverUtil.java:357)
	at org.apache.camel.util.ResolverUtil.find(ResolverUtil.java:293)
	at org.apache.camel.util.ResolverUtil.find(ResolverUtil.java:277)
	at org.apache.camel.util.ResolverUtil.findAnnotated(ResolverUtil.java:253)
	at org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:57)
	at org.apache.camel.impl.converter.DefaultTypeConverter.checkLoaded(DefaultTypeConverter.java:218)
	at org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:64)
	at org.apache.camel.util.CamelContextHelper.convertTo(CamelContextHelper.java:85)
	at org.apache.camel.component.bean.RegistryBean.getProcessor(RegistryBean.java:77)
	at org.apache.camel.component.bean.BeanProcessor.getProcessor(BeanProcessor.java:135)
	at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:76)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
	at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:146)
	at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:90)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:85)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57)
	at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:59)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57)
	at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:146)
	at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:90)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57)
	at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:39)
	at com.comarch.p7.objectrepository.camel.ObjRepConsumer.poll(ObjRepConsumer.java:35)
	at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:65)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.apache.camel.converter.jaxp.StaxConverter
	at java.lang.ClassLoader.findClass(ClassLoader.java:358)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:429)
	at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
	at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:289)
	at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1269)
	at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)
	... 39 more
12:43:42,593 DEBUG [.camel.ObjRepComponent@11773e4] org.apache.camel.util.ResolverUtil        - Could not find class 'org/apache/camel/converter/jaxp/DomConverter.class' in classloader: BundleDelegatingClassLoader for [Dialog orders (com.comarch.p7samples.dialorder)]. Reason: java.lang.ClassNotFoundException: org.apache.camel.converter.jaxp.DomConverter not found from bundle [com.comarch.p7samples.dialorder]

These logs have DEBUG state, but also I receive one ERROR state log:

12:43:42,812 ERROR [.camel.ObjRepComponent@11773e4] org.apache.camel.util.ResolverUtil        - Could not search jar file '\org\apache\camel\converter' for classes matching criteria: annotated with @Converter due to an IOException: \org\apache\camel\converter (System nie może odnaleźć określonej ścieżki)
java.io.FileNotFoundException: \org\apache\camel\converter (System nie może odnaleźć określonej ścieżki)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:106)
	at org.apache.camel.util.ResolverUtil.loadImplementationsInJar(ResolverUtil.java:439)
	at org.apache.camel.util.ResolverUtil.find(ResolverUtil.java:343)
	at org.apache.camel.util.ResolverUtil.find(ResolverUtil.java:277)
	at org.apache.camel.util.ResolverUtil.findAnnotated(ResolverUtil.java:253)
	at org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:57)
	at org.apache.camel.impl.converter.DefaultTypeConverter.checkLoaded(DefaultTypeConverter.java:218)
	at org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:64)
	at org.apache.camel.util.CamelContextHelper.convertTo(CamelContextHelper.java:85)
	at org.apache.camel.component.bean.RegistryBean.getProcessor(RegistryBean.java:77)
	at org.apache.camel.component.bean.BeanProcessor.getProcessor(BeanProcessor.java:135)
	at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:76)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
	at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:146)
	at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:90)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:85)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57)
	at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:59)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57)
	at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:146)
	at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:90)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57)
	at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:39)
	at com.comarch.p7.objectrepository.camel.ObjRepConsumer.poll(ObjRepConsumer.java:35)
	at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:65)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)

Except of these logs everything is working fine. 

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Updated: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang updated CAMEL-577:
-------------------------------

    Attachment: CAMEL-577.patch

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43491#action_43491 ] 

Claus Ibsen commented on CAMEL-577:
-----------------------------------

Ah you got it sorted by a inner class, smart move ;) Kinda like the OsgiResolverUtil.

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Wojciech Durczynski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43798#action_43798 ] 

Wojciech Durczynski commented on CAMEL-577:
-------------------------------------------

Also without dependency to org.apache.camel.converter package everything works fine, but there are even more error reports. Probably class loaders are checked in wrong order.

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43404#action_43404 ] 

Freeman Fang commented on CAMEL-577:
------------------------------------

Hi

Just a very quick glimpse. I gotta do some work for the client so cant peek to much.

Isn't there a stable OSGI pendency for felix that can be used instead of 1.1.0-SNAPSHOT or whatever it was?

And are we sure its the spring osgi bundle classpath loader that is used all the time?

Med venlig hilsen
 
Claus Ibsen

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Assigned: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-577:
---------------------------------

    Assignee: Claus Ibsen

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43838#action_43838 ] 

Claus Ibsen commented on CAMEL-577:
-----------------------------------

Woljciech.

Do you mind creating a new ticket for your issue and attach a sample project that demonstrates the problem?
Please note what container and versions you are using and how to reproduce the problem.

Then we will be in a better position to address this for Camel 1.5 

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43405#action_43405 ] 

Freeman Fang commented on CAMEL-577:
------------------------------------

re upload the patch
use 1.0.1 instead of 1.1-SNAPSHOT in the pom
also avoid hardcode classloader name,  if the classloader has getBundle method , then it's an osgi bundle classloader

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43419#action_43419 ] 

Claus Ibsen commented on CAMEL-577:
-----------------------------------

Leaving open until it is verified that it works in an osgi environment. Freeman are you able to try it out?

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43418#action_43418 ] 

Claus Ibsen commented on CAMEL-577:
-----------------------------------

Thanks a lot for the patch. I have applied it with a few adjustments regarding debug/trace logging.

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Commented: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43288#action_43288 ] 

Freeman Fang commented on CAMEL-577:
------------------------------------

Hi Claus,
Sure, I will try to provide a patch to resovle it.

Cheers

Freeman

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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


[jira] Resolved: (CAMEL-577) ResolverUtil can't resolve class under osgi enviroment

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet resolved CAMEL-577.
-----------------------------------

    Resolution: Fixed

Sending        camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java
Transmitting file data .
Committed revision 668216.

> ResolverUtil can't resolve class under osgi enviroment
> ------------------------------------------------------
>
>                 Key: CAMEL-577
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-577
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Freeman Fang
>             Fix For: 1.4.0
>
>         Attachments: CAMEL-577.patch
>
>
> in method of 
> protected void find(Test test, String packageName, ClassLoader loader) 
> it try to load class  from directory or jar, it works for standalone mode.
> But if the classloader of the method is osgi bundle class loader, it will fail since the getResource(packgename) return neither directory nor jar
> for example, package name is org/apache/camel/convert, then what returned is /org/apache/camel/convert, so both loadImplementationsInDirectory and loadImplementationsInJar doesn't work in this case

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