• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

jsp can't find message resource files

 
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 ?
 
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!