Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring ROO issue with UrlRewrite in STS (eclipse)

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?

like image 712
user224270 Avatar asked Jun 15 '10 19:06

user224270


4 Answers

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">
like image 153
Rudy Avatar answered Sep 28 '22 23:09

Rudy


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.

like image 23
xtrycatchx Avatar answered Sep 28 '22 23:09

xtrycatchx


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:

  1. Download the DTD file yourself, verify that it looks like an XML DTD, store it locally, and point at this in your urlrewrite.xml header.
  2. Go to Preferences -> General -> Network Connections -> Cache and remove the cached DTD, then revalidate the XML (Right-click -> Validate). Repeat until you get a good copy of the DTD cached.
like image 25
sosiouxme Avatar answered Sep 29 '22 00:09

sosiouxme


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">
like image 42
SonTL Avatar answered Sep 28 '22 23:09

SonTL