Re: Exception in the bean after onException

2014-11-03 Thread Vadim Vararu
Yes, that works, but as i've observed, i get this way only the cause
message, and not the whole stacktrace.

On Mon, Nov 3, 2014 at 6:55 PM, Claus Ibsen  wrote:

> Hi
>
> This is by design. As the on exception routes the exchange, so the
> exchange needs to not have the exception in getException as that is
> used to detect if a new exception is thrown during routing with
> onException.
>
> So you can grab the caused exception from the exchange property, or if
> you use a bean instead of .process, then just define an Exception type
> in the method signature and Camel will provide the caused exception in
> the parameter.
>
> On Mon, Nov 3, 2014 at 4:53 PM, Vadim Vararu 
> wrote:
> > Hi,
> >
> > I have a global error handler that passes the exchange to a processor.
> > I wonder why the exception attribute of the injected Exchange is null in
> > this case?
> >
> > //GLOBAL ERROR MANAGEMENT
> > onException(Throwable.class)
> > .process(new GlobalLoggerProcessor());
> >
> > I can find the message of the exception in a property of the exchange,
> but
> > the exception itself if NULL.
> >
> > Thanks in advance, Vadim.
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@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: Camel - JDBC

2014-11-03 Thread smilevasu6
Claus Ibsen, if i write these configuration xml files in eclipse (i am using)
how can i run these from eclipse as there is no Java class to call these.

Could you please help?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-JDBC-tp5758485p5758488.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel - JDBC

2014-11-03 Thread smilevasu6
Thanks Claus Ibsen for quick reply.

I already tried those links but it could not worked.

And that is for Insertion.

I am looking for select.

Is there any example for the same start to end.

Please.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-JDBC-tp5758485p5758487.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel - JDBC

2014-11-03 Thread Claus Ibsen
Hi

There is a camel-sql example at
http://camel.apache.org/sql-example.html

And also a similar example using MyBatis instead
http://camel.apache.org/mybatis-example.html

And more examples you can find in the component documentation, and the
unit tests of the components which you can find in the source code.

On Tue, Nov 4, 2014 at 7:15 AM, smilevasu6  wrote:
> Hi,
>
> I am very new to camel.
>
> I am trying to establish the oracle connection and fetch the results from
> the Data base like select * from emp.
>
> I have a searched a lot but i couldn't find any solution or any source code
> from scratch.
>
> Can you please help me out.
>
> Regards,
>
> Srinivas T
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-JDBC-tp5758485.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@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/


Camel - JDBC

2014-11-03 Thread smilevasu6
Hi,

I am very new to camel.

I am trying to establish the oracle connection and fetch the results from
the Data base like select * from emp.

I have a searched a lot but i couldn't find any solution or any source code
from scratch.

Can you please help me out.

Regards,

Srinivas T 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-JDBC-tp5758485.html
Sent from the Camel - Users mailing list archive at Nabble.com.


ERROR MESSAGE: org.apache.camel.component.file.GenericFileOperationFailedException: Cannot write null body to file:

2014-11-03 Thread xeni
Hello,

I have one problema. In one folder I have more tar files. I want to untar
this files and move them in other folder.

 


folder1








folder2




 

*
   
file:C://archive/input/archive_tar/${header.folderNumber}
 *  



   
file:C://archive/ftp/${header.folderNumber}?fileExist=Override




Because I have to read from more folder I want to pass folder name from one
route to other route. The proble apear when I try to read archive file from
folder. I receive thi error:
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
write null body to file:

Where is the mistake?





--
View this message in context: 
http://camel.465427.n5.nabble.com/ERROR-MESSAGE-org-apache-camel-component-file-GenericFileOperationFailedException-Cannot-write-null--tp5758470.html
Sent from the Camel - Users mailing list archive at Nabble.com.


There is a problem with the dataFormat MESSAGE and an XSLT transformation?

2014-11-03 Thread aioria3077
Good day to all


I have the following request:


http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ws="http://ws.ampersand.mx"; xmlns:mod="http://modelo.ampersand.mx";>
   
   
  
 
6508
2014-09-01T00:00:00
1500
Id unico Grupo
Posadas
 
  
   


my camel route command to call the transformation:



http://www.w3.org/1999/XSL/Transform"; 
   xmlns:ws="http://ws.ampersand.mx"; xmlns:mod="http://modelo.ampersand.mx";
   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
   
  http://schemas.xmlsoap.org/soap/envelope/";
xmlns:mer="http://skywards.com/Mercator.CRIS.WS";>
   
  
 

   
  false
  
 
false
  false
  0
   
   
  false
  
 
false
  true
  **
   
   
   
  false
  
 
false
  true
  **
   
   
   
   
  false
  
 
