Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet works on WebSphere but not on Tomcat

 
William Peck
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 **************/
 
William Peck
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic