| Author |
jsp can't find message resource files
|
Bruce Clark
Greenhorn
Joined: Dec 07, 2012
Posts: 2
|
|
I'm trying to port an application from OC4J to Weblogic and one of the problems is that jsp's can't find Application.properties type resources.
I have code like this
<bean:message key="Confirmation.Instruction"/>
and receive and an exception
javax.servlet.jsp.JspException: ServletException in '/personalinformation/confirmation.jsp': Missing message for key "Confirmation.Instruction"
All of the app's resource files have been bundled into the _wl_cls_gen.jar by weblogic.
if I extract the resource files and put them into web-inf/classes then the app will work. However are production environment won't allow us fiddle with deployments like that.
Anyone ever run into this before ?
|
 |
Danny Vittal
Greenhorn
Joined: Feb 24, 2005
Posts: 10
|
|
I hit the same problem. Not sure whether it will help you now.
I was doing an ear deployment, which has a web.war inside. WebLogic was packaging all the contents present under the war/WEB-INF/classes folder and creating a jar _wl_cls_gen.jar. This jar was pushed inside WEB-INF/lib folder during deployment. What I did to overcome this was packaging war inside the ear as exploded war(eg: web.war folder instead of the war archive).
In this case WebLogic was not creating the jar _wl_cls_gen.jar and was able to deploy the application successfully.
|
 |
Bruce Clark
Greenhorn
Joined: Dec 07, 2012
Posts: 2
|
|
Thanks for your reply, but my production environment doesn't allow us to deploy that way.
What I did was kind of clumsy. I created a jsp file like this:
<%@ page import="org.apache.struts.util.MessageResources" %>
<%@ page import="org.apache.struts.util.MessageResourcesFactory" %>
<%
// This was added because the message resource was not being found since
// Weblogic rolls the contents of WEB-INF/classes into _wl_cls_gen.jar
MessageResources myResources =
MessageResourcesFactory.createFactory().createResources("resources/personalinformation/personalinformation");
request.getServletContext().setAttribute("personalInformationBundle", myResources );
%>
this jsp file is included in any jsp that uses a resource. The jsp include creates a message resource bundle which is referenced in the main jsp.
|
 |
 |
|
|
subject: jsp can't find message resource files
|
|
|