OmniFaces 3.0 and MyFaces 2.2.12 throws java.lang.NoSuchMethodError: javax.faces.application.ApplicationFactory
OmniFaces 3.0 and MyFaces 2.2.12 throws java.lang.NoSuchMethodError: javax.faces.application.ApplicationFactory
jboss-fuse 6.3.0283 上的 myfaces 初始化期间,karaf 中抛出了 InvocationTargetException。这是否意味着 omnifaces 将无法与 myfaces 2.2.12 捆绑包一起正常工作,或者是否有一些依赖 类 未被容器加载?
顺便说一句,我们使用 primefaces 6.1 和 pax-cdi-web-weld 进行 cdi。安装和激活的功能和捆绑包是:
<feature version="1.0.0.RC1-redhat-001">pax-cdi-web-weld</feature>
<bundle>mvn:commons-digester/commons-digester/1.8.1</bundle>
<bundle>mvn:org.apache.myfaces.core/myfaces-bundle/2.2.12</bundle>
<bundle>mvn:org.primefaces/primefaces/6.1</bundle>
<bundle>wrap:mvn:org.primefaces.extensions/primefaces-extensions/6.1.1</bundle>
Felix 插件:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<extensions>true</extensions>
<configuration>
<instructions>
<_wab>src/main/webapp</_wab>
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
<Import-Package>
com.fasterxml.jackson.annotation;version="[2.6,3)",
com.fasterxml.jackson.core;version="[2.6,3)",
com.fasterxml.jackson.databind.module;version="[2.6,3)",
com.fasterxml.jackson.databind;version="[2.6,3)",
com.google.gson;version="[2.2,3)",
javax.annotation;version="[1.2,2)",
javax.crypto,
javax.crypto.spec,
javax.el;version="[2.2,3)",
javax.enterprise.context;version="[1.1,2)",
javax.enterprise.context.spi;version="[1.1,2)",
javax.enterprise.event;version="[1.1,2)",
javax.enterprise.inject.spi;version="[1.1,2)",
javax.faces.application;version="[2.2,3)",
javax.faces.bean;version="[2.2,3)",
javax.faces.component.behavior;version="[2.2,3)",
javax.faces.component.html;version="[2.2,3)",
javax.faces.component.visit;version="[2.2,3)",
javax.faces.component;version="[2.2,3)",
javax.faces.context;version="[2.2,3)",
javax.faces.convert;version="[2.2,3)",
javax.faces.el;version="[2.2,3)",
javax.faces.event;version="[2.2,3)",
javax.faces.lifecycle;version="[2.2,3)",
javax.faces.model;version="[2.2,3)",
javax.faces.render;version="[2.2,3)",
javax.faces.validator;version="[2.2,3)",
javax.faces.view.facelets;version="[2.2,3)",
javax.faces.view;version="[2.2,3)",
javax.faces.webapp;version="[2.2,3)",
javax.faces;version="[2.2,3)",
javax.inject,
javax.naming,
javax.servlet.http;version="[3.1,4)",
javax.servlet.jsp.jstl.core;version=1.2,
javax.servlet.jsp.jstl.fmt;version=1.2,
javax.servlet.jsp.jstl.tlv;version=1.2,
javax.servlet.jsp;version="[2.2.0,3.0.0)",
javax.servlet;version="[3.1,4)",
javax.websocket,
javax.websocket.server,
javax.xml.parsers,
org.apache.commons.lang3,
org.apache.commons.logging,
org.apache.taglibs.standard.resources;version=1.1.2,
org.apache.taglibs.standard.tag.common.core;version=1.1.2,
org.apache.taglibs.standard.tag.rt.core;version=1.1.2,
org.apache.taglibs.standard.tei;version=1.1.2,
org.apache.taglibs.standard.tlv;version=1.1.2,
org.jboss.weld.bean.builtin;version="[2.3,3)",
org.jboss.weld.el;version="[2.3,3)",
org.jboss.weld.manager;version="[2.3,3)",
org.jboss.weld.servlet;version="[2.3,3)",
org.jboss.weld.util;version="[2.3,3)",
org.ops4j.pax.cdi.api;version="[1.0,2)",
org.osgi.framework;version="[1.7,2)",
org.osgi.service.blueprint.container;version="[1.0,2)",
org.osgi.service.log;version="[1.3,2)",
org.osgi.util.tracker;version="[1.5,2)",
org.primefaces.context;version="[6.1,7)",
org.primefaces.event;version="[6.1,7)",
org.slf4j;version="[1.7,2)",
org.w3c.dom,
org.xml.sax,
org.xml.sax.ext,
org.xml.sax.helpers
</Import-Package>
<Export-Package>!*</Export-Package>
<Bundle-Classpath>
WEB-INF/classes,
WEB-INF/lib/all-themes-1.0.10.jar,
WEB-INF/lib/commons-lang3-3.7.jar,
WEB-INF/lib/aspectjrt-1.8.9.jar,
WEB-INF/lib/resources-codemirror-6.1.1.jar,
WEB-INF/lib/omnifaces-3.0.jar
</Bundle-Classpath>
<Web-ContextPath>${web.context.path}</Web-ContextPath>
<Require-Bundle>
org.primefaces;visibility:=reexport,
org.apache.myfaces.core.bundle;visibility:=reexport,
wrap_mvn_org.primefaces.extensions_primefaces-extensions_6.1.1;visibility:=reexport
</Require-Bundle>
<Require-Capability>
osgi.extender; filter:="(osgi.extender=pax.cdi)",org.ops4j.pax.cdi.extension; filter:="(extension=pax-cdi-extension)"
</Require-Capability>
<_removeheaders>
Include-Resource,
Private-Package,
Embed-Dependency,
Embed-Transitive
</_removeheaders>
</instructions>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
</configuration>
异常:
2018-01-07 12:54:31,283 | ERROR | FelixStartLevel | AbstractFacesInitializer | 351 - org.apache.myfaces.core.bundle - 2.2.12 | An error occured while initializing MyFaces: java.lang.reflect.InvocationTargetException
javax.faces.FacesException: java.lang.reflect.InvocationTargetException
at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:544)[351:org.apache.myfaces.core.bundle:2.2.12]
at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:361)[351:org.apache.myfaces.core.bundle:2.2.12]
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:225)[351:org.apache.myfaces.core.bundle:2.2.12]
at org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:695)
at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:595)
at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:416)[351:org.apache.myfaces.core.bundle:2.2.12]
at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:73)[351:org.apache.myfaces.core.bundle:2.2.12]
at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:172)[351:org.apache.myfaces.core.bundle:2.2.12]
at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:121)[351:org.apache.myfaces.core.bundle:2.2.12]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.call(HttpServiceContext.java:354)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.call(HttpServiceContext.java:350)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.callContextInitialized(HttpServiceContext.java:349)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:791)[91:org.eclipse.jetty.server:9.2.21.v20170120]
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)[92:org.eclipse.jetty.servlet:9.2.21.v20170120]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.startContext(HttpServiceContext.java:601)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)[91:org.eclipse.jetty.server:9.2.21.v20170120]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:260)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)[94:org.eclipse.jetty.util:9.2.21.v20170120]
at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.start(JettyServerImpl.java:284)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.end(HttpServiceStarted.java:1096)
at org.ops4j.pax.web.service.internal.HttpServiceProxy.end(HttpServiceProxy.java:417)
at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.end(RegisterWebAppVisitorWC.java:380)
at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:692)
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf.jar:2.4.0.redhat-630283]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)[karaf.jar:2.4.0.redhat-630283]
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[152:org.apache.felix.scr:1.8.4]
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[152:org.apache.felix.scr:1.8.4]
at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:894)[karaf.jar:2.4.0.redhat-630283]
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:943)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:794)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:544)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4445)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.registerService(Felix.java:3431)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:353)[org.apache.felix.framework-4.4.1.jar:]
at org.ops4j.pax.cdi.web.AbstractWebAppDependencyManager.register(AbstractWebAppDependencyManager.java:57)
at org.ops4j.pax.cdi.web.AbstractWebAppDependencyManager.postCreate(AbstractWebAppDependencyManager.java:84)
at org.ops4j.pax.cdi.extender.impl.CdiExtender.doCreateLazyContainer(CdiExtender.java:202)
at org.ops4j.pax.cdi.extender.impl.CdiExtender.handleWebBundles(CdiExtender.java:226)
at org.ops4j.pax.cdi.extender.impl.CdiExtender.setWebAdapter(CdiExtender.java:219)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_151]
at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:231)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.helper.BaseMethod.access0(BaseMethod.java:39)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:624)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:508)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.helper.BindMethod.invoke(BindMethod.java:37)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1608)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:1593)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:382)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.DependencyManager$SingleDynamicCustomizer.addedService(DependencyManager.java:708)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.DependencyManager$SingleDynamicCustomizer.addedService(DependencyManager.java:674)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1480)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1401)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:1210)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:1148)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1432)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:943)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:794)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:544)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4445)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.registerService(Felix.java:3431)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.register(AbstractComponentManager.java:1003)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.register(AbstractComponentManager.java:992)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:134)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:1044)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:841)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:419)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:376)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:172)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:120)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:258)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.Activator.access[=12=]0(Activator.java:45)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:185)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)[152:org.apache.felix.scr:1.8.4]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:479)[152:org.apache.felix.scr:1.8.4]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:414)[152:org.apache.felix.scr:1.8.4]
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)[152:org.apache.felix.scr:1.8.4]
at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:443)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:869)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:790)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:515)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4429)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2100)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)[org.apache.felix.framework-4.4.1.jar:]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_151]
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.8.0_151]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_151]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_151]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_151]
at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:531)[351:org.apache.myfaces.core.bundle:2.2.12]
... 94 more
Caused by: java.lang.NoSuchMethodError: javax.faces.application.ApplicationFactory.<init>(Ljavax/faces/application/ApplicationFactory;)V`
**Pax Extender Exception:**
`2018-01-07 12:54:32,289 | ERROR | FelixStartLevel | WebAppPublisher | 276 - org.ops4j.pax.web.pax-web-extender-war - 4.3.1 | Error deploying web application
java.lang.reflect.MalformedParameterizedTypeException
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:58)[:1.8.0_151]
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:51)[:1.8.0_151]
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:92)[:1.8.0_151]
at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:105)[:1.8.0_151]
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:140)[:1.8.0_151]
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)[:1.8.0_151]
at sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.java:68)[:1.8.0_151]
at java.lang.reflect.Method.getGenericReturnType(Method.java:255)[:1.8.0_151]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedMethod.<init>(BackedAnnotatedMethod.java:38)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedMethod.of(BackedAnnotatedMethod.java:32)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.computeValue(BackedAnnotatedType.java:195)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.computeValue(BackedAnnotatedType.java:188)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.util.LazyValueHolder.get(LazyValueHolder.java:35)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$EagerlyInitializedLazyValueHolder.<init>(BackedAnnotatedType.java:156)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.<init>(BackedAnnotatedType.java:188)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.<init>(BackedAnnotatedType.java:188)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.<init>(BackedAnnotatedType.java:63)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.of(BackedAnnotatedType.java:44)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:83)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:80)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)[129:com.google.guava:18.0.0.redhat-1]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)[129:com.google.guava:18.0.0.redhat-1]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)[129:com.google.guava:18.0.0.redhat-1]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)[129:com.google.guava:18.0.0.redhat-1]
at com.google.common.cache.LocalCache.get(LocalCache.java:3937)[129:com.google.guava:18.0.0.redhat-1]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)[129:com.google.guava:18.0.0.redhat-1]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)[129:com.google.guava:18.0.0.redhat-1]
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:49)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:74)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:175)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:194)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.bootstrap.AnnotatedTypeLoader.loadAnnotatedType(AnnotatedTypeLoader.java:78)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.bootstrap.AnnotatedTypeLoader.loadAnnotatedType(AnnotatedTypeLoader.java:60)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:97)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer.doWork(ConcurrentBeanDeployer.java:65)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer.doWork(ConcurrentBeanDeployer.java:62)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.executor.IterativeWorkerTaskFactory.call(IterativeWorkerTaskFactory.java:63)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.executor.IterativeWorkerTaskFactory.call(IterativeWorkerTaskFactory.java:56)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_151]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_151]
您的问题是由版本不匹配引起的。来自 OmniFaces homepage:
Minimum requirements
- OmniFaces 3.x requires Java 1.8, JSF 2.3, EL 3.0, Servlet 3.1, CDI 2.0, WS 1.1
- OmniFaces 2.x requires Java 1.7, JSF 2.2, EL 2.2, Servlet 3.0, CDI 1.1, WS 1.1
- OmniFaces 1.x requires Java 1.6, JSF 2.0, EL 2.1, Servlet 2.5
MyFaces 2.2.x 是 JSF 2.2,不是 JSF 2.3。
您有 2 个选择:
- 将 MyFaces 升级到 JSF 2.3 兼容版本。目前还没有最终版本。最好的办法是 2.3.0-beta.
- 将 OmniFaces 降级为 JSF 2.2 兼容版本。目前最新的是2.6.8.
jboss-fuse 6.3.0283 上的 myfaces 初始化期间,karaf 中抛出了 InvocationTargetException。这是否意味着 omnifaces 将无法与 myfaces 2.2.12 捆绑包一起正常工作,或者是否有一些依赖 类 未被容器加载?
顺便说一句,我们使用 primefaces 6.1 和 pax-cdi-web-weld 进行 cdi。安装和激活的功能和捆绑包是:
<feature version="1.0.0.RC1-redhat-001">pax-cdi-web-weld</feature>
<bundle>mvn:commons-digester/commons-digester/1.8.1</bundle>
<bundle>mvn:org.apache.myfaces.core/myfaces-bundle/2.2.12</bundle>
<bundle>mvn:org.primefaces/primefaces/6.1</bundle>
<bundle>wrap:mvn:org.primefaces.extensions/primefaces-extensions/6.1.1</bundle>
Felix 插件:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<extensions>true</extensions>
<configuration>
<instructions>
<_wab>src/main/webapp</_wab>
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
<Import-Package>
com.fasterxml.jackson.annotation;version="[2.6,3)",
com.fasterxml.jackson.core;version="[2.6,3)",
com.fasterxml.jackson.databind.module;version="[2.6,3)",
com.fasterxml.jackson.databind;version="[2.6,3)",
com.google.gson;version="[2.2,3)",
javax.annotation;version="[1.2,2)",
javax.crypto,
javax.crypto.spec,
javax.el;version="[2.2,3)",
javax.enterprise.context;version="[1.1,2)",
javax.enterprise.context.spi;version="[1.1,2)",
javax.enterprise.event;version="[1.1,2)",
javax.enterprise.inject.spi;version="[1.1,2)",
javax.faces.application;version="[2.2,3)",
javax.faces.bean;version="[2.2,3)",
javax.faces.component.behavior;version="[2.2,3)",
javax.faces.component.html;version="[2.2,3)",
javax.faces.component.visit;version="[2.2,3)",
javax.faces.component;version="[2.2,3)",
javax.faces.context;version="[2.2,3)",
javax.faces.convert;version="[2.2,3)",
javax.faces.el;version="[2.2,3)",
javax.faces.event;version="[2.2,3)",
javax.faces.lifecycle;version="[2.2,3)",
javax.faces.model;version="[2.2,3)",
javax.faces.render;version="[2.2,3)",
javax.faces.validator;version="[2.2,3)",
javax.faces.view.facelets;version="[2.2,3)",
javax.faces.view;version="[2.2,3)",
javax.faces.webapp;version="[2.2,3)",
javax.faces;version="[2.2,3)",
javax.inject,
javax.naming,
javax.servlet.http;version="[3.1,4)",
javax.servlet.jsp.jstl.core;version=1.2,
javax.servlet.jsp.jstl.fmt;version=1.2,
javax.servlet.jsp.jstl.tlv;version=1.2,
javax.servlet.jsp;version="[2.2.0,3.0.0)",
javax.servlet;version="[3.1,4)",
javax.websocket,
javax.websocket.server,
javax.xml.parsers,
org.apache.commons.lang3,
org.apache.commons.logging,
org.apache.taglibs.standard.resources;version=1.1.2,
org.apache.taglibs.standard.tag.common.core;version=1.1.2,
org.apache.taglibs.standard.tag.rt.core;version=1.1.2,
org.apache.taglibs.standard.tei;version=1.1.2,
org.apache.taglibs.standard.tlv;version=1.1.2,
org.jboss.weld.bean.builtin;version="[2.3,3)",
org.jboss.weld.el;version="[2.3,3)",
org.jboss.weld.manager;version="[2.3,3)",
org.jboss.weld.servlet;version="[2.3,3)",
org.jboss.weld.util;version="[2.3,3)",
org.ops4j.pax.cdi.api;version="[1.0,2)",
org.osgi.framework;version="[1.7,2)",
org.osgi.service.blueprint.container;version="[1.0,2)",
org.osgi.service.log;version="[1.3,2)",
org.osgi.util.tracker;version="[1.5,2)",
org.primefaces.context;version="[6.1,7)",
org.primefaces.event;version="[6.1,7)",
org.slf4j;version="[1.7,2)",
org.w3c.dom,
org.xml.sax,
org.xml.sax.ext,
org.xml.sax.helpers
</Import-Package>
<Export-Package>!*</Export-Package>
<Bundle-Classpath>
WEB-INF/classes,
WEB-INF/lib/all-themes-1.0.10.jar,
WEB-INF/lib/commons-lang3-3.7.jar,
WEB-INF/lib/aspectjrt-1.8.9.jar,
WEB-INF/lib/resources-codemirror-6.1.1.jar,
WEB-INF/lib/omnifaces-3.0.jar
</Bundle-Classpath>
<Web-ContextPath>${web.context.path}</Web-ContextPath>
<Require-Bundle>
org.primefaces;visibility:=reexport,
org.apache.myfaces.core.bundle;visibility:=reexport,
wrap_mvn_org.primefaces.extensions_primefaces-extensions_6.1.1;visibility:=reexport
</Require-Bundle>
<Require-Capability>
osgi.extender; filter:="(osgi.extender=pax.cdi)",org.ops4j.pax.cdi.extension; filter:="(extension=pax-cdi-extension)"
</Require-Capability>
<_removeheaders>
Include-Resource,
Private-Package,
Embed-Dependency,
Embed-Transitive
</_removeheaders>
</instructions>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
</configuration>
异常:
2018-01-07 12:54:31,283 | ERROR | FelixStartLevel | AbstractFacesInitializer | 351 - org.apache.myfaces.core.bundle - 2.2.12 | An error occured while initializing MyFaces: java.lang.reflect.InvocationTargetException
javax.faces.FacesException: java.lang.reflect.InvocationTargetException
at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:544)[351:org.apache.myfaces.core.bundle:2.2.12]
at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:361)[351:org.apache.myfaces.core.bundle:2.2.12]
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:225)[351:org.apache.myfaces.core.bundle:2.2.12]
at org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:695)
at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:595)
at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:416)[351:org.apache.myfaces.core.bundle:2.2.12]
at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:73)[351:org.apache.myfaces.core.bundle:2.2.12]
at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:172)[351:org.apache.myfaces.core.bundle:2.2.12]
at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:121)[351:org.apache.myfaces.core.bundle:2.2.12]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.call(HttpServiceContext.java:354)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.call(HttpServiceContext.java:350)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.callContextInitialized(HttpServiceContext.java:349)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:791)[91:org.eclipse.jetty.server:9.2.21.v20170120]
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)[92:org.eclipse.jetty.servlet:9.2.21.v20170120]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.startContext(HttpServiceContext.java:601)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)[91:org.eclipse.jetty.server:9.2.21.v20170120]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:260)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)[94:org.eclipse.jetty.util:9.2.21.v20170120]
at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.start(JettyServerImpl.java:284)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.end(HttpServiceStarted.java:1096)
at org.ops4j.pax.web.service.internal.HttpServiceProxy.end(HttpServiceProxy.java:417)
at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.end(RegisterWebAppVisitorWC.java:380)
at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:692)
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)
at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf.jar:2.4.0.redhat-630283]
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)[karaf.jar:2.4.0.redhat-630283]
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[152:org.apache.felix.scr:1.8.4]
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[152:org.apache.felix.scr:1.8.4]
at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:894)[karaf.jar:2.4.0.redhat-630283]
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:943)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:794)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:544)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4445)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.registerService(Felix.java:3431)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:353)[org.apache.felix.framework-4.4.1.jar:]
at org.ops4j.pax.cdi.web.AbstractWebAppDependencyManager.register(AbstractWebAppDependencyManager.java:57)
at org.ops4j.pax.cdi.web.AbstractWebAppDependencyManager.postCreate(AbstractWebAppDependencyManager.java:84)
at org.ops4j.pax.cdi.extender.impl.CdiExtender.doCreateLazyContainer(CdiExtender.java:202)
at org.ops4j.pax.cdi.extender.impl.CdiExtender.handleWebBundles(CdiExtender.java:226)
at org.ops4j.pax.cdi.extender.impl.CdiExtender.setWebAdapter(CdiExtender.java:219)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_151]
at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:231)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.helper.BaseMethod.access0(BaseMethod.java:39)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:624)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:508)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.helper.BindMethod.invoke(BindMethod.java:37)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1608)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:1593)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:382)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.DependencyManager$SingleDynamicCustomizer.addedService(DependencyManager.java:708)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.DependencyManager$SingleDynamicCustomizer.addedService(DependencyManager.java:674)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1480)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1401)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:1210)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:1148)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1432)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:943)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:794)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:544)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4445)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.registerService(Felix.java:3431)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.register(AbstractComponentManager.java:1003)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.register(AbstractComponentManager.java:992)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:134)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:1044)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:841)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:419)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:376)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:172)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:120)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:258)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.Activator.access[=12=]0(Activator.java:45)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:185)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)[152:org.apache.felix.scr:1.8.4]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:479)[152:org.apache.felix.scr:1.8.4]
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:414)[152:org.apache.felix.scr:1.8.4]
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)[152:org.apache.felix.scr:1.8.4]
at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:443)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:869)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:790)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:515)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4429)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2100)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)[org.apache.felix.framework-4.4.1.jar:]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_151]
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.8.0_151]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_151]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_151]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_151]
at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:531)[351:org.apache.myfaces.core.bundle:2.2.12]
... 94 more
Caused by: java.lang.NoSuchMethodError: javax.faces.application.ApplicationFactory.<init>(Ljavax/faces/application/ApplicationFactory;)V`
**Pax Extender Exception:**
`2018-01-07 12:54:32,289 | ERROR | FelixStartLevel | WebAppPublisher | 276 - org.ops4j.pax.web.pax-web-extender-war - 4.3.1 | Error deploying web application
java.lang.reflect.MalformedParameterizedTypeException
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:58)[:1.8.0_151]
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:51)[:1.8.0_151]
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:92)[:1.8.0_151]
at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:105)[:1.8.0_151]
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:140)[:1.8.0_151]
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)[:1.8.0_151]
at sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.java:68)[:1.8.0_151]
at java.lang.reflect.Method.getGenericReturnType(Method.java:255)[:1.8.0_151]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedMethod.<init>(BackedAnnotatedMethod.java:38)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedMethod.of(BackedAnnotatedMethod.java:32)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.computeValue(BackedAnnotatedType.java:195)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.computeValue(BackedAnnotatedType.java:188)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.util.LazyValueHolder.get(LazyValueHolder.java:35)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$EagerlyInitializedLazyValueHolder.<init>(BackedAnnotatedType.java:156)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.<init>(BackedAnnotatedType.java:188)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.<init>(BackedAnnotatedType.java:188)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.<init>(BackedAnnotatedType.java:63)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.of(BackedAnnotatedType.java:44)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:83)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:80)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)[129:com.google.guava:18.0.0.redhat-1]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)[129:com.google.guava:18.0.0.redhat-1]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)[129:com.google.guava:18.0.0.redhat-1]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)[129:com.google.guava:18.0.0.redhat-1]
at com.google.common.cache.LocalCache.get(LocalCache.java:3937)[129:com.google.guava:18.0.0.redhat-1]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)[129:com.google.guava:18.0.0.redhat-1]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)[129:com.google.guava:18.0.0.redhat-1]
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:49)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:74)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:175)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:194)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.bootstrap.AnnotatedTypeLoader.loadAnnotatedType(AnnotatedTypeLoader.java:78)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.bootstrap.AnnotatedTypeLoader.loadAnnotatedType(AnnotatedTypeLoader.java:60)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:97)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer.doWork(ConcurrentBeanDeployer.java:65)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer.doWork(ConcurrentBeanDeployer.java:62)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.executor.IterativeWorkerTaskFactory.call(IterativeWorkerTaskFactory.java:63)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.executor.IterativeWorkerTaskFactory.call(IterativeWorkerTaskFactory.java:56)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_151]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_151]
您的问题是由版本不匹配引起的。来自 OmniFaces homepage:
Minimum requirements
- OmniFaces 3.x requires Java 1.8, JSF 2.3, EL 3.0, Servlet 3.1, CDI 2.0, WS 1.1
- OmniFaces 2.x requires Java 1.7, JSF 2.2, EL 2.2, Servlet 3.0, CDI 1.1, WS 1.1
- OmniFaces 1.x requires Java 1.6, JSF 2.0, EL 2.1, Servlet 2.5
MyFaces 2.2.x 是 JSF 2.2,不是 JSF 2.3。
您有 2 个选择:
- 将 MyFaces 升级到 JSF 2.3 兼容版本。目前还没有最终版本。最好的办法是 2.3.0-beta.
- 将 OmniFaces 降级为 JSF 2.2 兼容版本。目前最新的是2.6.8.