aspose file tools*
The moose likes Struts and the fly likes problem with struts installation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with struts installation" Watch "problem with struts installation" New topic
Author

problem with struts installation

sai murali
Greenhorn

Joined: Oct 03, 2001
Posts: 13
I have read the article from:
http://www.javaranch.com/newsletter/Mar2002/newslettermar2002.jsp#struts
and installed struts as specified in the article. I tried the sample application from the article, but I was getting following exception:

org.apache.jasper.JasperException: Missing message for key title.login
Please help me out.
Thankyou.


saimurali
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
Do a search on this forum. I know that question has been answered before, but I don't recall what the answer was.


Matthew Phillips
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
There are a few reasons you can get this.
Make sure the MessageResources.properties is located in the correct location.
Make sure that it is configured correctly in the web.xml file
Mkae sure that struts.jar is located in your app/WEB_INF/lib directory and nowhere else on your classpath.
If this doesn't help, post here and we can try something else.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
keerti pai
Greenhorn

Joined: Dec 05, 2002
Posts: 4
If you are following that article I think you might have missed one of these. So please check.
1. Check if you have following entry in web.xml
<init-param>
<param-name>application</param-name>
<param-value>test.struts.MessageResources</param-value>
</init-param>
2. Check if you have MessageResources.properties in WEB-INF\classes\test\struts
3. Check if you have defind following key in the same properties file
title.login=Login Screen
Keerti Pai.
IBM certified solution developer(WSAD)
www.theopenstack.com
sai murali
Greenhorn

Joined: Oct 03, 2001
Posts: 13
Hi,
I have not changed anything from the code downloaded from the link. I just followed the steps for installing struts and deploying the sample files which were given in article.
I am using Tomcat 4.1. I have "struts.jar" in
C:\j2sdk1.4.0_01\jre\lib\ext\ instead of having it in struts/WEB-INF/lib (application) folder.
I am still getting the same:
javax.servlet.ServletException: Missing message for key title.login Exception.
Please help to come out of this loop.
Thanks.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Originally posted by sai murali:
I am using Tomcat 4.1. I have "struts.jar" in
C:\j2sdk1.4.0_01\jre\lib\ext\ instead of having it in struts/WEB-INF/lib (application) folder.


You can't do this!!!
Didn't you read this warning in the article:
WARNING - Do NOT add struts.jar to the classpath of your Servlet container in an attempt to avoid placing it in the /WEB-INF/lib directory of each individual web app! Doing so will cause problems with ClassNotFoundException exceptions.
Remove it from everywhere except the WEB-INF/lib directory!!!
sai murali
Greenhorn

Joined: Oct 03, 2001
Posts: 13
Hi,
Actually, I read following lines from the article:
You can also copy the struts.jar into the jre\lib\ext directory since you will need it to do compiles of programs using Struts. You should also add the servlet.jar file to that directory if you haven't already done it. You can find the servlet.jar file in the c:\tomcat\common\lib directory.
So, I thought I can retain struts.jar in jre\lib\ext even after compiling the files.
Now, I took off all struts.jar instances from throughout my system except from \application\WEB-INF\lib\, now it works fine.
Thankyou so much I am out of loop now.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Great! I am glad to hear it. I will update the article to make this clearer.
Question: did you have the struts.jar in both the jre/lib/ext directory and in your WEB-INF/lib or only in the jre/lib/ext directory?
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
By the way, Thomas, in the first article you did not mention creating the struts directory:

The installation of Struts is a relatively simple process. We will first create a directory structure in our Tomcat installation that will allow us to create our test application. (In this example we are assuming that Tomcat has been isntalled to a directory named c:\tomcat.) Under the webapps directory in the tomcat installation directory, create two directories, jsp and WEB-INF. The jsp directory will be used to hold the JSPs we create for our application. Under the WEB-INF directory create two directories, classes and lib. The lib directory will hold the struts.jar file. The classes directory will be used to hold all the Java classes that we code. Under the classes directory, create a directory named test. Under the test directory, create a directory called struts.

The structure should be c:\tomcat\webapps\struts\jsp and c:\tomcat\webapps\struts\WEB-INF. Right?
Cheers -Barry
[ March 13, 2003: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Good catch, Barry!
sai murali
Greenhorn

Joined: Oct 03, 2001
Posts: 13
When I was getting exception, I had "struts.jar" only in "jre/lib/ext" not in both "WEB-INF/lib" and ""jre/lib/ext"".
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
yes, that will cause the exception you encountered. You can have the struts.jar in your ext directory but you still must have it in the WEB-INF/lib directory. On my own setup that is how I have it so I can do compiles easily.
[ March 17, 2003: Message edited by: Thomas Paul ]
Alex Kovalchuk
Greenhorn

Joined: Oct 20, 2004
Posts: 13
Originally posted by Thomas Paul:
yes, that will cause the exception you encountered. You can have the struts.jar in your ext directory but you still must have it in the WEB-INF/lib directory. On my own setup that is how I have it so I can do compiles easily.

[ March 17, 2003: Message edited by: Thomas Paul ]


I also sent Barry this email and he replied that he had not worked with this in a long time;

On this web page you made a reference;

http://www.coderanch.com/t/46371/Struts/struts-installation

On this line of;

quote:
--------------------------------------------------------------------------------
The structure should be c:\tomcat\webapps\struts\jsp and c:\tomcat\webapps\struts\WEB-INF. Right?

--------------------------------------------------------------------------------



I have;
WebSphere Studio Application Developer (Windows) Version: 5.1.2
using Apache Tomcat Support 5.1.1
Struts Tools 5.1.2

I have the information laid out like the previous posts talk about. Except I do not have tomcat laid out in the folder order you mentioned. I just added CVS Repository to my PC. That seems to have been when this started.

Do you have a list suggestion of what needs to be laid out in what order with my config?

Thanks in advance,
Alex
srinivasM Reddy
Greenhorn

Joined: May 23, 2005
Posts: 5
Hi,

i have read the whole article , and cross checked all my jar's are in the correct path as mentioned, But still i get this error

javax.servlet.jsp.JspException: Missing message for key "title.login"
at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:297)


i am trying to test this in weblogic 8.1 sp4, can any one let me know
what else could be the issue..

i need one more info, do we need the applicationresources.properties file also, or else MessageResource.properties files is enough


any help on this is great.

Thanks in advance
zied ben mlah
Greenhorn

Joined: May 27, 2005
Posts: 3
i'm trying to configure struts to run with Jrun 4,i'm using the plug-in myeclipse with eclipse IDE ;

I created a new web application with Eclipse
I added the struts capabilities with myeclipse
I copied struts.jat under web-inf/lib

i created a jsp Page in which i copied this code .
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

i used this taglib <html:html>

but i found this error :
The tag html's handler class org.apache.struts.taglib.html.HtmlTag was not found in the classpath

can someone help me ?
zied ben mlah
Greenhorn

Joined: May 27, 2005
Posts: 3
and i found this error in the jrun log

javax.servlet.UnavailableException: Cannot initialize RequestProcessor of class org.apache.struts.action.RequestProcessor: java.lang.ClassNotFoundException: org.apache.struts.action.RequestProcessor
 
wood burning stoves
 
subject: problem with struts installation