This question already has answers here:
Wildfly starts with error. javax.faces.FacesException: Unable to find CDI BeanManager
(2 answers)
Closed 2 years ago.
I am using:
TARGET RUNTIME:
WildFly 14.0
DYNAMIC WEB MODULE VERSION
4.0
CONFIGURATION
Dynamic Web Module 4.0
Java 1.8
JavaServer Faces 2.3
JSF CAPABILITIES
JSF Configuration File: /WEB-INF/faces-config.xml
JSF Servlet Name: Faces Servlet JSF
Servlet Class Name: javax.faces.webapp.FacesServlet
URL Mapping Patterns: *.jsf
I have this error:
21:26:14,941 SEVERE
[javax.enterprise.resource.webcontainer.jsf.config] (ServerService
Thread Pool -- 76) Critical error during deployment: :
com.sun.faces.config.ConfigurationException: Factory
'javax.faces.lifecycle.ClientWindowFactory' was not configured
properly. at
com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:357)
at
com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:243)
at
com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:443)
at
com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:237)
at
io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at
io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:216)
at
io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185)
at
io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at
io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at
org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at
org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at
org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at
org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at
io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:250)
at
org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
at
org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source) at java.util.concurrent.FutureTask.run(Unknown Source) at
org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at
org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Unknown Source) at
org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: javax.faces.FacesException: Unable to find CDI BeanManager
21:26:14,945 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 76) MSC000001: Failed to start service jboss.deployment.unit."PruebaTresWebJEE.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."PruebaTresWebJEE.war".undertow-deployment: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
>
this issue is resolved here, the solution is to add an xml file "beans.xml" in the WEB-INF directory with the following content :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
version="2.0" bean-discovery-mode="annotated">
</beans>
Related
I have certain web aplication based on JSF and CDI which works perfectly in Websphere ND 8.5. Nevertheless, it doesn't work in Liberty Profile 16 (WebSphere Application Server 16.0.0.3/wlp-1.0.14). If I tried to start the Liberty Profile with war already deployed to it, it caused
com.ibm.ws.container.service.state.StateChangeException: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001301: Annotation #javax.inject.Named(value=oam_FLOW_BUILDER_FACTORY_BEAN_NAME) is not a qualifier
The error is the same when I tried to start with either
<webApplication id="myWebApp" location="myWebApp.war" name="myWebApp">
<classloader delegation="parentFirst"/>
</webApplication>
or
<webApplication id="myWebApp" location="myWebApp.war" name="myWebApp">
<classloader delegation="parentLast"/>
</webApplication>
I am using these features:
<featureManager>
<feature>webProfile-7.0</feature>
<feature>localConnector-1.0</feature>
<feature>cdi-1.2</feature>
<feature>servlet-3.1</feature>
</featureManager>
If I start Liberty Profile without myWebApp and then I try to add the web application via Eclipse, I get
com.ibm.ws.container.service.state.StateChangeException: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions: Exception 0 : javax.enterprise.event.ObserverException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40) at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:78) at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:96) at org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:144) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:309) at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:124) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:287) at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:265) at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:302) at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:291) at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:160) at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:154) at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:53) at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:44) at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:62) at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:422) at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83) at com.ibm.ws.cdi.impl.CDIContainerImpl.applicationStarting(CDIContainerImpl.java:149) at com.ibm.ws.cdi.liberty.CDIRuntimeImpl.applicationStarting(CDIRuntimeImpl.java:353) at com.ibm.ws.container.service.state.internal.ApplicationStateManager.fireStarting(ApplicationStateManager.java:29) at com.ibm.ws.container.service.state.internal.StateChangeServiceImpl.fireApplicationStarting(StateChangeServiceImpl.java:51) at com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.preDeployApp(DeployedAppInfoBase.java:788) at com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.deployApp(DeployedAppInfoBase.java:815) at com.ibm.ws.app.manager.war.internal.WARApplicationHandlerImpl.install(WARApplicationHandlerImpl.java:66) at com.ibm.ws.app.manager.internal.statemachine.StartAction.execute(StartAction.java:141) at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.enterState(ApplicationStateMachineImpl.java:1192) at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.performAction(ApplicationStateMachineImpl.java:1038) at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.run(ApplicationStateMachineImpl.java:813) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.util.ServiceConfigurationError: com.sun.faces.util.cdi11.CDIUtil: Provider com.sun.faces.util.cdi11.CDIUtilImpl not a subtype at java.util.ServiceLoader.fail(ServiceLoader.java:239) at java.util.ServiceLoader.access$300(ServiceLoader.java:185) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) at java.util.ServiceLoader$1.next(ServiceLoader.java:480) at com.sun.faces.flow.FlowCDIExtension.afterBeanDiscovery(FlowCDIExtension.java:107) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
I heard someone saying that it is caused because reflection (certain feature that CDI depends on) doesn't work in Liberty Profile but it does work in WAS ND. Honestly, I don't think this is a final explanation. I tend to believe that it is some trick related to classloader which I am missing.
The entire libraries list is:
"wsdl4j.jar" "all-themes-1.0.10.jar" "axis.jar" "check-sessionid.jar" "commons-discovery-0.2.jar" "commons-logging.jar" "javax.faces-2.2.8.jar" "javax.servlet_3.0.0.jar" "javax-inject.jar" "jaxrpc.jar" "joda-time-2.9.4.jar" "jsf-api-2.2.8.jar" "jsf-impl-2.2.8.jar" "log4j-1.2.17.jar" "log4j-boot.jar" "lombok.jar" "ojdbc6.jar" "primefaces-5.1.RC1.jar" "primefaces-5.1.RC1-sources.jar" "saaj.jar"
In WebSphere ND 8.5 I successfuly start the same web aplication using these setup:
1 - Server-specific Application Settings: Classloader policy
2 - Class loader order: Classes loaded with parent class loader first
3 - WAR class loader policy: Class loader for each WAR file in application
4 - Shared Libraries:
cells:hohmlweb01-aixCell01:nodes:hohmlweb01-aixNode01:servers:Sistemas_MyCompany_HML
Cell=hohmlweb01-aixCell01, Profile=Dmgr01>Shared Libraries > icefaces4.0.0 Classpath: /home/sisorb/icefaces-ace-4.0.0.jar /home/sisorb/icepush-4.0.0.jar /home/sisorb/icefaces-4.0.0.jar /home/sisorb/jfreechart-1.0.19.jar
Shared Libraries > jsf_versao_228 Classpath: /home/sisorb/jsf-api-2.2.8.jar /home/sisorb/jsf-impl-2.2.8.jar /home/sisorb/javax.faces-2.2.8.jar
If someone can at least tell me how to reproduce such WAS ND configuration in Liberty Profile it will be highly appreciatted. Probably I can fix the issue by replicating same class loading configuration.
P.S.: this question was originally created in other forum but since I get no answer at all I am sharing my doubt here as well (https://developer.ibm.com/answers/questions/323283/how-can-i-reproduce-same-was-nd-classloader-setup.html)
* New Lines
I commented ConfigureListener as suggested *
<display-name>CallCenter</display-name>
<!--<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener> -->
<listener>
<listener-class>
com.mycomp.Inicialize
</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>glass-x</param-value>
<!-- <param-value>bluesky</param-value> -->
</context-param>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
2016/Nov/30 at 12:30am Brazilian TIme
I removed "javax.faces-2.2.8.jar" "jsf-api-2.2.8.jar" "jsf-impl-2.2.8.jar"
I left "all-themes-1.0.10.jar" "axis.jar" "check-sessionid.jar" "commons-discovery-0.2.jar" "commons-logging.jar" "javax.servlet_3.0.0.jar" "javax-inject.jar" "jaxrpc.jar" "joda-time-2.9.4.jar" "log4j-1.2.17.jar" "log4j-boot.jar" "lombok.jar" "ojdbc6.jar" "primefaces-5.1.RC1.jar" "primefaces-5.1.RC1-sources.jar" "saaj.jar" "wsdl4j.jar"
Then I got a new error:
Application Error
SRVE0777E: Exceção lançada pela classe de aplicativo 'javax.faces.webapp.FacesServlet.service:230'
javax.servlet.ServletException: javax.el.PropertyNotFoundException: Não alcançável no destino, identificador 'dashBean' resolvido como nulo
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:230)
at [internal classes]
Caused by: org.apache.myfaces.view.facelets.el.ContextAwarePropertyNotFoundException: javax.el.PropertyNotFoundException: Não alcançável no destino, identificador 'dashBean' resolvido como nulo
at org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.setValue(ContextAwareTagValueExpression.java:157)
... 1 more
Caused by: javax.el.PropertyNotFoundException: Não alcançável no destino, identificador 'dashBean' resolvido como nulo
at org.apache.el.parser.AstValue.getTarget(AstValue.java:72)
... 1 more
*Added 2016/Nov/30 at 2h30pm Brazilian Time
faces-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
<application>
<action-listener>org.primefaces.application.DialogActionListener</action-listener>
<navigation-handler>org.primefaces.application.DialogNavigationHandler</navigation-handler>
<view-handler>org.primefaces.application.DialogViewHandler</view-handler>
</application>
</faces-config>
Websphere Liberty Profile - server.xml
<featureManager>
<feature>localConnector-1.0</feature>
<feature>cdi-1.2</feature>
<feature>jsf-2.2</feature>
</featureManager>
*Added 2016/11/30 at 4:40pm Brazilian Time after deleted two more jars (javax.servlet_3.0.0 and javax-inject)
FFDC* created "com.ibm.wsspi.injectionengine.InjectionException: java.lang.NoClassDefFoundError: ServletContextEvent com.ibm.ws.webcontainer.webapp.WebApp.loadListener 672"
*FFDC is the deeper log statement we can see
WebSphere Liberty Profile log FFDC
Exception = com.ibm.wsspi.injectionengine.InjectionException
Source = com.ibm.ws.webcontainer.webapp.WebApp.loadListener
probeid = 672
Stack Dump = com.ibm.wsspi.injectionengine.InjectionException: java.lang.NoClassDefFoundError: ServletContextEvent
at com.ibm.ws.webcontainer.osgi.webapp.WebApp.inject(WebApp.java:1282)
at com.ibm.ws.webcontainer.osgi.webapp.WebApp.injectAndPostConstruct(WebApp.java:1424)
at com.ibm.ws.webcontainer.osgi.webapp.WebApp.injectAndPostConstruct(WebApp.java:1412)
at com.ibm.ws.webcontainer.osgi.webapp.WebApp.loadListener(WebApp.java:818)
at com.ibm.ws.webcontainer.webapp.WebApp.loadLifecycleListeners(WebApp.java:2251)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1039)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6545)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:466)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:264)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:329)
at com.ibm.ws.http.internal.VirtualHostImpl.discriminate(VirtualHostImpl.java:251)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:301)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:471)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:405)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:285)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:256)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:504)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:574)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:929)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1018)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: ServletContextEvent
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.jboss.weld.annotated.slim.backed.SecurityActions.getDeclaredMethods(SecurityActions.java:41)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.computeValue(BackedAnnotatedType.java:194)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.computeValue(BackedAnnotatedType.java:188)
at org.jboss.weld.util.LazyValueHolder.get(LazyValueHolder.java:35)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$EagerlyInitializedLazyValueHolder.<init>(BackedAnnotatedType.java:156)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.<init>(BackedAnnotatedType.java:188)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.<init>(BackedAnnotatedType.java:188)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.<init>(BackedAnnotatedType.java:63)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.of(BackedAnnotatedType.java:44)
at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:83)
at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:80)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3599)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2379)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2342)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2257)
at com.google.common.cache.LocalCache.get(LocalCache.java:4000)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4004)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4874)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:49)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:74)
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:175)
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:194)
at org.jboss.weld.manager.BeanManagerImpl.createAnnotatedType(BeanManagerImpl.java:1215)
at com.ibm.ws.cdi.impl.managedobject.AbstractManagedObjectFactory.getInjectionTarget(AbstractManagedObjectFactory.java:177)
at com.ibm.ws.cdi.impl.managedobject.AbstractManagedObjectFactory.createManagedObject(AbstractManagedObjectFactory.java:204)
at com.ibm.ws.cdi.impl.managedobject.CDIManagedObjectFactoryImpl.createManagedObject(CDIManagedObjectFactoryImpl.java:60)
at com.ibm.ws.webcontainer.osgi.webapp.WebApp.inject(WebApp.java:1258)
... 24 more
Caused by: java.lang.ClassNotFoundException: ServletContextEvent
at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:488)
at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:271)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:466)
at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:438)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 54 more
As mentioned, the webProfile-7.0 feature includes the jsf-2.2 feature, which provides the same EE feature (JSF 2.2) as the jsf-* jars you're bundling in your application. You can likely resolve this issue by choosing one JSF implementation to use. There are two options:
1) Bundle a JSF implementation with your application: remove the webProfile-7.0 feature from your server definition and only enable the (non-JSF) features you need.
2) Remove the jsf-api and jsf-impl jars from your application. This is the recommended route: WebSphere Liberty provides the MyFaces JSF 2.2 implementation. Here is some additional information for configuring the jsf-2.2 feature.
From your second stack trace, it looks like one of the jars in your application is registering a CDI extension. When this extension is called, it tries to load the CDI11Util service but doesn't get an object of the expected type.
I suspect that it may be the jsf-impl.jar doing this. As you're using the webProfile-7.0 feature (which includes JSF), you shouldn't be providing your own JSF implementation in your application. Could you try removing this jar?
As a side note, you shouldn't need the servlet, faces, inject or jsf API jars either as the server will provide these classes for your application.
As a second side note, the default classloader setup in Liberty is as you describe in your question (classloader is parent first, each WAR has its own classloader).
This question already has an answer here:
How to properly install and configure JSF libraries via Maven?
(1 answer)
Closed 5 years ago.
I am migrating from glassfish 4 to wildfly 8.1.
Before project had been migrated from jsf 2.0 to jsf 2.2 and everything worked well on glassfish 4
This exception comes when I try to deploy an application to wildfly 8.1:
INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-4) Initializing Mojarra 2.2.6-jbossorg-4 20140501-1134 for context ''
22:35:02,685 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-4) Critical error during deployment: : com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:422) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:378) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:321) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:270) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:437) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:216) [jsf-impl-2.2.6-jbossorg-4.jar:]
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:190) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_20]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_20]
22:35:02,686 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_20]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_20]
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:219)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
... 3 more
Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:275)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:190)
... 7 more
Caused by: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:422)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:378)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:321)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:270)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:437)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:216)
... 9 more
Project spec: JSF 2.2, WildFly 8.1, Primefaces 5
By the way Mojarra version is 2.2.6 so there is should not be issue like here
I have found the solution
In case if you already migrated to JSF 2.2 remove JSF 2.2 library from project library list because Wildfly 8.1 alredy comes with JSF implementation.
I did the instruction from this website (JSF 2.2 in JBoss 7.1.1 Final). After I overcome the problem posted :
ClassNotFoundException for JSTL jar when I try to migrate JBoss 7.1 application to JSF 2.2
I get new issue.
No active contexts for scope type javax.faces.flow.builder.FlowDefinition
Stack Trace :
14:57:33,400 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-8) Critical error during deployment: : org.jboss.weld.context.ContextNotActiveExceptio
n: WELD-001303 No active contexts for scope type javax.faces.flow.builder.FlowDefinition
at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:607) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
at com.sun.faces.application.ApplicationAssociate$PostConstructApplicationListener.loadFlows(ApplicationAssociate.java:322) [jsf-impl-2.2.1.jar:2.2.1]
at com.sun.faces.application.ApplicationAssociate$PostConstructApplicationListener.processEvent(ApplicationAssociate.java:302) [jsf-impl-2.2.1.jar:2.2.1]
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:108) [jsf-api-2.2.1.jar:2.2]
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2187) [jsf-impl-2.2.1.jar:2.2.1]
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2163) [jsf-impl-2.2.1.jar:2.2.1]
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:296) [jsf-impl-2.2.1.jar:2.2.1]
at org.jboss.as.weld.webtier.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:288) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:739) [jsf-api-2.2.1.jar:2.2]
at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:691) [jsf-impl-2.2.1.jar:2.2.1]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:253) [jsf-impl-2.2.1.jar:2.2.1]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_25]
14:57:33,416 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsf-cdi]] (MSC service thread 1-8) Exception sending context initialized event to listener i
nstance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type
javax.faces.flow.builder.FlowDefinition
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:273) [jsf-impl-2.2.1.jar:2.2.1]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_25]
Caused by: org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.faces.flow.builder.FlowDefinition
at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:607) [weld-core-1.1.8.Final.jar:2012-04-29 10:45]
at com.sun.faces.application.ApplicationAssociate$PostConstructApplicationListener.loadFlows(ApplicationAssociate.java:322) [jsf-impl-2.2.1.jar:2.2.1]
at com.sun.faces.application.ApplicationAssociate$PostConstructApplicationListener.processEvent(ApplicationAssociate.java:302) [jsf-impl-2.2.1.jar:2.2.1]
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:108) [jsf-api-2.2.1.jar:2.2]
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2187) [jsf-impl-2.2.1.jar:2.2.1]
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2163) [jsf-impl-2.2.1.jar:2.2.1]
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:296) [jsf-impl-2.2.1.jar:2.2.1]
at org.jboss.as.weld.webtier.jsf.ForwardingApplication.publishEvent(ForwardingApplication.java:288) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:739) [jsf-api-2.2.1.jar:2.2]
at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:691) [jsf-impl-2.2.1.jar:2.2.1]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:253) [jsf-impl-2.2.1.jar:2.2.1]
I tried to change weld-core module in JBoss 7 with the following jar fils.
weld-core-1.1.8.Final.jar
weld-core-2.1.1.Final.jar
It does not effect, error is the same. How can I resolve it?
One of the things that JBoss EAP 7 (and I assume Wildfly 10) also needs is a beans.xml file in the war project WEB-INF directory.
We have a number of EAR projects, with an EJB project containing the java code. It used to be that the beans.xml in this EJB project was sufficient to have JSF use CDI scopes, but with EAP 7 / JSF 2.2 this isn't enough anymore and the war project itself also needs this marker file.
I assume this is more standard compliant, but can lead to interesting bug chases if you don't realize this.
This question already has answers here:
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
(2 answers)
Closed 7 years ago.
I get an error, when I started my JavaServer Faces application. On the browser I get following error:
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: javax/servlet/jsp/jstl/core/Config
javax.faces.webapp.FacesServlet.service(FacesServlet.java:229)
root cause
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
org.apache.myfaces.view.jsp.JspViewDeclarationLanguage.buildView(JspViewDeclarationLanguage.java:91)
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:77)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
root cause
java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
org.apache.myfaces.view.jsp.JspViewDeclarationLanguage.buildView(JspViewDeclarationLanguage.java:91)
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:77)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.12 logs.
On my Eclipse IDE follwoing error:
Nov 19, 2013 8:37:17 PM org.apache.catalina.startup.Catalina start
Information: Server startup in 2518 ms
Nov 19, 2013 8:37:18 PM org.apache.catalina.core.StandardWrapperValve invoke
Schwerwiegend: Servlet.service() for servlet [Faces Servlet] in context with path [/de.xxx.jsf.first] threw exception [javax/servlet/jsp/jstl/core/Config] with root cause
java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at org.apache.myfaces.view.jsp.JspViewDeclarationLanguage.buildView(JspViewDeclarationLanguage.java:91)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:77)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
How is this caused and how can I solve it?
java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config
A ClassNotFoundException means that the specified class is missing in the runtime classpath. As the package name hints, it's part of JSTL.
JSF (more specifically, Facelets) has indeed a dependency on JSTL for the <c:xxx> tags. When JSF loads, it's implicitly also loading JSTL core taglib configuration. However, if it cannot be found, you'll get exactly this exception.
JSTL (and JSF!) is normally already provided out the box on Java EE container such as JBoss AS/EAP/WildFly, GlassFish, TomEE, WebLogic, etcetera. However, you're using Tomcat, which is a barebones JSP/Servlet container and doesn't ship with JSTL out the box. If upgrading to e.g. TomEE is not an option, you'd need to manuall supply JSTL along with the webapp, like as you did for JSF.
Just download jstl-1.2.jar and drop it in /WEB-INF/lib folder of your webapp, along with the JSF JAR(s).
See also:
Our JSTL wiki page
It seems you are missing lib.
check if JSTL 1.1 - jstl.jar is added in your classpath.
Add jstl maven dependency in pom.xml:
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
I am new to JSF. I am using Tomcat 7.0.14 and trying to run SimpleHelloByEnteringName example but getting following errors in startup and at runtime
Startup Console message:
INFO: Deploying web application directory SimpleHelloByEnteringName
Jun 15, 2011 7:35:42 AM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.0.3 (FCS b03) for context '/SimpleHelloByEnteringName'
Jun 15, 2011 7:35:43 AM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
**Jun 15, 2011 7:35:44 AM com.sun.faces.config.processor.NavigationConfigProcessor addNavigationCasesForRule
WARNING: JSF1058: The resource referred to by to-view-id, 'result.jsp', for navigation from '/pages/inputname.jsp', does not start with '/'. This will be added for you, but it should be corrected.**
Jun 15, 2011 7:35:44 AM com.sun.faces.config.ConfigureListener$WebConfigResourceMonitor$Monitor <init>
INFO: Monitoring jndi:/localhost/SimpleHelloByEnteringName/WEB-INF/faces-config.xml for modifications
Jun 15, 2011 7:35:44 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-apr-8081"]
Jun 15, 2011 7:35:44 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Jun 15, 2011 7:35:44 AM org.apache.catalina.startup.Catalina start
and runtime error when trying to run http://localhost:8081/SimpleHelloByEnteringName/
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/el/ELResolver
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:342)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.NoClassDefFoundError: javax/el/ELResolver
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
java.lang.ClassLoader.defineClass(ClassLoader.java:615)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
java.net.URLClassLoader.access$000(URLClassLoader.java:58)
java.net.URLClassLoader$1.run(URLClassLoader.java:197)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
java.lang.ClassLoader.loadClass(ClassLoader.java:295)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
java.lang.ClassLoader.loadClass(ClassLoader.java:295)
java.lang.ClassLoader.loadClass(ClassLoader.java:247)
org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:220)
org.apache.jsp.index_jsp._jspInit(index_jsp.java:23)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:49)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:171)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.ClassNotFoundException: javax.el.ELResolver
java.net.URLClassLoader$1.run(URLClassLoader.java:202)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
java.lang.ClassLoader.loadClass(ClassLoader.java:247)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
java.lang.ClassLoader.defineClass(ClassLoader.java:615)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
java.net.URLClassLoader.access$000(URLClassLoader.java:58)
java.net.URLClassLoader$1.run(URLClassLoader.java:197)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
java.lang.ClassLoader.loadClass(ClassLoader.java:295)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
java.lang.ClassLoader.loadClass(ClassLoader.java:295)
java.lang.ClassLoader.loadClass(ClassLoader.java:247)
org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:220)
org.apache.jsp.index_jsp._jspInit(index_jsp.java:23)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:49)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:171)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:356)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.14 logs.
How is this problem caused and how can I solve it?
WARNING: JSF1058: The resource referred to by to-view-id, 'result.jsp', for navigation from '/pages/inputname.jsp', does not start with '/'. This will be added for you, but it should be corrected.
The warning is not relevant to the problem. JSF has already fixed it for you, but it is telling you that you should fix it yourself in the faces-config.xml.
java.lang.ClassNotFoundException: javax.el.ELResolver
This is however pretty serious. This can have several causes:
You are actually not running Tomcat 7.0 at all, but Tomcat 5.5 which is missing this class. Doublecheck it.
You have dropped a bunch of servletcontainer specific libraries such as el-api.jar, jsp-api.jar, etc of a different servletcontainer make/version (perhaps Tomcat 5.5?) in webapp's WEB-INF/lib or in Java's JRE/lib folder. Probably to overcome compilation problems. Moving/copying servletcontainer specific JARs around is the wrong solution. Undo it and remove them all.
Your web.xml is not declared conform at least the Servlet 2.5 specification. Since you mention to be using Tomcat 7.0, which is a Servlet 3.0 container, you should be declaring the web.xml conform Servlet 3.0:
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<!-- Your config here -->
</web-app>
Update: oh wait ... I googled on the "SimpleHelloByEnteringName" and I discovered that this is actually a Roseindia.net (shudder) example as presented here: Downloading and Installing "SimpleHelloByEnteringName" JSF Example. I would like to stress that this site is the worst Java EE learning resource on the interwebs. I strongly recommend to head to other resources.
Coreservlets.com JSF 2.0 tutorial
Java EE 6 tutorial - JSF
Mkyong.com JSF 2.0 tutorials
My JSF 2.0 tutorial with Eclipse and Glassfish
I had a similar problem when executing a Dynamic web project in Eclipse.
java.lang.NoClassDefFoundError: javax/el/ELResolver
Here the problem is the Classes you use in your project are not defined in the classpath. In my case, I had to add
el-api.jar
jsp-api.jar
servlet-api.jar
into my Tomcat's classpath under Bootstrap entries.
So, In your case, check whether, these 3 jar's are present in C:\Tomcat\lib directory. Add it to the classpath if not present.
Hope this solves your problem.