[opencms-dev] HTML Import chokes on href="#"

Thomas Gagné tgagne at wideopenwest.com
Wed Apr 7 07:17:01 CEST 2004


Hmm.  Perhaps not.  It must be late (for me)

I've decided I don't know what's going on.

It thought it may have been complaining about the 
href="../somefile.html" references.  It only considered relative URLs to 
start with # and /, not ../.  To HtmlConverter.html I added the test for 
../ below:
    public  String getAbsoluteUri(String relativeUri, String baseUri) {
        if (
            (relativeUri == null) ||
            (relativeUri.charAt(0) == '/') ||
            (relativeUri.startsWith("#")) ||
            (relativeUri.startsWith("../"))
        ) {

            return relativeUri;
        }
But it still seems to be crashing at the same place.  I look again and 
realize it doesn't like the charAt().  It would only barf on that if it 
was trying it on an empty string, right?  I'm looking at what I think 
the source file is and am not finding one.  Arrgh!

How do I debug this little pecker?  Can I run it interactively?

This is the traceback.
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    at java.lang.String.charAt(String.java:460)
    at 
org.opencms.modules.htmlimport.HtmlImport.getAbsoluteUri(HtmlImport.java:660)
    at 
org.opencms.modules.htmlimport.HtmlConverter.transformStartElement(HtmlConverter.java:409)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:259)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:266)
    at 
org.opencms.modules.htmlimport.HtmlConverter.printDocument(HtmlConverter.java:245)
    at 
org.opencms.modules.htmlimport.HtmlConverter.convertHTML(HtmlConverter.java:183)
    at 
org.opencms.modules.htmlimport.HtmlConverter.convertHTML(HtmlConverter.java:213)
    at 
org.opencms.modules.htmlimport.HtmlImport.parseHtmlFile(HtmlImport.java:811)
    at 
org.opencms.modules.htmlimport.HtmlImport.copyHtmlFiles(HtmlImport.java:404)
    at 
org.opencms.modules.htmlimport.HtmlImport.startImport(HtmlImport.java:836)
    at 
org.opencms.modules.htmlimport.HtmlImportThread.run(HtmlImportThread.java:89)
com.opencms.core.CmsException: 0 Unknown exception. Detailed error: 
String index out of range: 0.
    at 
org.opencms.modules.htmlimport.HtmlImport.parseHtmlFile(HtmlImport.java:817)
    at 
org.opencms.modules.htmlimport.HtmlImport.copyHtmlFiles(HtmlImport.java:404)
    at 
org.opencms.modules.htmlimport.HtmlImport.startImport(HtmlImport.java:836)
    at 
org.opencms.modules.htmlimport.HtmlImportThread.run(HtmlImportThread.java:89)


-- 
.tom
remove email address' dashes for replies
opensource middleware at <http://isectd.sourceforge.net>
<http://gagne.homedns.org/~tgagne/>




More information about the opencms-dev mailing list