0
votes

I keep getting this exception while trying to access my application via url. The same configuration runs perfectly with one of my colleges.

Here is some of the configuration that I have in my application:

faces-config.xml

<factory>
    <exception-handler-factory>org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory</exception-handler-factory> 

web.xml

  <error-page>
        <exception-type>javax.faces.application.ViewExpiredException</exception-type>
        <location>/logout.xhtml</location>
  </error-page>

  <error-page>
        <error-code>403</error-code>
        <location>/errorGeneral.xhtml</location>
  </error-page>

  <error-page>
        <error-code>404</error-code>  <!-- Not Found -->
        <location>/errorGeneral.xhtml</location>
  </error-page>

  <error-page>
        <error-code>408</error-code>   <!-- Timeout -->
        <location>/logout.xhtml</location>
  </error-page>

  <error-page>
        <error-code>500</error-code>
        <location>/errorGeneral.xhtml</location>  <!-- Internal Server Error -->
  </error-page>

and here the full stack of the exception:

Exception

Excepción de página de errores
SRVE0260E: El servidor no puede utilizar la página de error especificada para que la aplicación gestione la excepción original que se muestra a continuación.

Excepción original:
Mensaje de error: javax.servlet.ServletException: SRVE0207E: Excepción de inicialización no obtenida creada por el servlet
Código de error: 500
Servlet de destino: Faces Servlet
Pila de errores:
java.lang.IllegalArgumentException: Class org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory is no javax.faces.context.ExceptionHandlerFactory
     at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:320)
     at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:286)
     at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:191)
     at org.apache.myfaces.context.FacesContextFactoryImpl.<init>(FacesContextFactoryImpl.java:120)
     at java.lang.J9VMInternals.newInstanceImpl(Native Method)
     at java.lang.Class.newInstance(Class.java:1549)
     at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:326)
     at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:286)
     at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:191)
     at javax.faces.webapp.FacesServlet.init(FacesServlet.java:112)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:363)
     at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:171)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:744)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:507)
     at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3954)
     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:945)
     at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:191)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)
     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
     at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
     at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
     at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
     at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
     at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
     at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1660)

I'm working on:

Websphere 7 RAD 9.1.1 JDK 8.

Any thoughts as to what my problem is?

Thanks.

1

1 Answers

-1
votes

It looks like your application is picking up two separate JSF implementations - there's the OmniFaces class in the exception, of course, but MyFaces is showing up in the stack (most likely loaded by the server).

The easiest answer would just be to remove the JSF stuff from your app and rely on the version packaged in the server - you can't hit conflicts between multiple implementations if there aren't multiple implementations. If you're specifically reliant on OmniFaces, then you'll need to make sure that you're including the full API+implementation in your application, using PARENT_LAST class loading (or an isolated shared library), and eliminating any references to the MyFaces implementation from your application code and build artifacts.