aspose file tools*
The moose likes Tomcat and the fly likes Tomcat Cannot Find The properties File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Cannot Find The properties File" Watch "Tomcat Cannot Find The properties File" New topic
Author

Tomcat Cannot Find The properties File

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I am trying to run my first Struts -- using the tutorial "Login" example at http://www.javaranch.com/newsletter/Mar2002/newslettermar2002.jsp#struts
There is a MessageResources.properties file that allows for all strings displayed in an application to be defined. Nonetheless, After I
entered http://localhost:8080/struts/jsp/LoginView.jsp
in the browser address bar, I got HTTP Status 500. I know that the LoginView.jsp file was found; otherwise, I would have gotten HTTP Status 404 -- LoginView file not found error.
The problem is that the text provided in the MessageResources.properties file could not be picked up - I think that it is because the Tomcat cannot find the MessageResources.properties file.
I have checked MessageResources.properties:
1. name of the file: spelling is correct
2. location of the file: it is in the directory together with all compiled servlet class files; i.e. c:\tomcat\webapps\struts\WEB-INF\classes\test\struts
3. type of the file: the Windows Explorer shows the type of the
MessageResources.properties file is a PROPERTIES File
The contents of the web.xml file that is in the c:\tomcat\webapps\struts\WEB-INF directory is shown below:

I need your experience in telling what else could go wrong. Please help.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16061
    
  21

Windows users often forget that Java is picky about capitalization in filenames in cases where Windows itself doesn't care. But it looks like you did all that correctly.
I would double-check the log files to see if the 500 error was in fact due to inability to locate the resource and not something else. Also, don't accept Window's affirmation that just because Windows says it's a properties file that it really is. The actual determinant is that the filename ends with ".properties".
Since I can't see anything obviously wrong, if none of the above helps, check to make sure that the property name within the properties file is spelled and capitalized exactly as you invoke it in the JSP. Sometimes I find it useful to have someone double-check for me, since I have been known to see what "should" be there and not what actually is there.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat Cannot Find The properties File