Liberty profile: birt and jsf integration

2019-08-30 22:20发布

问题:

I'm building a web application running on Liberty profile 8.5, with JSF 2.0 feature enabled (jsf-2.0 in server.xml) and BIRT integration in the web app. The web application includes all BIRT needed libs in WEB-INF/lib folder, but the only way to make it working (specially for chart report) is to set the classloader to 'parentlast' in the server.xml:

<webApplication contextRoot="MyApp" id="MyApp" location="MyApp.war" name="MyApp">
        <classloader delegation="parentLast"/> 
</webApplication>

In this way, I correctly see charts and reports.

But the 'parentlast' setting makes JSF not working, with this exception:

[ERROR ] SRVE0315E: An execption occurred: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:385) at [internal classes] Caused by: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet ... 3 more

Caused by: java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions! If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml. A typical config looks like this;

<listener><listenerclass>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
 </listener>

Without the parentlast setting, the JSF pages are correctly shown, but BIRT charts don't work.

I understand this behaviour, as the parentlast classloading makes the application seeing at first the application libs, where JSF is not included (it's loaded at server scope).

Any suggestion? Thank you in advance!