0
votes

I am making a maven project using JSF 2.2, Primefaces 6.2 on Eclipse. I recieved the following error when I tried to use <p:chips id="chips" /> that is displayed on Primefaces' website:

javax.servlet.ServletException: org.primefaces.context.RequestContext.getCurrentInstance(Ljavax/faces/context/FacesContext;)Lorg/primefaces/context/RequestContext;

Even though I have removed the changes I made on my .xhmtl page and took it all the way back where it was running, I still receive the same error and my webpage is not running.

Here is my pom.xml for primefaces component:

<!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>6.2</version>
        </dependency>

Could that be some kind of Eclipse - Maven compile error? I have cleaned, re- built the project and even deleted .m2 file but nothing changed. All help will be appreciated.

Also here is the exception and stack trace:

2018-05-15T08:34:34.986+0300|Warning: StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception java.lang.NoSuchMethodError: org.primefaces.context.RequestContext.getCurrentInstance(Ljavax/faces/context/FacesContext;)Lorg/primefaces/context/RequestContext; at org.primefaces.util.AutoUpdateComponentPhaseListener.beforePhase(AutoUpdateComponentPhaseListener.java:35) at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283) at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167) 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:235) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536) 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:591) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571) at java.lang.Thread.run(Thread.java:748)

1
Is there any additional stack trace for that exception? What is the actual exception details? A ServletException can happen for any number of reasons.Paul Nicolucci
I have added stack trace to my question. You can find it above.KontrCode
As far as I can tell version 6.2 added the method in question. Do you have an older version in your application perhaps? Perhaps in the web-inf/lib? RequestContext 6.2 and RequestContext 6.1Paul Nicolucci

1 Answers

1
votes

As far as I can tell version 6.2 added the method in question. Perhaps you have an older version in your application? Check in the web-inf/lib directory. For reference: RequestContext 6.2 and RequestContext 6.1