false
  false
  0001-01-01T00:00:00
   
   COMP
   
   
   
  

   
   
  false
  
 
false
  false
  0
   
   
   **
  
false
   false
   false
   
   **
   
  false
  
 
false
  false
  0
   
   
   ?

 
  
  

   



camel route looks like this endpoint with dataFormat MESSAGE






  
  http://cr5w5cptest.clubpremier.com/Mercator.CRIS.WebService.TESTCRIS/MemberWebService.asmx";
 
wsdlURL="wsdl/MemberWebService.wsdl"
bindingId="s:tns:MemberWebServiceSoap"
/>

  




  http://camel.apache.org/schema/spring"; streamCache="true">





  
  
  

  
  

  

  

  

  
  
  
  
  
  
  
  
  
  



  


these things I miss looking at different sites and does not make me
request_proxy mapping to request_original, xslt will not use much and I feel
that the problem is out there, I miss this kind of changes but when the
services, I stuck with dataFormat PAYLOAD, this specific service I did not
work with that format.



--
View this message in context: 
http://camel.465427.n5.nabble.com/There-is-a-problem-with-the-dataFormat-MESSAGE-and-an-XSLT-transformation-tp5758477.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel 2.14 breaks our test

2014-11-03 Thread Christian Müller
Can you provide a test case which is showing the regression?

Best,
Christian


On Fri, Oct 31, 2014 at 4:06 PM, James Green 
wrote:

> We just upgraded from 2.13.2 to 2.14.0 and our test now hangs using the
> producerTemplate to send to an ActiveMQ (5.10.0) endpoint.
>
> The route accepts the message, sends it through JAXB and into a Processor
> which doesn't seem to be executed.
>
> We set debug logging on, and ActiveMQ seems to increment the enqueuedCount,
> then there's a 20 second delay before Camel logs a timeout.
>
> The route has been modified to log the inbound message, but this doesn't
> trigger either.
>
> It works fine if we revert back to Camel 2.13.2. Any ideas?
>
> Thanks,
>
> James
>


Re: Adding jaas authentication to a cxf endpoint in karaf

2014-11-03 Thread Daniel Kulp
I’ll let Sergey handle most of this, but…..


> On Nov 3, 2014, at 6:12 AM, Hilderich  wrote:
> 
> 
> Last week I have commenced with an update to Karaf 3.0.2 but so far I am not
> able to start my bundle because cxf bus in blueprint cannot initialized
> (this part in bluprint.xml: ). Probably this
> has something to do with wrong versions and missing imports. I am very
> discouraged.
> 

I’m a bit curious by this one.   Do you have a test case for this?   I’d really 
like to know what would cause this.


-- 
Daniel Kulp
dk...@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com



Re: Exception in the bean after onException

2014-11-03 Thread Claus Ibsen
Hi

This is by design. As the on exception routes the exchange, so the
exchange needs to not have the exception in getException as that is
used to detect if a new exception is thrown during routing with
onException.

So you can grab the caused exception from the exchange property, or if
you use a bean instead of .process, then just define an Exception type
in the method signature and Camel will provide the caused exception in
the parameter.

On Mon, Nov 3, 2014 at 4:53 PM, Vadim Vararu  wrote:
> Hi,
>
> I have a global error handler that passes the exchange to a processor.
> I wonder why the exception attribute of the injected Exchange is null in
> this case?
>
> //GLOBAL ERROR MANAGEMENT
> onException(Throwable.class)
> .process(new GlobalLoggerProcessor());
>
> I can find the message of the exception in a property of the exchange, but
> the exception itself if NULL.
>
> Thanks in advance, Vadim.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@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/


Exception in the bean after onException

2014-11-03 Thread Vadim Vararu
Hi,

I have a global error handler that passes the exchange to a processor.
I wonder why the exception attribute of the injected Exchange is null in
this case?

//GLOBAL ERROR MANAGEMENT
onException(Throwable.class)
.process(new GlobalLoggerProcessor());

I can find the message of the exception in a property of the exchange, but
the exception itself if NULL.

Thanks in advance, Vadim.


Re: Adding jaas authentication to a cxf endpoint in karaf

2014-11-03 Thread Sergey Beryozkin

Hi
On 03/11/14 14:42, Hilderich wrote:

Hello Sergey,

First of all what you have suggested I have done as you can see above. But
this incorporation of an interceptor has no effect and no one requires a
login if I do a request to the address in my browser.
My question about JAAS was intended to get a feedback from you if I have
grasp JAAS correctly. In Karaf the JAAS login mechanism looks into
/etc/users.properties, isn't it?

As far as I recall yes

I don't know what you mean when you are talking about anonymous users and I
cannot find any property /allowAnonymous/. I just want to know if one entry
as stated above in users.propties is enough
for an authorization?
No, that entry should be enough for populating a security context - 
which still needs to be acted upon.

However this is not the point at the moment because no
one is asking for any authorization - what a shame.

I do not even recall you talking about the authorization in this thread 
before so I'm not sure why you are surprised.
What is you plan to enforce the authorization, do you use RBAC rules 
like @RolesAllowed

Do I have to create any web app context file for any other authentication
stuff beyond /blueprint.xml/ and /users.properties/? Do I have to configure
/etc/org.apache.karaf.jaas.cfg ???

No idea - ask at the Karaf list. As far as CXF is concerned, please 
check the same page I linked to earlier on how to set up simple 
authorizing interceptors which can check RolesAllowed.


By the way: sorry if I hijacked the thread - may be the solution 
proposed originally should've been explored till the end...


Thanks, Sergey

Kind regards,
Hilderich



--
View this message in context: 
http://camel.465427.n5.nabble.com/Adding-jaas-authentication-to-a-cxf-endpoint-in-karaf-tp5758340p5758462.html
Sent from the Camel - Users mailing list archive at Nabble.com.





Re: Adding jaas authentication to a cxf endpoint in karaf

2014-11-03 Thread Hilderich
Hello Sergey,

First of all what you have suggested I have done as you can see above. But
this incorporation of an interceptor has no effect and no one requires a
login if I do a request to the address in my browser. 
My question about JAAS was intended to get a feedback from you if I have
grasp JAAS correctly. In Karaf the JAAS login mechanism looks into
/etc/users.properties, isn't it? 
I don't know what you mean when you are talking about anonymous users and I
cannot find any property /allowAnonymous/. I just want to know if one entry
as stated above in users.propties is enough 
for an authorization? However this is not the point at the moment because no
one is asking for any authorization - what a shame. 

Do I have to create any web app context file for any other authentication
stuff beyond /blueprint.xml/ and /users.properties/? Do I have to configure
/etc/org.apache.karaf.jaas.cfg ???

Kind regards,
Hilderich



--
View this message in context: 
http://camel.465427.n5.nabble.com/Adding-jaas-authentication-to-a-cxf-endpoint-in-karaf-tp5758340p5758462.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Adding jaas authentication to a cxf endpoint in karaf

2014-11-03 Thread Sergey Beryozkin

Hi
On 03/11/14 14:09, Hilderich wrote:

Hello Sergey,

Thank your for your help. I've tried as here:



In //etc/users.properties/ is one entry:

*karaf=karaf,admin*

I think this should be okay, isn't it?

If I understand JAAS correctly any login is referenced to users.properties
and if a match exist you are authorized.
However so far no login is required at the moment and that is the problem at
all.

Do you mean that anonymous users are still accepted ? if so then the 
interceptor's allowAnonymous property should be set to false


Cheers, Sergey

Kind regards,
Hilderich



--
View this message in context: 
http://camel.465427.n5.nabble.com/Adding-jaas-authentication-to-a-cxf-endpoint-in-karaf-tp5758340p5758455.html
Sent from the Camel - Users mailing list archive at Nabble.com.





Re: Adding jaas authentication to a cxf endpoint in karaf

2014-11-03 Thread Hilderich
Hello Sergey,

Thank your for your help. I've tried as here:



In //etc/users.properties/ is one entry:

*karaf=karaf,admin*

I think this should be okay, isn't it?

If I understand JAAS correctly any login is referenced to users.properties
and if a match exist you are authorized. 
However so far no login is required at the moment and that is the problem at
all.

Kind regards,
Hilderich



--
View this message in context: 
http://camel.465427.n5.nabble.com/Adding-jaas-authentication-to-a-cxf-endpoint-in-karaf-tp5758340p5758455.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CXF Inteceptor Error handling with Camel-CXF, JMS and ActiveMQ

2014-11-03 Thread g8torPaul
Thanks, Willem. 

I had already started down this route, but had some trouble. I finally got
it to work. The trick was to make sure that when the exception thrown/caught
by CXF, that I propagated that exception back into the Camel route using
another interceptor. The interceptor uses the following technique:

public void handleException(final Message message)
{
Throwable exception = message.getContent(Exception.class);

if (exception != null) {
Exchange exchange = (Exchange) 
message.get("org.apache.camel.exchange");
if (exchange != null) {
exchange.setException(exception);
}
}
}

This way the Camel route recieves the exception and can process the message
with an onException clause.

Thanks, 

-g8torPaul





--
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-Inteceptor-Error-handling-with-Camel-CXF-JMS-and-ActiveMQ-tp5758297p5758453.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Adding jaas authentication to a cxf endpoint in karaf

2014-11-03 Thread Sergey Beryozkin

Hi

Can CXF JAASLoginInterceptor help ?
CXF endpoint declaration in Spring or Blueprint with its interceptors 
section referencing JAASLoginInterceptor (with one or two properties 
set) is all what is needed to have a user authenticated against JAAS, be 
it in Karaf or Tomcat.

http://cxf.apache.org/docs/security.html#Security-JAASLoginInterceptor

Thanks, Sergey

On 03/11/14 11:12, Hilderich wrote:

Hello Christian,

I did exactly as you described above but no authentication mechanism is
triggered. I have tried your two approaches as well and no authentication
mechanism ever came into action. Maybe there is something wrong with my
versions:

Apache Karaf 2.3.2
Apache CXF 2.7.6
Apache Camel 2.11.1

I have read this

https://issues.apache.org/jira/browse/CXF-5863

but I am not sure if this is the reason.

Last week I have commenced with an update to Karaf 3.0.2 but so far I am not
able to start my bundle because cxf bus in blueprint cannot initialized
(this part in bluprint.xml: ). Probably this
has something to do with wrong versions and missing imports. I am very
discouraged.

Kind regards,
Hilderich





--
View this message in context: 
http://camel.465427.n5.nabble.com/Adding-jaas-authentication-to-a-cxf-endpoint-in-karaf-tp5758340p5758448.html
Sent from the Camel - Users mailing list archive at Nabble.com.





Re: camel-jetty [2.10.7] resends message after 200 secs

2014-11-03 Thread Christoph Schmid
I found the solution, I had to change the parameter "maxIdleTime".

JettyHttpComponent jettyComponent = camelContext.getComponent("jetty",
JettyHttpComponent.class);  
jettyComponent.addSocketConnectorProperty("maxIdleTime", (60 * 60 * 1000));



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-jetty-2-10-7-resends-message-after-200-secs-tp5758342p5758449.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Adding jaas authentication to a cxf endpoint in karaf

2014-11-03 Thread Hilderich
Hello Christian,

I did exactly as you described above but no authentication mechanism is
triggered. I have tried your two approaches as well and no authentication
mechanism ever came into action. Maybe there is something wrong with my
versions: 

Apache Karaf 2.3.2
Apache CXF 2.7.6
Apache Camel 2.11.1

I have read this 

https://issues.apache.org/jira/browse/CXF-5863

but I am not sure if this is the reason. 

Last week I have commenced with an update to Karaf 3.0.2 but so far I am not
able to start my bundle because cxf bus in blueprint cannot initialized
(this part in bluprint.xml: ). Probably this
has something to do with wrong versions and missing imports. I am very
discouraged.

Kind regards,
Hilderich





--
View this message in context: 
http://camel.465427.n5.nabble.com/Adding-jaas-authentication-to-a-cxf-endpoint-in-karaf-tp5758340p5758448.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CXF with WS-Security using JAAS

2014-11-03 Thread garethahealy
I've also added the code my to github account @
https://github.com/garethahealy/jboss-fuse-examples - ws-security-*



--
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-with-WS-Security-using-JAAS-tp5758345p5758447.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Master/Slave failover for camel routes

2014-11-03 Thread gilboy
Done a little more digging round this and I take if I invoke the following:
 
*exchange.setProperty(Exchange.ROUTE_STOP,
CustomFaultToleranceAPI.isInActive());
*

>From RoutePolicy.onExchangeBegin() this will ensure the exchange on the warm
instance will not be processed and yet the route will stay active

Thanks
Joe



--
View this message in context: 
http://camel.465427.n5.nabble.com/Master-Slave-failover-for-camel-routes-tp5758438p5758446.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Master/Slave failover for camel routes

2014-11-03 Thread gilboy
Unfortunately AMQ cluster,Zookeeper etc are not an option as I am constrained
by internal approved tech stack.
Joe



--
View this message in context: 
http://camel.465427.n5.nabble.com/Master-Slave-failover-for-camel-routes-tp5758438p5758445.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: route information is not coming with camelContext.getRoute("route1")

2014-11-03 Thread bharadwaj
The old option shouldStartContext have been removed and replaced with this
new autoStartup option instead. What it allows is to configure Camel to not
auto start when Spring starts.

So how do you start Camel then?
The autoStartup option on the  is only used once, so you can
manually start Camel later by invoking its start method as shown below:
ApplicationContext ac = ...
SpringCamelContext camel = (SpringCamelContext) ac.getBean("myCamel");
 
// now start Camel manually
camel.start();

once you camel context is active running then only you can get route
definition.




--
View this message in context: 
http://camel.465427.n5.nabble.com/route-information-is-not-coming-with-camelContext-getRoute-route1-tp5758371p5758444.html
Sent from the Camel - Users mailing list archive at Nabble.com.