Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » XML Catalog User entries ignored by embedded tomcat
XML Catalog User entries ignored by embedded tomcat [message #512108] Wed, 03 February 2010 22:53 Go to next message
David Durham is currently offline David DurhamFriend
Messages: 9
Registered: July 2009
Junior Member
I'm extending spring with a namespace. The way that works you provide a schema xsd file in your jar and hook into spring xml processing for schema validation and such. In eclipse, the schema is expected to be available at a given location. For instance:

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:ws="http://mywork/namespace
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5 .xsd
http://mywork/namespace
http://mywork/namespace.xsd
">

Now.. I can add an entry in the eclipse XML catalog so that the XML editor works. However, when I launch my webapp with an embedded WTP tomcat instance, I see this error:

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'myelement'

This is the same error the editor was giving before I added the user entry to xml catalogs. So, does WTP use those entries as well? It would appear not. Anyone seen this and have a solution?

Thanks.

Re: XML Catalog User entries ignored by embedded tomcat [message #512110 is a reply to message #512108] Wed, 03 February 2010 22:58 Go to previous messageGo to next message
David Durham is currently offline David DurhamFriend
Messages: 9
Registered: July 2009
Junior Member
I should note that when I bundle up my app into a war and deploy to a standalone java instance .. it works just fine.
Re: XML Catalog User entries ignored by embedded tomcat [message #512322 is a reply to message #512108] Thu, 04 February 2010 11:50 Go to previous messageGo to next message
Valentin is currently offline ValentinFriend
Messages: 36
Registered: July 2009
Member
Hi David, I don't know much about how embedded servers work, but I would
suspect they don't ship by default or use the workspace XML catalog. Looking
at the problem from a pure XML point of view, I suspect it would be up to
the program that parses that XML file to provide an entity resolver, perhaps
delegating to an XML catalog to resolve your schema. The schema itself may
be located on the web or shipped with your application. I would suggest you
ask the Spring folks if they support this scenario.

Regards, Valentin

"David Durham" <david.durham.jr@gmail.com> wrote in message
news:hkcupq$mgb$1@build.eclipse.org...
> I'm extending spring with a namespace. The way that works you provide a
> schema xsd file in your jar and hook into spring xml processing for schema
> validation and such. In eclipse, the schema is expected to be available
> at a given location. For instance:
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:ws="http://mywork/namespace
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.5 .xsd
> http://mywork/namespace
> http://mywork/namespace.xsd
> ">
>
> Now.. I can add an entry in the eclipse XML catalog so that the XML editor
> works. However, when I launch my webapp with an embedded WTP tomcat
> instance, I see this error:
>
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The
> matching wildcard is strict, but no declaration can be found for element
> 'myelement'
>
> This is the same error the editor was giving before I added the user entry
> to xml catalogs. So, does WTP use those entries as well? It would appear
> not. Anyone seen this and have a solution?
>
> Thanks.
>
>
Re: XML Catalog User entries ignored by embedded tomcat [message #512348 is a reply to message #512322] Thu, 04 February 2010 18:01 Go to previous messageGo to next message
David Durham is currently offline David DurhamFriend
Messages: 9
Registered: July 2009
Junior Member
The app works fine when I war it up and place it in a standalone server -- just doesn't work within the WTP tomcat instance. Spring supports the xsd not being available publicly, it has a mapping file where you tell it where to fine the xsd file on the classpath. And that works in a standalone tomcat instance, just not within wtp.

Thanks,
Dave
Re: XML Catalog User entries ignored by embedded tomcat [message #512357 is a reply to message #512348] Thu, 04 February 2010 13:36 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
David Durham wrote:
> The app works fine when I war it up and place it in a standalone server
> -- just doesn't work within the WTP tomcat instance. Spring supports
> the xsd not being available publicly, it has a mapping file where you
> tell it where to fine the xsd file on the classpath. And that works in
> a standalone tomcat instance, just not within wtp.
>
> Thanks,
> Dave

Where is this schema file in your project?

Cheers,
Larry
Re: XML Catalog User entries ignored by embedded tomcat [message #512373 is a reply to message #512357] Thu, 04 February 2010 19:29 Go to previous messageGo to next message
David Durham is currently offline David DurhamFriend
Messages: 9
Registered: July 2009
Junior Member
In a jar on the classpath.

I have a war that depends on my spring extension library that includes a xsd.
Re: XML Catalog User entries ignored by embedded tomcat [message #512588 is a reply to message #512373] Fri, 05 February 2010 14:40 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
David Durham wrote:
> In a jar on the classpath.
>
> I have a war that depends on my spring extension library that includes a
> xsd.

The few clues so far aren't pointing to any obvious reasons that would
explain the difference in behavior. To clarify, is this "jar" just a
jar or is it another project in your workspace that your Dynamic Web
project depends on?

Cheers,
Larry
Re: XML Catalog User entries ignored by embedded tomcat [message #512622 is a reply to message #512588] Fri, 05 February 2010 16:28 Go to previous messageGo to next message
David Durham is currently offline David DurhamFriend
Messages: 9
Registered: July 2009
Junior Member
Does it really matter where exactly it is on the classpath? Ultimately it resides in a jar file in the .metadata/.plugins/org.eclipse.wst.server.core/tmp0/.../WEB- INF/lib, but it could also be in .metadata/.plugins/.../WEB-INF/classes and it still would not work.

It's the setup of the embedded tomcat container that is causing my problem. I have not dug into the embedded environment enough to say, "Ok the parser is setup this way .. so that's why it's not working in one scenario, but my standalone server does work because a parser is setup this way." Instead, I was kind of hoping that someone would say "this is how you can make the embedded tomcat container honor the user entries in preferences -> XML Catalog, .. or no you can not do that, and we'll note that as a feature request."

In fact, I was going to add it as a feature request myself, but bugzilla comes back with:

Sorry, either the product WTP Server Tools does not exist or you aren't authorized to enter a bug into it.

at: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=WTP%20Se rver%20Tools


Thanks,
Dave
Re: XML Catalog User entries ignored by embedded tomcat [message #512641 is a reply to message #512622] Fri, 05 February 2010 13:02 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
David Durham wrote:
> Does it really matter where exactly it is on the classpath? Ultimately
> it resides in a jar file in the
> .metadata/.plugins/org.eclipse.wst.server.core/tmp0/.../WEB- INF/lib,
> but it could also be in .metadata/.plugins/.../WEB-INF/classes and it
> still would not work.
> It's the setup of the embedded tomcat container that is causing my
> problem. I have not dug into the embedded environment enough to say,
> "Ok the parser is setup this way .. so that's why it's not working in
> one scenario, but my standalone server does work because a parser is
> setup this way." Instead, I was kind of hoping that someone would say
> "this is how you can make the embedded tomcat container honor the user
> entries in preferences -> XML Catalog, .. or no you can not do that,
> and we'll note that as a feature request."
>
> In fact, I was going to add it as a feature request myself, but bugzilla
> comes back with:
>
> Sorry, either the product WTP Server Tools does not exist or you
> aren't authorized to enter a bug into it.
>
> at:
> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=WTP%20Se rver%20Tools
>
> Thanks,
> Dave

The difference in the behavior between the embedded Tomcat and your
external Tomcat is likely due to a configuration difference between the
Tomcats, a bug or quirk in spring, a bug in WTP, or some combination of
these. The prior question relates to the "bug in WTP" possibility,
based on some past history. I just need to confirm that the jar is
where it belongs and it contains the xsd where it should. If this is
coming from project in your workspace and a certain past bug (don't
remember the number) has reappeared, then the answer could be "no". To
avoid wasting time, I need to eliminate this before pursuing other
possibilities.

If the jar and xsd are where they should be under "tmp0/.../WEB-
INF/lib", or you get the same error putting the xsd in the appropriate
location under WEB-INF/classes, then it would help to have a stacktrace
for the startup error you are seeing, if one is available in some log
output. It would also help to know which version of WTP, Spring, and
Tomcat you are using.

Cheers,
Larry
Re: XML Catalog User entries ignored by embedded tomcat [message #512645 is a reply to message #512641] Fri, 05 February 2010 18:21 Go to previous messageGo to next message
David Durham is currently offline David DurhamFriend
Messages: 9
Registered: July 2009
Junior Member
Thanks.

I filed a report here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=301985

It has the stack trace you mention. And the xsd file is in the jar file in WEB-INF/lib where it should be.

Thanks again,
Dave
Re: XML Catalog User entries ignored by embedded tomcat [message #512647 is a reply to message #512641] Fri, 05 February 2010 18:26 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
Larry Isaacs wrote:
> David Durham wrote:
>> Does it really matter where exactly it is on the classpath?
>> Ultimately it resides in a jar file in the
>> .metadata/.plugins/org.eclipse.wst.server.core/tmp0/.../WEB- INF/lib,
>> but it could also be in .metadata/.plugins/.../WEB-INF/classes and it
>> still would not work. It's the setup of the embedded tomcat container
>> that is causing my problem. I have not dug into the embedded
>> environment enough to say, "Ok the parser is setup this way .. so
>> that's why it's not working in one scenario, but my standalone server
>> does work because a parser is setup this way." Instead, I was kind
>> of hoping that someone would say "this is how you can make the
>> embedded tomcat container honor the user entries in preferences -> XML
>> Catalog, .. or no you can not do that, and we'll note that as a
>> feature request."
>>
>> In fact, I was going to add it as a feature request myself, but
>> bugzilla comes back with:
>>
>> Sorry, either the product WTP Server Tools does not exist or you
>> aren't authorized to enter a bug into it.
>>
>> at:
>> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=WTP%20Se rver%20Tools
>>
>> Thanks,
>> Dave
>
> The difference in the behavior between the embedded Tomcat and your
> external Tomcat is likely due to a configuration difference between the
> Tomcats, a bug or quirk in spring, a bug in WTP, or some combination of
> these. The prior question relates to the "bug in WTP" possibility,
> based on some past history. I just need to confirm that the jar is
> where it belongs and it contains the xsd where it should. If this is
> coming from project in your workspace and a certain past bug (don't
> remember the number) has reappeared, then the answer could be "no". To
> avoid wasting time, I need to eliminate this before pursuing other
> possibilities.
>
> If the jar and xsd are where they should be under "tmp0/.../WEB-
> INF/lib", or you get the same error putting the xsd in the appropriate
> location under WEB-INF/classes, then it would help to have a stacktrace
> for the startup error you are seeing, if one is available in some log
> output. It would also help to know which version of WTP, Spring, and
> Tomcat you are using.
>
> Cheers,
> Larry

Never mind about the stacktrace, I saw Bug 301985.

Cheers,
Larry
Previous Topic:EL Syntax Error for no-args function
Next Topic:How to get Get JavaScript" type resolution" in script blocks of HTML/JSP files
Goto Forum:
  


Current Time: Sun Nov 23 22:31:35 GMT 2014

Powered by FUDForum. Page generated in 0.02193 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software