| Author |
Porting Tomcat to Websphere - HowTo?
|
|
| John Muir 2004-05-08, 10:37 am |
| We have a running Tomcat (V5) application that I am trying to port to
Websphere V5.1 (specifically WAS Express on iSeries).
I created a war file from the applications' Tomcat 'webapps' folder and
imported it into WAS as a new app. This completes without errors. But
when I try to run it, I get an error message saying that my servlets
cannot be found (although they are of course there).
(Bearing in mind that it works fine in Tomcat...) what do I have to do
to get it running in WAS?
Any help/tips would be very welcome!
Thanks,
John
| |
| Wayne Beaton 2004-05-10, 5:40 pm |
| What error are you getting (a stack trace might help).
Did the web.xml file get imported?
Wayne
"John Muir" <john@europe.com> wrote in message
news:c7huut$q0k$03$1@news.t-online.com...
> We have a running Tomcat (V5) application that I am trying to port to
> Websphere V5.1 (specifically WAS Express on iSeries).
>
> I created a war file from the applications' Tomcat 'webapps' folder and
> imported it into WAS as a new app. This completes without errors. But
> when I try to run it, I get an error message saying that my servlets
> cannot be found (although they are of course there).
>
> (Bearing in mind that it works fine in Tomcat...) what do I have to do
> to get it running in WAS?
>
> Any help/tips would be very welcome!
>
> Thanks,
> John
| |
| Henrik Sjostrand 2004-05-10, 5:40 pm |
| John Muir <john@europe.com> wrote in message news:<c7huut$q0k$03$1@news.t-online.com>...
> We have a running Tomcat (V5) application that I am trying to port to
> Websphere V5.1 (specifically WAS Express on iSeries).
>
> I created a war file from the applications' Tomcat 'webapps' folder and
> imported it into WAS as a new app. This completes without errors. But
> when I try to run it, I get an error message saying that my servlets
> cannot be found (although they are of course there).
>
> (Bearing in mind that it works fine in Tomcat...) what do I have to do
> to get it running in WAS?
>
> Any help/tips would be very welcome!
>
> Thanks,
> John
Have you tried updating the HTTP Server plugin configuration?
In WAS admin console go to Environment -> Update web server plugin ->
Click OK to update the config. Then wait 60 seconds (for the HTTP
server to reload the config) OR restart the HTTP server.
If this doesn't help, post your error message.
/Henrik Sjöstrand
| |
| John Muir 2004-05-12, 2:53 pm |
| Wayne Beaton wrote:
> What error are you getting (a stack trace might help).
>
(Sorry for not answering before - on a business trip)
Just a 404 that the servlet cannot be found
> Did the web.xml file get imported?
>
yes, and it contained the servlet entries
| |
| John Muir 2004-05-12, 2:53 pm |
| Henrik Sjostrand wrote:
> Have you tried updating the HTTP Server plugin configuration?
>
(Sorry for not answering before - on a business trip)
yes and I restarted the server
| |
| Wayne Beaton 2004-05-12, 8:45 pm |
| Did you set the contextRoot and are you using it in your URL?
Wayne
"John Muir" <john@europe.com> wrote in message
news:c7toqk$vo0$00$1@news.t-online.com...
> Wayne Beaton wrote:
> (Sorry for not answering before - on a business trip)
> Just a 404 that the servlet cannot be found
>
> yes, and it contained the servlet entries
| |
| Balasubramanian Mangalaganesh 2004-05-12, 10:33 pm |
| John,
Though this is not related to your question you might find this interesting,
IN JSP's tomcat (at least 3.2.4) somhow imports java.util.Vector Object
in the generated Servlet
I am not too sure why it does just this guy and not anyother class say
java.util.Date.
So if you are migrating and your JSPs use Vector make sure you add a
page import for java.util.Vector.
My two cents.
Manglu
John Muir wrote:
> Wayne Beaton wrote:
>
> (Sorry for not answering before - on a business trip)
> Just a 404 that the servlet cannot be found
>
> yes, and it contained the servlet entries
| |
| John Muir 2004-05-13, 1:47 am |
| Wayne Beaton wrote:
> Did you set the contextRoot and are you using it in your URL?
>
Yes and yes ;-) The index.html and images get displayed ok, just the
servlets not.
Could the problem be the deployment descriptor? Tomcat only has the
web.xml but WAS seems to use another couple of XML/XMI files.
Is there a guide or FAQ for porting Tomcat to WAS?
Thanks for your help,
john
| |
| Wayne Beaton 2004-05-13, 1:34 pm |
| You shouldn't generally need to do anything special to migrate simple
servlets from Tomcat to WebSphere Application Server. You also don't need
the XMI file (I believe it's ibm-web-bnd.xmi) unless you are using JNDI
local references that need to be mapped to global ones. The absense of this
file may make your servlets not work properly, but they should still run.
I assume that the index.html file is in the root of your WAR (or in the
WebContent directory of your Web Project in WebSphere Studio), and that the
web.xml file is in the WEB-INF directory.
Do you have a "servlet" and "servlet-mapping" entry into your web.xml file
for the servlet? Are you using the "url-pattern" in your request?
Are there any (possibly unrelated) exceptions when you start up the app
server?
Wayne
"John Muir" <john@europe.com> wrote in message
news:c7v12i$qat$06$1@news.t-online.com...
> Wayne Beaton wrote:
> Yes and yes ;-) The index.html and images get displayed ok, just the
> servlets not.
>
> Could the problem be the deployment descriptor? Tomcat only has the
> web.xml but WAS seems to use another couple of XML/XMI files.
>
> Is there a guide or FAQ for porting Tomcat to WAS?
>
> Thanks for your help,
> john
| |
| John Muir 2004-05-14, 12:33 am |
| Wayne Beaton wrote:
> You shouldn't generally need to do anything special to migrate simple
> servlets from Tomcat to WebSphere Application Server. You also don't need
> the XMI file (I believe it's ibm-web-bnd.xmi) unless you are using JNDI
> local references that need to be mapped to global ones. The absense of this
> file may make your servlets not work properly, but they should still run.
>
You are dead right! Somehow its now all working by itself. The servlets
are now found. I just can't see what changed. Maybe I just needed to
reboot WAS again.
> I assume that the index.html file is in the root of your WAR (or in the
> WebContent directory of your Web Project in WebSphere Studio), and that the
> web.xml file is in the WEB-INF directory.
>
> Do you have a "servlet" and "servlet-mapping" entry into your web.xml file
> for the servlet? Are you using the "url-pattern" in your request?
>
That's the strange thing: the current (working) web.xml has no entries
for the servlets but they are found OK - is the invoker servlet active
in WAS by default (its not in Tomcat since V4)?
AND (answer this if you can ;-)... relative references like
<a href="images/some.gif">
in a jsp page get translated to
<a href="/mycontext/servlet/images/some.gif">
in the 'final' HTML, and obviously don't get found. If I rewrite it as
<a href="/mycontext/images/some.gif">
then everything is OK. (I am very puzzled by this)
> Are there any (possibly unrelated) exceptions when you start up the app
> server?
>
No, none.
> Wayne
Many thanks for the help!
John
| |
| John Muir 2004-05-14, 12:33 am |
| Manglu wrote:
> John,
>
> You might want to check this.
>
> Check if your web.xml strictly follows the DTD.
>
> The way the elements <servlet>,<servlet0mapping> , <session-config>
> etc are arranged strictly obey the DTD
>
> if this is the error the Application shouldn't even start.
>
> Why don't you post the contents of the SYs out and Sys Err File of the
> App Server that hosts this application.
>
> BTW, i am currently migrating Tomcat Apps(3.2.4) to WAS V5
>
> I am using WSAD to move the Code and test before porting it to WAS.
> You might want to do this.
>
> HTH
> Manglu
Somehow its now all working by itself. The servlets are now found. I
just can't see what changed. Maybe I just needed to reboot WAS again.
That's the strange thing: the current (working) web.xml has no entries
for the servlets but they are found OK - is the invoker servlet active
in WAS by default (its not in Tomcat since V4)?
I'll post the current config when I get into work today as a wrap up.
Thanks for the help ;-)
John
| |
| Balasubramanian Mangalaganesh 2004-05-17, 3:34 am |
| John,
> That's the strange thing: the current (working) web.xml has no entries
> for the servlets but they are found OK - is the invoker servlet active
> in WAS by default (its not in Tomcat since V4)?
The invoker Servelt is turned on/off via the ibm-web-ext.xmi file and
since you mentioend that you never created this file i would believe
that the invoker Servlet is turned off.
But it is very easy to check what the default is? If your forms are
using the packagename.ServeltName to call them and it works without
creatign this ext.xmi file thent he invoker servlet is turned ON by default.
BTW, it is a bad practice to not use servlet mappings. it is recommended
to turn of Invoker Servlet.
If youdecide to turn on J2EE Security then your servlet cannot be
secured unless you declare it in the web.xml.
HTH
manglu
|
|
|
|