You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dan Miser <mi...@hotmail.com> on 2001/04/27 22:27:50 UTC

Struts and WebSphere

I noticed the WAS installation instructions at the URLs below needed to be 
merged. At this point, there is no reason to recompile the Struts source to 
make things work with WAS, so the second URL is a bit dated. I also found 
the key to making Struts work without resorting to creating extra WEB-INF 
directories or moving files around.

I took the text from the first URL and modified it. I split the doc up into 
2 parts: general Struts config and getting the struts-example to run under 
WAS.

I'd appreciate it if someone else running WAS would give this a spin to 
double-check me. If it checks out OK, I would suggest that this doc replace 
the other two.

Any comments or suggestions are most welcome. If you need me to submit this 
to Bugzilla, just let me know.

http://jakarta.apache.org/struts/installation-was352-x.html
http://jakarta.apache.org/struts/installation-was352.html

Begin text
==========

<h3><a name="was352">WebSphere Application Server 3.5 Configuration</a></h3>

<p>Server: Windows 2000 Server with WebSphere 3.5.3 Advanced<br></p>
<b>Configuring WAS 3.5</b>
<ol>
<li>Open struts.jar with WinZip.  Extract the three DTD's 
(struts-config_1_0.dtd, web-app_2_2.dtd and web-app_2_3.dtd) into 
c:\websphere\appserver\classes, making sure you use folder names (so the 
files extract to classes/org/apache/struts/resources). Now WebSphere can 
find the DTD files with it's class loader, and there is no problem with 
using the SYSTEM identifier for the DTD. These files will be available to 
all webapps that WAS hosts with no additional effort.</li>
</ol>

<b>Deploying struts-example</b>
<ol>
<li>Start up the adminserver. </li>
<li>Start up Admin Console. </li>
<li>Use the Convert War file task to convert the struts-example.war from the 
struts-b1 distrib as-is. </li>
<li>Convert to the default_server, default servlet engine and standard
install directory (c:\websphere\appserver\hosts\default_host). </li>
<li>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. </li>
<li>Click on struts-example in the Admin Console under Default 
Server/Default Servlet Engine and click the advanced tab on the right hand 
side of the screen. </li>
<li>Down where it says Default Error Page, enter /ErrorReporter and then
click Apply. </li>
<li>Start the Default Server via the Admin Console. You should see a whole 
bunch of ActionServlet messages in the default_host_stdout.log file with no 
exceptions. </li>
<li>Via a browser accessed the app using 
http://localhost/struts-example/index.jsp. </li>
<li>If it returns "Application not Available" then go back to the Admin
Console, right-click on struts-example and select Restart WebApp. </li>
<li>Once it reports success, go back to the URL above and try again - it
should work flawlessly. </li>
</ol>
<p>

========
End text

--
Dan Miser
http://www.distribucon.com
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


Re: Struts and WebSphere

Posted by Dan Miser <dm...@wi.rr.com>.
Good thought. Makes sense to me. I'll update the docs to reflect these
things and pass it on if TPTB want it.
--
Dan Miser
http://www.distribucon.com

----- Original Message -----
From: "Stephen Schaub" <ss...@bju.edu>
To: <st...@jakarta.apache.org>
Sent: Saturday, April 28, 2001 6:50 AM
Subject: Re: Struts and WebSphere


> An alternate approach that worked for me:
>
> Add the web folder to the struts-example application
> classpath:
>
> C:\WebSphere\AppServer\hosts\default_host\struts-example\web
>
> When I did this, the struts-example app worked flawlessly.



Re: Struts and WebSphere

Posted by Stephen Schaub <ss...@bju.edu>.
An alternate approach that worked for me:

Add the web folder to the struts-example application
classpath:

C:\WebSphere\AppServer\hosts\default_host\struts-example\web

When I did this, the struts-example app worked flawlessly.

That might be a little simpler config than maintaining two
separate WEB-INF folders, especially when updating a
deployment.

I like your idea of putting the DTDs in the systemwide
classpath.

Stephen

----- Original Message -----
From: "Dan Miser" <dm...@wi.rr.com>
To: <st...@jakarta.apache.org>
Sent: Saturday, April 28, 2001 1:36 AM
Subject: Re: Struts and WebSphere


My fault. I was using an older version of struts.jar on that
machine. I have the revised instructions at work, but the
short of it is that the original article was right about
adding the XML files to servlets\WEB-INF and
the TLD files to web\WEB-INF.

I would still make the argument that putting the DTDs in
c:\websphere\appserver\classes is a good thing, since it can
be done once system-wide *and* it solved my problems where
the SYSTEM DTDs were not being registered properly. But that
looks like the only change on there now.
--
Dan Miser
http://www.distribucon.com

----- Original Message -----
From: "Stephen Schaub" <ss...@bju.edu>
To: <st...@jakarta.apache.org>
Sent: Friday, April 27, 2001 4:56 PM
Subject: Re: Struts and WebSphere


> > I'd appreciate it if someone else running WAS would
> > give this a spin to  double-check me.
>
..



Re: Struts and WebSphere

Posted by Dan Miser <dm...@wi.rr.com>.
My fault. I was using an older version of struts.jar on that machine. I have
the revised instructions at work, but the short of it is that the original
article was right about adding the XML files to servlets\WEB-INF and the TLD
files to web\WEB-INF.

I would still make the argument that putting the DTDs in
c:\websphere\appserver\classes is a good thing, since it can be done once
system-wide *and* it solved my problems where the SYSTEM DTDs were not being
registered properly. But that looks like the only change on there now.
--
Dan Miser
http://www.distribucon.com

----- Original Message -----
From: "Stephen Schaub" <ss...@bju.edu>
To: <st...@jakarta.apache.org>
Sent: Friday, April 27, 2001 4:56 PM
Subject: Re: Struts and WebSphere


> > I'd appreciate it if someone else running WAS would
> > give this a spin to  double-check me.
>
> I'm running WAS 3.5.3 Advanced 60-day trial. I followed your
> instructions and was able to get index.jsp from the
> struts-example app to display. However, when I click on the
> Register link, I get the following error:
>
> Error 500
> An error has occured while processing request:
> http://localhost/struts-example/editRegistration.do
> Message: Failed to load target servlet [action]
>
> Target Servlet: action
> StackTrace:
> ------------------------------------------------------------
> --------------------
> Root Error-1: Missing configuration resource for path
> /WEB-INF/struts-config.xml
>
>
> javax.servlet.UnavailableException: Missing configuration
> resource for path /WEB-INF/struts-config.xml
>  at
> javax.servlet.ServletException.<init>(ServletException.java:
> 107)
>  ...
>
> I also notice that when the application is starting up, the
> following messages appear in the log:
>
> Loading servlet: "database"
> [Servlet LOG]: "database: init"
> [Servlet LOG]: "database: Initializing database servlet"
> [Servlet LOG]: "database: Loading database from
> '/WEB-INF/database.xml'"
> [Servlet LOG]: "database: No such resource available -
> loading empty database"
> Servlet available for service: "database"



Re: Struts and WebSphere

Posted by Stephen Schaub <ss...@bju.edu>.
> I'd appreciate it if someone else running WAS would
> give this a spin to  double-check me.

I'm running WAS 3.5.3 Advanced 60-day trial. I followed your
instructions and was able to get index.jsp from the
struts-example app to display. However, when I click on the
Register link, I get the following error:

Error 500
An error has occured while processing request:
http://localhost/struts-example/editRegistration.do
Message: Failed to load target servlet [action]

Target Servlet: action
StackTrace:
------------------------------------------------------------
--------------------
Root Error-1: Missing configuration resource for path
/WEB-INF/struts-config.xml


javax.servlet.UnavailableException: Missing configuration
resource for path /WEB-INF/struts-config.xml
 at
javax.servlet.ServletException.<init>(ServletException.java:
107)
 ...

I also notice that when the application is starting up, the
following messages appear in the log:

Loading servlet: "database"
[Servlet LOG]: "database: init"
[Servlet LOG]: "database: Initializing database servlet"
[Servlet LOG]: "database: Loading database from
'/WEB-INF/database.xml'"
[Servlet LOG]: "database: No such resource available -
loading empty database"
Servlet available for service: "database"

..

Seems like it's having difficulty finding resources in the
/WEB-INF folder. Any suggestions?

Stephen Schaub

----- Original Message -----
From: "Dan Miser" <mi...@hotmail.com>
To: <st...@jakarta.apache.org>
Sent: Friday, April 27, 2001 8:27 PM
Subject: Struts and WebSphere


I noticed the WAS installation instructions at the URLs
below needed to be  merged. At this point, there is no
reason to recompile the Struts source to  make things work
with WAS, so the second URL is a bit dated. I also
found  the key to making Struts work without resorting to
creating extra WEB-INF directories or moving files around.

I took the text from the first URL and modified it. I split
the doc up into  2 parts: general Struts config and getting
the struts-example to run under  WAS.

I'd appreciate it if someone else running WAS would give
this a spin to  double-check me. If it checks out OK, I
would suggest that this doc replace the other two.
..