JBoss 5.1EAP classpath/classloading problem
rohit1183 Mar 27, 2012 6:27 PMHi,
I have an JSF-Seam based application which works perfectly on JBoss 4.3. I am facing two issues when trying to migrate this application on JBoss 5.1EAP.
1. Not able to find messages_en.properties (resource bundle) : The properties file is in the following hierarchy:
MDU.ear --> MDU.war --> WEB-INF --> classes --> messages_en.properties
The above works perfectly fine on JBoss 4.3. However on JBoss 5, somehow the application is not able to find the resource bundle.
So if my messages_en.properties has say the following entry:
mykey.error=This is a sample message
The code <h:outputText value="#{messages['mykey.error']}"/> on JBoss 4.3 displays 'This is a sample message' on UI. However on JBoss 5, I am getting 'mykey.error' on UI. Somehow I feel JBoss 5 is not able to load the resource file even if the same is present in WEB-INF/classes.
If I keep messages_en.properties directly under MDU.ear then it works fine.
2. I am exporting an excel using seam excel which has a link to stylesheet. On jboss5, the application is not able to parse the path of the stylesheet. Following is the code:
<e:link URL="#{request.contextPath}/stylesheet/mdu-excel.css"/>
The stylesheet is kept at MDU.ear --> MDU.war --> stylesheet --> mdu-excel.css
The above works perfectly on JBoss 4.3. However on JBoss 5, I get the following exception:
Caused by: org.jboss.seam.excel.ExcelWorkbookException: Could not parse stylesheet
at org.jboss.seam.excel.jxl.JXLExcelWorkbook.setStylesheets(JXLExcelWorkbook.java:704)
at org.jboss.seam.excel.ui.UIWorkbook.encodeBegin(UIWorkbook.java:316)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
... 46 more
Caused by: java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:61)
at java.io.InputStreamReader.<init>(InputStreamReader.java:55)
at org.jboss.seam.excel.css.CSSParser.readCSS(CSSParser.java:149)
at org.jboss.seam.excel.css.CSSParser.parseStylesheet(CSSParser.java:178)
at org.jboss.seam.excel.css.CSSParser.loadStylesheets(CSSParser.java:90)
at org.jboss.seam.excel.css.CSSParser.setStylesheets(CSSParser.java:366)
at org.jboss.seam.excel.jxl.JXLHelper.setStylesheets(JXLHelper.java:285)
at org.jboss.seam.excel.jxl.JXLExcelWorkbook.setStylesheets(JXLExcelWorkbook.java:702)
... 56 more
The stylesheet however is available at that path because I can pull up the contents of the css on my browser if I hit http://localhost:8080/stylesheet/mdu-excel.css
If however I keep the stylesheet directly inside MDU.ear and refer it using "/mdu-excel.css" then it works.
Please suggest.
Regards,
Rohit