You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Daniel Lamb <da...@discoverygarden.ca> on 2015/06/30 21:32:25 UTC

PHP and OSGi?

Hi,

Has anyone out there ever successfully used PHP within camel routes running in an OSGi container?   I keep getting the following error despite having camel-script installed: Bundle php_test.xml is waiting for dependencies [(&(language=php)(objectClass=org.apache.camel.spi.LanguageResolver))]

Is there an extra dependency for it a la camel-script-groovy or camel-script-jruby?  Is this even possible?

Google does not provide much information on the subject, though it alludes to a Quercus OSGi bundle which appears to be an abandoned effort?

Here’s the route I’m playing around with:

<?xml version="1.0" encoding="UTF-8"?>

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
           xsi:schemaLocation="
           http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

  <camelContext xmlns="http://camel.apache.org/schema/blueprint">

    <route>
      <description>Tests PHP</description>
      <from uri="timer://foo?period=1000"/>
        <transform><language language="php">'TEST'</language></transform>
        <log message="${body}"/>
    </route>

  </camelContext>

</blueprint>

~Danny


Re: PHP and OSGi?

Posted by Daniel Lamb <da...@discoverygarden.ca>.
Hans,

Thanks for the response and sorry for the late reply.  Yesterday was a holiday here in Canada.

Unfortunately, adding org.apache.camel.* to the Import-Package section for the bundle plugin didn’t have any effect.  Same error.

~Danny

On Jul 2, 2015, at 7:58 AM, Hans Loven <th...@gmail.com> wrote:

> (Specifically, I'd meant that you'd put this in the imports section of the
> apache Felix bundle plugin for maven). Did it work? New error?
> 
> Pardon the brevity,
> Sent from my phone
> On Jun 30, 2015 4:19 PM, "Hans Loven" <th...@gmail.com> wrote:
> 
>> Try importing org.apache.camel.* in your php bundle
>> 
>> Pardon the brevity,
>> Sent from my phone
>> On Jun 30, 2015 3:32 PM, "Daniel Lamb" <da...@discoverygarden.ca> wrote:
>> 
>>> Hi,
>>> 
>>> Has anyone out there ever successfully used PHP within camel routes
>>> running in an OSGi container?   I keep getting the following error despite
>>> having camel-script installed: Bundle php_test.xml is waiting for
>>> dependencies
>>> [(&(language=php)(objectClass=org.apache.camel.spi.LanguageResolver))]
>>> 
>>> Is there an extra dependency for it a la camel-script-groovy or
>>> camel-script-jruby?  Is this even possible?
>>> 
>>> Google does not provide much information on the subject, though it
>>> alludes to a Quercus OSGi bundle which appears to be an abandoned effort?
>>> 
>>> Here’s the route I’m playing around with:
>>> 
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> 
>>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>>>           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>           xmlns:cm="
>>> http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
>>>           xsi:schemaLocation="
>>>           http://www.osgi.org/xmlns/blueprint/v1.0.0
>>> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>>> 
>>>  <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>>> 
>>>    <route>
>>>      <description>Tests PHP</description>
>>>      <from uri="timer://foo?period=1000"/>
>>>        <transform><language language="php">'TEST'</language></transform>
>>>        <log message="${body}"/>
>>>    </route>
>>> 
>>>  </camelContext>
>>> 
>>> </blueprint>
>>> 
>>> ~Danny
>>> 
>>> 


Re: PHP and OSGi?

Posted by Hans Loven <th...@gmail.com>.
(Specifically, I'd meant that you'd put this in the imports section of the
apache Felix bundle plugin for maven). Did it work? New error?

Pardon the brevity,
Sent from my phone
On Jun 30, 2015 4:19 PM, "Hans Loven" <th...@gmail.com> wrote:

> Try importing org.apache.camel.* in your php bundle
>
> Pardon the brevity,
> Sent from my phone
> On Jun 30, 2015 3:32 PM, "Daniel Lamb" <da...@discoverygarden.ca> wrote:
>
>> Hi,
>>
>> Has anyone out there ever successfully used PHP within camel routes
>> running in an OSGi container?   I keep getting the following error despite
>> having camel-script installed: Bundle php_test.xml is waiting for
>> dependencies
>> [(&(language=php)(objectClass=org.apache.camel.spi.LanguageResolver))]
>>
>> Is there an extra dependency for it a la camel-script-groovy or
>> camel-script-jruby?  Is this even possible?
>>
>> Google does not provide much information on the subject, though it
>> alludes to a Quercus OSGi bundle which appears to be an abandoned effort?
>>
>> Here’s the route I’m playing around with:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>>            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>            xmlns:cm="
>> http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
>>            xsi:schemaLocation="
>>            http://www.osgi.org/xmlns/blueprint/v1.0.0
>> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>>
>>   <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>>
>>     <route>
>>       <description>Tests PHP</description>
>>       <from uri="timer://foo?period=1000"/>
>>         <transform><language language="php">'TEST'</language></transform>
>>         <log message="${body}"/>
>>     </route>
>>
>>   </camelContext>
>>
>> </blueprint>
>>
>> ~Danny
>>
>>

