You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pierre Thibaudeau <pi...@gmail.com> on 2008/06/23 04:36:48 UTC

[S2] attempts to access www.opensymphony.com on Struts startup???

I would love to get to the bottom of a problem that has cropped up a number
of times on this list:

* On April 29, 2008, I reported that XmlConfigurationProvider was trying to
access the internet.  (At the time, I thought the problem might be due to an
incompatibility with a specific version of Tomcat.)
* On March 26, 2008, Nuwan Chandrasoma reports a similar phenomenon to do
with loading validator.xml.

I experienced anew the problem yesterday, when I could not access the
internet.  This time, Struts complains that it can't find struts.xml,
looking for it in the very exact location where it is!  When I have internet
access, on the other hand, struts.xml loads without a glitch!  Has anyone
got an idea how to prevent Struts from trying to look online for what's
under its nose?

struts.xml is in the following path:
D:/applications/apache-tomcat-6.0.16/webapps/myapp/WEB-INF/classes/struts.xml

Version of Struts: 2.1.2

Here's struts.xml's header:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation //DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

Relevant excerpt from web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="infloox"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
    version="2.5">
...
    <filter>
        <filter-name>action2</filter-name>

 <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>action2</filter-name>
        <url-pattern>*.action</url-pattern>
    </filter-mapping>



And finally here is the relevant part of the error trace when I am offline:

16:32:24,199 DEBUG XmlConfigurationProvider:58 - Loading action
configurations from: struts.xml
2008-06-22 16:32:24 org.apache.catalina.core.StandardContext filterStart
GRAVE: Exception au démarrage du filtre action2
Unable to load configuration. - Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 177 - java/net/PlainSocketImpl.java:177:-1
    at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
    at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
    at
org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:213)
    at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
    at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
    at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
    at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
    at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4356)
    at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
    at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
    at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
    at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    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:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: Unable to load
file:/D:/applications/apache-tomcat-6.0.16/webapps/myapp/WEB-INF/classes/struts.xml
- Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 177 - java/net/PlainSocketImpl.java:177:-1
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:875)
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:161)
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:130)
    at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:155)
    at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
    ... 30 more
Caused by: struts.apache.org - Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 177 - java/net/PlainSocketImpl.java:177:-1
    at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:122)
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:870)
    ... 34 more
Caused by: java.net.UnknownHostException: struts.apache.org
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
    at java.net.Socket.connect(Socket.java:518)
    at java.net.Socket.connect(Socket.java:468)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:389)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:516)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
    at sun.net.www.http.HttpClient.New(HttpClient.java:306)
    at sun.net.www.http.HttpClient.New(HttpClient.java:318)
    at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:788)
    at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729)
    at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)
    at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)
    at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown
Source)
    at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown
Source)
    at
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
Source)
    at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
    at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:120)
    ... 35 more

Re: [S2] attempts to access www.opensymphony.com on Struts startup???

Posted by Pierre Thibaudeau <pi...@gmail.com>.
Thanks, Chris, for the info!

It doesn't make sense to me that the DTD's should be compared to the ones
stored remotely (rather than locally), but at least it explains why the
system fails to start up when the internet is unavailable!  May I suggest to
the Powers That Be that this should be made very very very explicit in the
docs/guides/FAQs.

2008/6/22 Chris Pratt <th...@gmail.com>:

> When validating the XML files, the system has to load the DTD's or
> XSD's that are housed at apache.org and opensymphony.org.  There's
> probably a way to disable the XML validation of those files, I haven't
> had the need to look for it yet.
>

Re: [S2] attempts to access www.opensymphony.com on Struts startup???

Posted by Pierre Thibaudeau <pi...@gmail.com>.
In case people were interested in newer developments on this topic, Perry
kindly posted an issue on Jira:
https://issues.apache.org/struts/browse/WW-2781

He also came up with a workaround: changing the DTD reference in struts.xml
from

<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

to

<!DOCTYPE struts SYSTEM "struts-2.0.dtd">

and putting the struts-2.0.dtd into the local class path.

Re: [S2] attempts to access www.opensymphony.com on Struts startup???

Posted by Pierre Thibaudeau <pi...@gmail.com>.
apache.org is currently down.
"Big deal!", you might say... Well with my recurring problem of Struts2.1.2
always trying to access that website on startup, I cannot restart my local
server!!!!  This is very infuriating!

Are we agreed that Struts should not be attempting to access any remote
server on startup?  If it does, there is a problem somewhere, either in my
setup or in struts' code---probably in both.

I would appreciate any suggestion, any hint, any hunch and any far-fetched
hypothesis.  Am willing --- to an extent --- to dive into xwork/struts2 code
if need be.

Here is the most recent error trace:

12:43:11,340  INFO XmlConfigurationProvider:32 - Parsing configuration file
[struts-default.xml]
12:43:11,659  INFO XmlConfigurationProvider:32 - Parsing configuration file
[struts-plugin.xml]
2008-07-17 12:43:32 org.apache.catalina.core.StandardContext filterStart
GRAVE: Exception au démarrage du filtre action2
Unable to load configuration. - [unknown location]
    at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
    at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
    at
org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:213)
    at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
    at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
    at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
    at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
    at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4356)
    at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
    at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
    at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
    at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    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:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: Unable to load
file:/D:/applications/apache-tomcat-6.0.16/webapps/myapp/WEB-INF/classes/struts.xml
- [unknown location]
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:875)
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:161)
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:130)
    at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:155)
    at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
    ... 30 more
Caused by: Connection timed out: connect - [unknown location]
    at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:122)
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:870)
    ... 34 more
Caused by: java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.Socket.connect(Socket.java:518)
    at java.net.Socket.connect(Socket.java:468)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:389)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:516)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
    at sun.net.www.http.HttpClient.New(HttpClient.java:306)
    at sun.net.www.http.HttpClient.New(HttpClient.java:318)
    at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:788)
    at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729)
    at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)
    at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)
    at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown
Source)
    at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown
Source)
    at
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
Source)
    at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
    at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:120)
    ... 35 more

Re: [S2] attempts to access www.opensymphony.com on Struts startup???

Posted by Pierre Thibaudeau <pi...@gmail.com>.
Thank you, Dave!
I had no problem checking out the source.  Now whether I'll have time to
delve into its depths to unlock this mysterious online-connect-on-startup is
another matter...

2008/6/23 Dave Newton <ne...@yahoo.com>:

> --- On Mon, 6/23/08, Dave Newton <ne...@yahoo.com> wrote:
> > http://opensymphony.com/xwork/
> >
> > See the "source repository" link.
>
> (Having said that, of course, I'm not able to check out the source from
> there. I was on Saturday, IIRC.)
>

Re: [S2] attempts to access www.opensymphony.com on Struts startup???

Posted by Dave Newton <ne...@yahoo.com>.
--- On Mon, 6/23/08, Dave Newton <ne...@yahoo.com> wrote:
> http://opensymphony.com/xwork/
> 
> See the "source repository" link.

(Having said that, of course, I'm not able to check out the source from there. I was on Saturday, IIRC.)

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] attempts to access www.opensymphony.com on Struts startup???

Posted by Dave Newton <ne...@yahoo.com>.
--- On Mon, 6/23/08, Pierre Thibaudeau <pi...@gmail.com> wrote:
> (Subsidiary question: where does one get hold of the source
> code for com.opensymphony.xwork2?  I briefly looked on opensymphony.com 
> and quickly got confused!)

http://opensymphony.com/xwork/

See the "source repository" link.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] attempts to access www.opensymphony.com on Struts startup???

Posted by Pierre Thibaudeau <pi...@gmail.com>.
2008/6/23 Chris Pratt <th...@gmail.com>:

> If you look at the <!DOCTYPE of the struts.xml file it explicitly
> states that the location of the DTD is
> http://struts.apache.org/dtds/struts-2.0.dtd.  Since there is no way
> to put something like this on the CLASSPATH, the only way I know of to
> stop the XML libraries from loading this DTD remotely during
> validation is to turn validation off.  But, of course, I could be
> wrong.


Sorry, Chris, but that "location" most definitely is NOT a URL, even though
it looks like one.  It's only the official (and unique) reference name for
that particular DTD.  (That's not something specific to Struts, but it's
similar with any DTD.)

In this case, it refers to the DTD stored inside struts2-core-2.1.2.jar (or
the equivalent jar file, if using a different version of Struts).  Let's
have a look inside that jar file.  The jar file contains the file
struts-2.0.dtd which contains the following comment:
<!--
   Struts configuration DTD.
   Use the following DOCTYPE

   <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
-->
(The rest of that file defines the DTD itself;  no need to fetch from
abroad;  it's all there, available locally on my classpath.)

Now, I am no specialist of DTD syntax, therefore I cannot judge if
everything is exactly as it should be inside struts-2.0.dtd, but I assume
that's the case, since no one else seems to have reported some major problem
here...

Therefore my original question remains:  Why, oh why does Struts feel the
need to access the internet on startup?
(Subsidiary question: where does one get hold of the source code for
com.opensymphony.xwork2?  I briefly looked on opensymphony.com and quickly
got confused!)

Re: [S2] attempts to access www.opensymphony.com on Struts startup???

Posted by Chris Pratt <th...@gmail.com>.
If you look at the <!DOCTYPE of the struts.xml file it explicitly
states that the location of the DTD is
http://struts.apache.org/dtds/struts-2.0.dtd.  Since there is no way
to put something like this on the CLASSPATH, the only way I know of to
stop the XML libraries from loading this DTD remotely during
validation is to turn validation off.  But, of course, I could be
wrong.
  (*Chris*)

On Sun, Jun 22, 2008 at 9:10 PM, Pierre Thibaudeau
<pi...@gmail.com> wrote:
> As a matter of fact, the DTD for struts.xml that corresponds to "
> http://struts.apache.org/dtds/struts-2.0.dtd" is found inside
> struts2-core-2.1.2.jar which IS on the classpath.
>
> 2008/6/22 Pierre Thibaudeau <pi...@gmail.com>:
>
>> As far as I know, the DTDs definitely are on the classpath.  At least,
>> Eclipse considers they are.  (It's easy to check:  if I modify the header of
>> the DTD by (say) changing the DTD's version number, Eclipse gives a warning
>> that it cannot anymore find the corresponding "mock" DTD on the classpath.)
>>
>> 2008/6/22 Wendy Smoak <ws...@gmail.com>:
>>
>>> If it needs them, it should load them from the classpath using the
>>> URI.  Aren't they in one of the Struts 2 jars?
>>>
>>> (I'm not sure how it works with schemas, but DTDs definitely don't
>>> need to be loaded from a remote url.)
>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] attempts to access www.opensymphony.com on Struts startup???

Posted by Pierre Thibaudeau <pi...@gmail.com>.
As a matter of fact, the DTD for struts.xml that corresponds to "
http://struts.apache.org/dtds/struts-2.0.dtd" is found inside
struts2-core-2.1.2.jar which IS on the classpath.

2008/6/22 Pierre Thibaudeau <pi...@gmail.com>:

> As far as I know, the DTDs definitely are on the classpath.  At least,
> Eclipse considers they are.  (It's easy to check:  if I modify the header of
> the DTD by (say) changing the DTD's version number, Eclipse gives a warning
> that it cannot anymore find the corresponding "mock" DTD on the classpath.)
>
> 2008/6/22 Wendy Smoak <ws...@gmail.com>:
>
>> If it needs them, it should load them from the classpath using the
>> URI.  Aren't they in one of the Struts 2 jars?
>>
>> (I'm not sure how it works with schemas, but DTDs definitely don't
>> need to be loaded from a remote url.)
>>
>>
>

Re: [S2] attempts to access www.opensymphony.com on Struts startup???

Posted by Pierre Thibaudeau <pi...@gmail.com>.
Hello Wendy,
As far as I know, the DTDs definitely are on the classpath.  At least,
Eclipse considers they are.  (It's easy to check:  if I modify the header of
the DTD by (say) changing the DTD's version number, Eclipse gives a warning
that it cannot anymore find the corresponding "mock" DTD on the classpath.)

2008/6/22 Wendy Smoak <ws...@gmail.com>:

> If it needs them, it should load them from the classpath using the
> URI.  Aren't they in one of the Struts 2 jars?
>
> (I'm not sure how it works with schemas, but DTDs definitely don't
> need to be loaded from a remote url.)
>
>

Re: [S2] attempts to access www.opensymphony.com on Struts startup???

Posted by Wendy Smoak <ws...@gmail.com>.
On Sun, Jun 22, 2008 at 7:53 PM, Chris Pratt <th...@gmail.com> wrote:
> When validating the XML files, the system has to load the DTD's or
> XSD's that are housed at apache.org and opensymphony.org.  There's
> probably a way to disable the XML validation of those files, I haven't
> had the need to look for it yet.

If it needs them, it should load them from the classpath using the
URI.  Aren't they in one of the Struts 2 jars?

(I'm not sure how it works with schemas, but DTDs definitely don't
need to be loaded from a remote url.)

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] attempts to access www.opensymphony.com on Struts startup???

