[opencms-dev] /* No XML schema set for content definition...

Wils wilson.neto at cesar.org.br
Thu May 18 23:45:13 CEST 2006


Hi,

I am trying read a XML file.

Please, see my code:

<%@ page import="java.util.*,org.opencms.*,org.opencms.jsp.*,org.opencms.xml.*, org.opencms.xml.content.*" %>

<%

// medias2site.xml

String filename   = request.getParameter("filename"); 

String content = "[nothing read]";

CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,response);

org.opencms.file.CmsFile file = cms.getCmsObject().readFile(filename);

try
{
 CmsXmlContent c = CmsXmlContentFactory.unmarshal(cms.getCmsObject(), file);
}
catch(CmsXmlException e)
{
 out.println("Erro:" + e.getMessage());
}

%>


It display a tarsh error message:

org.opencms.main.CmsRuntimeException: No XML schema set for content definition.
	at org.opencms.xml.content.CmsXmlContent.getContentDefinition(CmsXmlContent.java:544)
	at org.opencms.xml.content.CmsXmlContent.<init>(CmsXmlContent.java:137)
	at org.opencms.xml.content.CmsXmlContentFactory.unmarshal(CmsXmlContentFactory.java:247)
	at org.opencms.xml.content.CmsXmlContentFactory.unmarshal(CmsXmlContentFactory.java:115)
	at org.opencms.xml.content.CmsXmlContentFactory.unmarshal(CmsXmlContentFactory.java:172)
	at org.opencms.xml.content.CmsXmlContentFactory.unmarshal(CmsXmlContentFactory.java:129)
	at org.apache.jsp.WEB_002dINF.jsp.offline.sites.default_.rain.fileGenerator_jsp._jspService(org.apache.jsp.WEB_002dINF.jsp.offline.sites.default_.rain.fileGenerator_jsp:77)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
	at org.opencms.flex.CmsFlexRequestDispatcher.includeExternal(CmsFlexRequestDispatcher.java:194)
	at org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:170)
	at org.opencms.loader.CmsJspLoader.service(CmsJspLoader.java:433)
	at org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFlexRequestDispatcher.java:423)
	at org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:174)
	at org.opencms.loader.CmsJspLoader.dispatchJsp(CmsJspLoader.java:467)
	at org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:412)
	at org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.java:719)
	at org.opencms.main.OpenCmsCore.showResource(OpenCmsCore.java:1362)
	at org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:151)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:831)
	at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:652)
	at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1203)
	at java.lang.Thread.run(Unknown Source)Can help me?Tks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060518/f4d54fdd/attachment.htm>


More information about the opencms-dev mailing list