Validator in camel route shows strange error message

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Validator in camel route shows strange error message

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

Reply | Threaded
Open this post in threaded view
|

Re: Validator in camel route shows strange error message

ceposta
How are you running this camel route? A container? which one?

On Mon, May 12, 2014 at 2:45 AM, yuncil <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Validator in camel route shows strange error message

yuncil
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.
Reply | Threaded
Open this post in threaded view
|

Re: Validator in camel route shows strange error message

yuncil
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?
Reply | Threaded
Open this post in threaded view
|

Re: Validator in camel route shows strange error message

Christian Mueller
Administrator
Which version do you use?

Best,
Christian
Am 13.05.2014 17:14 schrieb "yuncil" <[hidden email]>:

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