PUBLICIDADE
alguem pode me ajudar?
estol tentando criar uma persistencia, baseado no tutorial:
http://www.netbeans.org/kb/55/persistence_ontomcat.html
tanto usando TopLink como com Hibernate esta dando este erro, cannot
find simbol “getELContext()”
fonte no metodo: getAsObject
da classe: AnimalConverter.java que foi criada pelo NetBeans
package entityes;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
public Object getAsObject(FacesContext facesContext, UIComponent
uIComponent, String string) {
if (string == null) {
return null;
}
Integer id = new Integer(string);
AnimalController controller = (AnimalController)
facesContext.getApplication().getELResolver().getValue(
facesContext.getELContext(), null, “animal”);
return controller.findAnimal(id);
}
erro:
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
Compiling 1 source file to C:\Java\teste\AplicacaoWeb5\build\web\WEB-
INF\classes
C:\Java\teste\AplicacaoWeb5
\src\java\entityes\AnimalConverter.java:32: cannot find symbol
symbol : method getELContext()
location: class javax.faces.context.FacesContext
facesContext.getELContext(), null, “animal”);
C:\Java\teste\AplicacaoWeb5
\src\java\entityes\AnimalConverter.java:31: cannot find symbol
symbol : method getELResolver()
location: class javax.faces.application.Application
AnimalController controller = (AnimalController)
facesContext.getApplication().getELResolver().getValue(
2 errors
C:\Java\teste\AplicacaoWeb5\nbproject\build-impl.xml:323: The
following error occurred while executing this line:
C:\Java\teste\AplicacaoWeb5\nbproject\build-impl.xml:149: Compile
failed; see the compiler error output for details.
FALHA NA EXECUÇÃO (tempo total: 0 segundos)