No Such Method Error

UI Components for JSF
Post Reply
madhuraj
Posts: 5
Joined: 10 Apr 2013, 14:23

10 Apr 2013, 15:16

Dear All,

I am very New to Primefaces and i am using below jars for my project.

PrimeFaces3.5
JSF-API 2.0.3
JSF-Core2.0.3
WebSphere 6.1
RAD 7.5

i am getting below error message:

Code: Select all

WebApp        E   [Servlet Error]-[Faces Servlet]: java.lang.NoSuchMethodError: javax/faces/context/FacesContext.getAttributes()Ljava/util/Map;
	at org.primefaces.lifecycle.RestoreViewPhaseListener.afterPhase(RestoreViewPhaseListener.java:30)
	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:228)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1101)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:569)
	at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1461)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:118)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
my Files are:
web.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 
  <display-name>PrimeFaces Web Application</display-name>
 
  	<!-- Change to "Production" when you are ready to deploy -->
	<context-param>
		<param-name>javax.faces.PROJECT_STAGE</param-name>
		<param-value>Development</param-value>
	</context-param>
 
	<!-- Welcome page -->
	<welcome-file-list>
		<welcome-file>index.xhtml</welcome-file>
	</welcome-file-list>
 
	<!-- JSF mapping -->
	<servlet>
		<servlet-name>Faces Servlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
 
	<!-- Map these files with JSF -->
	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>/faces/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>*.faces</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>*.xhtml</url-pattern>
	</servlet-mapping>
 
</web-app>
index.xhtml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
 
<h:head>
</h:head>
<h:body>
	<h1>Hello World PrimeFaces</h1>
 
	<h:form>
	   <p:editor value="#{editor.value}" />
	</h:form>
 
</h:body>
</html>
EditorBean.java

Code: Select all

import javax.faces.bean.ManagedBean;

@ManagedBean(name = "editor")
public class EditorBean {
 
	private String value = "This editor is provided by PrimeFaces";
 
	public String getValue() {
		return value;
	}
 
	public void setValue(String value) {
		this.value = value;
	}
}
Please help on this, i strucked on this issue from past 3 days.

Thanks in Advace.
-Madhu.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

10 Apr 2013, 15:29

AFAICS it still references JSF 1.x API.
Ask the Websphere guys how you can upgrade your JSF api/impl.
This is not PrimeFaces related.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

llech
Posts: 236
Joined: 29 Nov 2012, 11:29
Location: DE, Bayern
Contact:

11 Apr 2013, 11:14

On WebSphere 7 it is possible by putting MyFaces 2.0 in shared library, there are some tutorials to be googled... I've googled it once, but I haven't saved the link.

As for WebSphere 6, I don't know if it is possible. If not, it's good for you. You can than easy convince your boss to use Tomcat :D
PrimeFaces 3.4/3.5, MyFaces 2.0.7, IBM WebSphere 7.0

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

11 Apr 2013, 11:31

llech wrote:As for WebSphere 6, I don't know if it is possible. If not, it's good for you. You can than easy convince your boss to use Tomcat :D
And then manually add jpa, jta, jms etc... ;)

Edit:

Disclaimer: this was meant as a joke, don't try this at home :lol:
Last edited by kukeltje on 11 Apr 2013, 14:35, edited 1 time in total.

rikup
Posts: 459
Joined: 29 Jan 2013, 14:27

11 Apr 2013, 14:30

And then manually add jpa, jta, jms etc... ;)
IMO that's dangerous thing to joke about, some poor guy might actually do that...
PrimeNG 2.0.0
Angular 2.4.5

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

11 Apr 2013, 14:34

Ooops, sorry... Disclaimer added ;)

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

11 Apr 2013, 15:39

kukeltje wrote:
llech wrote:As for WebSphere 6, I don't know if it is possible. If not, it's good for you. You can than easy convince your boss to use Tomcat :D
And then manually add jpa, jta, jms etc... ;)

Edit:

Disclaimer: this was meant as a joke, don't try this at home :lol:
Try this at home instead:- use TomcatEE.

WebSphere 6.1 is practically hammer and chisel technology too.

Warning: if you include a JSF implementation library in your project with it being deployed then this can cause havoc at runtime and is often the cause of such headaches.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

llech
Posts: 236
Joined: 29 Nov 2012, 11:29
Location: DE, Bayern
Contact:

11 Apr 2013, 22:39

I was serious :D

I know no person happy with WebSphere. It is heavy, requires IBM RAD which is even slower than normal Eclipse, and extremally full of refreshing issues when you use includes... Tomcat starts much much faster, and initial effort with setting up Spring+Hibernate loans itself after a time... Development is much faster, you have less idle time waiting for redeploy. Well, I'm writing from my personal experience and I know that many people enjoy that idle time...
PrimeFaces 3.4/3.5, MyFaces 2.0.7, IBM WebSphere 7.0

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

12 Apr 2013, 09:31

Yes, we know you were serious in advising against websphere 6... As we are all...

The difference is, is that most of us advise against going for a plain old tomcat server and adding spring and hibernate... It might pay off in the end/long run, but if want to integrate other franeworks that e.g. require real solid transaction management (like any real enterprise app does) adding jta into the mix, and maybe some simple jms for async stuff, it blows up in your face... Going for a real modern EE server with jpa, cdi and all the other things as well, pays of immediately. It starts almost as quick as a plain tomcat server and if you take bootstrapping spring into account it even has your application running quicker...

So these days: go JEE

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 90 guests