You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jhcha <jh...@kds.co.kr> on 2008/06/02 12:57:25 UTC

how to disable warn log message when running HttpGetTest.java ?

Dear Camel Developer.

I tested org.apache.camel.component.http.HttpGetTest.java in the camel http
component example,
with the log setting at info level. 

The camel version is 1.3.0.  

then the below warn log message happened.
I don't know it is really a problem.
but I'd like to know what this warning means, ant how to disable it. 

Sincerely.

J. H. Cha

2008-06-02 18:41:16,921 [main           ] [WARN ] [DefaultTypeConverter]
(DefaultTypeConverter.java:93) - Overriding type converter from:
InstanceMethodTypeConverter: public javax.servlet.ServletInputStream
org.apache.camel.component.http.HttpConverter.toInputStream(org.apache.camel.component.http.HttpMessage)
throws java.io.IOException to: InstanceMethodTypeConverter: public
javax.servlet.ServletInputStream
org.apache.camel.component.http.HttpConverter.toServletInputStream(org.apache.camel.component.http.HttpMessage)
throws java.io.IOException
2008-06-02 18:41:17,265 [main           ] [INFO ] [MockEndpoint]
(MockEndpoint.java:204) - Asserting: Endpoint[mock:results] is satisfied

-- 
View this message in context: http://www.nabble.com/how-to-disable-warn-log-message-when-running-HttpGetTest.java---tp17598680s22882p17598680.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: how to disable warn log message when running HttpGetTest.java ?

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Thansk for looking into this. It's a bug in Camel. I have reported it  	 CAMEL-607


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: jhcha [mailto:jhcha@kds.co.kr] 
Sent: 13. juni 2008 09:46
To: camel-user@activemq.apache.org
Subject: Re: how to disable warn log message when running HttpGetTest.java ?


Dear Camel Developer.

Thanks for reply.

After your reply, I has investigated the reason of that warning message 
more precisely. 
I did understand the Camel TypeConverter more deeply. 

I found why the warning message displayed. 

Tha camel http component type converter class has the two methods having the
same input parameter type
ant return type. 

at org.apache.camel.component.http.HttpConverter.java 

 @Converter
    public ServletInputStream toServletInputStream(HttpMessage message)
throws IOException {
        System.out.println("Converting to an InputStream using the
HttpConverter!");
        HttpServletRequest request = toServletRequest(message);
        if (request != null) {
            return request.getInputStream();
        }
        return null;
    }

    @Converter
    public ServletInputStream toInputStream(HttpMessage message) throws
IOException {
        return toServletInputStream(message);
    }

I don't know why the two methods has the same from and to type. 

Might the toInputStream return type be InputStream ? 
When I replace the toInputStream return type to InputStream, the warning
message disappeared. 

Could you check the camel http component type converter source ? 

Thanks a lot. 

Sincerely.

J. H. Cha 



-- 
View this message in context: http://www.nabble.com/how-to-disable-warn-log-message-when-running-HttpGetTest.java---tp17598680s22882p17817463.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: how to disable warn log message when running HttpGetTest.java ?

Posted by jhcha <jh...@kds.co.kr>.
Dear Camel Developer.

Thanks for reply.

After your reply, I has investigated the reason of that warning message 
more precisely. 
I did understand the Camel TypeConverter more deeply. 

I found why the warning message displayed. 

Tha camel http component type converter class has the two methods having the
same input parameter type
ant return type. 

at org.apache.camel.component.http.HttpConverter.java 

 @Converter
    public ServletInputStream toServletInputStream(HttpMessage message)
throws IOException {
        System.out.println("Converting to an InputStream using the
HttpConverter!");
        HttpServletRequest request = toServletRequest(message);
        if (request != null) {
            return request.getInputStream();
        }
        return null;
    }

    @Converter
    public ServletInputStream toInputStream(HttpMessage message) throws
IOException {
        return toServletInputStream(message);
    }

I don't know why the two methods has the same from and to type. 

Might the toInputStream return type be InputStream ? 
When I replace the toInputStream return type to InputStream, the warning
message disappeared. 

Could you check the camel http component type converter source ? 

Thanks a lot. 

Sincerely.

J. H. Cha 



-- 
View this message in context: http://www.nabble.com/how-to-disable-warn-log-message-when-running-HttpGetTest.java---tp17598680s22882p17817463.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: how to disable warn log message when running HttpGetTest.java ?

Posted by bwtaylor <br...@yahoo.com>.
It means that Camel was told twice to convert an HttpMessage to a
ServletInputStream using HttpConverter. It doesn't sound like a problem. If
you want to disable it, you have to find where the extra one is coming from,
which is hard to do without more information.

TypeConverters are described here:
http://activemq.apache.org/camel/type-converter.html


-- 
View this message in context: http://www.nabble.com/how-to-disable-warn-log-message-when-running-HttpGetTest.java---tp17598680s22882p17811784.html
Sent from the Camel - Users mailing list archive at Nabble.com.