wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts error" Watch "Struts error" New topic
Author

Struts error

Deepak A
Ranch Hand

Joined: Oct 04, 2001
Posts: 120
Hi guys,
i am trying to deploy a very simple and basic struts application.
I have a properties file(ApplicationResources.properties) in my WEB-INF.
However, when i am trying to run the application i get the following error message on my browser.
javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE
at org.apache.struts.util.RequestUtils.message(RequestUtils.java:568)
at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239)
at _strutsTest1._jspService(_strutsTest1.java:83)
[SRC:/strutsTest1.jsp:13]
at com.orionserver[Oracle9iAS (9.0.4.0.0) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:568)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:303)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:498)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:402)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:293)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:602)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:308)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:779)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:264)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
at com.evermind[Oracle9iAS (9.0.4.0.0) Containers for J2EE].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:536)
Can anyone try to figure out where i might be going wrong ??


Face Off.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

put ApplicationResources.properties in WEB-INF/classes.


Groovy
Deepak A
Ranch Hand

Joined: Oct 04, 2001
Posts: 120
Actually, it is in web-inf/classes directory.
The lines within it is
'index.title=Hello in English'
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

Have you put the whole line within single quote
Deepak A
Ranch Hand

Joined: Oct 04, 2001
Posts: 120
Even without single quote it gives the same problem.
Here is my jsp :
<%@page language="java" import="first.testBean" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="Logic" %>
<jsp:useBean id="testBean" scope="session" class="first.testBean" />
<jsp:setProperty name="testBean" property="naam" value="Hello" />
<html:html locale="true">
<head>
<html:base />
<title>
<bean:message key="index.title" />
</title>
</head>
<BODY>
<FORM ACTION="http://localhost:8888/strutsShop/strutsTest2.jsp" >
<FONT FACE="VERDANA" SIZE="2">Test Jsp 1.</FONT>
<%= testBean.getNaam() %>
<input type="submit">
</FORM>
</BODY>
</html:html>
Its crying for the following line :
<bean:message key="index.title" />
The message part it aint understaing thats what i know... wats the setting for the message part??
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

1.Do not use single quote
http://jakarta.apache.org/struts/userGuide/building_view.html#i18n
Deepak A
Ranch Hand

Joined: Oct 04, 2001
Posts: 120
I havent placed it in single quotes. BTW, my xml file is as follows.
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<!-- A demo servlet, add servlets below -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>

<!-- Struts Tag Library Descriptor -->
<taglib>
<taglib-uri>/WEB-INF/struts.tld</taglib-uri>
<taglib-location>/WEB-INF/struts.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts.tld</taglib-uri>
<taglib-location>/WEB-INF/struts.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts.tld</taglib-uri>
<taglib-location>/WEB-INF/struts.tld</taglib-location>
</taglib>

</web-app>
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

http://www.coderanch.com/t/45753/Struts/Help-Struts-struts-action-MESSAGE
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
i assume you are using struts1.1 and hope you do have a message-resources mapping in your struts-config.xml file
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

Originally posted by karthik Guru:
i assume you are using struts1.1 and hope you do have a message-resources mapping in your struts-config.xml file

http://jakarta.apache.org/struts/userGuide/configuration.html#resources_config
Deepak A
Ranch Hand

Joined: Oct 04, 2001
Posts: 120
Karthik,
i think u have caught the bull by its horns. Where do i have to make this entry ?? i havent made this entry...
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

Originally posted by Deepak Acharya:
Karthik,
i think u have caught the bull by its horns. Where do i have to make this entry ?? i havent made this entry...

struts-config.xml
Deepak A
Ranch Hand

Joined: Oct 04, 2001
Posts: 120
Pradeep can u paste a sample struts-config.xml file here. and where do i have to put this file ??
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

http://www.reumann.net/do/struts/lesson1/step8
Deepak A
Ranch Hand

Joined: Oct 04, 2001
Posts: 120
Now my struts-config.xml in WEB-INF :
<?xml version="1.0"?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd" >

<struts-config>
<message-resources parameter="ApplicationResources" null="false" />
</struts-config>
Still did not work...
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

1. Have you posted the complete struts-config.xml?
2. which version of the struts are you using?
Deepak A
Ranch Hand

Joined: Oct 04, 2001
Posts: 120
1.0.2.
Yes i have pasted the struts-config.xml file as i have it on my server.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

If you are using struts 1.0.2 you cannot use the message-resource tag, your old file is correct.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

Moving to the Struts forum.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Struts error
 
Similar Threads
struts
NoClassDefFoundError in index.jsp
NoClassDefFoundError in index.jsp
Version conflict
Can't run a JSP page due to error 500