You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by yuncil <jo...@hotmail.de> on 2014/05/12 11:45:32 UTC

Validator in camel route shows strange error message

Hi,

I'm using the java DSL to configure a camel route.

After getting XML via servlet i want to validate the message against a
schema, using the validator component. Everything works fine, except the
validation process.

My route configuration:

from("servlet:///foo?servletName=bar")
            .log(LoggingLevel.INFO, "Empfange XML...")
            .process(new XMLInProcessor())
            .doTry()
            .to("validator:file:" + xsdPath)
            
            .......

This exception occurs every time during the startup process:

12.05 11:29:29 ERROR: Error starting CamelContext.
org.apache.camel.FailedToCreateRouteException: Failed to create route route1
at: >>> DoTry[[To[validator:file:path/to/xsd], Log[XML erfolgreich
validiert...], DoCatch[ [class java.lang.Exception] -> [Log[Fehler beim
Validieren der XML-Nachricht: ${exception.stacktrace}]]]]] <<< in route:
Route(route1)[[From[servlet:///foo?servletName=bar because of Failed to
resolve endpoint: validator://file:path/to/xsd due to: content is not
allowed in prolog.

It's curious because i know the xsd-File is correct. We also use the same in
other projects without problems. I already checked if there are some
characters before the xml declaration, and the xsd-File is encoded in UTF-8
without BOM. 

Some ideas?

Thanks.





--
View this message in context: http://camel.465427.n5.nabble.com/Validator-in-camel-route-shows-strange-error-message-tp5751018.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Validator in camel route shows strange error message

Posted by Christian Müller <ch...@gmail.com>.
Which version do you use?

Best,
Christian
Am 13.05.2014 17:14 schrieb "yuncil" <jo...@hotmail.de>:

> I tested it with another schema file, and the test successfully passed. The
> original schema file has many includes and the included files also have
> many
> includes, consequently there are lots of references to resolve. Could it be
> a streaming issue or similar?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Validator-in-camel-route-shows-strange-error-message-tp5751018p5751066.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Validator in camel route shows strange error message

Posted by yuncil <jo...@hotmail.de>.
I tested it with another schema file, and the test successfully passed. The
original schema file has many includes and the included files also have many
includes, consequently there are lots of references to resolve. Could it be
a streaming issue or similar?



--
View this message in context: http://camel.465427.n5.nabble.com/Validator-in-camel-route-shows-strange-error-message-tp5751018p5751066.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Validator in camel route shows strange error message

Posted by yuncil <jo...@hotmail.de>.
Hi,

I'm running this route in a web-container on glassfish 4.0. I'm also using
the CamelContextLifeCycle for initialization purposes.

When i use a processor in the camel route, with schemaFactory and validator
from the java api in the process method, it works.



--
View this message in context: http://camel.465427.n5.nabble.com/Validator-in-camel-route-shows-strange-error-message-tp5751018p5751053.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Validator in camel route shows strange error message

Posted by Christian Posta <ch...@gmail.com>.
How are you running this camel route? A container? which one?

On Mon, May 12, 2014 at 2:45 AM, yuncil <jo...@hotmail.de> wrote:
> Hi,
>
> I'm using the java DSL to configure a camel route.
>
> After getting XML via servlet i want to validate the message against a
> schema, using the validator component. Everything works fine, except the
> validation process.
>
> My route configuration:
>
> from("servlet:///foo?servletName=bar")
>             .log(LoggingLevel.INFO, "Empfange XML...")
>             .process(new XMLInProcessor())
>             .doTry()
>             .to("validator:file:" + xsdPath)
>
>             .......
>
> This exception occurs every time during the startup process:
>
> 12.05 11:29:29 ERROR: Error starting CamelContext.
> org.apache.camel.FailedToCreateRouteException: Failed to create route route1
> at: >>> DoTry[[To[validator:file:path/to/xsd], Log[XML erfolgreich
> validiert...], DoCatch[ [class java.lang.Exception] -> [Log[Fehler beim
> Validieren der XML-Nachricht: ${exception.stacktrace}]]]]] <<< in route:
> Route(route1)[[From[servlet:///foo?servletName=bar because of Failed to
> resolve endpoint: validator://file:path/to/xsd due to: content is not
> allowed in prolog.
>
> It's curious because i know the xsd-File is correct. We also use the same in
> other projects without problems. I already checked if there are some
> characters before the xml declaration, and the xsd-File is encoded in UTF-8
> without BOM.
>
> Some ideas?
>
> Thanks.
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Validator-in-camel-route-shows-strange-error-message-tp5751018.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta