struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jain, Shipra" <Shipra.J...@GTECH.COM>
Subject Struts on AIX
Date Thu, 23 Aug 2001 16:41:17 GMT
Hi JiRong

Sorry for replying so late, but I was busy in some other stuff & also you
had come out with your fix. 
Anyway, I saw your fix . All steps looks fine to me especially if it works
for you, but I have to say about steps 7 & 8.

Regarding step 7. We also came with the same fix at first, but one of our
enthusiastic deployer said that changing the DTD to use SYSTEM identifier &
point to file on local system is not good practice. This hard codes the file
& we have to change the file on every machine  we deploy. I totally agree
with him. Later on, he diged into the source code for Struts & Java & came
up with the following changes in the Struts code. 

In Class ActionServlet, method initDigester(int) & initServlet(). 
// Register our local copy of the DTDs that we can find
        for (int i = 0; i < registrations.length; i += 2) {
           URL url = this.getClass().getResource(registrations[i+1]);
           if (url != null) {
                digester.register(registrations[i], url.getFile()); //
modified by us
           }
        }

// Register our local copy of the DTDs that we can find
for (int i = 0; i < registrations.length; i += 2) {
            URL url = this.getClass().getResource(registrations[i+1]);
            if (url != null)
                digester.register(registrations[i], url.toString()); //
original
        }

In Class Digester, method resolveEntity
// Return an input source to our alternative URL
try {
    	URL url = new URL("classloader", null, dtdURL);  // we modified
      InputStream stream = url.openStream();
      return (new InputSource(stream));
    } catch (Exception e) {
         throw new SAXException(e);
    }

try {
    	URL url = new URL(dtdURL);           // original
      InputStream stream = url.openStream();
      return (new InputSource(stream));
    } catch (Exception e) {
         throw new SAXException(e);
    }

The reason he gave had something to do with difference in how URL are
handled in Windows & AIX. According, to him his code should work on all
systems. Altough he too wasn't much comfortable with his fix, especially the
line 
URL url = new URL("classloader", null, dtdURL);  could aslo be "file"
instead of classloader.

Anyway, That moment, it gave us a temporary fix. This was first deployment
of our part of application on production like environment. On next,
deployment hope we move to WAS 4.0. We will see what happens then.  I would
like to bring this to attention of developers of Struts. So, I am posting to
developers mailing list also . They can more clearly explain if Sturts code
has a bug in regards to AIX system, or something else is wrong. They also
can tell which is a better fix. I myself don't like the idea of changing the
struts code either. Although, we have to do that anyway for FormTag problem.


Regarding step 8 for parser :
We followed following step from
http://jakarta.apache.org/struts/installation-was352-x.html

6: Copy jaxp 1.0.1's (NOT 1.1.1's) jaxp.jar and parser.jar to the servlets
directory of the strut-example webapp. 

That worked for us. I am not sure about the link that you had send for
parser.

Hope you are not bored by my long mail.

Regards
Shipra 

-----Original Message-----
From: jirong.hu@lido.net [mailto:jirong.hu@lido.net]
Sent: Tuesday, August 21, 2001 8:00 AM
To: struts-user@jakarta.apache.org
Subject: Finally make the Struts working on AIX



Hi,

To share with you, here is my recorded instruction to config Struts 1.0 on
my AIX 4.3 with WebSphere 3.5.4.
Does it mean I can go ahead with Struts?

Regards,
JiRong

========================
config Struts on sindev02

1. Start adminclient.bat from D:\WebSphere\AppServer\bin
     adminclient sindev02

2. Create Applicatin Server "Payment", create "Default Servlet Engine"
     create a "payment webapp" to test, must change the permisson of
"payment" directory

3. Copy jakarta-struts-1.0.tar file to /home/rongji1/temp, extract to
/home/rongji1/ as
     /home/rongji1/jakarta-struts-1.0

4. Use the Convert War File task in WebSphere to convert the
struts-example.war to /home/rongji/ as
     /home/rongji1/struts-example

5. Create a WEB-INF folder under /home/rongji1/struts-example/servlets/ as
     /home/rongji1/struts-example/servlets/WEB-INF

6. Copy struts-config.xml, database.xml and web.xml into the above
directory

7. Edit the struts-config.xml and web.xml to point the DTD file to local
system as:
     <!DOCTYPE struts-config SYSTEM

"file:/home/rongji1/struts-example/servlets/org/apache/struts/resources/stru
ts-config_1_0.dtd">
     be careful about the space

8. Copy the latest IBM XML parse 3.2.1 from:
http://www.alphaworks.ibm.com/tech/xml4j, xerces.jar
     copy into /home/rongji1/struts-example/servlets/

9. Copy struts-config_1_0.dtd, web-app_2_2.dtd and web-app_2_3.dtd from
/home/rongji1/jakarta-struts-1.0/lib to
     /home/rongji1/struts-example/servlets/org/apache/struts/resources

10.Replace the struts.jar at /home/rongji1/struts-example/servlets with the
one update the FormTag from Chris:
     http://www.enfused.com/struts.jar

11. Add /ErrorReporter to the struts-example webapp

12. Restart Payment server.

Mime
View raw message