• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with validation dtd

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

i am using struts2 framework and want to validate my fields with the xml method.
I have read the tutorials at the struts homepage, but eclipse gives me the this error:

- Referenced file contains errors (http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd).



Haven't found a solution yet. I hope you can help me.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't found a good solution yet, either, but the problem becomes apparent when you try to go to the URL where the DTD resides, http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd. Instead of getting the DTD, you are redirected to a page saying that the opensymphony.com site has been removed, which I think may have just happend on Monday, May 30. Since the xwork stuff is now part of struts.apache.org, one would have hoped that they would have had the foresight to transfer these DTD files to that domain, and set up redirects on opensymphony.com to go to the new URL, but that doesn't seem to be the case. They do have the site archived, and you can get to the DTD using this URL: http://web.archive.org/web/20090222210559/http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd but that is certainly not a long term solution. The DTD also resides in the xwork jar file, but I haven't found a way to reference the DTD in the jar without using an absolute path, which also isn't a practical solution. I think we are stuck until the xwork DTDs are hosted on struts.apache.org.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have same problem, and found that because when I trying to access http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd I see that project got closed and the link is not valid anymore. I just removed the error dtd link (temporary fix, before apache get new link work)

<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">

and get it works though there is still a warning.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you do have a local copy of the DTD (in the xwork jar file)... then the problem is to tell the parser to use that local copy instead. I have no idea how you would do that in Struts but for the general idea of the available mechanisms, have a look at this Wikipedia article: XML Catalog.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I ran into the same thing...I just extracted the file from xwork-core-2.2.1.jar, copied it into WEB-INF and replaced the opensymphony dtd reference with


It seems to work like a champ.

-Jonathan
 
David Wimmer
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to all

I have copied the dtd from the webarchiv into a xml file and put it into the WEB-INF folder as Jonathan Lewis mentioned.

Works fine and now I can validate my fields
 
Jonathan Lewis
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool! I posted this same issue to the struts user group that is run by Dave Newton....

Hopefully he can get in touch with someone that can eventually host any public files that were on opensymphony.com. I can't believe they pulled the plug without re-hosting their files...
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Guys - we solved this problem by copying the dtd into the file validators.xml

<!DOCTYPE validators [
<!ELEMENT validators (validator)+>

<!ELEMENT validator (#PCDATA)>
<!ATTLIST validator
name CDATA #REQUIRED
class CDATA #REQUIRED
>
]>


This seems to have revealed a bug in their XML configuration parsing
logic; hence, the app fails to load the DTD file from a local "jar"
library instead of the internet; we're expecting hundreds of websites
would be suffering of this issue by now.

I can't believe OpenSymphony didn't setup some url forward to the dtd's. I don't think they know about this problem.

Hope this helps

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It does not complaint for the reference by putting the dtd into the web-inf however it doesn't work for me. what I can do is use the internal dtd as michael did
 
Jonathan Lewis
Greenhorn
Posts: 3
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Per the struts user group: Public files have been re-hosted here: (xwork dtds should be put up there soon....not yet though)

http://struts.apache.org/dtds/
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I extracted the "xwork-core-2.2.1.jar" file in WEB-INF directory and I replaced the opensymphony dtd reference with the local reference... but not works.
The same thing that if there aren't validators xml.

Any alternative or new idea??

Thanks, Juan Manuel
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can wait a bit and try to download the latest development version from here [1], I've just posted updates to DTDs. You can try to use xwork-core.jar directly if your Struts version is 2.1 or 2.2, if not extract DTDs and replace what you have in your xwork.jar


[1] https://builds.apache.org/view/S-Z/view/Struts/job/Struts2/lastStableBuild/

Lukasz
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jonathan Lewis wrote:Per the struts user group: Public files have been re-hosted here: (xwork dtds should be put up there soon....not yet though)

http://struts.apache.org/dtds/



New URL works for us !!!.

Now OpenSymphony has seen it's final days. All xml have to change the dtd to struts.apache.org. xworks related DTD's have been uploaded on "2011-06-02 17:47"

In eclipse you will get below mentioned error which can be resolved as specified by this solution.




E.g. To fix your validation xml files.

Old way of validation DTD



Replace with New validation DTD


 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the very reason I am reluctant to have ANY links to external sites that my production level application requires. It's great until that company has a policy change or goes out of business. No, everything from jQuery to dtd's go on my own directories where I KNOW they will be there tomorrow and the next day and every day after that as long as my website is operational.
 
Gladwin Burboz
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Glenn Puckett wrote:This is the very reason I am reluctant to have ANY links to external sites that my production level application requires. It's great until that company has a policy change or goes out of business. No, everything from jQuery to dtd's go on my own directories where I KNOW they will be there tomorrow and the next day and every day after that as long as my website is operational.



This change does not directly impacts any existing deployed production systems as required DTDs are bundled with respective JARs.
Changes listed above are done only to satisfy eclipse IDE and there are also other work around to do same.
reply
    Bookmark Topic Watch Topic
  • New Topic