Hi-
I am running into a problem with Classloading with MyFaces 1.1.1 on Weblogic 9. Weblogic allows you to deploy your webapp in an exploded directory format. That means that you can modify a JSP (or Facelet xhtml) and copy it to the deployment directory to be automatically redeployed. This functionality works fine in the old Struts/JSP world.
Now that I'm using MyFaces, I'm running into problems with the FactoryFinder. As I understand it, FacesServlet or FactoryFinder "stores" the Factories based on the current classloader. When Weblogic redeploys a JSP, it drops the current ClassLoader and creates a new one. That means that the next time I hit a JSF page, I get an IllegalStateException (see full stack trace below).
I looked at the code in FacesServlet and I see this comment, "//TODO: null-check for Weblogic, that tries to initialize Servlet before ContextListener". Obviously I'm not the first to run into this problem. I browsed the source of the trunk online and I see the same code is still there. Does anybody have a fix for this? Is there any work around other than doing a full redeploy for each JSP modification?
Thanks for your help.
Adam
java.lang.IllegalStateException: No Factories configured for this Application - typically this is because a context listener is not setup in your web.xml.
A typical config looks like this;
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:84)
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:84)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:265)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:61)
at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:502)
at weblogic.servlet.internal.ServletStubImpl.checkForReload(ServletStubImpl.java:429)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:221)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3022)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1925)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1848)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1288)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
Adam Brod
Product Development Team
- MyFaces + Weblogic = Classloading Problems Adam Brod
- Re: MyFaces + Weblogic = Classloading Pro... Martin Marinschek
- Re: MyFaces + Weblogic = Classloading... Adam Brod
- RE: MyFaces + Weblogic = Classloading Pro... Jesse Alexander \(KBSA 21\)
- RE: MyFaces + Weblogic = Classloading... Adam Brod

