I am trying to a attach handler to spark UI using this code:
private def getSparkUI(sparkContext: SparkContext): SparkUI = {
sparkContext.ui.getOrElse {
throw new SparkException("Parent SparkUI to attach this tab to not found!")
}
}
import org.apache.spark.ui.JettyUtils.createServletHandler
val ui = getSparkUI(sparkContext)
val graphHttpServlet = new GraphHttpServlet("/graph/", sessionUtils)
val handler = createServletHandler("/graph/", graphHttpServlet, "")
ui.attachHandler(handler)
this code fails to compile with error:
Error:(20, 19) Symbol 'type org.eclipse.jetty.servlet.ServletContextHandler' is missing from the classpath.
This symbol is required by 'method org.apache.spark.ui.JettyUtils.createServletHandler'.
Make sure that type ServletContextHandler is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'JettyUtils.class' was compiled against an incompatible version of org.eclipse.jetty.servlet.
val handler = createServletHandler("/graph/", graphHttpServlet, "")
I know that spark shades jetty dependencies into a new package: org.spark_project.jetty.servlet.ServletContextHandler
I also decompile the jar and check that the jar has the shaded dependencies.
But why the compiler failed to see that? How I can attach the handler?
Also, faced similar issue and figured out after few experiments. Adding shade rule for org.eclipse.jetty libraries solves this issue.
This solves below exceptions:
java.lang.NoSuchMethodError: 'void org.apache.spark.ui.WebUI.attachHandler(org.eclipse.jetty.servlet.ServletContextHandler)'
java.lang.ClassCastException: class org.sparkproject.jetty.servlet.ServletContextHandler cannot be cast to class org.eclipse.jetty.servlet.ServletContextHandler (org.sparkproject.jetty.servlet.ServletContextHandler and org.eclipse.jetty.servlet.ServletContextHandler are in unnamed module of loader 'app')
sbt rule
assemblyShadeRules in assembly := Seq(
ShadeRule
.rename("org.eclipse.jetty.**" -> "org.sparkproject.jetty.#1")
.inAll
)
Maven rule
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<artifactSet>
<includes>
<include>org.eclipse.jetty:jetty-io</include>
<include>org.eclipse.jetty:jetty-http</include>
<include>org.eclipse.jetty:jetty-proxy</include>
<include>org.eclipse.jetty:jetty-client</include>
<include>org.eclipse.jetty:jetty-continuation</include>
<include>org.eclipse.jetty:jetty-servlet</include>
<include>org.eclipse.jetty:jetty-servlets</include>
<include>org.eclipse.jetty:jetty-plus</include>
<include>org.eclipse.jetty:jetty-security</include>
<include>org.eclipse.jetty:jetty-util</include>
<include>org.eclipse.jetty:jetty-server</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.eclipse.jetty</pattern>
<shadedPattern>org.sparkproject.jetty</shadedPattern>
<includes>
<include>org.eclipse.jetty.**</include>
</includes>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
During myfaces initialization on jboss-fuse 6.3.0283, InvocationTargetException has been thrown in karaf. Does that mean omnifaces will not properly work with myfaces 2.2.12 bundle or are there some dependent classes which are not loaded by the container?
By the way, we are using primefaces 6.1 and pax-cdi-web-weld for cdi. The features and bundles which installed and active are:
<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:
<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>
Exception:
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$3.call(HttpServiceContext.java:354)[115:org.ops4j.pax.web.pax-web-jetty:4.3.1]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext$3.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$1.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.access$500(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$3.register(AbstractComponentManager.java:1003)[152:org.apache.felix.scr:1.8.4]
at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.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$000(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$1.doWork(ConcurrentBeanDeployer.java:65)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:62)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)[348:org.jboss.weld.osgi-bundle:2.3.2.Final]
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.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]
Your problem is caused by a version mismatch. From the 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 is JSF 2.2, not JSF 2.3.
You have 2 options:
Upgrade MyFaces to a JSF 2.3 compatible version. This is currently not available yet as final version. Best what you can try is 2.3.0-beta.
Downgrade OmniFaces to a JSF 2.2 compatible version. Currently the latest is 2.6.8.
For some reason my locally stored font is not being decoded correctly in my jsf application. I've tried everything, and at this point I'm at a loss.
This is the css reference (located in project/resources/text - same as font files)
#font-face {
font-family: 'BunkenTechSansStd-Med';
src: url("#{resource['text/30B733_0_0.eot']}");
src: url("#{resource['text/30B733_0_0.woff2']}") format('woff2'),
url("#{resource['text/30B733_0_0.woff']}") format('woff'),
url("#{resource['text/30B733_0_0.ttf']}") format('truetype');
}
The sheet is referenced in the template as:
<h:outputStylesheet library="text" name="MyFontsWebfontsKit.css"></h:outputStylesheet>
<h:outputStylesheet library="css" name="style.css"></h:outputStylesheet>
The error I'm receiving in chrome is stated as follows (for all three files):
"failed to decode downloaded font: http://localhost:1717/javax.faces.resource/text/30B733_0_0.woff2.jsf"
Here's is the folder structure:
Furthermore the mapping is as follows:
<mime-mapping>
<extension>eot</extension>
<mime-type>application/vnd.ms-fontobject</mime-type>
</mime-mapping>
<mime-mapping>
<extension>otf</extension>
<mime-type>font/opentype</mime-type>
</mime-mapping>
<mime-mapping>
<extension>svg</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
<mime-mapping>
<extension>ttf</extension>
<mime-type>application/x-font-ttf</mime-type>
</mime-mapping>
<mime-mapping>
<extension>woff</extension>
<mime-type>application/x-font-woff</mime-type>
</mime-mapping>
<mime-mapping>
<extension>woff2</extension>
<mime-type>application/x-font-woff2</mime-type>
</mime-mapping>
And lastly a pic of the error in dev tools:
JSF apparently requires folder nav as ":" instead of backslashes.
#font-face {font-family: 'BunkenTechSansStd-Med'; src: url("#{resource['text:30B733_0_0.eot']}");
src: url("#{resource['text:30B733_0_0.woff2']}") format('woff2'),
url("#{resource['text:30B733_0_0.woff']}") format('woff'),
url("#{resource['text:30B733_0_0.ttf']}") format('truetype');}
For my webapp i'm trying to introduce the richface skinning.
I'm getting an error that leaves me clueless.
Old situation (works) :
messages.css
#inhoud #infoblock {
min-height:36px;
width:100%;
background:#B1D1FA url(#{resource['image/helpmelding.gif']});
padding:2px 0;
background-position: 3px center;
}
New situation (Doesn't work correctly)
messages.ecss
#inhoud #infoblock {
background-color:'#{richSkin.infoBlockBackground}';
padding:2px 0;
background-image:url(#{resource['image/helpmelding.gif']});
background-position: 3px center;
background-repeat:no-repeat;
min-height:36px;
width:100%;
}
result:
*#inhoud *#infoblock {
background-color: #B1D1FA;
padding:2px 0;
}
Stopped css parsing when hitting
#{resource['image/helpmelding.gif']}
Logger:
WARNING: Problem parsing 'messages.ecss' resource: Error in expression.
Invalid token "#". Was expecting one of: <S>, "+", "-", <HASH>, <STRING>, <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>,
<LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMEN>,
<PERCENTAGE>, <NUMBER>, "rgb(", <FUNCTION>, <IDENT>, <UNICODERANGE>.
mei 06, 2014 2:25:42 PM org.richfaces.resource.CompiledCSSResource$ErrorHandlerImpl logException
Settings
web.xml
<!-- Resource Servlet van Richfaces-->
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>org.richfaces.webapp.ResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/org.richfaces.resources/*</url-pattern>
</servlet-mapping>
pom.xml
<plugin>
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-richfaces-resources-plugin</artifactId>
<version>${org.richfaces.bom.version}</version>
<configuration>
<skins>
<!-- the name of your skin -->
<skin>LUID</skin>
</skins>
<excludedFiles>
<exclude>^\Qorg.richfaces.renderkit.html.images.\E.*</exclude>
<exclude>^\Qorg.richfaces.renderkit.html.iconimages.\E.*</exclude>
<exclude>^\Qorg.richfaces.renderkit.html.iconimages.\E.*</exclude>
</excludedFiles>
<includedContentTypes>
<include>application/javascript</include>
<include>text/css</include>
<include>image/.+</include>
</includedContentTypes>
<fileNameMappings>
<property>
<name>^.*showcase.*/([^/]+\.css)$</name>
<value>org.richfaces.luid.css/$1</value>
</property>
<property>
<name>^.+/([^/]+\.(png|gif|jpg))$</name>
<value>org.richfaces.images/$1</value>
</property>
<property>
<name>^.+/([^/]+\.css)$</name>
<value>org.richfaces.css/$1</value>
</property>
</fileNameMappings>
</configuration>
....
</plugin>
As the error tells you, the url cannot start with a '#'. You need to wrap it in quotes:
background-image: url("#{resource['image/helpmelding.gif']}");
I have a very simple Mule (3.x) flow:
<spring:bean name="messageHandler" class="mypackage.MessageHandler"/>
<flow name="main">
<vm:inbound-endpoint path="in" exchange-pattern="request-response"/>
<component>
<spring-object bean="messageHandler"/>
</component>
<vm:outbound-endpoint path="out"/>
</flow>
where messageHandler is a simple Groovy class:
class MessageHandler {
String handleMessage(String xml) {
return xml + " Received";
}
}
When I execute the test I get:
org.mule.model.resolvers.EntryPointNotFoundException: Failed to find entry point for component, the following resolvers tried but failed:[ ... ReflectionEntryPointResolver: Could not find entry point on: "mypackage.MessageHandler" with arguments: "{class java.lang.String}" ... ]
but when I use Java class it works!! (Also works with Callable interface on groovy class).
I'm using gmaven plugin for groovy compling:
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<extensions>true</extensions>
<inherited>true</inherited>
<executions>
<execution>
<goals>
<goal>generateStubs</goal>
<goal>compile</goal>
<goal>generateTestStubs</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
What could be the problem here?
Try adding the logger element in the flow before the component to see what's coming into the component.