Here's what someone posted to this list just yesterday:
================================================================================
I have some additional information for anyone trying to run struts 1.0
based apps with WebSphere 3.5.2/3:
There two main issues that have come up with the move from 0.5 to 1.0
1. The call to ServletContext.getResourceAsStream() in ActionServlet fails
to find the "/WEB-INF/struts-config.xml" file.
This is because the call is directed to the WebApps classloader to find the
resource and it looks for it on its classpath. The ConvertWar Tool copies the
WEB-INF directory to the web directory which is not on the classpath and thus
it fails to find it.
Solution :
Either put the web directory (or doc root directory) on the webapps classpath.
You can do this via the Admin Console.
Or you can make a directory in your servlets directory called WEB-INF and
place the struts-config.xml in there.
You should NOT have to make code changes to ActionServlet.
2. The struts-config.xml,web-app_2_2.dtd,web-app_2_3.dtd cannot be loaded from
the struts.jar. It seems there is a bug with the classloader for loading
resources out of jar files.
Solution.
Create a directory in your servlets directory called org/apache/struts/resources
and place the dtds in there. (Or package them up in your war file off of the
classes directory and the convertwar tool should copy them for you.
The classloader should now find them.
Additionally I also found that welcome files don't seem to be picked up. When
running the struts-example I could not use just /struts-example but
/struts-example/index.jsp worked fine.
By using this steps I was able to get the struts-example war working fine. I
did have to copy the database.xml file to the new WEB-INF directory on the
classpath too.
Additionally :
The details about copying jaxp.jar and parser.jar to the servlets directory
(or placed in the war lib directory) still applies.
Richard Backhouse
================================================================================
Hope that helps,
Donnie
>>> [EMAIL PROTECTED] 03/27/01 04:52PM >>>
All -
I'm begging for help here! :\ I have to get this working in WS tomorrow or
we're going to drop using Struts in our app and that would THOROUGHLY suck.
Here's the most detailed info I can provide - thank you all in advance.
1) Current Environment:
- Development: JBoss 2.0 w/ Tomcat 3.2b7
- Production: WebSphere 3.5.3 Advanced Server
- Struts Milestone Build: 1.0b1
2) Situation:
- Using struts-example.war, we deploy simply in JBoss with 100% success.
- Using our own struts app (just a test build of one screen from front
end to EJB), we deploy in JBoss with 100% success.
3) Problem:
- Porting struts-example.war to WebSphere 3.5.3 fails.
- Porting our own War fails in WS as well.
4) Steps Taken:
- Converted the struts-example.war file through the Converter tool in WS.
- Deployed to default_host/struts_example
- Added latest jaxp.jar, crimson.jar (the example seems to need crimson
not parser), and xalan.jar (for good measure) to servlets directory
- Created WEB-INF directory under servlets - placed struts-config.xml and
database.xml inside.
- Started Server
- Server starts successfully in console.
- Error log shows that initializing database servlet bomb on uncaught SAX
exceptions from Crimson (database: Database load exception":
org.xml.sax.SAXNotRecognizedException: Feature:
http://xml.org/sax/features/raw-names)
- No other errors shown.
- Visit IP/struts-example/index.jsp
- Error: Application not available
- Oddly enough if you go to the admin console, right click on
struts-example and say restart webapp and try again, it works - returning
the following error message.
- Uncaught servlet exception thrown: (see it for yourself
http://209.114.152.157/struts-example/index.jsp if you are interested)
------------
...ServletInstan X Uncaught service() exception thrown by servlet {0}:
{1}
"jsp11"
javax.servlet.ServletException: Cannot find message resources under
key org.apache.struts.action.MESSAGE at
javax.servlet.ServletException.<init>(ServletException.java:161)
--------------
- Error log shows no errors in addition to this. (I have to wonder why
the heck it is still trying for org.apache.struts.action.MESSAGE versus the
file we initialize in the startup params)
5) Analysis
I went through the Struts source to identify what might cause this and
studied the interaction between web.xml (and the init params) along with how
ActionServlet gets this parameter and then assigns the key value in Action.
Realizing that web.xml is used to configure the WS console on conversion, I
checked out the console settings to ensure that "application" was being set
to "org.apache.struts.example.ApplicationResources" -- it was.
At this point I'm clueless, I actually DID NOT have this problem in 3.5.2
(just gobs of other ones) but the client we are developing for agreed to the
FixPack 3 upgrade, so now I need only worry about 3.5.3.
Please help! :)
Chris