Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ReferenceSyntaxException

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ravindra Rawat
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! It worked!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic