You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nick Afshartous <ni...@proactcorp.com> on 2001/06/18 22:47:23 UTC

moving computer into DMZ affects Class.getResource() result

Ok, here's one for the books.  Our app works fine in 
our own local network.  We then moved the same box 
into the company's DMZ to set up for a demo.  

Boom! It stopped working.  At first we thought it was a Struts
issue because the because this line in ActionServlet.initDigester

  URL url = this.getClass().getResource(registrations[i+1]);

is returning null.  This is where the Struts DTDs get registered
with the Digester.
Then I tried inserting a call to getResource()
to see if it could find one of our resource files 
(ApplicationResource.properties) and that failed as well.

I know getResource() uses the class loader, but does anyone
have any idea why moving a computer from behind a firewall into
a DMZ would affect how resources are found ? 

Thanks for any info to help figure this one out.
-- 

	Nick




Re: moving computer into DMZ affects Class.getResource() result

Posted by Dan Miser <dm...@wi.rr.com>.
The problem most likely stems from the fact that before you moved the box,
you were getting the DTD from the external link via http (see the top of the
DTD file for the location). When you moved the box inside the DMZ, that
access was blocked, which means Struts needs to fall back to a local copy of
the DTD.

Fortunately, the getResource call will load a local copy. Unfortunately, at
least one app server (WebSphere) does not load resources from JAR files
(this is a bug in WebSphere). Take a look at my other post a few minutes ago
for possible solutions.
--
Dan Miser
http://www.distribucon.com

----- Original Message -----
From: "Nick Afshartous" <ni...@proactcorp.com>
To: <st...@jakarta.apache.org>
Sent: Monday, June 18, 2001 3:47 PM
Subject: moving computer into DMZ affects Class.getResource() result


>
> Ok, here's one for the books.  Our app works fine in
> our own local network.  We then moved the same box
> into the company's DMZ to set up for a demo.
>
> Boom! It stopped working.  At first we thought it was a Struts
> issue because the because this line in ActionServlet.initDigester
>
>   URL url = this.getClass().getResource(registrations[i+1]);
>
> is returning null.  This is where the Struts DTDs get registered
> with the Digester.



moving computer into DMZ affects Class.getResource() result

Posted by Nick Afshartous <ni...@proactcorp.com>.
We've now identified the problem.  Looks like a bug in iPlanet 
web server 6.0.  
-- 

	Nick


Nick Afshartous writes:
 > 
 > Ok, here's one for the books.  Our app works fine in 
 > our own local network.  We then moved the same box 
 > into the company's DMZ to set up for a demo.  
 > 
 > Boom! It stopped working.  At first we thought it was a Struts
 > issue because the because this line in ActionServlet.initDigester
 > 
 >   URL url = this.getClass().getResource(registrations[i+1]);
 > 
 > is returning null.  This is where the Struts DTDs get registered
 > with the Digester.
 > Then I tried inserting a call to getResource()
 > to see if it could find one of our resource files 
 > (ApplicationResource.properties) and that failed as well.
 > 
 > I know getResource() uses the class loader, but does anyone
 > have any idea why moving a computer from behind a firewall into
 > a DMZ would affect how resources are found ? 
 > 
 > Thanks for any info to help figure this one out.
 > -- 
 > 
 > 	Nick
 > 
 > 
 >