Posted by Chris Pratt <th...@gmail.com>.
When validating the XML files, the system has to load the DTD's or
XSD's that are housed at apache.org and opensymphony.org.  There's
probably a way to disable the XML validation of those files, I haven't
had the need to look for it yet.
  (*Chris*)

On Sun, Jun 22, 2008 at 7:36 PM, Pierre Thibaudeau
<pi...@gmail.com> wrote:
> I would love to get to the bottom of a problem that has cropped up a number
> of times on this list:
>
> * On April 29, 2008, I reported that XmlConfigurationProvider was trying to
> access the internet.  (At the time, I thought the problem might be due to an
> incompatibility with a specific version of Tomcat.)
> * On March 26, 2008, Nuwan Chandrasoma reports a similar phenomenon to do
> with loading validator.xml.
>
> I experienced anew the problem yesterday, when I could not access the
> internet.  This time, Struts complains that it can't find struts.xml,
> looking for it in the very exact location where it is!  When I have internet
> access, on the other hand, struts.xml loads without a glitch!  Has anyone
> got an idea how to prevent Struts from trying to look online for what's
> under its nose?
>
> struts.xml is in the following path:
> D:/applications/apache-tomcat-6.0.16/webapps/myapp/WEB-INF/classes/struts.xml
>
> Version of Struts: 2.1.2
>
> Here's struts.xml's header:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE struts PUBLIC
>    "-//Apache Software Foundation //DTD Struts Configuration 2.0//EN"
>    "http://struts.apache.org/dtds/struts-2.0.dtd">
>
> Relevant excerpt from web.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app id="infloox"
>    xmlns="http://java.sun.com/xml/ns/j2ee"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
>    version="2.5">
> ...
>    <filter>
>        <filter-name>action2</filter-name>
>
>  <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>    </filter>
>    <filter-mapping>
>        <filter-name>action2</filter-name>
>        <url-pattern>*.action</url-pattern>
>    </filter-mapping>
>
>
>
> And finally here is the relevant part of the error trace when I am offline:
>
> 16:32:24,199 DEBUG XmlConfigurationProvider:58 - Loading action
> configurations from: struts.xml
> 2008-06-22 16:32:24 org.apache.catalina.core.StandardContext filterStart
> GRAVE: Exception au démarrage du filtre action2
> Unable to load configuration. - Class: java.net.PlainSocketImpl
> File: PlainSocketImpl.java
> Method: connect
> Line: 177 - java/net/PlainSocketImpl.java:177:-1
>    at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
>    at
> org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
>    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
>    at
> org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:213)
>    at
> org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
>    at
> org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
>    at
> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
>    at
> org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
>    at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4356)
>    at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
>    at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
>    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
>    at
> org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
>    at
> org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
>    at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
>    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
>    at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
>    at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
>    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
>    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
>    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>    at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
>    at
> org.apache.catalina.core.StandardService.start(StandardService.java:516)
>    at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
>    at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
>    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:597)
>    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
>    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> Caused by: Unable to load
> file:/D:/applications/apache-tomcat-6.0.16/webapps/myapp/WEB-INF/classes/struts.xml
> - Class: java.net.PlainSocketImpl
> File: PlainSocketImpl.java
> Method: connect
> Line: 177 - java/net/PlainSocketImpl.java:177:-1
>    at
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:875)
>    at
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:161)
>    at
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:130)
>    at
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:155)
>    at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
>    ... 30 more
> Caused by: struts.apache.org - Class: java.net.PlainSocketImpl
> File: PlainSocketImpl.java
> Method: connect
> Line: 177 - java/net/PlainSocketImpl.java:177:-1
>    at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:122)
>    at
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:870)
>    ... 34 more
> Caused by: java.net.UnknownHostException: struts.apache.org
>    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
>    at java.net.Socket.connect(Socket.java:518)
>    at java.net.Socket.connect(Socket.java:468)
>    at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
>    at sun.net.www.http.HttpClient.openServer(HttpClient.java:389)
>    at sun.net.www.http.HttpClient.openServer(HttpClient.java:516)
>    at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
>    at sun.net.www.http.HttpClient.New(HttpClient.java:306)
>    at sun.net.www.http.HttpClient.New(HttpClient.java:318)
>    at
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:788)
>    at
> sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729)
>    at
> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)
>    at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
>    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
> Source)
>    at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
>    at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown
> Source)
>    at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown
> Source)
>    at
> org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
> Source)
>    at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> Source)
>    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
>    at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:120)
>    ... 35 more
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org