aspose file tools*
The moose likes Servlets and the fly likes Servlet works on WebSphere but not on Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet works on WebSphere but not on Tomcat" Watch "Servlet works on WebSphere but not on Tomcat" New topic
Author

Servlet works on WebSphere but not on Tomcat

William Peck
Ranch Hand

Joined: Dec 18, 2009
Posts: 54
I just worked through my first servlet, and it was looking good on my local development machine (WebSphere server). So then I was saddened to see that it didn't work on Tomcat 5.5.

I am opening a Word document and it now works fine in WebSphere (local machine), with this URL:
http://localhost:9080/edw/getDoc?filename=R:/FTP/Highmark/data/test/ods_cdr_tab_cnt_104_2011_04_26_at_17_02.doc

but when moving to Tomcat (to another machine that the organization can use), this doesn't work:
http://xpc-120268/edwdev/getDoc?filename=R:/FTP/Highmark/data/test/ods_cdr_tab_cnt_104_2011_04_26_at_17_02.doc

both environments are pointing to the same database, so it seems like it's a Tomcat thing.

I am sure the file is there as it opens from WebSphere (and from Windows explorer)

Below is my servlet and web.xml.

this is the error message on local development when the file name is bad:
Error 404: The file R:/FTP/Highmark/data/test/ods_cdr_tab_cnt_104_2011_04_26_XXX_17_02.doc could not be found.

it shows up just as written above on a white screen inside a "thick-box" (I forced it to be bad with "XXX")

on the Tomcat server, I get this more detailed message, also inside the thick-box
HTTP Status 404 - The file R:/FTP/Highmark/data/test/ods_cdr_tab_cnt_104_2011_04_26_at_17_02.doc could not be found.

type Status report

message The file R:/FTP/Highmark/data/test/ods_cdr_tab_cnt_104_2011_04_26_at_17_02.doc could not be found.

description The requested resource (The file R:/FTP/Highmark/data/test/ods_cdr_tab_cnt_104_2011_04_26_at_17_02.doc could not be found.) is not available.
Apache Tomcat/5.5.31


servlet:



/********* Web xml entry **********/


/********* JSP **************/


Bill in Baltimore
William Peck
Ranch Hand

Joined: Dec 18, 2009
Posts: 54
got it, I had to allow tomcat to run using a user that had access to network drives, then my link needed to be full UNC path, not a mapped drive.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18993
    
    8

That's right. Just for reference, you would have had to do exactly the same thing for a Websphere instance running as a service.
William Peck
Ranch Hand

Joined: Dec 18, 2009
Posts: 54
Ok, thank you.
 
 
subject: Servlet works on WebSphere but not on Tomcat