gigaZhang / urlrewritefilter

Automatically exported from code.google.com/p/urlrewritefilter
Other
0 stars 0 forks source link

Failed validation of urlrewrite.xml in cause of DTD not found #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a urlrewrite.xml with this doctype definition
<!DOCTYPE urlrewrite
    PUBLIC "-//tuckey.org//DTD UrlRewrite 3.2//EN"
    "http://tuckey.org/res/dtds/urlrewrite3.2.dtd">
2. Validate it with any XML-Editor
3. If you try it to start with tomcate 6, you got an 
org.xml.sax.SAXParseException

What is the expected output? What do you see instead?
The excepted output is to start tomcat without exception. Insteed I've got an 
exception

What version of the product are you using? On what operating system?
We are using this artifact:
<groupId>org.tuckey</groupId>
<artifactId>urlrewrite</artifactId>
<version>2.6.0</version>

Application-Server: Tomcat6 or Jetty
OS: Linux

Please provide any additional information below.
Please have alook on exception Stacktrace:
2011-05-05 
08:03:47.054:INFO:/b4f-client-http:org.tuckey.web.filters.urlrewrite.UrlRewriteF
ilter INFO: reload check set to 300s
2011-05-05 
08:03:47.417:WARN:/b4f-client-http:org.tuckey.web.filters.urlrewrite.Conf 
ERROR: Parse error on line 3 The markup declarations contained or pointed to by 
the document type declaration must be well-formed.
org.xml.sax.SAXParseException: The markup declarations contained or pointed to 
by the document type declaration must be well-formed.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
        at org.tuckey.web.filters.urlrewrite.Conf.loadDom(Conf.java:125)
        at org.tuckey.web.filters.urlrewrite.Conf.<init>(Conf.java:78)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.loadConf(UrlRewriteFilter.java:631)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.init(UrlRewriteFilter.java:617)
        at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662)
        at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
        at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
        at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
        at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:115)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
        at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
        at org.mortbay.jetty.Server.doStart(Server.java:224)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:441)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:383)
        at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:210)
        at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

Original issue reported on code.google.com by soehm...@gmail.com on 5 May 2011 at 6:05

GoogleCodeExporter commented 9 years ago
The dtd listed is used by the application server to configure the rewrite rules 
but http://tuckey.org can sometimes go down. I am experiencing the same issue.

Original comment by githaiga on 5 May 2011 at 6:55

GoogleCodeExporter commented 9 years ago
Hi Githaiga,

thanks for the answer, but thats not the problem. The server is on but if you 
try to go to http://tuckey.org/res/dtds/urlrewrite3.2.dtd you get an HTTP 302.
And if you try to go to http://tuckey.org/res/dtds you get an forbidden. So it 
seems that the URL for DTD is no longer exist.

Original comment by soehm...@gmail.com on 5 May 2011 at 7:03

GoogleCodeExporter commented 9 years ago
I solved it with this information

http://notwastingtime.blogspot.com/2010/06/solved-orgtuckeywebfiltersurlrewritec
on.html

Original comment by githaiga on 5 May 2011 at 7:12

GoogleCodeExporter commented 9 years ago
Yeah, I've the same idea as you - but the problem is, that I haven't the 3.2 
version of DTD to download. (Or any other version of DTD)

Did you have the 3.2 version?

And of course I'm wondering that the DTD's of a real public project is abrupt 
moved or directory is forbidden.

Original comment by soehm...@gmail.com on 5 May 2011 at 7:37

GoogleCodeExporter commented 9 years ago
And now, I've a link where to find the DTD's:

http://www.google.com/codesearch/p?hl=de#cUalbiPJGlY/trunk/src/java/org/tuckey/w
eb/filters/urlrewrite/dtds/urlrewrite3.2.dtd&q=urlrewrite3.2.dtd%20package:http:
//urlrewritefilter\.googlecode\.com&sa=N&cd=2&ct=rc

Original comment by soehm...@gmail.com on 5 May 2011 at 7:38

GoogleCodeExporter commented 9 years ago
Great! Should work now.

Original comment by githaiga on 5 May 2011 at 7:49

GoogleCodeExporter commented 9 years ago
xx

Original comment by douglasi...@gmail.com on 23 May 2011 at 12:57

GoogleCodeExporter commented 9 years ago
http://gamerprospersonalblog.blogspot.com/2011/08/solved-urlrewritexml-validatio
n-issue.html

Has the right solution to this problem 
Simply add  WWW to the url 

Original comment by tapasvi....@gmail.com on 1 Aug 2011 at 6:13

GoogleCodeExporter commented 9 years ago
"Simply add  WWW to the url" making it 
"<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 2.6//EN" 
"http://www.tuckey.org/res/dtds/urlrewrite2.6.dtd">" 
solved the problem for me too.

Original comment by skgoo...@wikisquare.de on 15 Aug 2011 at 7:24

GoogleCodeExporter commented 9 years ago
I've updated all examples to be http://www.tuckey.org/res/dtds/...

Hopefully this helps.

Original comment by p...@tuckey.org on 25 Oct 2011 at 10:13