I'm migrating from JBoss 5.1.0.GA to JBoss 6.0.0-Final and facing following exception during FacesServler initialization
2011-03-09 18:07:24,574 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/].[Faces Servlet]] (http-0.0.0.0-8080-4) Allocate exception for servlet Faces Servlet: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:725) [:1.2_15-20100816-SNAPSHOT]
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:239) [:1.2_15-20100816-SNAPSHOT]
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:164) [:1.2_15-20100816-SNAPSHOT]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1208) [:6.0.0.Final]
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:955) [:6.0.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:188) [:6.0.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [:6.0.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:619) [:1.6.0_14]
I've looked into code and found out that FactoryFinder looks up corresponding FactoryManager based on current thread classloader. I also found that my FactoryFinder.FACTORIES_CACHE contains two entries for two class loaders:
* BaseClassLoader which loads my EAR and
* WebCtxLoader.ENCLoader which is used during web app running and which was current context classloaded for failed thread.
My deploy structure is following:
* deploy
o myapplication.ear
+ lib
# richfaces jars (3.3.1.GA)
# seam jars (2.2.1.Final)
# openfaces jar (2.0.0)
# other jars
+ META-INF
# jboss-app.xml
# application.xml
+ myapplication.war
# WEB-INF
* web.xml
* faces-config.xml
* components.xml
* deployers
o jbossweb.deployer
o jsf.deployer
o and others
I'm using Mojarra-1.2 as JSF implementation
<param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name>
<param-value>Mojarra-1.2</param-value>
After some debugging I could sumup:
1. all JSF initialization is made in BaseClassLoader thread, i.e. when javax.faces.FactoryFinder#setFactory(..) is invoked getClassLoader() returns EAR BaseClassLoader
2. A servlet thread (which cause exception) tries to look FactoryManager but his current classloader ( Thread.currentThread().getContextClassLoader()) is WebCtxLoader.ENCLoader. So nothing is returned and exception is thrown.
I checked JBoss 5.1.0 and ensured that initialization and access for FactoryManager's were made in threads having same class loader.
I've tried to google by didn't find much information about anybody having same problem - which makes me think something is wrong in my environment.
Can anybody comment on or help with this?
This is a sign of classpath pollution. JBoss already ships with JSF bundled. This exception can occur if you bundle JSF in your WAR as well. It'll only collide.
There are 2 solutions:
Get rid of jsf-api and jsf-impl JARs in your WAR (i.e. they should not end up in /WEB-INF/lib after build/deploy.
Tell JBoss that your WAR ships with its own version of JSF so that JBoss won't use its own.
<context-param>
<param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
<param-value>true</param-value>
</context-param>
I had the same issue, but with embedded GlassFish v3. I added this and it worked:
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
Here is the web page explains the problem: Using JSF 1.2 with Facelets on Google App Engine.
I was having the same problem with Jboss EAP 6.1 and 6.3.
I´m using Maven, then, my problem was about the generation of the EAR file, when I´m using Maven I discovered that my EAR file was been deployed whith dependencies "exploded", that is to say, my EAR file was been deployed with a folder containing the files for my project, and not a WAR and a JAR files.
When investigating the differences between the exploded EAR directory and the EAR archive I discovered that what you see is not what you get with Maven. I think the issue is that the various Maven plugins for WAR and EAR building are not applied when creating the exploded directories.
To fix it, I just removed the 'unpack' directives from the POM for the EAR.
<modules>
<webModule>
<groupId>br.web</groupId>
<artifactId>Web</artifactId>
<contextRoot>/project</contextRoot>
<unpack>false</unpack>
</webModule>
<ejbModule>
<groupId>br.ejb</groupId>
<artifactId>Ejb</artifactId>
<unpack>false</unpack>
</ejbModule>
</modules>
In addition, I don't recommend that exploded directories should be used in a EAR file.
Related
JSF 2.3 Extensionless URLs as explained here not working for my enterprise app. When navigating to url without .xhtml extension, FileNotFoundException exception is thrown:
Warning: JSF1091: No mime type could be found for file /pages/najmovi. To resolve this, add a mime-type mapping to the applications web.xml.
FATAL: JSF1073: javax.faces.FacesException caught during processing of RESTORE_VIEW 1 : UIComponent-ClientId=, Message=java.io.FileNotFoundException
FATAL: java.io.FileNotFoundException
javax.faces.FacesException: java.io.FileNotFoundException
at com.sun.faces.application.view.ViewMetadataImpl.createMetadataView(ViewMetadataImpl.java:158)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:247)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:133)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:201)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:670)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1580)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:338)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:305)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.edu.iznajmljivanje.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:30)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:652)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:591)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:463)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:168)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException
at org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:403)
at com.sun.faces.util.Util.getLastModified(Util.java:1278)
at com.sun.faces.facelets.impl.DefaultFaceletCache$2.newInstance(DefaultFaceletCache.java:98)
at com.sun.faces.facelets.impl.DefaultFaceletCache$2.newInstance(DefaultFaceletCache.java:93)
at com.sun.faces.util.ExpiringConcurrentCache$1.call(ExpiringConcurrentCache.java:100)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.sun.faces.util.ExpiringConcurrentCache.get(ExpiringConcurrentCache.java:115)
at com.sun.faces.facelets.impl.DefaultFaceletCache.getViewMetadataFacelet(DefaultFaceletCache.java:148)
at com.sun.faces.facelets.impl.DefaultFaceletCache.getViewMetadataFacelet(DefaultFaceletCache.java:63)
at com.sun.faces.facelets.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:310)
at com.sun.faces.facelets.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:240)
at com.sun.faces.application.view.ViewMetadataImpl.createMetadataView(ViewMetadataImpl.java:146)
... 41 more
Servlet-mappings in web.xml are configured: prefix /app/* and suffix *.xhtml
Also, there is an authentication filter #WebFilter for pattern /app/pages/* (similar to this)
Server: GlassFish ver-5.0; some other JSF 2.3 features are working fine.
I hade the same issue using JBoss EAP 7.0. Although it is claimed you can use extensionless URL's it is not working out of the box with only JSF 2.3 code (like in the blog you mention). I have yet to see a working example which works on all application servers without additional framework.
I use Rewrite because the configuration is simple and works out of the box. An alternative could be Omnifaces, but because we use JBoss EAP 7.0 and Omnifaces needs a (dirty!) workaround to get it running on JBoss EAP 7.0 (Why is WildFly 10 + JSF 2.3 not working with Omnifaces 2.6.1?) we abandoned Omnifaces. The link mentioned Wildfly 10, but it is applicable also to EAP 7.0.x versions.
This is my maven dependency:
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-servlet</artifactId>
<version>3.4.2.Final</version>
</dependency>
This is my Rewrite configuration:
import javax.servlet.ServletContext;
import org.ocpsoft.rewrite.annotation.RewriteConfiguration;
import org.ocpsoft.rewrite.config.Configuration;
import org.ocpsoft.rewrite.config.ConfigurationBuilder;
import org.ocpsoft.rewrite.servlet.config.HttpConfigurationProvider;
import org.ocpsoft.rewrite.servlet.config.rule.Join;
/**
* Configuration file to ensure extensionless url's with Rewrite framework from ocpsoft
*
*
* #since 1.0.0
*
*/
#RewriteConfiguration
public class ExtensionlessConfiguration extends HttpConfigurationProvider {
/*
* (non-Javadoc)
*
* #see org.ocpsoft.common.pattern.Weighted#priority()
*/
#Override
public int priority() {
return 10;
}
/*
* (non-Javadoc)
*
* #see org.ocpsoft.rewrite.config.ConfigurationProvider#getConfiguration(java.lang.Object)
*/
#Override
public Configuration getConfiguration(final ServletContext context) {
return ConfigurationBuilder.begin().addRule(Join.path("/beheer").to("/beheren/welkom.xhtml")).addRule(Join.path("/{param}").to("/{param}.xhtml"))
.addRule(Join.path("/").to("/welkom.xhtml")).addRule(Join.path("/beheren/{param}").to("/beheren/{param}.xhtml"));
}
}
This will map following pages to extensionless URL's:
Basic application URL / will be mapped internally to welkom.xhtml, like in web.xml welcome list, which in turn will be mapped without extension thanks to point 2. So for instance www.inter.it will be mapped internally to www.inter.it/welkom.xhtml.
All pages in root application will be without .xhtml. So for instance www.inter.it/welkom.xhtml will be mapped to www.inter.it/welkom
All pages under /beheren folder will be without .xhtml. So for instance www.inter.it/beheren/team.xhtml will be mapped to www.inter.it/beheren/team
SAML entrypoint URL /beheer will be mapped internally to /beheren/welkom.xhtml, which in turn will be mapped without extension thanks to point 3. So for instance www.inter.it/beheer will be mapped to www.inter.it/beheren/welkom.xhtml
Good luck with it ;-)
Environment :
JAVA EE 7
CDI
WildFly 8.2.0
MyFaces 2.2.8
Issue :
I am trying to run WildFly 8.2.0 with myFaces 2.2.8 as default JSF implementation.
Installion is completed . The details for this are on another SO question :
Installing Apache MyFaces 2 on WildFly 8.2.0
When my application war is deployed on WildFly 8.2.0 , the following exception is thrown and deployment doesn't complete.
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.InstanceManager from [Module "com.sun.jsf-impl:myfaces-2.2.8" from local module loader #736e9adb
(finder: local module finder #6d21714c (roots: C:\Users\xyz\wildfly-8.2.0.Final\modules,C:\Users\xyz\wildfly-8.2.0.Final\modules\system\layers\base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
at org.apache.myfaces.spi.impl.Tomcat7AnnotationInjectionProvider.initManager(Tomcat7AnnotationInjectionProvider.java:182)
at org.apache.myfaces.spi.impl.Tomcat7AnnotationInjectionProvider.postConstruct(Tomcat7AnnotationInjectionProvider.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_60]
at javax.faces.FactoryFinder.injectAndPostConstruct(FactoryFinder.java:415)
at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:519)
at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:361)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:225)
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:186)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:131)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:203)
... 10 more
I have searched for the issue on web and found out same problem here http://www.hivmr.com/db/3jsapc8j3xz3js1dsasjxjpkx37379cm , but no solution has been found.
The issue can be described as :
1) MyFaces uses Tomcat7AnnotationInjectionProvider for annotation processing which requires org.apache.tomcat.InstanceManager which is not available.
2) One solution is to use CDIAnnotationDelegateInjectionProvider , but how to configure it in MyFaces is not known ?
3) How to hook MyFaces in WildFly so that JBOSS Weld can process annotations instead of MyFaces supplied class ?
Wildfly uses Mojarra as their implementation choice of JSF. To use MyFaces you can follow their installation steps explained here [1]
[1] https://developer.jboss.org/wiki/StepsToAddMyFacesSupportToWildFly
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 trying to test CorrectAddress API on my web application using java program name JavaCANativeDispatcher .
Deployed this .war file on jboss application server on Linux environment.
the location of CorrectA is as under –
/apps/jboss-5.1.0.GA/IstCorrectAddress/libCorrectA.so
/apps/jboss-5.1.0.GA/IstCorrectAddress/Data/CorrectAddressData
Path setup is in bashrc , code as under –
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apps/jboss-5.1.0.GA/IstCorrectAddress/libCorrectA.so;
export LD_LIBRARY_PATH;
export CA_DATA=/apps/jboss-5.1.0.GA/IstCorrectAddress/Data;
when end-user running this application through browser(from windows ), it throws following error on server.log-
2013-07-23 15:06:21,830 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web]. [localhost].[/].[Controller]] Servlet.service() for servlet Controller threw exception
java.lang.UnsatisfiedLinkError: com.gfw.biz.JavaCANativeDispatcher.FindCityCounty([C[C[C[C[C)I
at com.gfw.biz.JavaCANativeDispatcher.FindCityCounty(Native Method)
at com.gfw.biz.JavaCANativeDispatcher.CallFindCityCounty(JavaCANativeDispatcher.java:487)
at com.gfw.jsp.Address.standardize(Address.java:113)
at com.gfw.jsp.actions.SetMailOptOutsAction.validate(SetMailOptOutsAction.java:385)
at com.gfw.jsp.actions.SetMailOptOutsAction.execute(SetMailOptOutsAction.java:97)
at com.gfw.jsp.Controller.processRequest(Controller.java:72)
at com.gfw.jsp.Controller.doPost(Controller.java:114)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Note - if i run the program JavaCANativeDispatcher on linux server by giving command
java JavaCANativeDispatcher it works perfectly.i only did for running this program -
export CA_DATA=/apps/jboss-5.1.0.GA/IstCorrectAddress/Data
Seems something in config or setup missing. Please suggest.
Need to set the path for tomcat-
export PATH=$PATH:$LIBPATH
CLASSPATH=$CLASSPATH:$CA_DATA
export LD_LIBRARY_PATH=$LIBPATH
export CA_DATA=/apps/apache-tomcat-7.0.42/shared/IstCorrectAddress/Data
export JAVA_OPTS="-Djava.library.path=/apps/apache-tomcat-7.0.42/shared"
I have to use version 4.0.1 of Hibernate in my enterprise application. The EAR is deployed into a JBoss 6.0 Container.
The ear file contains the following hibernate jars:
hibernate-commons-annotations-4.0.1.Final.jar
hibernate-core-4.0.1.Final.jar
hibernate-entitymanager-4.0.1.Final.jar
hibernate-envers-4.0.1.Final.jar
hibernate-envers-4.0.1.Final.jar
hibernate-envers-4.0.1.Final.jar
hibernate-search-analyzers-4.0.0.Final.jar
hibernate-search-engine-4.0.0.Final.jar
hibernate-search-engine-4.0.0.Final.jar
hibernate-validator-4.2.0.Final.jar
According to Upgrade Hibernate version in JBOSS I've tried to configure custom classloading using the follwing jboss-app.xml and jboss-classloading.xml
<!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_5_0.dtd">
<jboss-app>
<loader-repository>
com.acme.sample:archive=Sample
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</jboss-app>
<?xml version="1.0" encoding="UTF-8"?>
<classloading xmlns="urn:jboss:classloading:1.0"
domain="sample.ear"
export-all="NON_EMPTY"
import-all="true"
parent-first="false">
</classloading>
When starting up the JBoss 6 Container following lines occur in the log file:
09:49:55,238 INFO [org.hibernate.annotations.common.Version] HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
09:49:55,265 INFO [org.hibernate.Version] HHH000412: Hibernate Core {4.0.1.Final}
Seems as if Hibernate 4.0.1 has been detected. But then the following exception occurs:
09:49:55,388 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=sample-SNAPSHOT.ear/lib/persistence_impl-0.0.21-SNAPSHOT.jar#sample state=Create: java.lang.ClassCastException: org.jboss.as.jpa.scanner.HackTLScanner cannot be cast to org.hibernate.ejb.packaging.Scanner
at org.hibernate.ejb.Ejb3Configuration.buildScanner(Ejb3Configuration.java:415) [:3.6.0.Final]
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:582) [:3.6.0.Final]
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) [:3.6.0.Final]
at org.jboss.jpa.builder.DefaultCEMFBuilder.build(DefaultCEMFBuilder.java:47) [:1.0.2-alpha-3]
at org.jboss.as.jpa.scanner.HackCEMFBuilder.build(HackCEMFBuilder.java:49) [:6.0.0.Final]
at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:275) [:1.0.2-alpha-3]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.0.GA]
at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.0.GA]
at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.0.GA]
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.GA]
at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.GA]
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.GA]
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.GA]
In the exception stack trace the version 3.6.0.Final of hibernate is mentioned. Seems as if the Container still tries to create the JPA Persistence Unit using the version of hibernate that ships with JBoss.
Can anybody give me a hint on what I am doing wrong and how to configure the custom classloading so that JBoss uses the Hibernate version that is packaged in the EAR file.
I have done a workaround for this problem and it works...
my ear structure is like this--->
accountEAR.ear
|
|--lib
|<all jars for hibernate 4.0.1 and mysql jdbc jar>
|
|--META-INF
| application.xml
| jboss-app.xml
| jboss-classloading.xml
| mysql-ds.xml
|
|-- account_persistence.jar
jboss version is 6.1 and mysql version 5.1
jboss-app.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD Java EE Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_5_0.dtd" >
<jboss-app>
<loader-repository>
com.accountEAR:loader=accountEAR
<loader-repository-config>
java2ParentDelegation=false
</loader-repository-config>
</loader-repository>
<library-directory>lib</library-directory>
</jboss-app>
jboss-classloading.xml:
<?xml version="1.0" encoding="UTF-8"?>
<classloading
xmlns="urn:jboss:classloading:1.0"
export-all="NON_EMPTY"
import-all="true"
parent-first="false"/>