[jdom-interest] JDOM, Resin 2.0.13 org.jdom.*

John Rosocha john at clandecadence.com
Thu May 12 15:46:21 PDT 2005


I'm not so sure how to add to my original problem via email. This is the 
stack trace. I am using JDOM1.0 from http://www.jdom.org/dist/binary/.

org.jdom.IllegalNameException: The name "xml:lang" is not legal for 
JDOM/XML attributes: Attribute names cannot contain colons. at 
org.jdom.Attribute.setName(Attribute.java:361) at 
org.jdom.Attribute.(Attribute.java:228) at 
org.jdom.Attribute.(Attribute.java:276) at 
org.jdom.DefaultJDOMFactory.attribute(DefaultJDOMFactory.java:93) at 
org.jdom.input.SAXHandler.startElement(SAXHandler.java:544) at 
com.caucho.xml.XmlParser.addElement(XmlParser.java:2259) at 
com.caucho.xml.XmlParser.parseElement(XmlParser.java:615) at 
com.caucho.xml.XmlParser.parseNode(XmlParser.java:364) at 
com.caucho.xml.XmlParser.parseInt(XmlParser.java:246) at 
com.caucho.xml.AbstractParser.parse(AbstractParser.java:614) at 
org.jdom.input.SAXBuilder.build(SAXBuilder.java:453) at 
org.jdom.input.SAXBuilder.build(SAXBuilder.java:770) at 
_john._jdom__jsp._jspService(_jdom__jsp.java:31) at 
com.caucho.jsp.JavaPage.service(JavaPage.java:75) at 
com.caucho.jsp.Page.subservice(Page.java:506) at 
com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182) 
at com.caucho.server.http.Invocation.service(Invocation.java:315) at 
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135) 
at 
com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346) 
at 
com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274) 
at com.caucho.server.TcpConnection.run(TcpConnection.java:139) at 
java.lang.Thread.run(Thread.java:534)

------------------------------------------

I have a jsp file listed below (and running here: 
http://www.clandecadence.com/john/jdom.jsp). I am using the JDOM 1.0 
release against an Atom.xml file (located here:  
http://jrosocha.blogspot.com/atom.xml ).

Locally on my pc, running Tomcat 5.5.9 Server, Resin 2.1.14 and 3.0.13, 
this file executes fine with : [Document: No DOCTYPE declaration, Root 
is [Element: ]] as output.

Running at the supplied URL above ( 
http://www.clandecadence.com/john/jdom.jsp ), this file executes with 
the following error: Error: org.jdom.IllegalNameException: The name 
"xml:lang" is not legal for JDOM/XML attributes: Attribute names cannot 
contain colons.

I can not figure out how or why this is the case. My local apps run 
fine, but when deployed to my lunarpages host, things fall apart. I've 
tried several different ways to build the document with JDOM and all 
fail in the same fashion.

Can anyone help me?
jsp file below ------------

<%
try {
 java.net.URL atomURL = new 
java.net.URL("http://jrosocha.blogspot.com/atom.xml");
 org.jdom.input.SAXBuilder domSaxBuilder = new org.jdom.input.SAXBuilder();
 org.jdom.Document atomDocument = domSaxBuilder.build( 
atomURL.openStream() );
 out.print(atomDocument.toString());
} catch (Exception e)
{
 out.print("Error: " + e);
}
%>




More information about the jdom-interest mailing list