| Author |
Invalid content taglib
|
Ekaterina Galkina
Greenhorn
Joined: Sep 14, 2010
Posts: 13
|
|
Hi,
I'm trying to test <taglib> element in web.xml.
I'm placing
under <web-app> and getting the following error ("Eclipse Europa", "Java EE Preview at localhost" server):
Invalid content was found starting with element 'taglib'...
What's wrong have I done? Thank you for any hints.
|
 |
Frits Walraven
Rancher
Joined: Apr 07, 2010
Posts: 742
|
|
Hi !
under <web-app> and getting the following error ("Eclipse Europa", "Java EE Preview at localhost" server):
Invalid content was found starting with element 'taglib'...
I don't see anything in those lines. I guess that you get that error when starting up the server?
Can you post your full web.xml and your full stacktrace?
Regards,
Frits
|
 |
Ekaterina Galkina
Greenhorn
Joined: Sep 14, 2010
Posts: 13
|
|
ok, here is the full web.xml.
yes, the error occures when I'm starting up the server. (But before that Eclipse displays it too like compile errors)
28.12.2011 12:04:49 org.mortbay.xml.XmlParser$Handler error
WARNING: ERROR@null line:72 col:10 : org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'. One of '{"http://java.sun.com/xml/ns/j2ee":description, "http://java.sun.com/xml/ns/j2ee":display-name, "http://java.sun.com/xml/ns/j2ee":icon, "http://java.sun.com/xml/ns/j2ee":distributable, "http://java.sun.com/xml/ns/j2ee":context-param, "http://java.sun.com/xml/ns/j2ee":filter, "http://java.sun.com/xml/ns/j2ee":filter-mapping, "http://java.sun.com/xml/ns/j2ee":listener, "http://java.sun.com/xml/ns/j2ee":servlet, "http://java.sun.com/xml/ns/j2ee":servlet-mapping, "http://java.sun.com/xml/ns/j2ee":session-config, "http://java.sun.com/xml/ns/j2ee":mime-mapping, "http://java.sun.com/xml/ns/j2ee":welcome-file-list, "http://java.sun.com/xml/ns/j2ee":error-page, "http://java.sun.com/xml/ns/j2ee":jsp-config, "http://java.sun.com/xml/ns/j2ee":security-constraint, "http://java.sun.com/xml/ns/j2ee":login-config, "http://java.sun.com/xml/ns/j2ee":security-role, "http://java.sun.com/xml/ns/j2ee":env-entry, "http://java.sun.com/xml/ns/j2ee":ejb-ref, "http://java.sun.com/xml/ns/j2ee":ejb-local-ref, "http://java.sun.com/xml/ns/j2ee":service-ref, "http://java.sun.com/xml/ns/j2ee":resource-ref, "http://java.sun.com/xml/ns/j2ee":resource-env-ref, "http://java.sun.com/xml/ns/j2ee":message-destination-ref, "http://java.sun.com/xml/ns/j2ee":message-destination, "http://java.sun.com/xml/ns/j2ee":locale-encoding-mapping-list}' is expected.
28.12.2011 12:04:49 org.mortbay.jetty.servlet.WebApplicationContext doStart
WARNING: Configuration error on C:/Documents and Settings/cat/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/dwp
org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'. One of '{"http://java.sun.com/xml/ns/j2ee":description, "http://java.sun.com/xml/ns/j2ee":display-name, "http://java.sun.com/xml/ns/j2ee":icon, "http://java.sun.com/xml/ns/j2ee":distributable, "http://java.sun.com/xml/ns/j2ee":context-param, "http://java.sun.com/xml/ns/j2ee":filter, "http://java.sun.com/xml/ns/j2ee":filter-mapping, "http://java.sun.com/xml/ns/j2ee":listener, "http://java.sun.com/xml/ns/j2ee":servlet, "http://java.sun.com/xml/ns/j2ee":servlet-mapping, "http://java.sun.com/xml/ns/j2ee":session-config, "http://java.sun.com/xml/ns/j2ee":mime-mapping, "http://java.sun.com/xml/ns/j2ee":welcome-file-list, "http://java.sun.com/xml/ns/j2ee":error-page, "http://java.sun.com/xml/ns/j2ee":jsp-config, "http://java.sun.com/xml/ns/j2ee":security-constraint, "http://java.sun.com/xml/ns/j2ee":login-config, "http://java.sun.com/xml/ns/j2ee":security-role, "http://java.sun.com/xml/ns/j2ee":env-entry, "http://java.sun.com/xml/ns/j2ee":ejb-ref, "http://java.sun.com/xml/ns/j2ee":ejb-local-ref, "http://java.sun.com/xml/ns/j2ee":service-ref, "http://java.sun.com/xml/ns/j2ee":resource-ref, "http://java.sun.com/xml/ns/j2ee":resource-env-ref, "http://java.sun.com/xml/ns/j2ee":message-destination-ref, "http://java.sun.com/xml/ns/j2ee":message-destination, "http://java.sun.com/xml/ns/j2ee":locale-encoding-mapping-list}' is expected.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.mortbay.xml.XmlParser.parse(XmlParser.java:217)
at org.mortbay.xml.XmlParser.parse(XmlParser.java:235)
at org.mortbay.jetty.servlet.XMLConfiguration.configureWebApp(XMLConfiguration.java:190)
at org.mortbay.jetty.servlet.WebApplicationContext.configureWebApp(WebApplicationContext.java:425)
at org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:478)
at org.mortbay.util.Container.start(Container.java:72)
at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
at org.mortbay.util.Container.start(Container.java:72)
at org.eclipse.wst.server.preview.internal.PreviewStarter.run(PreviewStarter.java:116)
at org.eclipse.wst.server.preview.internal.PreviewStarter.main(PreviewStarter.java:39)
|
 |
Frits Walraven
Rancher
Joined: Apr 07, 2010
Posts: 742
|
|
If you are using Eclipse, try formatting the web.xml with CNTRL-SHIFT-F and see if the problem goes away. It seems there are characters that the parser cannot handle.
Your web.xml looks ok, apart from the formatting.
Regards,
Frits
|
 |
Ekaterina Galkina
Greenhorn
Joined: Sep 14, 2010
Posts: 13
|
|
is it possible that Java EE preview server doesn't support taglib tag? May be I should use Tomcat or other server...
Without taglib tag everything is ok.
yes, I'm using Eclipse Europa and build-in web-server Java EE preview. CNTRL-SHIFT-F didn't help.
|
 |
Frits Walraven
Rancher
Joined: Apr 07, 2010
Posts: 742
|
|
is it possible that Java EE preview server doesn't support taglib tag? May be I should use Tomcat or other server...
Without taglib tag everything is ok.
hmm, I guess that it supports EE5 and Servlet 2.4, and then it should be able to read the taglib tag.
It seems it doesn't like the "http://" string, try this:
and use
in your JSP.
Regards,
Frits
|
 |
Ekaterina Galkina
Greenhorn
Joined: Sep 14, 2010
Posts: 13
|
|
|
I don't know why, but after I changed web-server the problem has been solved.
|
 |
 |
|
|
subject: Invalid content taglib
|
|
|