Rqgg Page 1/4

helpflightInternet και Εφαρμογές Web

10 Νοε 2013 (πριν από 3 χρόνια και 9 μήνες)

399 εμφανίσεις

java.lang.NoClassDefFoundError: Could not initialize class org.omnifaces.config.WebXml
Asked by
Kilgorjn
on 2013-04-18T12:59:40-04:00
I have added recently added omnifaces 1.4.1 to my pom to use some of the converters.




org.omnifaces

omnifaces

1.4.1


Now, every request to the application throws an exception
which starts at


java.lang.NoClassDefFoundError: Could not initialize class org.omnifaces.config.WebXml
The
omnifaces.SelectItemsIndexConverter I'm using is working fine, but this exception is being thrown
for every request; even on pages that do not contain /questions/tagged/onmifaces components.

My environment is as follows:



Tomcat 7.0.37

Mojarra 2.1.10

PrimeFaces 3.4.2

PrimeFaces Extensions 0.6.1

Is there some
additional setup that is required more than just adding to the pom?


Apr 18, 2013 11:35:06 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE:
Servlet.service() for servlet [Faces Servlet] in context with path [/MyApp] threw exception [Servlet
execution threw an exception] with root cause java.lang.NoClassDefFoundError: Could not initialize
class org.omnifaces.config.WebXml at
org.omnifaces.context.OmniPartialViewContext$OmniPartialResponseWriter.startDocument(OmniP
artialViewContext.java:253) at
org.primefaces.context.PrimePartialResponseWriter.startDocument(PrimePartialResponseWriter.jav
a:133) at
com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandl
erImpl.java:199) at
com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:123) at
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119) at
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
:311) at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInte
rceptor.java:116) at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInt
erceptor.java:83) at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
:323) at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFi
lter.java:113) at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
:323) at
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagement
Filter.java:101) at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
:323) at
Rqgg
Page 1/4
java.lang.NoClassDefFoundError: Could not initialize class org.omnifaces.config.WebXml
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(Anonymou
sAuthenticationFilter.java:113) at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
:323) at
org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.do
Filter(RememberMeAuthenticationFilter.java:146) at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
:323) at
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(Sec
urityContextHolderAwareRequestFilter.java:54) at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
:323) at
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheA
wareFilter.java:45) at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
:323) at
org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthe
nticationFilter.java:150) at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
:323) at
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(Ab
stractAuthenticationProcessingFilter.java:182) at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
:323) at
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
:323) at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContext
PersistenceFilter.java:87) at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
:323) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173) at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346
) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessio
nInViewFilter.java:198) at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) at
Rqgg
Page 2/4
java.lang.NoClassDefFoundError: Could not initialize class org.omnifaces.config.WebXml
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589
) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at
java.lang.Thread.run(Unknown Source)
Best Answer
Answer by
BalusC
on 2013-04-18T13:17:33-04:00
java.lang.NoClassDefFoundError: Could not initialize class org.omnifaces.config.WebXml


This will occur when
http://wiki.omnifaces.googlecode.com/hg/javadoc/org/omnifaces/config/WebXml.html failed to parse
the webapp's
web.xml
and/or
web-fragment.xml
(s). This should however have thrown a runtime
exception about that. I will check why it's been swallowed. It's perhaps Tomcat specific.

As to the runtime exception in your particular case,


java.lang.ClassNotFoundException: avax.faces.application.ViewExpiredException


This suggests that you've in your
web.xml
something like:



avax.faces.application.ViewExpiredException
...

while it should really have been
http://docs.oracle.com/javaee/6/api/javax/faces/application/ViewExpiredException.html. Fix it
accordingly and
WebXml
will then succeed in parsing the
web.xml
.

Archives
Technology
Programmers
Apr 18th, 2013
Week 16, 2013
April, 2013
Related
JSF char comparison does not work as expected
assign unique ids to div using JSF
What are the situations when we must consider JSF or Spring MVC or Struts
Format a JSF converted value
Update inputText in jsf without ajax
How to add row details in JSF data table?
jboss 6.1 jsf and beans
JSF 2.0 WITH richfaces 4.2.3 org.apache.jasper.JasperException: /Web/login.jsp(21,20) #{…}
is not allowed in template text
JSF JDBC Jasper Reports
session-timeout in JSF
Rqgg
Page 3/4
java.lang.NoClassDefFoundError: Could not initialize class org.omnifaces.config.WebXml
View Online
http://www.rqgg.net/topic/nkqmx-java-lang-noclassdeffounderror-could-not-initialize-class-org-omnifa
ces-config-webxml.html
Rqgg
Page 4/4