You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Hohlen, John" <JH...@erac.com> on 2002/09/10 21:25:07 UTC

RE: Runtime Exception: Cannot find message resources under key (S trut s 1.1 B2 with WebLogic 6.1 SP2)

This solution still doesn't work.  It appears that each message resource
file should be declared in it's corresponding sub-app Struts config file.
But I have narrowed the problem down.  Struts is storing the message
resource file (object) in application scope under the key:
"LOGIN_MESSAGES_KEY/login"

However, the exception occurs when Struts tries to retrieve the object under
the key:
"LOGIN_MESSAGES_KEY"

I'm not sure which side is wrong, the storing or the retrieval, so I'm going
to dig into source the code.

-----Original Message-----
From: Hohlen, John 
Sent: Monday, September 09, 2002 4:25 PM
To: 'Struts Users Mailing List'
Cc: 'hwatkins@vignette.com'
Subject: RE: Runtime Exception: Cannot find message resources under key
(S trut s 1.1 B2 with WebLogic 6.1 SP2)


I solved my own problem here.  What I had to was move the declaration of the
<messages-resources> from the Struts Config sub-application file (i.e.
Struts-Config-Login.xml) to the default Struts Config file (i.e.
Struts-Config.xml).  Since I was planning on making every module a
sub-application, I originally had a blank Struts-config.xml file with just
the following:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!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>
                                     
</struts-config>

============================================================================
====

To fix my problem, my Struts-Config.xml now looks like the following:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!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 key="LOGIN_MESSAGES_KEY" 
                     parameter="com.erac.training.LoginMessages" 
                     null="true"/>
                     
                     
</struts-config>

-----Original Message-----
From: Hohlen, John 
Sent: Wednesday, September 04, 2002 9:52 AM
To: Struts-Help (E-mail)
Subject: Runtime Exception: Cannot find message resources under key
(Strut s 1.1 B2 with WebLogic 6.1 SP2)


I'm migrating my web application from Struts 1.0 to Struts 1.1 (B2).  I'm
trying to take advantage of the mutiple sub-applications functionality in
1.1.  I've created a separate a Struts config file for each sub-application.
I've also created a separate message resource files for each sub
application.  I'm currently getting a runtime exception due to the message
resource file not being found under the specified key.  I'm using  WebLogic
6.1 (SP 2).  I've placed the message resource file under the
"classes\com\abc\training" directory. Does anyone have any ideas on what my
problem might be?  Thanks, JOHN

----------------  web.xml (sniplet) -------------------------------------
  <init-param>
    <param-name>config/login</param-name>
    <param-value>/WEB-INF/struts-config-login.xml</param-value>
  </init-param>
  <init-param>
    <param-name>config/training</param-name>
    <param-value>/WEB-INF/struts-config-training.xml</param-value>
  </init-param>      

----------------  Struts-Config-Login.xml (sniplet) ---------------------

  <message-resources key="LOGIN_MESSAGES_KEY" 
                     parameter="com.abc.training.LoginMessages" 
                     null="false"/>

----------------- Runtime Exception --------------------------------------
javax.servlet.ServletException: Cannot find message resources under key
LOGIN_MESSAGES_KEY
	at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
l.java:256)
	at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
14)
	at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:417)
	at
org.apache.struts.action.RequestProcessor.processActionForward(RequestProces
sor.java:390)
	at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:271)
	at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
	at
com.erac.fleetsystems.strutsx.FleetSystemsServlet.process(FleetSystemsServle
t.java:178)
	at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:265)
	at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:200)
	at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:2495)
	at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2204)
	at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
	at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>