a question on servlet component

2013-10-25 Thread 朱 巍
hi,camel riders
Very sorry to interrupt you. My name is Zhu Wei, i'm from China. I am new to 
camel, now when i using camel servlet component i meet a problem, it trapped me 
for several days, i see you are very eager to help people, so i write this 
email hope to get some help from you.

the case is: i use a jsp page to post some data to my camel servlet, then camel 
bridge this request to a external HTTP url, the external HTTP url is a simple 
servlet, it just reply a string to the original requester 
(response.getWriter().print("Hello World~~")). my thinking is it will be 
displayed on the requester's browser.

camel configuration like below:

http://192.168.81.1:8080/ext/externalApp?bridgeEndpoint=true"/>

the problem is: the request browser can receive the response, but it will pop 
up a dialog box to ask you if want to save a file...i open this file, the 
content is the string from the external app, it seems the browser couldn't 
recognize the response.  
Do you know the root cause? Hope hear some voice from you.

regards!
zhu wei

Re: a question on servlet component

2013-10-25 Thread gquintana
If you want your browser to display the response as a web page, then you
should set Content Type header with text/html value.

Gérald



--
View this message in context: 
http://camel.465427.n5.nabble.com/a-question-on-servlet-component-tp5742164p5742168.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Get all data from local sftp server -> encrypt -> transfer encrypted files to the remote sftp server

2013-10-25 Thread dmitrijs.balcers
Hello!
I have to accomplish such task:
1. Receive every file from appropriate directory in local sftp server;
2. Encrypt each file using custom encryption tool;
3. Send the encrypted file to the local sftp server into appropriate
directory;
4. Send the encrypted file to the remote (customer) sftp server into
appropriate directory;

Could you please advise me the best strategy to accomplish this task?

I presume that I have to use the process method, but can I modify the file
without downloading it?




--
View this message in context: 
http://camel.465427.n5.nabble.com/Get-all-data-from-local-sftp-server-encrypt-transfer-encrypted-files-to-the-remote-sftp-server-tp5742173.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-cxf and activemq example

2013-10-25 Thread Claus Ibsen
You can also find some examples in the jboss fuse distribution under
examples directory.

As well some examples here
http://www.jboss.org/products/fuse/fusebyexample.html

The rider auto example is a good example
https://github.com/FuseByExample/rider-auto-osgi

And as Christian said you can find some Camel examples and tutorials
here (some are not OSGi based)
http://camel.apache.org/examples
http://camel.apache.org/tutorials.html


On Wed, Oct 23, 2013 at 12:46 PM, harry  wrote:
> Hi,
> Can anybody help me finding any working example/tutorial on
> camel-cxf,activemq example in jboss fuse6. Any quick help is highly
> appriciated.
>
> Thanks
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-cxf-and-activemq-example-tp5742069.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


Re: Polling for file updates over http/s?

2013-10-25 Thread Claus Ibsen
Hi

Yeah sounds like you can create a route starting from a timer / quartz
to trigger when to run, and then call a http endpoint, and then
process the response / stores the response as a file etc.

On Thu, Oct 24, 2013 at 12:29 PM, James Green  wrote:
> I'm having to write a java daemon that polls a service over http for an
> updated file. This effectively provides an "automatic updates" mechanism.
>
> Sounds like a job that could be a fit for Camel. Has anyone ever tried
> developing such a component?
>
> James



-- 
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


Re: Issue with camel-http4 HttpProducer

2013-10-25 Thread Claus Ibsen
Hi

Yeah we could improve on that with an option so you can force not
sending any body. Feel free to log a JIRA



On Mon, Sep 30, 2013 at 2:02 PM, sbo13  wrote:
> Hi,
>
> I'm having a problem with the HttpProducer of camel-http4 (version 2.12)
>
> In the createMethod() function, line 365, the producer always tries to build
> a request entity.
> Unfortunately we issue a lot of GET requests that don't support bodies, but
> in order to build the request-url we have a body in the exchange.
>
> BUT since the producer always tries to marshal the exchange body I get a
> exception saying no converter can be found to transform it.
> It looks a bit odd to me that although I say 'No, I don't want to send a
> body!' camel still tries to build one.
>
> Regards
> Sebastian
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Issue-with-camel-http4-HttpProducer-tp5740548.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


Re: Route HANGS processing XML with external DOCTYPE declaration

2013-10-25 Thread Claus Ibsen
Hi

I logged a ticket about this to not forget
https://issues.apache.org/jira/browse/CAMEL-6897

Seems useful especially if you want to make sure the server dont try
to load external resources such as a DTD file.

