users@glassfish.java.net

Re: XML validations

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Tue, 27 Feb 2007 17:57:51 -0800

glassfish_at_javadesktop.org wrote On 02/27/07 08:33 AM,:

>Hi,
>
>I'm trying to deploy an application with Jboss Seam integrated with it,
>
>I get the following error in deployment time:
>
>
>[#|2007-02-23T06:22:57.413+0200|SEVERE|sun-appserver-ee9.1|javax.enterprise.system.container.web|_Th
>readID=10;_ThreadName=main;_RequestID=06c4caa0-8019-44cf-8f5f-3c165cf6b171;|WebModule[/jboss-seam-gl
>assfish]PWC1275: Exception sending context initialized event to listener instance of class org.jboss
>.seam.servlet.SeamListener
>java.lang.RuntimeException: error while reading file:/opt/glassfish/domains/domain1/applications/j2e
>e-apps/jboss-seam-glassfish/jboss-seam_jar/META-INF/components.xml
> at org.jboss.seam.init.Initialization.initComponentsFromXmlDocuments(Initialization.java:112
>)
> at org.jboss.seam.init.Initialization.<init>(Initialization.java:83)
> at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
> at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4414)
> at org.apache.catalina.core.StandardContext.start(StandardContext.java:5069)
> at com.sun.enterprise.web.WebModule.start(WebModule.java:299)
> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:960)
> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:944)
> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:662)
> at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1549)
> at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1192)
> at com.sun.enterprise.web.WebContainer.loadJ2EEApplicationWebModules(WebContainer.java:1117)
>
> at com.sun.enterprise.server.TomcatApplicationLoader.load(TomcatApplicationLoader.java:128)
> at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:208)
> at com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:204)
> at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:332)
> at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112)
> at com.sun.enterprise.server.PEMain.run(PEMain.java:326)
> at com.sun.enterprise.server.PEMain.main(PEMain.java:260)
> 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:585)
> at com.sun.enterprise.server.PELaunch.main(PELaunch.java:272)
>Caused by: org.dom4j.DocumentException: jboss.com Nested exception: jboss.com
> at org.dom4j.io.SAXReader.read(SAXReader.java:353)
> at org.dom4j.io.SAXReader.read(SAXReader.java:264)
> at org.jboss.seam.util.XML.getRootElement(XML.java:16)
> at org.jboss.seam.init.Initialization.initComponentsFromXmlDocuments(Initialization.java:108
>)
> ... 23 more
>
>
>
>looks like GF tries to validates the XML file,
>
>Can I cancel the validation against the xml? This server does not have access to the internet.
>
>

Instances of org.dom4j.io.SAXReader are non-validating by default, and
org.jboss.seam.util.XML (see
http://fisheye.labs.jboss.com/browse/JBoss/jboss-seam/src/main/org/jboss/seam/util/XML.java)
does not enable validation on the SAXReader instance it creates.
(Enabling validation is under the control of the entity that creates the
SAXReader,
and is not influenced by GlassFish in any way.)

Also notice that org.jboss.seam.util.XML assigns to its SAXReader an
EntityResolver (org.jboss.seam.util.DTDEntityResolver, see
http://fisheye.labs.jboss.com/browse/~raw,r=1.4/JBoss/jboss-seam/src/main/org/jboss/seam/util/DTDEntityResolver.java)
which attempts to resolve systemId URLs locally first, before trying
to load them over HTTP, which is what you want. For some reason, the
local lookup fails for you.

Could you perhaps share your EAR file so we can take a look?


Jan


>
>Thanks,
>
>Asaf.
>[Message sent by forum member 'trouby' (trouby)]
>
>http://forums.java.net/jive/thread.jspa?messageID=205493
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>