Re: PHP and OSGi?

Posted by Hans Loven <th...@gmail.com>.
Try importing org.apache.camel.* in your php bundle

Pardon the brevity,
Sent from my phone
On Jun 30, 2015 3:32 PM, "Daniel Lamb" <da...@discoverygarden.ca> wrote:

> Hi,
>
> Has anyone out there ever successfully used PHP within camel routes
> running in an OSGi container?   I keep getting the following error despite
> having camel-script installed: Bundle php_test.xml is waiting for
> dependencies
> [(&(language=php)(objectClass=org.apache.camel.spi.LanguageResolver))]
>
> Is there an extra dependency for it a la camel-script-groovy or
> camel-script-jruby?  Is this even possible?
>
> Google does not provide much information on the subject, though it alludes
> to a Quercus OSGi bundle which appears to be an abandoned effort?
>
> Here’s the route I’m playing around with:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>            xmlns:cm="
> http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
>            xsi:schemaLocation="
>            http://www.osgi.org/xmlns/blueprint/v1.0.0
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>
>   <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>
>     <route>
>       <description>Tests PHP</description>
>       <from uri="timer://foo?period=1000"/>
>         <transform><language language="php">'TEST'</language></transform>
>         <log message="${body}"/>
>     </route>
>
>   </camelContext>
>
> </blueprint>
>
> ~Danny
>
>

Re: PHP and OSGi?

Posted by Daniel Lamb <da...@discoverygarden.ca>.
Thanks Claus,

That’s sort of what I figured.  I couldn’t find anything relevant to PHP on the web and was thinking that might be the case.  I understand it’s not a very common use case and was more curious than anything else.

We’re integrating a bunch of Symfony command line php scripts with a preservation system and a CMS, and thought it would be nice for our community (which is mostly php developers) to be able to use that feature of camel if they needed to do some one-liners in a blueprint xml without dipping into Java.

Javascript will do just fine, though.  Or they can just learn a little Java :D

Thanks again.  As always, the Camel community is prompt and courteous.

~Danny

On Jul 2, 2015, at 11:36 AM, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
> 
> Yeah there is only specialized camel-script-xxx features for those
> that works in OSGi like ruby, javascript.
> 
> You cannot use php, or at least we have no osgi bundle of a library
> that works and that we test with.
> 
> And is there any reason you cannot just use any of the other scripting
> language or java.
> 
> On Tue, Jun 30, 2015 at 9:32 PM, Daniel Lamb <da...@discoverygarden.ca> wrote:
>> Hi,
>> 
>> Has anyone out there ever successfully used PHP within camel routes running in an OSGi container?   I keep getting the following error despite having camel-script installed: Bundle php_test.xml is waiting for dependencies [(&(language=php)(objectClass=org.apache.camel.spi.LanguageResolver))]
>> 
>> Is there an extra dependency for it a la camel-script-groovy or camel-script-jruby?  Is this even possible?
>> 
>> Google does not provide much information on the subject, though it alludes to a Quercus OSGi bundle which appears to be an abandoned effort?
>> 
>> Here’s the route I’m playing around with:
>> 
>> <?xml version="1.0" encoding="UTF-8"?>
>> 
>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>>           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
>>           xsi:schemaLocation="
>>           http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>> 
>>  <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>> 
>>    <route>
>>      <description>Tests PHP</description>
>>      <from uri="timer://foo?period=1000"/>
>>        <transform><language language="php">'TEST'</language></transform>
>>        <log message="${body}"/>
>>    </route>
>> 
>>  </camelContext>
>> 
>> </blueprint>
>> 
>> ~Danny
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/


Re: PHP and OSGi?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah there is only specialized camel-script-xxx features for those
that works in OSGi like ruby, javascript.

You cannot use php, or at least we have no osgi bundle of a library
that works and that we test with.

And is there any reason you cannot just use any of the other scripting
language or java.

On Tue, Jun 30, 2015 at 9:32 PM, Daniel Lamb <da...@discoverygarden.ca> wrote:
> Hi,
>
> Has anyone out there ever successfully used PHP within camel routes running in an OSGi container?   I keep getting the following error despite having camel-script installed: Bundle php_test.xml is waiting for dependencies [(&(language=php)(objectClass=org.apache.camel.spi.LanguageResolver))]
>
> Is there an extra dependency for it a la camel-script-groovy or camel-script-jruby?  Is this even possible?
>
> Google does not provide much information on the subject, though it alludes to a Quercus OSGi bundle which appears to be an abandoned effort?
>
> Here’s the route I’m playing around with:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>            xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
>            xsi:schemaLocation="
>            http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>
>   <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>
>     <route>
>       <description>Tests PHP</description>
>       <from uri="timer://foo?period=1000"/>
>         <transform><language language="php">'TEST'</language></transform>
>         <log message="${body}"/>
>     </route>
>
>   </camelContext>
>
> </blueprint>
>
> ~Danny
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/