I have created a fairly straightforward Java Server Faces (JSF) application that performs several searches, data update, and audits of the updates. I like to run Jetty through Eclipse to help speed up development times, and to allow me to extensively test the application before migrating to WebLogic 10.3 on my Development Linux Box.

I had a series of Selenium tests included to ensure my application was functioning as per the requirements and I was happy with the application. As soon as I deployed this application to WebLogic, I immediately received a blank page for my initial search screen. I went to the logs, and I would get this error each time I tried to access any JSF page on the site:

####<May 4, 2009 2:48:10 PM EDT> <Error> <HTTP> <pghdcmpwlsl01> <cmpServer01>
<[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'>
<<WLS Kernel>> <> <> <1241462890157> <BEA-101017>
<[weblogic.servlet.internal.WebAppServletContext@1bacf06 -
appName: 'rjm-jsf-test', name: 'rjm-jsf-test.war', context-path: '/rjm-jsf-test',
spec-version: 'null', request: weblogic.servlet.internal.ServletRequestImpl@1d9d915[
GET /rjm-jsf-test/jsftest.faces HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10)
Gecko/2009042316 Firefox/3.0.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: JSESSIONID=BjmqJ1pDL3Jfy9ChLZmjtcssBN2cdC60qp4FS6LPVVQfYrwhQ1CK!-472700567;
ADMINCONSOLESESSION=kpMQJ1pLjpGFLLSznck4HMfZNbgB2q0QbgsynpgRwKPr8x0qT754!-1870568620

]] Root cause of ServletException.
<span style="color: #ff0000;"><strong>java.lang.IllegalStateException: strict servlet API: cannot call getWriter() after getOutputStream()</strong></span>
at weblogic.servlet.internal.ServletResponseImpl.getWriter(ServletResponseImpl.java:308)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:186)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(
StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(
WebAppServletContext.java:3496)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
&gt;

I spent some futile time trying to resolve this with my existing application, so to make things simpler, I tried to step back, and create a simple JSF application and get that working with the dependencies I already had in my original WAR.

I started with this war structure:

[insert image of war and DEP here….]

Then I finally came to this solution:

[insert image of war and DEP here….]

Conclusion

It seems I needed to change the jsf jar librariesversions, as well as remove xmlAPIs.jar from the webapp war in order for this to deploy to WebLogic 10.3

Mick Knutson

Java, JavaEE, J2EE, WebLogic, WebSphere, JBoss, Tomcat, Oracle, Spring, Maven, Architecture, Design, Mentoring, Instructor and Agile Consulting. http://www.baselogic.com/blog/resume

View all posts

Java / JavaEE / Spring Boot Channel

BLiNC Supporters

BLiNC Adsense

Archives

Newsletter