You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by hom <tl...@sharklasers.com> on 2012/08/29 16:28:53 UTC

Can not use Karaf Camel feature behind HTTP proxy

Hi,

We are building a custom Karaf distribution using the feature descriptor:
mvn:org.apache.camel.karaf/apache-camel/${camel.version}/xml/features

It contains some bundles with repo definitions as part of the Maven url. 
For instance:

<feature name='camel-script-jruby' version='2.9.2' resolver='(obr)'
start-level='50'>
   
<bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-jruby/1.1</bundle>
    <bundle dependency='true'>mvn:org.jruby/jruby/1.6.7</bundle>
  </feature>

When we build out project using a http proxy the bundle resolution does not
work.
Without a http proxy it works.

The error is:

[ERROR] Failed to execute goal
org.apache.karaf.tooling:features-maven-plugin:2.2.8:add-features-to-repo
(add-features-to-repo-win) on project dist: Can't resolve bundle
com.google.code.scriptengines:scriptengines-jruby:jar:1.1: Could not
transfer artifact com.google.code.s
criptengines:scriptengines-jruby:jar:1.1 from/to
http://scriptengines.googlecode.com/svn/m2-repo/
(http://scriptengines.googlecode.com/svn/m
2-repo/): Connection to http://scriptengines.googlecode.com refused [ERROR]
com.google.code.scriptengines:scriptengines-jruby:jar:1.1
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] http://scriptengines.googlecode.com/svn/m2-repo/
(http://scriptengines.googlecode.com/svn/m2-repo/, releases=true,
snapshots=true):
Connection refused: connect

Do you have an idea how to use the feature in combination with a http proxy?

Hom    



--
View this message in context: http://camel.465427.n5.nabble.com/Can-not-use-Karaf-Camel-feature-behind-HTTP-proxy-tp5718267.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Can not use Karaf Camel feature behind HTTP proxy

Posted by Scott England-Sullivan <su...@gmail.com>.
Hi Alex,

The problem is that the
"camel-script-jruby/camel-script-javascript/camel-script-groovy" features
reference library/versions not available in a well known public repository
such as maven central.  This notation allows Camel to designate said
library in a location other than those included by the Karaf Maven URL
Configuration.  Including one of those features is causing your build to
fail.

I can take a look at it but I will need to see your POM file with all the
proper versions or the effective POM to debug it.

In the mean time, a short term work around is a two step process:

First edit your settings file and add the googlecode repository:

<repository>
    <id>scriptengines.googlecode.com</id>
    <name>Script Engines</name>
    <url>http://scriptengines.googlecode.com/svn/m2-repo</url>
</repository>


Next, create a custom local feature file that eliminates the http URL from
the desired feature and point to that in your build:

<feature name="camel-script-jruby" version="2.9.2" resolver="(obr)"
start-level="50">
<bundle>mvn:com.google.code.scriptengines/scriptengines-jruby/1.1</bundle>
<bundle dependency="true">mvn:org.jruby/jruby/1.6.7</bundle>
</feature>
<feature name="camel-script-javascript" version="2.9.2" resolver="(obr)"
start-level="50">
<bundle>mvn:com.google.code.scriptengines/scriptengines-javascript/1.1
</bundle>
<bundle>
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.rhino/1.7R2_3
</bundle>
</feature>
<feature name="camel-script-groovy" version="2.9.2" resolver="(obr)"
start-level="50">
<bundle>mvn:com.google.code.scriptengines/scriptengines-groovy/1.1</bundle>
<bundle>mvn:org.codehaus.groovy/groovy-all/1.8.6</bundle>
</feature>

Send me your pom when you have a second and I will take a look.

Best Regards,
Scott ES

On Thu, Sep 6, 2012 at 5:00 AM, Charx <al...@accelsis.biz> wrote:

> This is a double post after subscribing to the mailing list...
>
> Hi Scott,
>
> yes we have configured http-proxy in the settings.xml. We also tried
> setting
> system-properties by using -Dhttp.proxyHost and -Dhttp.proxyPort, but it
> did
> not help.
>
> It seems as if the org.apache.karaf.tooling:features-maven-plugin does not
> take over the proxy configurations.
>
> We also installed the not-accessible .jars into our local repository prior
> to the build, but this also does not help.
>
> Inside the file apache-camel-2.9.2-features.xml there are entries like
> these:
>
> <bundle>mvn:
> http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-jruby/1.1
> <
> http://scriptengines.googlecode.com/svn/m2-repo/%21com.google.code.scriptengines/scriptengines-jruby/1.1
> >
> </bundle>
>
> which cause maven to ignore the local repository and instead search in the
> internet for the referenced library.
>
> A notation like mvn:groupId:artifactId:version would probably help at this
> point.
>
> Is there any solution for this problem?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Can-not-use-Karaf-Camel-feature-behind-HTTP-proxy-tp5718267p5718713.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
-- 
Scott England-Sullivan
----------------------------------
FuseSource
Web:     http://www.fusesource.com
Blog:     http://sully6768.blogspot.com
Twitter: sully6768

Re: Can not use Karaf Camel feature behind HTTP proxy

Posted by Charx <al...@accelsis.biz>.
This is a double post after subscribing to the mailing list...

Hi Scott,

yes we have configured http-proxy in the settings.xml. We also tried setting
system-properties by using -Dhttp.proxyHost and -Dhttp.proxyPort, but it did
not help.

It seems as if the org.apache.karaf.tooling:features-maven-plugin does not
take over the proxy configurations.

We also installed the not-accessible .jars into our local repository prior
to the build, but this also does not help.

Inside the file apache-camel-2.9.2-features.xml there are entries like
these:

<bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-jruby/1.1<http://scriptengines.googlecode.com/svn/m2-repo/%21com.google.code.scriptengines/scriptengines-jruby/1.1>
</bundle> 

which cause maven to ignore the local repository and instead search in the
internet for the referenced library.

A notation like mvn:groupId:artifactId:version would probably help at this
point.

Is there any solution for this problem? 



--
View this message in context: http://camel.465427.n5.nabble.com/Can-not-use-Karaf-Camel-feature-behind-HTTP-proxy-tp5718267p5718713.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Can not use Karaf Camel feature behind HTTP proxy

Posted by Scott England-Sullivan <su...@gmail.com>.
Ah, sorry.  I misunderstood.  WRT to Maven, do you have the proxy
configured in your settings.xml?

On Thu, Aug 30, 2012 at 4:27 AM, hom <tl...@sharklasers.com> wrote:

> Hi Scott,
>
> The problem occurs when we build our custom Karaf distribution using the
> org.apache.karaf.tooling:features-maven-plugin
>
> So there is no running Karaf there. How can
> etc/org.ops4j.pax.url.mvn.cfg help in this regard?
>
> Hom
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Can-not-use-Karaf-Camel-feature-behind-HTTP-proxy-tp5718267p5718358.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
-- 
Scott England-Sullivan
----------------------------------
FuseSource
Web:     http://www.fusesource.com
Blog:     http://sully6768.blogspot.com
Twitter: sully6768

Re: Can not use Karaf Camel feature behind HTTP proxy

Posted by hom <tl...@sharklasers.com>.
Hi Scott,

The problem occurs when we build our custom Karaf distribution using the               
org.apache.karaf.tooling:features-maven-plugin

So there is no running Karaf there. How can 
etc/org.ops4j.pax.url.mvn.cfg help in this regard?

Hom




--
View this message in context: http://camel.465427.n5.nabble.com/Can-not-use-Karaf-Camel-feature-behind-HTTP-proxy-tp5718267p5718358.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Can not use Karaf Camel feature behind HTTP proxy

Posted by Scott England-Sullivan <su...@gmail.com>.
Hi Hom,

Did you enable proxy support?

etc/org.ops4j.pax.url.mvn.cfg --> org.ops4j.pax.url.mvn.proxySupport=true

If not make sure you have it set up correctly in your Maven settings.xml
and then uncomment the line above.

Best Regards,
Scott ES

On Wed, Aug 29, 2012 at 9:28 AM, hom <tl...@sharklasers.com> wrote:

> Hi,
>
> We are building a custom Karaf distribution using the feature descriptor:
> mvn:org.apache.camel.karaf/apache-camel/${camel.version}/xml/features
>
> It contains some bundles with repo definitions as part of the Maven url.
> For instance:
>
> <feature name='camel-script-jruby' version='2.9.2' resolver='(obr)'
> start-level='50'>
>
> <bundle>mvn:
> http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-jruby/1.1
> </bundle>
>     <bundle dependency='true'>mvn:org.jruby/jruby/1.6.7</bundle>
>   </feature>
>
> When we build out project using a http proxy the bundle resolution does not
> work.
> Without a http proxy it works.
>
> The error is:
>
> [ERROR] Failed to execute goal
> org.apache.karaf.tooling:features-maven-plugin:2.2.8:add-features-to-repo
> (add-features-to-repo-win) on project dist: Can't resolve bundle
> com.google.code.scriptengines:scriptengines-jruby:jar:1.1: Could not
> transfer artifact com.google.code.s
> criptengines:scriptengines-jruby:jar:1.1 from/to
> http://scriptengines.googlecode.com/svn/m2-repo/
> (http://scriptengines.googlecode.com/svn/m
> 2-repo/): Connection to http://scriptengines.googlecode.com refused
> [ERROR]
> com.google.code.scriptengines:scriptengines-jruby:jar:1.1
> [ERROR]
> [ERROR] from the specified remote repositories:
> [ERROR] http://scriptengines.googlecode.com/svn/m2-repo/
> (http://scriptengines.googlecode.com/svn/m2-repo/, releases=true,
> snapshots=true):
> Connection refused: connect
>
> Do you have an idea how to use the feature in combination with a http
> proxy?
>
> Hom
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Can-not-use-Karaf-Camel-feature-behind-HTTP-proxy-tp5718267.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
-- 
Scott England-Sullivan
----------------------------------
FuseSource
Web:     http://www.fusesource.com
Blog:     http://sully6768.blogspot.com
Twitter: sully6768