Forum Home » Enterprise Products » Fuse Management Console

Thread: Unable to download maven bundle in amazon cloud

 

Permlink Replies: 18 - Last Post: Jul 31, 2012 4:59 PM Last Post By: sandeep16
sandeep16

Posts: 40
Registered: 04/27/12
Unable to download maven bundle in amazon cloud
Posted: Jul 20, 2012 4:45 PM
  Click to reply to this thread Reply
a) using fuse fabric latest version
b) deployed a container in amazon cloud.
c) Created a new profile.
d) Deployed new camel route ( bundle) to this new profile using Fuse IDE. When I access profile from fuse IDE, I can see below for bundles:
mvn:group/camel-blueprint/1.0.0-SNAPSHOT

e) Associate new profile with the cloud container using fuse IDE.

But somehow agent is unable to deploy this new bundle to container.
Log says:
Unable to update agent
MultiExceptionjava.io.IOException: Error downloading mvn:group/camel-blueprint/1.0.0-SNAPSHOT
at org.fusesource.fabric.agent.DeploymentAgent.downloadBundles(DeploymentAgent.java:948)57:org.fusesource.fabric.fabric-agent:7.0.0.fuse-061
at org.fusesource.fabric.agent.DeploymentAgent.updateDeployment(DeploymentAgent.java:502)57:org.fusesource.fabric.fabric-agent:7.0.0.fuse-061
at org.fusesource.fabric.agent.DeploymentAgent.doUpdate(DeploymentAgent.java:371)57:org.fusesource.fabric.fabric-agent:7.0.0.fuse-061
at org.fusesource.fabric.agent.DeploymentAgent$1.run(DeploymentAgent.java:204)57:org.fusesource.fabric.fabric-agent:7.0.0.fuse-061
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441):1.6.0_31
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303):1.6.0_31
at java.util.concurrent.FutureTask.run(FutureTask.java:138):1.6.0_31
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886):1.6.0_31
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908):1.6.0_31
at java.lang.Thread.run(Thread.java:662):1.6.0_31

I tried to set up FABRIC MAVEN PROXY as below for the profile I'm using ith cloud container but not sure about the path of local repository:
fabric:profile-edit --pid org.fusesource.fabric.maven/localRepository=\system cloud_camel

My zookeeper server is on different cloud node.

Edited by: sandeep16 on Jul 20, 2012 4:59 PM
slewis

Posts: 235
Registered: 01/12/08
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 20, 2012 5:33 PM   in response to: sandeep16 in response to: sandeep16
  Click to reply to this thread Reply
Did you initially create the fabric on your local machine and then use that fabric to create a container in EC2? In this case the container would need to be able to connect back to your local machine on port 8107 to download that artifact.

The way it works is a fabric server runs the fabric maven proxy service. When containers are created and provisioned they download artifacts via the fabric maven proxy. So they need to be able to connect back to the OSGi HTTP service port, if you used FMC to create your fabric it'll be on 8107 as FMC configures it differently so as not to conflict with a Fuse ESB instance running on the same host.
sandeep16

Posts: 40
Registered: 04/27/12
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 20, 2012 7:41 PM   in response to: slewis in response to: slewis
  Click to reply to this thread Reply
thanks ..I will try it from FMC and let you know...

Sandeep
sandeep16

Posts: 40
Registered: 04/27/12
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 25, 2012 5:09 PM   in response to: sandeep16 in response to: sandeep16
  Click to reply to this thread Reply
Attachment blueprint.xml (1.8 KB)
okay..after fixing all the issues, and utilizing some workarounds, I was able to deploy bundle in fuse fabric which has just one simple camel route (blueprint.xml attached)

But somehow I am seeing below error when deploying it from fuse IDE:

2012-07-25 17:03:58,183 | ERROR | agent-1-thread-1 | DeploymentAgent | 57 - org.fusesource.fabric.fabric-agent - 7.0.0.fuse-061 | Unable to update agent
java.lang.Exception: Can not resolve feature:
Unsatisfied requirement(s):

package:(&(package=org.apache.camel.osgi))
A Camel Blueprint Route

at org.fusesource.fabric.agent.ObrResolver.resolve(ObrResolver.java:161)57:org.fusesource.fabric.fabric-agent:7.0.0.fuse-061
at org.fusesource.fabric.agent.DeploymentAgent.updateDeployment(DeploymentAgent.java:504)57:org.fusesource.fabric.fabric-agent:7.0.0.fuse-061
at org.fusesource.fabric.agent.DeploymentAgent.doUpdate(DeploymentAgent.java:371)57:org.fusesource.fabric.fabric-agent:7.0.0.fuse-061
at org.fusesource.fabric.agent.DeploymentAgent$1.run(DeploymentAgent.java:204)57:org.fusesource.fabric.fabric-agent:7.0.0.fuse-061
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471):1.6.0_18
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334):1.6.0_18
at java.util.concurrent.FutureTask.run(FutureTask.java:166):1.6.0_18
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110):1.6.0_18
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603):1.6.0_18
at java.lang.Thread.run(Thread.java:636):1.6.0_18

am I missing any package/feature/bundle here?

When I deployed fabric camel example, "fabric-camel-demo-7.0.0.fuse-061", it worked fine ...
slewis

Posts: 235
Registered: 01/12/08
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 25, 2012 5:15 PM   in response to: sandeep16 in response to: sandeep16
  Click to reply to this thread Reply
Check and see if IDE put it in the profile under the "Bundles" tab or under the "Fuse Application Bundles" tab in FMC. If it was installed as a bundle then you'd have to make the profile a child of the "camel" profile, which will install the camel-core and camel-blueprint feature. If it's the latter then the FAB runtime should have installed it for you, maybe make sure the profile created by IDE is a child of the "default" profile as the "default" profile includes the FAB runtime bundle, which turns a normal maven-built Jar into an OSGi bundle and should be installing dependent features automatically.
sandeep16

Posts: 40
Registered: 04/27/12
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 25, 2012 5:59 PM   in response to: slewis in response to: slewis
  Click to reply to this thread Reply
really appreciate your prompt response.
so, I bypassed that error..

My camel route has jetty endpoint and routing to activemq queue.

I have attached the blue print xml . Now, if I create new profile under camel and deploy this bundle , it has some dependencies it has to wait for like I see in log:

able to start blueprint container for bundle camel-blueprint due to unresolved dependencies http://(&(component=activemq)(objectClass=org.apache.camel.spi.ComponentResolver))
java.util.concurrent.TimeoutException

should I associate new repositories to this profile or we already have existing profile which I inherit from?
whats the best approach?
slewis

Posts: 235
Registered: 01/12/08
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 25, 2012 6:18 PM   in response to: sandeep16 in response to: sandeep16
  Click to reply to this thread Reply
Best practice is to re-use the out of box profiles whenever you can, as they mostly define feature repositories that have consistent versions. So for example you probably want to inherit from the "camel" profile, think that should have the features repositories your route would depend on, might need "mq" or "mq-base" if you're using activemq-camel. Strangely enough I'm not seeing the features repo for activemq stuff in my development build so just to be on the safe side you might need to add:

mvn:org.apache.activemq/activemq-karaf/5.5.1.fuse-7-060/xml/features

to your profile if just adding camel doesn't do the trick
sandeep16

Posts: 40
Registered: 04/27/12
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 25, 2012 6:56 PM   in response to: slewis in response to: slewis
  Click to reply to this thread Reply
okay.. I have added repository

mvn:org.apache.activemq/activemq-karaf/5.5.1.fuse-7-060/xml/features

to my profile...

As per logs everything is okay.
Now when I try to add my bundle with one caamel route it again complains about dependency

