You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Davis, Chad" <Ch...@emc.com> on 2012/12/01 00:52:39 UTC

RE: wierd stack trace regarding parsing of struts.xml

> Without knowing what you're specifying in your struts config it's tough to say.
> 
> The times I've seen this are when there's a mismatch between what's in the
> config and what's in the libraries, like if it can't find the file locally, it goes on
> to the network.
> 

So, I think the issue is that I went from webwork to struts 2.3 on this app.  I did the migration a while back, and the struts.xml files still worked fine even without migrating them to the new dtd ( declarations as well as actual structure ).  But in on this one installation they fail.  My theory is that if the internet is available, the struts.xml with "xwork" DTD will still work.  This makes me think that the DTD resolution must have someone of resolving the dTD from the classpath prior to hitting the web URL, but I've not had a change to investigate that yet.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: wierd stack trace regarding parsing of struts.xml

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/3 ChadDavis <ch...@gmail.com>:
> I'm happy to hear that, I've posted how to get contributor rights to docs
>
> Posted where?

http://markmail.org/message/4way2m5y2vlwkrih :-)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: wierd stack trace regarding parsing of struts.xml

Posted by ChadDavis <ch...@gmail.com>.
I'm happy to hear that, I've posted how to get contributor rights to docs
>

Posted where?

Re: wierd stack trace regarding parsing of struts.xml

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/3 ChadDavis <ch...@gmail.com>:
> So, it seems like this should be added to the wiki on the webworks to
> struts 2 migration page . . . I'm more than willing to do provide the text.
>  what do you think?

I'm happy to hear that, I've posted how to get contributor rights to docs


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: wierd stack trace regarding parsing of struts.xml

Posted by ChadDavis <ch...@gmail.com>.
So, it seems like this should be added to the wiki on the webworks to
struts 2 migration page . . . I'm more than willing to do provide the text.
 what do you think?


On Mon, Dec 3, 2012 at 1:20 AM, Lukasz Lenart <lu...@apache.org>wrote:

> 2012/12/1 ChadDavis <ch...@gmail.com>:
> > Thanks Lukasz.  This is very useful information. I think this clearly
> fixes
> > my problem, but I still have some questions.
> >
> > 1) when was xwork moved to ASF?
>
> Just before 2.2.1, two years ago, but DTDs where changed sometime later
>
> http://struts.apache.org/2.x/docs/version-notes-221.html
>
> > 2) It's not really Struts 2 doing the look up right?  It's the sax
> parser?
> >  Is Struts2 using the EntityResolver to add the resolution logic that
> > converts the DOCTYPE tag to a classpath resource lookup?  If you don't
> know
> > of the top of your head, I plan to dive into the code myself anyhow.
>
> Yes, but you can tell the parser where the DTDs are, so it can read
> them locally before looking for them over the internet. See
> XmlConfigurationProvider for more details.
>
> Example:
>         mappings.put("-//Apache Struts//XWork 2.3//EN", "xwork-2.3.dtd");
>         mappings.put("-//Apache Struts//XWork 2.1.3//EN",
> "xwork-2.1.3.dtd");
>         mappings.put("-//Apache Struts//XWork 2.1//EN", "xwork-2.1.dtd");
>         mappings.put("-//Apache Struts//XWork 2.0//EN", "xwork-2.0.dtd");
>         mappings.put("-//Apache Struts//XWork 1.1.1//EN",
> "xwork-1.1.1.dtd");
>         mappings.put("-//Apache Struts//XWork 1.1//EN", "xwork-1.1.dtd");
>         mappings.put("-//Apache Struts//XWork 1.0//EN", "xwork-1.0.dtd");
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: wierd stack trace regarding parsing of struts.xml

Posted by ChadDavis <ch...@gmail.com>.
Thanks!


On Mon, Dec 3, 2012 at 1:20 AM, Lukasz Lenart <lu...@apache.org>wrote:

> 2012/12/1 ChadDavis <ch...@gmail.com>:
> > Thanks Lukasz.  This is very useful information. I think this clearly
> fixes
> > my problem, but I still have some questions.
> >
> > 1) when was xwork moved to ASF?
>
> Just before 2.2.1, two years ago, but DTDs where changed sometime later
>
> http://struts.apache.org/2.x/docs/version-notes-221.html
>
> > 2) It's not really Struts 2 doing the look up right?  It's the sax
> parser?
> >  Is Struts2 using the EntityResolver to add the resolution logic that
> > converts the DOCTYPE tag to a classpath resource lookup?  If you don't
> know
> > of the top of your head, I plan to dive into the code myself anyhow.
>
> Yes, but you can tell the parser where the DTDs are, so it can read
> them locally before looking for them over the internet. See
> XmlConfigurationProvider for more details.
>
> Example:
>         mappings.put("-//Apache Struts//XWork 2.3//EN", "xwork-2.3.dtd");
>         mappings.put("-//Apache Struts//XWork 2.1.3//EN",
> "xwork-2.1.3.dtd");
>         mappings.put("-//Apache Struts//XWork 2.1//EN", "xwork-2.1.dtd");
>         mappings.put("-//Apache Struts//XWork 2.0//EN", "xwork-2.0.dtd");
>         mappings.put("-//Apache Struts//XWork 1.1.1//EN",
> "xwork-1.1.1.dtd");
>         mappings.put("-//Apache Struts//XWork 1.1//EN", "xwork-1.1.dtd");
>         mappings.put("-//Apache Struts//XWork 1.0//EN", "xwork-1.0.dtd");
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: wierd stack trace regarding parsing of struts.xml

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/3 ChadDavis <ch...@gmail.com>:
> There are (from 2.3):
>>
>> 79:        dtdMappings.put("-//Apache Software Foundation//DTD Struts
>> Configuration 2.0//EN", "struts-2.0.dtd");
>> 80:        dtdMappings.put("-//Apache Software Foundation//DTD Struts
>> Configuration 2.1//EN", "struts-2.1.dtd");
>> 81:        dtdMappings.put("-//Apache Software Foundation//DTD Struts
>> Configuration 2.1.7//EN", "struts-2.1.7.dtd");
>> 82:        dtdMappings.put("-//Apache Software Foundation//DTD Struts
>> Configuration 2.3//EN", "struts-2.3.dtd");
>>
>>
> Oh, I wasn't looking at the Struts2XmlConfigurationProvider; I was looking
> at the XmlConfigurationProvider . . .

The idea is that you can use XWork in a standalone application, without Struts 2


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: wierd stack trace regarding parsing of struts.xml

Posted by ChadDavis <ch...@gmail.com>.
There are (from 2.3):
>
> 79:        dtdMappings.put("-//Apache Software Foundation//DTD Struts
> Configuration 2.0//EN", "struts-2.0.dtd");
> 80:        dtdMappings.put("-//Apache Software Foundation//DTD Struts
> Configuration 2.1//EN", "struts-2.1.dtd");
> 81:        dtdMappings.put("-//Apache Software Foundation//DTD Struts
> Configuration 2.1.7//EN", "struts-2.1.7.dtd");
> 82:        dtdMappings.put("-//Apache Software Foundation//DTD Struts
> Configuration 2.3//EN", "struts-2.3.dtd");
>
>
Oh, I wasn't looking at the Struts2XmlConfigurationProvider; I was looking
at the XmlConfigurationProvider . . .

Re: wierd stack trace regarding parsing of struts.xml

Posted by Dave Newton <da...@gmail.com>.
There are (from 2.3):

79:        dtdMappings.put("-//Apache Software Foundation//DTD Struts
Configuration 2.0//EN", "struts-2.0.dtd");
80:        dtdMappings.put("-//Apache Software Foundation//DTD Struts
Configuration 2.1//EN", "struts-2.1.dtd");
81:        dtdMappings.put("-//Apache Software Foundation//DTD Struts
Configuration 2.1.7//EN", "struts-2.1.7.dtd");
82:        dtdMappings.put("-//Apache Software Foundation//DTD Struts
Configuration 2.3//EN", "struts-2.3.dtd");


On Mon, Dec 3, 2012 at 4:25 PM, ChadDavis <ch...@gmail.com> wrote:
> Why aren't there mappings for the struts-xxx.dtd's?
>
>
>
> On Mon, Dec 3, 2012 at 1:20 AM, Lukasz Lenart <lu...@apache.org>wrote:
>
>> 2012/12/1 ChadDavis <ch...@gmail.com>:
>> > Thanks Lukasz.  This is very useful information. I think this clearly
>> fixes
>> > my problem, but I still have some questions.
>> >
>> > 1) when was xwork moved to ASF?
>>
>> Just before 2.2.1, two years ago, but DTDs where changed sometime later
>>
>> http://struts.apache.org/2.x/docs/version-notes-221.html
>>
>> > 2) It's not really Struts 2 doing the look up right?  It's the sax
>> parser?
>> >  Is Struts2 using the EntityResolver to add the resolution logic that
>> > converts the DOCTYPE tag to a classpath resource lookup?  If you don't
>> know
>> > of the top of your head, I plan to dive into the code myself anyhow.
>>
>> Yes, but you can tell the parser where the DTDs are, so it can read
>> them locally before looking for them over the internet. See
>> XmlConfigurationProvider for more details.
>>
>> Example:
>>         mappings.put("-//Apache Struts//XWork 2.3//EN", "xwork-2.3.dtd");
>>         mappings.put("-//Apache Struts//XWork 2.1.3//EN",
>> "xwork-2.1.3.dtd");
>>         mappings.put("-//Apache Struts//XWork 2.1//EN", "xwork-2.1.dtd");
>>         mappings.put("-//Apache Struts//XWork 2.0//EN", "xwork-2.0.dtd");
>>         mappings.put("-//Apache Struts//XWork 1.1.1//EN",
>> "xwork-1.1.1.dtd");
>>         mappings.put("-//Apache Struts//XWork 1.1//EN", "xwork-1.1.dtd");
>>         mappings.put("-//Apache Struts//XWork 1.0//EN", "xwork-1.0.dtd");
>>
>>
>> Regards
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>



-- 
e: davelnewton@gmail.com
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton
b: Bucky Bits
g: davelnewton
so: Dave Newton

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: wierd stack trace regarding parsing of struts.xml

Posted by ChadDavis <ch...@gmail.com>.
Why aren't there mappings for the struts-xxx.dtd's?



On Mon, Dec 3, 2012 at 1:20 AM, Lukasz Lenart <lu...@apache.org>wrote:

> 2012/12/1 ChadDavis <ch...@gmail.com>:
> > Thanks Lukasz.  This is very useful information. I think this clearly
> fixes
> > my problem, but I still have some questions.
> >
> > 1) when was xwork moved to ASF?
>
> Just before 2.2.1, two years ago, but DTDs where changed sometime later
>
> http://struts.apache.org/2.x/docs/version-notes-221.html
>
> > 2) It's not really Struts 2 doing the look up right?  It's the sax
> parser?
> >  Is Struts2 using the EntityResolver to add the resolution logic that
> > converts the DOCTYPE tag to a classpath resource lookup?  If you don't
> know
> > of the top of your head, I plan to dive into the code myself anyhow.
>
> Yes, but you can tell the parser where the DTDs are, so it can read
> them locally before looking for them over the internet. See
> XmlConfigurationProvider for more details.
>
> Example:
>         mappings.put("-//Apache Struts//XWork 2.3//EN", "xwork-2.3.dtd");
>         mappings.put("-//Apache Struts//XWork 2.1.3//EN",
> "xwork-2.1.3.dtd");
>         mappings.put("-//Apache Struts//XWork 2.1//EN", "xwork-2.1.dtd");
>         mappings.put("-//Apache Struts//XWork 2.0//EN", "xwork-2.0.dtd");
>         mappings.put("-//Apache Struts//XWork 1.1.1//EN",
> "xwork-1.1.1.dtd");
>         mappings.put("-//Apache Struts//XWork 1.1//EN", "xwork-1.1.dtd");
>         mappings.put("-//Apache Struts//XWork 1.0//EN", "xwork-1.0.dtd");
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: wierd stack trace regarding parsing of struts.xml

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/1 ChadDavis <ch...@gmail.com>:
> Thanks Lukasz.  This is very useful information. I think this clearly fixes
> my problem, but I still have some questions.
>
> 1) when was xwork moved to ASF?

Just before 2.2.1, two years ago, but DTDs where changed sometime later

http://struts.apache.org/2.x/docs/version-notes-221.html

> 2) It's not really Struts 2 doing the look up right?  It's the sax parser?
>  Is Struts2 using the EntityResolver to add the resolution logic that
> converts the DOCTYPE tag to a classpath resource lookup?  If you don't know
> of the top of your head, I plan to dive into the code myself anyhow.

Yes, but you can tell the parser where the DTDs are, so it can read
them locally before looking for them over the internet. See
XmlConfigurationProvider for more details.

Example:
        mappings.put("-//Apache Struts//XWork 2.3//EN", "xwork-2.3.dtd");
        mappings.put("-//Apache Struts//XWork 2.1.3//EN", "xwork-2.1.3.dtd");
        mappings.put("-//Apache Struts//XWork 2.1//EN", "xwork-2.1.dtd");
        mappings.put("-//Apache Struts//XWork 2.0//EN", "xwork-2.0.dtd");
        mappings.put("-//Apache Struts//XWork 1.1.1//EN", "xwork-1.1.1.dtd");
        mappings.put("-//Apache Struts//XWork 1.1//EN", "xwork-1.1.dtd");
        mappings.put("-//Apache Struts//XWork 1.0//EN", "xwork-1.0.dtd");


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: wierd stack trace regarding parsing of struts.xml

Posted by ChadDavis <ch...@gmail.com>.
> > But what do you think needs to match the jar file?  I mean,
> struts2-core.jar doesn't contain xwork-1.1.1.dtd, but the xwork jar does .
> . . so why wouldn't it find it if it was just taking the xwork-1.1.1.dtd
> and checking the classpath.
>
> When XWork was moved to ASF, we changed all the DOCTYPEs, the correct one
> is:
>
>    <!DOCTYPE xwork PUBLIC
>                 "-//Apache Struts//XWork 1.0//EN"
>                 "http://struts.apache.org/dtds/xwork-1.1.1.dtd">
>
> You can find all the DTDs here [1], basically all these DTDs are part
> of distribution, so Struts 2 can read them from jars and don't have to
> look over the internet. In your case, the DOCTYPE is not available
> locally and Struts 2 is trying to fetch it from internet.
>
> [1] http://struts.apache.org/dtds/
>


Thanks Lukasz.  This is very useful information. I think this clearly fixes
my problem, but I still have some questions.

1) when was xwork moved to ASF?

2) It's not really Struts 2 doing the look up right?  It's the sax parser?
 Is Struts2 using the EntityResolver to add the resolution logic that
converts the DOCTYPE tag to a classpath resource lookup?  If you don't know
of the top of your head, I plan to dive into the code myself anyhow.

Re: wierd stack trace regarding parsing of struts.xml

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/1 Davis, Chad <Ch...@emc.com>:
>
>> IMO it just needs to match the DTD in the jar; as I said, I've generally seen
>> this happen when there's a mis-match.
>>
>> In regards to your SO question, it would depend completely on the
>> implementation and its configuration.
>>
>
> Here's the one that doesn't work:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE xwork PUBLIC
>         "-//OpenSymphony Group//XWork 1.1.1//EN"
>         "http://www.opensymphony.com/xwork/xwork-1.1.1.dtd">
>
> <xwork>
>
>
> But what do you think needs to match the jar file?  I mean, struts2-core.jar doesn't contain xwork-1.1.1.dtd, but the xwork jar does . . . so why wouldn't it find it if it was just taking the xwork-1.1.1.dtd and checking the classpath.

When XWork was moved to ASF, we changed all the DOCTYPEs, the correct one is:

   <!DOCTYPE xwork PUBLIC
		"-//Apache Struts//XWork 1.0//EN"
		"http://struts.apache.org/dtds/xwork-1.1.1.dtd">

You can find all the DTDs here [1], basically all these DTDs are part
of distribution, so Struts 2 can read them from jars and don't have to
look over the internet. In your case, the DOCTYPE is not available
locally and Struts 2 is trying to fetch it from internet.

[1] http://struts.apache.org/dtds/


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: wierd stack trace regarding parsing of struts.xml

Posted by "Davis, Chad" <Ch...@emc.com>.
> IMO it just needs to match the DTD in the jar; as I said, I've generally seen
> this happen when there's a mis-match.
> 
> In regards to your SO question, it would depend completely on the
> implementation and its configuration.
> 

Here's the one that doesn't work:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xwork PUBLIC 
	"-//OpenSymphony Group//XWork 1.1.1//EN"
	"http://www.opensymphony.com/xwork/xwork-1.1.1.dtd">

<xwork>


But what do you think needs to match the jar file?  I mean, struts2-core.jar doesn't contain xwork-1.1.1.dtd, but the xwork jar does . . . so why wouldn't it find it if it was just taking the xwork-1.1.1.dtd and checking the classpath.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: wierd stack trace regarding parsing of struts.xml

Posted by Dave Newton <da...@gmail.com>.
IMO it just needs to match the DTD in the jar; as I said, I've
generally seen this happen when there's a mis-match.

In regards to your SO question, it would depend completely on the
implementation and its configuration.

Dave

On Fri, Nov 30, 2012 at 6:52 PM, Davis, Chad <Ch...@emc.com> wrote:
>
>> Without knowing what you're specifying in your struts config it's tough to say.
>>
>> The times I've seen this are when there's a mismatch between what's in the
>> config and what's in the libraries, like if it can't find the file locally, it goes on
>> to the network.
>>
>
> So, I think the issue is that I went from webwork to struts 2.3 on this app.  I did the migration a while back, and the struts.xml files still worked fine even without migrating them to the new dtd ( declarations as well as actual structure ).  But in on this one installation they fail.  My theory is that if the internet is available, the struts.xml with "xwork" DTD will still work.  This makes me think that the DTD resolution must have someone of resolving the dTD from the classpath prior to hitting the web URL, but I've not had a change to investigate that yet.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>



-- 
e: davelnewton@gmail.com
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton
b: Bucky Bits
g: davelnewton
so: Dave Newton

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org