You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bill <ch...@gmail.com> on 2011/03/08 10:38:53 UTC

how can I hand the webservice error when starting the camel

Hi,
My camel contains some routes, and one route to a cxf endpoint.
If the cxf endpoint is not start when the camel begin starting , the server
throws error and the camelcontext do not work at all.
what I want it's to start this camelcontext and just log the error message.
How to hand it?

Thanks.

--
View this message in context: http://camel.465427.n5.nabble.com/how-can-I-hand-the-webservice-error-when-starting-the-camel-tp3413719p3413719.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how can I hand the webservice error when starting the camel

Posted by Bill <ch...@gmail.com>.
Hi, Ramakrishna-2 , thanks your reply.
I resovled it.
Because I defined the route information with WebURL like <***
wsdlURL="http://localhost:9000/order?wsdl">,
and I store the wsdl file to my classpath in ws.wsdl , change the
wsdlURL="ws.wsdl" .
It is done.

--
View this message in context: http://camel.465427.n5.nabble.com/how-can-I-hand-the-webservice-error-when-starting-the-camel-tp3413719p3425983.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how can I hand the webservice error when starting the camel

Posted by Tarun Ramakrishna <ta...@elankath.com>.
Do you have a wsdlUrl resolvable without contacting the CXF server ?


> My cxf endpoint configuration is not wrong.
> when my order is :  start cxf server --> start camel server , it is normal.
>
> but I want : start camel server --> start cxf server , it is throws
> FailedToCreateProducerException.
>
> I think when starting camel server, it check the cxf server is alive or not.
> I do not want camel to do this.

Re: how can I hand the webservice error when starting the camel

Posted by Bill <ch...@gmail.com>.
Hi,
My cxf endpoint configuration is not wrong.
when my order is :  start cxf server --> start camel server , it is normal.

but I want : start camel server --> start cxf server , it is throws
FailedToCreateProducerException.

I think when starting camel server, it check the cxf server is alive or not.
I do not want camel to do this.

--
View this message in context: http://camel.465427.n5.nabble.com/how-can-I-hand-the-webservice-error-when-starting-the-camel-tp3413719p3424372.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how can I hand the webservice error when starting the camel

Posted by Willem Jiang <wi...@gmail.com>.
I'm not sure what your route looks like.
But according the stack trace, it looks like your cxf endpoint 
configuration is wrong. It's better idea to let you know if the cxf 
endpoint is wrong.

 >org.apache.camel.FailedToCreateProducerException: Failed to create 
Producer
 > for endpoint: Endpoint[cxf://bean:serverEndpoint?dataFormat=MESSAGE].
 > Reason: org.apache.cxf.service.factory.ServiceConstructionException: 
Failed
 > to create service.

Willem

On 3/10/11 9:49 AM, Bill wrote:
> Hi,
> I am using spring.
>
> assuming the cxf endpoint is not a invalid endpoint, It is just not running
> when the camelcontext starts.
>
> what I want it's when camelcontext starts , it do not check the cxf endpoint
> is started or not.
>
> Just throws exception when I invoke cxf endpoint if the cxf server not
> started yet.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/how-can-I-hand-the-webservice-error-when-starting-the-camel-tp3413719p3422629.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


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

Re: how can I hand the webservice error when starting the camel

Posted by Bill <ch...@gmail.com>.
Hi,
I am using spring.

assuming the cxf endpoint is not a invalid endpoint, It is just not running
when the camelcontext starts.

what I want it's when camelcontext starts , it do not check the cxf endpoint
is started or not.

Just throws exception when I invoke cxf endpoint if the cxf server not
started yet.

--
View this message in context: http://camel.465427.n5.nabble.com/how-can-I-hand-the-webservice-error-when-starting-the-camel-tp3413719p3422629.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how can I hand the webservice error when starting the camel

Posted by Tarun Ramakrishna <ta...@elankath.com>.
A little unclear on what you expect here. The CamelContext does not
start because of an invalid endpoint.  The only way to make it start
AFAIK would be to remove this invalid endpoint. I assume you are using
Spring. If you have control over when the spring application context
is constructed, you can merely catch the exception and remove this
faulty CXF bean (and replace it with say a default CXF bean) . If you
are in an OSGI environment where the spring extender is responsible
for bootstrapping spring contexts, you can customize the extender
behavior and incorporate the same logic.

On Wed, Mar 9, 2011 at 11:13 AM, Bill <ch...@gmail.com> wrote:
>
> Hi,
> It does not matter with the error hander.
>
> It is a Context initialization failed error:
>
> org.apache.camel.FailedToCreateProducerException: Failed to create Producer
> for endpoint: Endpoint[cxf://bean:serverEndpoint?dataFormat=MESSAGE].
> Reason: org.apache.cxf.service.factory.ServiceConstructionException: Failed
> to create service.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/how-can-I-hand-the-webservice-error-when-starting-the-camel-tp3413719p3415036.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how can I hand the webservice error when starting the camel

Posted by Bill <ch...@gmail.com>.
Hi,
It does not matter with the error hander.

It is a Context initialization failed error:

org.apache.camel.FailedToCreateProducerException: Failed to create Producer
for endpoint: Endpoint[cxf://bean:serverEndpoint?dataFormat=MESSAGE].
Reason: org.apache.cxf.service.factory.ServiceConstructionException: Failed
to create service.

--
View this message in context: http://camel.465427.n5.nabble.com/how-can-I-hand-the-webservice-error-when-starting-the-camel-tp3413719p3415036.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how can I hand the webservice error when starting the camel

Posted by Tarun Ramakrishna <ta...@elankath.com>.
Hi,

Wouldn't setting and customizing an error handler on the route that delivers
to the CXF endpoint do this for you ?

Best Regards,
Tarun


On Tue, Mar 8, 2011 at 3:08 PM, Bill <ch...@gmail.com> wrote:

> Hi,
> My camel contains some routes, and one route to a cxf endpoint.
> If the cxf endpoint is not start when the camel begin starting , the server
> throws error and the camelcontext do not work at all.
> what I want it's to start this camelcontext and just log the error message.
> How to hand it?
>
> Thanks.
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/how-can-I-hand-the-webservice-error-when-starting-the-camel-tp3413719p3413719.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>