undle camel-blueprint is waiting for dependencies [(&(component=activemq)(

If you look at my route, it has jetty component as FROM URI and MQ queue as TO URI
using fabric addressing scheme..do I have to add anyother dependency?

<route id="HelloWorldRoute">
<from uri="fabric:cumuluscluster:jetty:http://0.0.0.0:8888/hellocamel"/>
<to uri="log:org.fusesource.fabric?level=INFO&amp;showExchangePattern=false&amp;showBodyType=false" id="cumulusto2"/>
<to uri="activemq:queue:camel-test"/>

slewis

Posts: 235
Registered: 01/12/08
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 25, 2012 7:01 PM   in response to: sandeep16 in response to: sandeep16
  Click to reply to this thread Reply
Did you inherit from the "camel" profile as well?
sandeep16

Posts: 40
Registered: 04/27/12
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 25, 2012 7:11 PM   in response to: slewis in response to: slewis
  Click to reply to this thread Reply
I did..

Please look at the attached screenshot..

maybe I am missing something
slewis

Posts: 235
Registered: 01/12/08
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 25, 2012 7:19 PM   in response to: sandeep16 in response to: sandeep16
  Click to reply to this thread Reply
Yeah, think you might need to add the "activemq-camel" feature to that profile as well as "camel-jms". The camel-core and camel-blueprint features are already defined in the camel profile. If you use camel-jetty in that route as well, then you'll also need to add that.
sandeep16

Posts: 40
Registered: 04/27/12
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 25, 2012 7:37 PM   in response to: slewis in response to: slewis
  Click to reply to this thread Reply
okay great..
I can just go and execute below command to add activemq-camel to my profile:
profile-edit --features activemq-camel cumulus_camel

but I think there is more attached to it when you want to assign features to profile.

For e.g when I look at camel profile, their features look something like:

camel-blueprint/2.9.0.fuse-7-061

do I have to pass the complete path or something or my command is good?
slewis

Posts: 235
Registered: 01/12/08
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 25, 2012 7:40 PM   in response to: sandeep16 in response to: sandeep16
  Click to reply to this thread Reply
Yep, so you don't have to specify the feature version as those profiles do, the provisioning agent can figure that out based on the feature repository. It's generally better to leave off the version actually, as then you can just change the feature repository version to update all relevant features.

Also, use FMC to make the update, should be easier than profile-edit on the command line :-)
sandeep16

Posts: 40
Registered: 04/27/12
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 25, 2012 9:03 PM   in response to: slewis in response to: slewis
  Click to reply to this thread Reply
thanks a lot.. I was able to deploy the jetty/mq camel route..
I am trying to call camel jetty endpoint from my local machine but its not working..

I have enabled port 8888 on fabric server and trying to call jetty endpoint using fabric server public IP address as below:

http://<fabricpublicIPadrress:8888>/hellocamel

my camel route is like this:

<from uri="fabric:cumuluscluster:jetty:http://0.0.0.0:8888/hellocamel"/>
<log message="Request received : ${body}"/>
<to uri="activemq:queue:camel-test"/>

sandeep16

Posts: 40
Registered: 04/27/12
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 26, 2012 1:32 PM   in response to: sandeep16 in response to: sandeep16
  Click to reply to this thread Reply
when I execute zk command, it does say endpoint is deployed but I am not sure why its appearing twice...

FMC:karaf@FuseManagementConsole> zk:list -r -d fabric/registry/camel
endpoints/cumuluscluster/00000000018 = jetty:http://0.0.0.0:8888/hellocamel
endpoints/cumuluscluster/00000000019 = jetty:http://0.0.0.0:8888/hellocamel
endpoints/cumuluscluster =
endpoints

still looking to understand how to call this endpoint from external machine which is out of amazon cloud..
slewis

Posts: 235
Registered: 01/12/08
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 26, 2012 1:47 PM   in response to: sandeep16 in response to: sandeep16
  Click to reply to this thread Reply
camel-fabric allows camel endpoints to be dynamically discovered via ZK, so you'd invoke that endpoint from camel via the endpoint name:

from("seda:foo").to("fabric:cumuluscluster")

if you wanted to invoke your route from your browser you'd need a route that uses a normal jetty endpoint that then sends messages to the fabric endpoint, which will get directed to one of the routes that have registered using that name. It's mentioned here and you should check out this demo.
sandeep16

Posts: 40
Registered: 04/27/12
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 26, 2012 5:09 PM   in response to: slewis in response to: slewis
  Click to reply to this thread Reply
great..I read those notes and watch those videos. Those were helpful

now, when I deploy normal jetty endpoint, it gets deployed on one of the containers which is associated with the corresponding profile.

so, if I want to invoke this jetty endpoint, how do I do it?

should I use fabric server IP address in my URL or that instance IP address ?

http://<ipaddress of fabric or container???????>:8889/test2
below is my camel route:

<route id="HelloWorldRoute3">
<from uri="jetty:http://0.0.0.0:8889/test2"/>
<setBody>
<simple>Fabric CUMULUS3 Camel Example: ${body}</simple>
</setBody>
<log message="Request received : ${body}"/>
<to uri="fabric:cumuluscluster"/>
</route>
slewis

Posts: 235
Registered: 01/12/08
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 27, 2012 6:12 PM   in response to: sandeep16 in response to: sandeep16
  Click to reply to this thread Reply
You'd use that instance's IP address.
sandeep16

Posts: 40
Registered: 04/27/12
Re: Unable to download maven bundle in amazon cloud
Posted: Jul 31, 2012 4:59 PM   in response to: slewis in response to: slewis
  Click to reply to this thread Reply
thanks..it worked fine...