File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes ReferenceSyntaxException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "ReferenceSyntaxException" Watch "ReferenceSyntaxException" New topic
Author

ReferenceSyntaxException

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi guys! I'm trying to access a managed bean from a PhaseListener. I have a utility class that I created so getting a managed bean would be as easy as ABC. The utility class looks like this





My PhaseListener looks like this



my managedbean in faces-config.xml




and I'm getting this exception...



type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: loginInfo
javax.faces.webapp.FacesServlet.service(FacesServlet.java:202)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)


root cause

javax.faces.el.ReferenceSyntaxException: loginInfo
com.sun.faces.application.ApplicationImpl.createValueBinding(ApplicationImpl.java:281)
com.wp.wpinventory.util.http.jsf.HttpJSFUtil.getManagedBean(HttpJSFUtil.java:48)
com.wp.wpinventory.listener.SessionPhaseListener.afterPhase(SessionPhaseListener.java:55)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:211)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.




We don't seem to have much activity here in the JSF forum but I hope someone could explain to me what I'm dong wrong. Thanks!
[ May 09, 2007: Message edited by: Timothy Sam ]

SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
Ravindra Rawat
Ranch Hand

Joined: Dec 09, 2004
Posts: 34
Commented code has the answer.



getApplication().createValueBinding expects an value expression like '#{..}' as in the commented code.

But you are passing the variable name from the listener. If you intend to that then you should have a look at ..getApplication().getVariableResolver().

Thanks
Ravindra
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Thanks! It worked!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ReferenceSyntaxException