On Wed, Sep 18, 2013 at 4:06 PM, Claus Ibsen  wrote:
> Hi Dale
>
> Sounds like a good idea to have a way of configuring this easily in Camel.
> Feel free to log a JIRA and attach your code.
>
> Though wonder also how we can make it easier to set any other custom
> features as well.
>
>
>
> On Wed, Sep 18, 2013 at 3:54 PM, Dale King  wrote:
>> I've used xpath routes previously and had no problem. I tried doing a split
>> with xpath on an XHTML document however and the route just hangs. It
>> doesn't throw an exception or simply fail to find a match for the XPath, it
>> just hangs.
>>
>> After 4-5 hours of debugging the issue, I have discovered it is because the
>> XHTML contains an external DTD declaration (a DOCTYPE) as it should. When
>> converting the XML content to a DOM it tries to load the external DTD which
>> never completes, causing the route to hang.
>>
>> The solution I have found is to add the following class and declare it as a
>> bean in the Spring configuration and Spring will autowire it into the
>> XmlConverter, but I would be interested in knowing anything better to avoid
>> the lockup:
>>
>> @SuppressWarnings("restriction")
>> public class NoExternalDtdDocumentBuilderFactory extends
>> DocumentBuilderFactoryImpl
>>  {
>> public NoExternalDtdDocumentBuilderFactory() throws
>> ParserConfigurationException
>> {
>> setValidating(false);
>> setNamespaceAware(true);
>> setFeature("http://xml.org/sax/features/namespaces";, false);
>> setFeature("http://xml.org/sax/features/validation";, false);
>> setFeature("
>> http://apache.org/xml/features/nonvalidating/load-dtd-grammar";, false);
>> setFeature("
>> http://apache.org/xml/features/nonvalidating/load-external-dtd";, false);
>> }
>> }
>>
>>
>> --
>> Dale King
>
>
>
> --
> 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



-- 
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


Re: Performance Degradation due to Reverse DNS Lookups

2013-10-25 Thread Claus Ibsen
Hi

I logged a ticket to not forget about this
https://issues.apache.org/jira/browse/CAMEL-6898

On Tue, Jun 25, 2013 at 11:19 AM, Claus Ibsen  wrote:
> On Tue, Jun 18, 2013 at 3:39 PM, rouble  wrote:
>> We already do something similar:
>> 
>> SSLContext ctx = SSLContext.getInstance("SSL");
>> ctx.init(null, new TrustManager[] { new
>> TrustAllTrustManager() }, null);
>> SSLSocketFactory ssf = new SSLSocketFactory(ctx,
>> SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
>> 
>>
>> This issue does not have to do with the host name verifier or with
>> camel per se, but more to do with the fact that Java core
>> implementation will try to do a reverse dns lookup when creating a
>> secure connection to an ip address. There are workarounds, but those
>> would need to be implemented in camel.
>>
>> Cheers
>> rouble
>>
>
> Yeah would be nice if we have a simple way of turning this on. Fell
> free to log a JIRA ticket.
>
>
>>
>>
>> On Mon, Jun 3, 2013 at 10:47 PM, Willem jiang  wrote:
>>> Hi,
>>>
>>> I'm not sure if setting the dummy implementation of X509HostnameVerifier 
>>> can resolve the issue.
>>> Can you try it to see if it work?
>>>
>>>
>>> --
>>> Willem Jiang
>>>
>>> Red Hat, Inc.
>>> FuseSource is now part of Red Hat
>>> Web: http://www.fusesource.com | http://www.redhat.com
>>> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
>>> (English)
>>>   http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
>>> Twitter: willemjiang
>>> Weibo: 姜宁willem
>>>
>>>
>>>
>>>
>>>
>>> On Tuesday, June 4, 2013 at 10:23 AM, rouble wrote:
>>>
 In my router configuration I am specifying "https4" - is that what you
 wanted to know?

 cheers
 rouble

 On Mon, Jun 3, 2013 at 9:59 PM, Willem jiang >>> (mailto:willem.ji...@gmail.com)> wrote:
 > Hi,
 >
 > There are lots of http related components can provide the https 
 > connection, it could be helpful if you can tell us which http component 
 > you are using.
 >
 > --
 > Willem Jiang
 >
 > Red Hat, Inc.
 > FuseSource is now part of Red Hat
 > Web: http://www.fusesource.com | http://www.redhat.com
 > Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
 > (English)
 > http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
 > Twitter: willemjiang
 > Weibo: 姜宁willem
 >
 >
 >
 >
 >
 > On Tuesday, June 4, 2013 at 5:20 AM, rouble wrote:
 >
 > > Camel Dudes,
 > >
 > > We have detected a very strange issue in that our https routes degrade
 > > in performance when an ip address is used (as opposed to a domain
 > > name).
 > >
 > > Turns out that the Java core libraries do reverse DNS lookup for ip
 > > address when SSL connections are created. Read all about it here:
 > >
 > > https://forums.oracle.com/forums/thread.jspa?threadID=1532033
 > > http://stackoverflow.com/questions/3193936/how-to-disable-javas-ssl-reverse-dns-lookup
 > >
 > > This becomes an issue when the IP address is not configured in the DNS
 > > server and the reverse DNS fails. In this case each connection has to
 > > wait for a timeout of the reverse DNS request before it can proceed.
 > > This makes domain name connections faster than ip address connections
 > > - which is backwards.
 > >
 > > Is this a known issue? There are a few workarounds/hacks recommended
 > > on the interwebs, I was wondering if it would be possible to introduce
 > > them into camel
 > > (http://www.velocityreviews.com/forums/showpost.php?p=2959030&postcount=8).
 > >
 > > tia,
 > > rouble
 >

>>>
>>>
>>>
>
>
>
> --
> Claus Ibsen
> -
> www.camelone.org: The open source integration conference.
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cib...@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
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


Re: CamelSpringTestSupport registry\bean modification

2013-10-25 Thread Claus Ibsen
Hi

Yeah we should make this easier.


I have logged a ticket
https://issues.apache.org/jira/browse/CAMEL-6900

On Tue, May 7, 2013 at 9:01 PM, javamonkey79  wrote:
> I hope there is a better solution that this, but this works for me:
>
> return new FileSystemXmlApplicationContext(
> "./src/main/webapp/WEB-INF/applicationContext.xml" ) {
> @SuppressWarnings( "unchecked" )
> @Override
> public < T > T getBean( final String name, final 
> Class< T > requiredType
> ) {
> if ( name.equals( "baz" ) ) {
> return (T)_bazRef;
> }
>
> return super.getBean( name, requiredType );
> }
> };
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/CamelSpringTestSupport-registry-bean-modification-tp5732127p5732128.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


Re: testing: intercept route and process() *after* its completion?

2013-10-25 Thread Claus Ibsen
Hi

I have logged a ticket to not forget about this. We should take the
opportunity in Camel 3.0 to make the DSL better and support these
use-cases.
https://issues.apache.org/jira/browse/CAMEL-6901



On Thu, Jun 14, 2012 at 2:54 AM, twelve17  wrote:
> Hello,
>
> I've been diving into Camel testing lately, which, I'm not gonna lie, has
> been quite fun.  Thanks to the Camel book for assistance. :)
>
> I did run into one hangup in which I am not sure what the best
> pattern/practice is.
>
> For my integration testing, I am using adviceWith() to "inject" processing
> into an existing route.  The routebuilder class looks something like:
>
>  @Override
>  public void configure() throws Exception {
>  interceptSendToEndpoint("bean:someEndpointToBeTested").process(new
> DoSomeAssertionProcessor());
> }
>
> The code above runs the processor before the intercepted endpoint.   What I
> would like to do is call a processor *after* the intercepted bean is
> completed, so I can verify that the data it produced matches some expected
> data set.  For the moment, I am using the above pattern to intercept the
> endpoint that follows the actual one I want to test, which seems a little
> fragile to me.
>
> I tried using "interceptFrom", but it does not get triggered, which makes me
> believe it is only triggered if you are intercepting an input route, versus
> matching an output route as if it were "from", from the perspective of when
> the pipeline moves to the following route.
>
> Am I making any sense here? :)
>
> Any help would be appreciated.
>
> Thanks,
>
> Alex
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/testing-intercept-route-and-process-after-its-completion-tp5714460.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


Re: Cannot stop inputstream during ftp transfer

2013-10-25 Thread Claus Ibsen
I logged a ticket about this to not forget, as it would be nice with
an option to be able to stop the download asap

https://issues.apache.org/jira/browse/CAMEL-6902

On Fri, Sep 14, 2012 at 11:46 AM, jmh  wrote:
> Hello,
>
> I would like to understand why my inputstream (from File: to sftp:) is not
> stopped after the shutdown timeout when I stop my bundle.
>
> I put in the camel-context.xml config file :
>
>
>
> This seems to not have any effect on the current inputstream since it
> continues until the file is completly uploaded !
>
>
> My route below :
>
>
>
>
> Thanks for your help
>
> J-M
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Cannot-stop-inputstream-during-ftp-transfer-tp5719356.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


how to call java method using quartz2

2013-10-25 Thread ishwar
hi .actually i need to call java method on future specific time. and i am
using cron pattern for creating the time but i am not getting how to call
the my java method 

This is my simple code which invoke the method

CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
public void configure() {

from("quartz2://myGroup/myfirstrigger?cron=0/2+*+*+*+*+?").to(new
Schedule().show());

}
});
context.start();
 
   the show() method available inside the schedule class so how to call. i
do not have any idea.










--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-call-java-method-using-quartz2-tp5742192.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: how to call java method using quartz2

2013-10-25 Thread Claus Ibsen
Hi

Read the Camel documentation about using beans

http://camel.apache.org/bean-integration.html
http://camel.apache.org/bean.html
http://camel.apache.org/bean-binding.html


On Fri, Oct 25, 2013 at 12:48 PM, ishwar  wrote:
> hi .actually i need to call java method on future specific time. and i am
> using cron pattern for creating the time but i am not getting how to call
> the my java method
>
> This is my simple code which invoke the method
>
> CamelContext context = new DefaultCamelContext();
> context.addRoutes(new RouteBuilder() {
> public void configure() {
> 
> from("quartz2://myGroup/myfirstrigger?cron=0/2+*+*+*+*+?").to(new
> Schedule().show());
>
> }
> });
> context.start();
>
>the show() method available inside the schedule class so how to call. i
> do not have any idea.
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/how-to-call-java-method-using-quartz2-tp5742192.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


Issue loading multiple properties files

2013-10-25 Thread erj2code
I posted this question on Stack Overflow yesterday:
http://stackoverflow.com/questions/19575425/loading-multiple-properties-files-with-camel

but haven't gotten any responses yet.

Basically I'm trying to load another properties file in addition to the ones
I have and I can't get it to work.

