0

I am facing problems while starting my application in the WAS Console. The application is a simple Hello World JSF servlet.

I'm using Websphere Application server version 7.0.0.9.

JSF 1.2 with facelets 1.1.14

When I try to start the application, I get the below error in the logs. Any idea how to fix this?

[15/06/12 15:13:49:747 BST] 00000045 config        I   Initializing Sun's JavaServer Faces implementation (1.2_07-b03-FCS) for context '/JsfServletDeployTest'
[15/06/12 15:13:49:756 BST] 00000045 webapp        E com.ibm.ws.webcontainer.webapp.WebApp notifyServletContextCreated SRVE0283E: Exception caught while initializing context: {0}
                                 java.lang.NoClassDefFoundError: com.sun.faces.config.DbfFactory (initialization failure)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:140)
    at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:276)
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:202)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:175)
    at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1678)

Further down the exception below:

[15/06/12 15:13:49:771 BST] 00000045 servlet       E com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0100E: Uncaught init() exception created by servlet Faces Servlet in application JsfServletDeployTest_war: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:270)
    at javax.faces.webapp.FacesServlet.init(FacesServlet.java:164)
    at com.ibm.ws.cache.servlet.ServletWrapper.init(ServletWrapper.java:238)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:358)
Nithin Satheesan
  • 1,546
  • 3
  • 17
  • 30
  • The "(initialization failure)" bit means that there should be a "Caused by" on the exception that is the real problem. Please find and include that in your question. If it's not there for some reason, search your logs for "DbgFactory.". – Brett Kail Jun 15 '12 at 14:44
  • Possible duplicate [question](http://stackoverflow.com/questions/5259145/exception-could-not-find-factory-javax-faces-context-facescontextfactory) – Ravi Kadaboina Jun 15 '12 at 14:45

2 Answers2

1

I too ran into same issue, and as I think I got answer to it as well...

It seems that when your server is already started without JSF(1.2) application on WPS 7.0, it doesnt load the SUN-JSF classes in the class-loader.

So, if you just deploy your application of portlet using JSF 1.2 it wont start working and fails to find the class as that class should be loaded by server bootstrap.

Now, when you have that application deployed and you restart the server, it upon initializing the JSF1.2 application, also loads the required SUN-JSF libraries. And hence when you click on the portlet it loads the portlet.

So, basically you need to restart the server once you deploy your portlet. But this should be only for first JSF 1.2 application.

Hope this helps.

//HP

HP24
  • 121
  • 6
0

I was facing the same problem and after debugging it was found that 'myfaces-api.jar' and 'myfaces-impl.jar' were missing from the classpath. After including them the application started properly without any error. Check if it is applicable to you.

Jon Lin
  • 142,182
  • 29
  • 220
  • 220
Sunny
  • 1
  • 1
    Note that the stacktrace in OP's case complains about a missing Mojarra class, not a MyFaces one. – BalusC Jun 22 '12 at 05:27
  • This seem to happen randomly. My workspace which was working fine til yesterday started getting this error. Really annoying!! – Nithin Satheesan Jun 29 '12 at 09:57