Unable to add jsp page to xhtml page?
Asked Answered
N

0

2

I am trying to include jsp page in my xhtml page following how-to-include-a-jsp-page-in-a-facelets-page but UIComponentBase class is not found, not sure why as application builds fine am getting this runtime exception.

I am using Mojarra 2.1.7, here is the stacktrace:

    Servlet.service() for servlet Faces Servlet threw exception: java.lang.ClassNotFoundException
: javax.faces.component.UIComponentBase
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200) [:1.6.0_18-ea]
        at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_18-ea]
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188) [:1.6.0_18-ea]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307) [:1.6.0_18-ea]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) [:1.6.0_18-ea]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252) [:1.6.0_18-ea]
        at java.lang.Class.forName0(Native Method) [:1.6.0_18-ea]
        at java.lang.Class.forName(Class.java:247) [:1.6.0_18-ea]
        at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:284) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1152) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:886) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:505) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:450) [jboss-classloader.jar:2.2.0.GA]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252) [:1.6.0_18-ea]
        at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_18-ea]
        at java.lang.ClassLoader.defineClass(ClassLoader.java:621) [:1.6.0_18-ea]
        at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:52) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:650) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:609) [jboss-classloader.jar:2.2.0.GA]
        at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_18-ea]
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:608) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:585) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:156) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.filter.FilteredDelegateLoader.doLoadClass(FilteredDelegateLoader.java:141) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:132) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:461) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:262) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:161) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:260) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1152) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:886) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:505) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:450) [jboss-classloader.jar:2.2.0.GA]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252) [:1.6.0_18-ea]
        at java.lang.Class.forName0(Native Method) [:1.6.0_18-ea]
        at java.lang.Class.forName(Class.java:247) [:1.6.0_18-ea]
        at org.jboss.classloader.plugins.loader.ClassLoaderToLoaderAdapter.loadClass(ClassLoaderToLoaderAdapter.java:184) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:461) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:262) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:161) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:260) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1152) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:886) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:505) [jboss-classloader.jar:2.2.0.GA]
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:450) [jboss-classloader.jar:2.2.0.GA]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:300) [:1.6.0_18-ea]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252) [:1.6.0_18-ea]
        at com.sun.faces.util.Util.loadClass(Util.java:293) [:2.1.7-SNAPSHOT]
        at com.sun.faces.application.ApplicationImpl.newThing(ApplicationImpl.java:1715) [:2.1.7-SNAPSHOT]
        at com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1894) [:2.1.7-SNAPSHOT]
        at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1164) [:2.1.7-SNAPSHOT]
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.createComponent(ComponentTagHandlerDelegateImpl.java:524) [:2.1.7-SNAPSHOT]
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:168) [:2.1.7-SNAPSHOT]
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) [:2.1.7-SNAPSHOT]
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) [:2.1.7-SNAPSHOT]
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) [:2.1.7-SNAPSHOT]
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:195) [:2.1.7-SNAPSHOT]
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) [:2.1.7-SNAPSHOT]
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) [:2.1.7-SNAPSHOT]
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) [:2.1.7-SNAPSHOT]
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) [:2.1.7-SNAPSHOT]
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86) [:2.1.7-SNAPSHOT]
        at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152) [:2.1.7-SNAPSHOT]
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:774) [:2.1.7-SNAPSHOT]
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100) [:2.1.7-SNAPSHOT]
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [:2.1.7-SNAPSHOT]
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [:2.1.7-SNAPSHOT]
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [:2.1.7-SNAPSHOT]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]

Any thoughts, suggestions?

Nine answered 12/4, 2012 at 16:45 Comment(8)
You seem to be using JBoss 6.0.0 which already ships with Mojarra 2.0.4 bundled. Did you tell it to use the webapp-bundled Mojarra 2.1.7 instead?Sheilasheilah
Yes, i have modified to jsf deployer xml file to use Mojarra 2.1.7 jsf lib.Nine
if you see com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [:2.1.7-SNAPSHOT] it calls from Mojarra 2.1.7-SNAPSHOTNine
Yes, I know. Just asking to exclude the one and other. The exception namely suggests a classpath messup wherein the JSF API was loaded from JBoss while JSF impl was loaded from webapp. Do you have any JSF JARs in /WEB-INF/lib? You should actually have none if you're relying on JBoss to load JSF.Sheilasheilah
i do not have any jsf related jars in /WEB-INF/lib but i have all 3 implementations of JSF inside jsf.deployer, i will try removing all of those and just keep Mojarra 2.1.7Nine
tried that but it did not resolved the issue...Nine
I don't know. I explored your question history and you seem to have multiple severe problems with your environment setup in general. I'd take a step back. I'd start creating a blank JSF2 playground project with a hello world JSF view and bean and check if it works. If it works, expand it step by step with artifacts of your existing project until it breaks. Then you should know the cause.Sheilasheilah
separate project works fine without any kind of issue, challenges come into picture when i try to integrate to actual project, anyways thanks for all your guidance, it really helps.Nine

© 2022 - 2024 — McMap. All rights reserved.