Any ideas?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Issue-loading-multiple-properties-files-tp5742200.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: how to call java method using quartz2

2013-10-25 Thread ishwar
after reading i implemented following code.

public class Schedule {
 

public static String SayService(String msg) {
System.out.println(msg);
return (msg);
}

public static void main(String args[])throws Exception
{
JndiContext context1 = new JndiContext();
context1.bind("bye", SayService("Good Bye!"));


CamelContext context = new DefaultCamelContext(context1);
context.addRoutes(new RouteBuilder() {
public void configure() {


from("quartz2://myGroup/myTimerName?cron=0+0/3+12-18+?+*+MON-FRI").to("bean:bye");

}
});
context.start();
Thread.sleep(1);
System.out.println("last line");

}

}

but i am getting this exception

SEVERE: Failed delivery for (MessageId: ID-Snefopc1-52758-1382702844080-0-1
on ExchangeId: ID-Snefopc1-52758-1382702844080-0-2). Exhausted after
delivery attempt: 1 caught:
org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous
method invocations possible: [public static java.lang.String
java.lang.String.valueOf(java.lang.Object), public static java.lang.String
java.lang.String.valueOf(boolean), public static java.lang.String
java.lang.String.valueOf(float), public static java.lang.String
java.lang.String.valueOf(double), public static java.lang.String
java.lang.String.valueOf(int), public static java.lang.String
java.lang.String.valueOf(char), public static java.lang.String
java.lang.String.valueOf(long), public static java.lang.String
java.lang.String.valueOf(char[],int,int), public static java.lang.String
java.lang.String.valueOf(char[]), public int
java.lang.String.indexOf(int,int), public int java.lang.String.indexOf(int),
public int java.lang.String.indexOf(java.lang.String,int), public int
java.lang.String.indexOf(java.lang.String), public int
java.lang.String.compareTo(java.lang.String), public boolean
java.lang.String.equalsIgnoreCase(java.lang.String), public boolean
java.lang.String.contentEquals(java.lang.StringBuffer), public boolean
java.lang.String.contentEquals(java.lang.CharSequence), public int
java.lang.String.compareToIgnoreCase(java.lang.String), public int
java.lang.String.codePointCount(int,int), public int
java.lang.String.codePointBefore(int), public int
java.lang.String.offsetByCodePoints(int,int), public boolean
java.lang.String.regionMatches(int,java.lang.String,int,int), public boolean
java.lang.String.regionMatches(boolean,int,java.lang.String,int,int), public
char java.lang.String.charAt(int), public java.lang.String
java.lang.String.concat(java.lang.String), public void
java.lang.String.getChars(int,int,char[],int), public static
java.lang.String
java.lang.String.format(java.lang.String,java.lang.Object[]), public static
java.lang.String
java.lang.String.format(java.util.Locale,java.lang.String,java.lang.Object[]),
public int java.lang.String.lastIndexOf(int,int), public int
java.lang.String.lastIndexOf(int), public int
java.lang.String.lastIndexOf(java.lang.String,int), public int
java.lang.String.lastIndexOf(java.lang.String), public java.lang.String[]
java.lang.String.split(java.lang.String,int), public java.lang.String[]
java.lang.String.split(java.lang.String), public java.lang.CharSequence
java.lang.String.subSequence(int,int), public boolean
java.lang.String.contains(java.lang.CharSequence), public boolean
java.lang.String.startsWith(java.lang.String), public boolean
java.lang.String.startsWith(java.lang.String,int), public java.lang.String
java.lang.String.substring(int,int), public java.lang.String
java.lang.String.substring(int), public java.lang.String
java.lang.String.toLowerCase(java.util.Locale), public boolean
java.lang.String.matches(java.lang.String), public java.lang.String
java.lang.String.toUpperCase(java.util.Locale), public static
java.lang.String java.lang.String.copyValueOf(char[]), public static
java.lang.String java.lang.String.copyValueOf(char[],int,int), public
boolean java.lang.String.endsWith(java.lang.String), public int
java.lang.String.codePointAt(int), public byte[]
java.lang.String.getBytes(java.lang.String) throws
java.io.UnsupportedEncodingException, public void
java.lang.String.getBytes(int,int,byte[],int), public byte[]
java.lang.String.getBytes(java.nio.charset.Charset), public java.lang.String
java.lang.String.replace(java.lang.CharSequence,java.lang.CharSequence),
public java.lang.String java.lang.String.replace(char,char), public
java.lang.String
java.lang.String.replaceAll(java.lang.String,java.lang.String), public
java.lang.String
java.lang.String.replaceFirst(java.lang.String,java.lang.String)].
Exchange[Message: [Body is null]]



--
View this message in context: 
http://camel.46542

Re: how to call java method using quartz2

2013-10-25 Thread Claus Ibsen
Tell Camel which method to invoke

.to("bean:bye?method=nameOfMethod")


On Fri, Oct 25, 2013 at 2:09 PM, ishwar  wrote:
> after reading i implemented following code.
>
> public class Schedule {
>
>
> public static String SayService(String msg) {
> System.out.println(msg);
> return (msg);
> }
>
> public static void main(String args[])throws Exception
> {
> JndiContext context1 = new JndiContext();
> context1.bind("bye", SayService("Good Bye!"));
>
>
> CamelContext context = new DefaultCamelContext(context1);
> context.addRoutes(new RouteBuilder() {
> public void configure() {
>
>
> from("quartz2://myGroup/myTimerName?cron=0+0/3+12-18+?+*+MON-FRI").to("bean:bye");
>
> }
> });
> context.start();
> Thread.sleep(1);
> System.out.println("last line");
>
> }
>
> }
>
> but i am getting this exception
>
> SEVERE: Failed delivery for (MessageId: ID-Snefopc1-52758-1382702844080-0-1
> on ExchangeId: ID-Snefopc1-52758-1382702844080-0-2). Exhausted after
> delivery attempt: 1 caught:
> org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous
> method invocations possible: [public static java.lang.String
> java.lang.String.valueOf(java.lang.Object), public static java.lang.String
> java.lang.String.valueOf(boolean), public static java.lang.String
> java.lang.String.valueOf(float), public static java.lang.String
> java.lang.String.valueOf(double), public static java.lang.String
> java.lang.String.valueOf(int), public static java.lang.String
> java.lang.String.valueOf(char), public static java.lang.String
> java.lang.String.valueOf(long), public static java.lang.String
> java.lang.String.valueOf(char[],int,int), public static java.lang.String
> java.lang.String.valueOf(char[]), public int
> java.lang.String.indexOf(int,int), public int java.lang.String.indexOf(int),
> public int java.lang.String.indexOf(java.lang.String,int), public int
> java.lang.String.indexOf(java.lang.String), public int
> java.lang.String.compareTo(java.lang.String), public boolean
> java.lang.String.equalsIgnoreCase(java.lang.String), public boolean
> java.lang.String.contentEquals(java.lang.StringBuffer), public boolean
> java.lang.String.contentEquals(java.lang.CharSequence), public int
> java.lang.String.compareToIgnoreCase(java.lang.String), public int
> java.lang.String.codePointCount(int,int), public int
> java.lang.String.codePointBefore(int), public int
> java.lang.String.offsetByCodePoints(int,int), public boolean
> java.lang.String.regionMatches(int,java.lang.String,int,int), public boolean
> java.lang.String.regionMatches(boolean,int,java.lang.String,int,int), public
> char java.lang.String.charAt(int), public java.lang.String
> java.lang.String.concat(java.lang.String), public void
> java.lang.String.getChars(int,int,char[],int), public static
> java.lang.String
> java.lang.String.format(java.lang.String,java.lang.Object[]), public static
> java.lang.String
> java.lang.String.format(java.util.Locale,java.lang.String,java.lang.Object[]),
> public int java.lang.String.lastIndexOf(int,int), public int
> java.lang.String.lastIndexOf(int), public int
> java.lang.String.lastIndexOf(java.lang.String,int), public int
> java.lang.String.lastIndexOf(java.lang.String), public java.lang.String[]
> java.lang.String.split(java.lang.String,int), public java.lang.String[]
> java.lang.String.split(java.lang.String), public java.lang.CharSequence
> java.lang.String.subSequence(int,int), public boolean
> java.lang.String.contains(java.lang.CharSequence), public boolean
> java.lang.String.startsWith(java.lang.String), public boolean
> java.lang.String.startsWith(java.lang.String,int), public java.lang.String
> java.lang.String.substring(int,int), public java.lang.String
> java.lang.String.substring(int), public java.lang.String
> java.lang.String.toLowerCase(java.util.Locale), public boolean
> java.lang.String.matches(java.lang.String), public java.lang.String
> java.lang.String.toUpperCase(java.util.Locale), public static
> java.lang.String java.lang.String.copyValueOf(char[]), public static
> java.lang.String java.lang.String.copyValueOf(char[],int,int), public
> boolean java.lang.String.endsWith(java.lang.String), public int
> java.lang.String.codePointAt(int), public byte[]
> java.lang.String.getBytes(java.lang.String) throws
> java.io.UnsupportedEncodingException, public void
> java.lang.String.getBytes(int,int,byte[],int), public byte[]
> java.lang.String.getBytes(java.nio.charset.Charset), public java.lang.String
> java.lang.String.replace(java.lang.CharSequence,java.lang.CharSequence),
> public java.lang.String java.lang.String.replace(char,char), public
> java.lang.String
> java.lang.String.replaceAll(java.lang.String,java.lang.String), public
> java.lang.String
> java.lang.String.replaceF

Re: camel-context only seems to work within the same file or do I use it wrong?

2013-10-25 Thread dantam74
Just to add my solution to my question.
I wanted to use camel-context to be able to enable me to split the camel
definition files into different modules.

I finally found the vm: component and it does exactly what I wanted to do,
ie direct communication between contexts without having for activemq or
similiar between.



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-context-only-seems-to-work-within-the-same-file-or-do-I-use-it-wrong-tp5738442p5742205.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issue loading multiple properties files

2013-10-25 Thread alexey-s
Hi
This error Spring Framework. Camel nothing to do with business.

Use in OSGI blueprint:

...


http://camel.apache.org/schema/blueprint";>

...




Aleksey



--
View this message in context: 
http://camel.465427.n5.nabble.com/Issue-loading-multiple-properties-files-tp5742200p5742206.html
Sent from the Camel - Users mailing list archive at Nabble.com.


SAXParseException due to invalid characters in cxf endpoint response

2013-10-25 Thread bhushand
Hello All
We are facing an issue which is due to some invalid charaters in
response returned by webservice. We are using Camel 2.9.2 for routing, cxf
2.6.0 to configure jaxws endpoint of our webservice. When response returned
from webservice contains some invalid charaters, consumer of our service
getting SAXParseException. That charaters get properly displayed at our
end,but consumers are getting issue. Also when some escape charaters
present, it is displayed as,

DB ValueValue displayed in response
'  '
< <
>  >
& &

But we want to display DB values as it is. Is it there any issue
with encoding. By assuming this as cause we tried to configure
JAXBDataBinding in endpoint, also tried with interceptor to forcefully
change the encoding as UTF-8.
We got success by doing so. We can see UTF-8 coming in content
type,but when same code is deployed on environment servers again content
type does not contains UTF-8.

 Can someone help me please, why it is so. Are we missing something,
or wrong approch. 



Thanks in advance
Bhushan




--
View this message in context: 
http://camel.465427.n5.nabble.com/SAXParseException-due-to-invalid-characters-in-cxf-endpoint-response-tp5742212.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Request-Reply a second route

2013-10-25 Thread Gabriel
Hello,
I have a route which proxies another route with a web-service like this (1.
Route:): 


from("cxf:bean:TpmsWSEndpoint")
   
.inOut("activemq:queue:tpms_sendTo_iccs?replyTo=tpms_from_iccs&jmsMessageType=Text");

The activemq:queue:tpms_sendTo_iccs queue is the beginning of an other route
witch also have a request-reply request like so (2. Route:)

from("activemq:queue:tpms_sendTo_iccs?useMessageIDAsCorrelationID=true").
inOut("activemq:queue:iccs.request?jmsMessageType=Text").
 to("activemq:queue:tpms_from_iccs");  

I'm loosing all header at the inout call. The Message is processed
succsessfully and resists in activemq:queue:tpms_from_iccs. The 1. Route
gets an timeout exception.

How can I fix that, any ideas?




--
View this message in context: 
http://camel.465427.n5.nabble.com/Request-Reply-a-second-route-tp5742211.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issue loading multiple properties files

2013-10-25 Thread erj2code
Can you clarify what exactly I need to adjust to fix my Spring error?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Issue-loading-multiple-properties-files-tp5742200p5742213.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Downloading IMAP attachments fails on karaf

2013-10-25 Thread Olaf
Hello,

downloading attachments (about 1Mb in size) fails if I deploy my application
to karaf.

If I start my application locally it uses mail-1.4.7.jar. I can see it in
exception trace, because messages cannot be copied:

javax.mail.MessagingException: A17 NO Error in IMAP command received by
server.
at com.sun.mail.imap.IMAPFolder.copyMessages(IMAPFolder.java:1762)
~[mail-1.4.7.jar:1.4.7]

After installing in karaf:

com.sun.mail.iap.CommandFailedException: A9 NO Error in IMAP command
received by server.
at
com.sun.mail.imap.IMAPFolder.copyMessages(IMAPFolder.java:1762)[72:javax.mail:1.4.7]


So it use javax.mail:1.4.7 there and for some reason it doesn't download
attachments.

Any suggestions, how to resolve this?




--
View this message in context: 
http://camel.465427.n5.nabble.com/Downloading-IMAP-attachments-fails-on-karaf-tp5742214.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: SAXParseException due to invalid characters in cxf endpoint response

2013-10-25 Thread bhushand
One thing to mention...we are using websphere for deployment. On our local
server it is running fine, on environments it is causing error.



--
View this message in context: 
http://camel.465427.n5.nabble.com/SAXParseException-due-to-invalid-characters-in-cxf-endpoint-response-tp5742212p5742216.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Netty: messages not propagated back from netty producer

2013-10-25 Thread javakurious
Sorry for responding so late.. 

That didn't help either. noticed that when I sent an erroneous message to
remote netty component, which returned right away with a failure message, it
was received and displayed correctly. But when I send a correct message ,
and the remote server is processing the message, it is not received back.. 

It really feels like that netty producer is not waiting for the response,
when the remote netty server is processing the request..

Vineet



--
View this message in context: 
http://camel.465427.n5.nabble.com/Netty-messages-not-propagated-back-from-netty-producer-tp5741315p5742218.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Netty: messages not propagated back from netty producer

2013-10-25 Thread javakurious
Another observation:

If I set the synchronous to true, I get empty body back..

Could netty be receiving something back before the actual response, which
makes it just return right away. 

Vineet



--
View this message in context: 
http://camel.465427.n5.nabble.com/Netty-messages-not-propagated-back-from-netty-producer-tp5741315p5742226.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Netty: messages not propagated back from netty producer

2013-10-25 Thread javakurious
In debug mode, it runs fine. So, it is a timing issue.. Netty producer is not
waiting for the response even if I set the requestTimeout value to be 10
secs. 

Vineet



--
View this message in context: 
http://camel.465427.n5.nabble.com/Netty-messages-not-propagated-back-from-netty-producer-tp5741315p5742227.html
Sent from the Camel - Users mailing list archive at Nabble.com.


HTTP Basic Authentication

2013-10-25 Thread martin11
Hello,

I`m trying to set BASIC Authentication on HTTP component (camel ver.
2.11.0).
I know that I can use header settings like this one:
.setHeader("Authorization", constant("Basic base64string")) and it works
fine.

But I`m looking for more elegant way to setup basic auth. Something like in
CXF spring bean and http:authorization properties.

- 1st test ---
So I tried to use HttpClientConfigurer:






and in route:
.to("http://{{server}}:{{port}}/{{address}}?httpClientConfigurerRef=myHttpConfig";)

I got an error:
INFO  - basic authentication scheme selected
INFO  - No credentials available for BASIC 'WSMAN'@172.24.40.110:5985
org.apache.camel.component.http.HttpOperationFailedException: HTTP operation
failed invoking http://172.24.40.110:5985/wsman with statusCode: 401

Why is not set BASIC credentials?

- 2nd test ---
I also try other way:











and in route:
.to("http://{{server}}:{{port}}/{{address}}";)

I got an error:
INFO  - Basic authentication scheme selected
java.io.IOException: Server returned HTTP response code: 400 for URL:
http://172.24.40.110:5985/wsman


What is the correct configuration for http basic authentication?

Thanks for any advice.



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


Re: HTTP Basic Authentication

2013-10-25 Thread contactreji
Hi

I used a interceptor approach. The java code for interceptor is as follows

*package outotec.com.mes.bw.copper_recovery_perc;*
*import java.io.IOException;*
*import java.io.OutputStream;*
*import java.net.HttpURLConnection;*
*import java.util.Arrays;*
*import java.util.List;*
*import java.util.Map;*
*import org.apache.cxf.binding.soap.interceptor.SoapHeaderInterceptor;*
*import org.apache.cxf.configuration.security.AuthorizationPolicy;*
*import org.apache.cxf.endpoint.Endpoint;*
*import org.apache.cxf.interceptor.Fault;*
*import org.apache.cxf.message.Exchange;*
*import org.apache.cxf.message.Message;*
*import org.apache.cxf.transport.Conduit;*
*import org.apache.cxf.ws.addressing.EndpointReferenceType;*
*import org.apache.log4j.Logger;*
*import org.springframework.beans.factory.annotation.Required;*
*
*
*/***
* * CXF Interceptor that provides HTTP Basic Authentication validation.*
* * *
* * Based on the concepts outline here:*
* *
http://chrisdail.com/2008/03/31/apache-cxf-with-http-basic-authentication*
* **
* * @author CDail*
* */*
*public class BasicAuthAuthorizationInterceptor extends
SoapHeaderInterceptor {*
*
*
*protected Logger log = Logger.getLogger(getClass());*
**
*/** Map of allowed users to this system with their corresponding
passwords. */*
*private Map users;*
**
*@Required*
*public void setUsers(Map users) {*
*this.users = users;*
*}*
**
*@Override public void handleMessage(Message message) throws Fault {*
*// This is set by CXF*
*AuthorizationPolicy policy =
message.get(AuthorizationPolicy.class);*
**
*// If the policy is not set, the user did not specify credentials*
*// A 401 is sent to the client to indicate that authentication is
required*
*if (policy == null) {*
*if (log.isDebugEnabled()) {*
*log.debug("User attempted to log in with no credentials");*
*}*
*sendErrorResponse(message,
HttpURLConnection.HTTP_UNAUTHORIZED);*
*return;*
*}*
**
*if (log.isDebugEnabled()) {*
*log.debug("Logging in use: " + policy.getUserName());*
*}*
**
*// Verify the password*
*String realPassword = users.get(policy.getUserName());*
*if (realPassword == null ||
!realPassword.equals(policy.getPassword())) {*
*log.error("Invalid username or password for user: " +
policy.getUserName());*
*   *
*sendErrorResponse(message, HttpURLConnection.HTTP_FORBIDDEN);*
*}*
*}*
**
*private void sendErrorResponse(Message message, int responseCode) {*
*Message outMessage = getOutMessage(message);*
*outMessage.put(Message.RESPONSE_CODE, responseCode);*
**
*// Set the response headers*
*Map> responseHeaders =*
*(Map>)message.get(Message.PROTOCOL_HEADERS);*
*if (responseHeaders != null) {*
*responseHeaders.put("WWW-Authenticate", Arrays.asList(new
String[]{"Basic realm=realm"}));*
*responseHeaders.put("Content-Length", Arrays.asList(new
String[]{"0"}));*
*}*
*message.getInterceptorChain().abort();*
*try {*
*getConduit(message).prepare(outMessage);*
*close(outMessage);*
*} catch (IOException e) {*
*log.warn(e.getMessage(), e);*
*}*
*}*
**
*private Message getOutMessage(Message inMessage) {*
*Exchange exchange = inMessage.getExchange();*
*Message outMessage = exchange.getOutMessage();*
*if (outMessage == null) {*
*Endpoint endpoint = exchange.get(Endpoint.class);*
*outMessage = endpoint.getBinding().createMessage();*
*exchange.setOutMessage(outMessage);*
*}*
*outMessage.putAll(inMessage);*
*return outMessage;*
*}*
**
*private Conduit getConduit(Message inMessage) throws IOException {*
*Exchange exchange = inMessage.getExchange();*
*EndpointReferenceType target =
exchange.get(EndpointReferenceType.class);*
*Conduit conduit =*
*exchange.getDestination().getBackChannel(inMessage, null,
target);*
*exchange.setConduit(conduit);*
*return conduit;*
*}*
**
*private void close(Message outMessage) throws IOException {*
*OutputStream os = outMessage.getContent(OutputStream.class);*
*os.flush();*
*os.close();*
*}*
*}*


And I configured my endpoint (in my case, its a web service CXF endpoint)
as shown below.
*
*
*http://10.43.25.123:8181/mes/myWebserviceEndPoint"*
* serviceClass="my.package.serviceClassImpl"*
* wsdlURL="wsdl/myWSDL.wsdl"*
* serviceName="p1:serviceNameFromWsdl"*
* xmlns:p1="my.sample.webservice.wsdl.targetNamespace" xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/";>*
* *
*
*
* *
*
*
* *
*
*
* *
*
*
*
*
* 
*
* *
* *
* *
* *
* *
*
*
* *

It works fine for me.

Would be nice if you could 

Re: SAXParseException due to invalid characters in cxf endpoint response

2013-10-25 Thread bhushand
Hello, can I get some help,please.



--
View this message in context: 
http://camel.465427.n5.nabble.com/SAXParseException-due-to-invalid-characters-in-cxf-endpoint-response-tp5742212p5742243.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Netty: messages not propagated back from netty producer

2013-10-25 Thread Claus Ibsen
Hi

There was a fix about request timeout recently. See CAMEL-6730

On Fri, Oct 25, 2013 at 10:55 PM, javakurious  wrote:
> In debug mode, it runs fine. So, it is a timing issue.. Netty producer is not
> waiting for the response even if I set the requestTimeout value to be 10
> secs.
>
> Vineet
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Netty-messages-not-propagated-back-from-netty-producer-tp5741315p5742227.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