Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp can't find message resource files

 
Bruce Clark
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic