You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bingliu <li...@gmail.com> on 2010/10/24 09:08:06 UTC

Camel used in osgi

Hi, 
I have asked a question of the camel be used in osgi.The information is
camel-osgi.jar/camel-spring-osgi.jar not detected in classpath.I was used
camel-2.3 then.But now i use camel-2.4,the problem also occur.
List my runtime environment:
IDE:Eclipse 3.5.2
Osgi framework:1.3.0
Spring framework:3.0.2
Camel framework:2.4( 2.3 at one time )
Apache another components
my Operation:
1.Create a bundle use Eclipse( Standard osgi )
2.Import Plugin( Spring, apache another components )
3.create a dir in the project, named 'lib'
4.copy camel-core-2.4.jar, camel-spring-2.4.jar, camel-ognl-2.4.jar and
ognl-osgi.jar to 'lib'
5.In 'MANIFEST.MF', import those jars to ClassPath.
6.Set another resources
7.Run osgi
8.Check console information, discover the information
'camel-osgi.jar/camel-spring-osgi.jar not detected in classpath'
9.Discover some Exceptions, for example
'org.apache.camel.impl.DefaultPackageScanClassResolver     - Cannot read
entries in url:
bundleresource://6.fwk25724761:8/org/apache/camel/component/file/
java.io.FileNotFoundException: \org\apache\camel\component\file (The system
cannot find the path specified)'
What is the cause of the problem?How can solve it?I have asked the question
three times.
Thanks
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-used-in-osgi-tp3234118p3234118.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel used in osgi

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Can you check the bundles that you installed, please make sure there is 
only one version of Camel.
BTW, if you are using Camel 2.4.0, you just need to install the 
camel-core, camel-spring bundles.

On 10/25/10 3:47 PM, Bingliu wrote:
>
> Hi, We have used spring-osgi's component as osgi runtime plugin.The
> information said like this:
>
> 2010 Oct 25 15:37:48 0    INFO  [SpringOsgiExtenderThread-1]
> org.apache.camel.spring.handler.CamelNamespaceHandler     -
> camel-osgi.jar/camel-spring-osgi.jar not detected in classpath
>
> The top of information is  [SpringOsgiExtenderThread-1].
> when the springOsgi running and loading the camel-osgi.jar. If spring-osgi
> thread find no jar in the same bundle.whether occur the problem?
>
> When i see the source of camel, i discover this program.look this:
>          Class cl = CamelContextFactoryBean.class;
>          try {
>              cl =
> Class.forName("org.apache.camel.osgi.CamelContextFactoryBean");
>              osgi = true;
>          } catch (Throwable t) {
>              ...
>          }
>          if (osgi) {
>              LOG.info("camel-osgi.jar/camel-spring-osgi.jar detected in
> classpath");
>          } else {
>              LOG.info("camel-osgi.jar/camel-spring-osgi.jar not detected in
> classpath");
>          }
> if spring-osgi-1.2.1 and camel-osgi as two bundle run, whether occur the
> problem?


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Re: Camel used in osgi

Posted by Bingliu <li...@gmail.com>.
Hi, We have used spring-osgi's component as osgi runtime plugin.The
information said like this:

2010 Oct 25 15:37:48 0    INFO  [SpringOsgiExtenderThread-1]
org.apache.camel.spring.handler.CamelNamespaceHandler     -
camel-osgi.jar/camel-spring-osgi.jar not detected in classpath

The top of information is  [SpringOsgiExtenderThread-1].
when the springOsgi running and loading the camel-osgi.jar. If spring-osgi
thread find no jar in the same bundle.whether occur the problem?

When i see the source of camel, i discover this program.look this:
        Class cl = CamelContextFactoryBean.class;
        try {
            cl =
Class.forName("org.apache.camel.osgi.CamelContextFactoryBean");
            osgi = true;
        } catch (Throwable t) {
            ...
        }
        if (osgi) {
            LOG.info("camel-osgi.jar/camel-spring-osgi.jar detected in
classpath");
        } else {
            LOG.info("camel-osgi.jar/camel-spring-osgi.jar not detected in
classpath");
        }
if spring-osgi-1.2.1 and camel-osgi as two bundle run, whether occur the
problem?
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-used-in-osgi-tp3234118p3235076.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel used in osgi

Posted by Bingliu <li...@gmail.com>.
Hi, We have used spring-osgi's component as osgi runtime plugin.The
information said like this:

2010 Oct 25 15:37:48 0    INFO  [SpringOsgiExtenderThread-1]
org.apache.camel.spring.handler.CamelNamespaceHandler     -
camel-osgi.jar/camel-spring-osgi.jar not detected in classpath

The top of information is  [SpringOsgiExtenderThread-1].
when the springOsgi running and loading the camel-osgi.jar. If spring-osgi
thread find no jar in the same bundle.whether occur the problem?

When i see the source of camel, i discover this program.look this:
        Class cl = CamelContextFactoryBean.class;
        try {
            cl =
Class.forName("org.apache.camel.osgi.CamelContextFactoryBean");
            osgi = true;
        } catch (Throwable t) {
            ...
        }
        if (osgi) {
            LOG.info("camel-osgi.jar/camel-spring-osgi.jar detected in
classpath");
        } else {
            LOG.info("camel-osgi.jar/camel-spring-osgi.jar not detected in
classpath");
        }
if spring-osgi-1.2.1 and camel-osgi as two bundle run, whether occur the
problem?
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-used-in-osgi-tp3234118p3235075.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel used in osgi

Posted by Claus Ibsen <cl...@gmail.com>.
See the osgi example in Camel
https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-osgi/


On Sun, Oct 24, 2010 at 9:08 AM, Bingliu <li...@gmail.com> wrote:
>
> Hi,
> I have asked a question of the camel be used in osgi.The information is
> camel-osgi.jar/camel-spring-osgi.jar not detected in classpath.I was used
> camel-2.3 then.But now i use camel-2.4,the problem also occur.
> List my runtime environment:
> IDE:Eclipse 3.5.2
> Osgi framework:1.3.0
> Spring framework:3.0.2
> Camel framework:2.4( 2.3 at one time )
> Apache another components
> my Operation:
> 1.Create a bundle use Eclipse( Standard osgi )
> 2.Import Plugin( Spring, apache another components )
> 3.create a dir in the project, named 'lib'
> 4.copy camel-core-2.4.jar, camel-spring-2.4.jar, camel-ognl-2.4.jar and
> ognl-osgi.jar to 'lib'
> 5.In 'MANIFEST.MF', import those jars to ClassPath.
> 6.Set another resources
> 7.Run osgi
> 8.Check console information, discover the information
> 'camel-osgi.jar/camel-spring-osgi.jar not detected in classpath'
> 9.Discover some Exceptions, for example
> 'org.apache.camel.impl.DefaultPackageScanClassResolver     - Cannot read
> entries in url:
> bundleresource://6.fwk25724761:8/org/apache/camel/component/file/
> java.io.FileNotFoundException: \org\apache\camel\component\file (The system
> cannot find the path specified)'
> What is the cause of the problem?How can solve it?I have asked the question
> three times.
> Thanks
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-used-in-osgi-tp3234118p3234118.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus