Reputation: 567
I'm having trouble figuring out how to solve this issue. I have a file called: "urlrewrite.xml" which was automatically generated by spring ROO after running the "controller" command in ROO Shell.
However, I still get the following error:
"Referenced file contains errors (http://tuckey.org/res/dtds/urlrewrite3.0.dtd). For more information, right click on the message in the Problems View and select "Show Details..."
Here's the content of the urlrewrite.xml file:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN" "http://tuckey.org/res/dtds/urlrewrite3.0.dtd">
<urlrewrite default-match-type="wildcard">
<rule>
<from>/resources/**</from>
<to last="true">/resources/$1</to>
</rule>
<rule>
<from>/static/WEB-INF/**</from>
<set type="status">403</set>
<to last="true">/static/WEB-INF/$1</to>
</rule>
<rule>
<from>/static/**</from>
<to last="true">/$1</to>
</rule>
<rule>
<from>/</from>
<to last="true">/app/index</to>
</rule>
<rule>
<from>/app/**</from>
<to last="true">/app/$1</to>
</rule>
<rule>
<from>/**</from>
<to>/app/$1</to>
</rule>
<outbound-rule>
<from>/app/**</from>
<to>/$1</to>
</outbound-rule>
</urlrewrite>
Any thoughts on how to get rid of this error?
Upvotes: 7
Views: 4971
Reputation: 1
That issue has been fixed for the next release... https://jira.springsource.org/browse/ROO-1129
Upvotes: 0
Reputation: 361
Add www to link works for me, i changed from
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE urlrewrite
PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN"
"http://tuckey.org/res/dtds/urlrewrite3.0.dtd">
to
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE urlrewrite
PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN"
"http://www.tuckey.org/res/dtds/urlrewrite3.0.dtd">
Upvotes: 3
Reputation: 611
I have figured out the problem. Try this url http://tuckey.org/res/dtds/urlrewrite3.1.dtd with your browse and you will see it's redirecting you to completely different html page instead of dtd file. So here is what I did. I found dtd file from tuckey jar and copied the content to {workspace}/.metadata/.plugins/org.eclipse.wst.internet.cache/279269156.cache and deleted the warnings from markers view and revalidated. Rememer 279269156.cache cache file's name will vary. So you have to find which is the bad file by opening the cache file with some editor
Upvotes: 0
Reputation: 354
i also got this problem. what i did was i just change the code from :
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.2//EN"
"http://tuckey.org/res/dtds/urlrewrite3.2.dtd">
into :
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//www.tuckey.org//DTD UrlRewrite 3.2//EN"
"http://www.tuckey.org/res/dtds/urlrewrite3.2.dtd">
basically, i just appended the "www." before the "tuckey.org" and it fixed the issue.
Upvotes: 7
Reputation: 611
It's better to download the DTD and point to it with an XML catalog entry, as this makes it unnecessary to change the DTD when publishing, yet your files will be validated locally while developing.
Upvotes: 0
Reputation: 11
set the dtd url to "http://urlrewritefilter.googlecode.com/svn-history/r275/trunk/src/java/org/tuckey/web/filters/urlrewrite/dtds/urlrewrite3.0.dtd", it works.
Upvotes: 1
Reputation: 437
I used user374708 method and cleared network cahce, like shown in Nearmars post
Upvotes: 0
Reputation: 21
Hi I just solved this based on a few of these answers here:
The steps I followed were:
1. Downloaded the urlrewrite3.2.dtd
2. saved it locally to ...war/WEB-INF/urlrewrite3.2.dtd
3. pointed my URLrewrite file to the local copy
4. removed the cached version (Preferences>General>Network Connections>Cache)
5. Revalidated the XML
Note: I initially tried editing the file as was suggested by Titi Wangsa bin Damhore but there i got a validation error in the dtd file. I removed that followed the steps above and boom. Problem solved. Thanks to those who contributed ideas.
Blockquote
Upvotes: 2
Reputation: 1256
http://forum.springsource.org/showthread.php?t=90962 led me to the right path.
If you download the DTD from http://tuckey.org/res/dtds/urlrewrite3.0.dtd you will find that sometimes it is correct and sometimes it is empty HTML. Eclipse caches what it downloads either way. You can fix the problem two ways:
Upvotes: 5
Reputation: 212
Just change 3.0 to 3.2
<!DOCTYPE urlrewrite
PUBLIC "-//tuckey.org//DTD UrlRewrite 3.2//EN"
"http://tuckey.org/res/dtds/urlrewrite3.2.dtd">
Upvotes: 10
Reputation: 11
In IntelliJ IDEA, you can select the red DTD URI, hit Alt-Enter, then choose "Fetch external resource".
In Eclipse, you can add the entry to the XML catalog under: Preferences -> XML -> XML Catalog.
I hope this helps.
Upvotes: 1
Reputation: 1
I got the DTD ... saved it in the same directory as the xml and altered it. now there's a red in the DTD and xml
The markup declarations contained or pointed to by the document type declaration must be well-formed. urlrewrite3.0.dtd
Referenced file contains errors (....App/src/main/webapp/WEB-INF/urlrewrite3.0.dtd). ..
Please upload your xml file and dtd file.
Upvotes: 0
Reputation: 7199
did some googling "sample dtd" 4th or 5th result was http://www.xmlfiles.com/dtd/dtd_examples.asp
the sample had a
<!DOCTYPE TVSCHEDULE [
<!ELEMENT TVSCHEDULE (CHANNEL+)>
..
..
]>
the url rewrite dtd started with
<!ELEMENT urlrewrite ((rule|class-rule)*, outbound-rule*, catch*)>
i issued a wget for ""http://tuckey.org/res/dtds/urlrewrite3.0.dtd"" and opened in in sts, yup, its red.
added at the top
<!DOCTYPE urlrewrite [
and ad the bottom
]>
and its no longer red.
so i suggest,
Upvotes: 1