permaculture playing cards*
The moose likes JSF and the fly likes Funny exception with StringBuffer with jsf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Funny exception with StringBuffer with jsf" Watch "Funny exception with StringBuffer with jsf" New topic
Author

Funny exception with StringBuffer with jsf

Luis Vazquez
Greenhorn

Joined: Dec 15, 2010
Posts: 1
Hi, I am really freaking out with an exception i can't solve during this 4 last days,and I must develop the project that will change the world. I'm using maven myfaces + tomahawk + spring. This is the exception i get when de application is run with jetty maven plugin:


com.sun.facelets.FaceletViewHandler handleRenderException
GRAVE: Error Rendering View[null]
java.lang.NullPointerException
at java.lang.StringBuffer.<init>(StringBuffer.java:103)
at com.sun.facelets.FaceletViewHandler.getRenderedViewId(FaceletViewHandler.java:763)
at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:505)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101)
at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:221)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:85)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:286)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:349)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)

Obviously i tried to search for a solution on Google but i did not suceed.


I will apreciatte a lot a solution.

PD: I attach pom.xml and web.xml. Oops,by the way,¡m on mac. Sorry for my english,i'm working on it.

Thanks in advance.

pom.xml:


web.xml:

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

You are attempting to execute the following code:

There's nothing wrong with StringBuffer except that it doesn't want a null argument, it wants a valid String argument.

Now comes the frustrating part. None of that code is your code and the null argument value itself is probably coming from a non-obvious place. For example, you might have a null drop-down menu list.

You can check the JSF page for possible problems. You can check the backing bean(s) to make sure that they don't return null properties. Maybe you'll get lucky.

A lot of times I don't, however and I end up having to set an IDE breakpoint to catch the exception, then start looking at stack frames in the hope that they'll lead me to the offending component.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
jQuery in Action, 2nd edition
 
subject: Funny exception with StringBuffer with jsf
 
Similar Threads
JSF 2 - Problem with ManagedBean
Spring Major version '3' expected
Maven web project dependencies
Could not resolve dependencies for maven project
Maven dependencies