List Info

Thread: Re: NPEs when loading css/js




Re: NPEs when loading css/js
user name
2008-04-14 18:51:00
On Mon, Apr 14, 2008 at 05:19:43PM +0100, Simon Brown
wrote:
> Hi Brendan,
> 
> I don't know how much servlets/JSP experience you have,
but basically,
> the "filters" defined in the /WEB-INF/web.xml
file (e.g.
> TransformingFilter, DispatchingFilter, GZIPFilter) are
executed upon
> every request. 

Alright.  Maybe it's a Jetty thing then.  I'll write a test
servlet/jsp
page that does nothing but return a static page with a css
file to test 
this hypothesis.

> There shouldn't be much happening for the CSS and JS
> files though because they are publicly accessible from
the web
> application (i.e. they are served up directly).

Are they?  Some of the css/js files are part of the pebble
distribution
inside the war; whereas some of them are custom ones of mine
(in
/usr/share/jetty/pebble/blogs/default/theme) that also have
the problem.

> I *still* can't get Pebble to deploy on Jetty! Which
version are you
> using? (Java and Jetty and OS?)

brmillerevo:~$ cat /etc/issue.net
Ubuntu 7.10
brmillerevo:~$ uname -a
Linux evo 2.6.22-14-server #1 SMP Sun Oct 14 23:34:23 GMT
2007 i686 GNU/Linux
brmillerevo:~$ java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode,
sharing)
brmillerevo:~$ dpkg -l jetty6 | grep jetty6
ii  jetty6                    6.1.8-1                   Java
servlet engine and webserver

> Cheers
> Simon
> p.s. I'm going to be out of the office for the rest of
the week, so I
> recommend using the mailing list if you need a quick
response from
> people.

I wrote to you because I didn't think anyone else knew. 

But here it is--if anyone is using Jetty, please let me
know.

Brendan

> On Fri, Apr 11, 2008 at 8:26 PM, Brendan Miller
<pebblebdkk.net> wrote:
> >
> >  Simon:
> >
> >  I'm writing today because I'm still having these
NullPointerExceptions
> >  which result in the loss of all .css and .js when
my site is rendered.
> >  I've tried to look at it myself, but I'm not
familiar enough with the
> >  pebble source to know where to start.
> >
> >  A sample stack trace is below.  It seems this is
the reason that I get
> >  no stylesheet, as it looks like it is on the GET
request of /pebble.css.
> >  (There is an identical NPE stack trace for each
of the other css and js
> >  files.)  I'm not sure if this is a Pebble issue
or a Jetty
> >  issue--obviously people have it working under
Tomcat, so I'm wondering
> >  if I'm missing a piece to my Jetty configuration.
 I'd really like to
> >  get this running under Jetty, and I'd like to
contribute the
> >  documentation (whatever surfaces) to your project
for HOWTO Run Pebble
> >  Under Jetty when I'm done.
> >
> >  So, could you help me out with the relation
between the initial GET
> >  request by the browser (for pebble.css, for
example) and all this
> >  GZIPFilter/GZIPResponseWrapper stuff?  This is
the part I don't
> >  understand.  I'm a java developer by trade, so I
keep telling myself I
> >  should be able to figure this out--I just need a
little overview of
> >  what's going on in these stacktraces to be able
to know which piece of
> >  code to read/debug.
> >
> >  Thanks,
> >  Brendan
> >
> >
> >  2008-04-11 12:29:35.767::WARN:  Nested in
javax.servlet.ServletException:
java.lang.NullPointerException:
> >  java.lang.NullPointerException
> >         at
net.sourceforge.pebble.web.filter.GZIPResponseWrapper.flushB
uffer(GZIPResponseWrapper.java:70)
> >         at
org.mortbay.jetty.servlet.DefaultServlet.passConditionalHead
ers(DefaultServlet.java:553)
> >         at
org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServle
t.java:405)
> >         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

> >         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

> >         at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder
.java:487)
> >         at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl
er.java:362)
> >         at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHa
ndler.java:216)
> >         at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandl
er.java:181)
> >         at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandl
er.java:726)
> >         at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.
java:405)
> >         at
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java
:285)
> >         at
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java
:126)
> >         at
net.sourceforge.pebble.web.filter.DispatchingFilter.doFilter
(DispatchingFilter.java:80)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
net.sourceforge.pebble.web.filter.LoggingFilter.doFilter(Log
gingFilter.java:115)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
net.sourceforge.pebble.web.filter.PreProcessingFilter.doFilt
er(PreProcessingFilter.java:172)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:264)
> >         at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.in
voke(FilterSecurityInterceptor.java:107)
> >         at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.do
Filter(FilterSecurityInterceptor.java:72)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:274)
> >         at
net.sourceforge.pebble.security.PrivateBlogSecurityIntercept
or.invoke(PrivateBlogSecurityInterceptor.java:110)
> >         at
net.sourceforge.pebble.security.PrivateBlogSecurityIntercept
or.doFilter(PrivateBlogSecurityInterceptor.java:79)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:274)
> >         at
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(Exc
eptionTranslationFilter.java:110)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:274)
> >         at
org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.d
oFilter(RememberMeProcessingFilter.java:135)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:274)
> >         at
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(Abstr
actProcessingFilter.java:217)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:274)
> >         at
org.acegisecurity.context.HttpSessionContextIntegrationFilte
r.doFilter(HttpSessionContextIntegrationFilter.java:191)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:274)
> >         at
org.acegisecurity.util.FilterChainProxy.doFilter(FilterChain
Proxy.java:148)
> >         at
org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBe
anProxy.java:90)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
net.sourceforge.pebble.web.filter.TransformingFilter.doFilte
r(TransformingFilter.java:127)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
net.sourceforge.pebble.web.filter.BlogLookupFilter.doFilter(
BlogLookupFilter.java:142)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
net.sourceforge.pebble.web.filter.GZIPFilter.doFilter(GZIPFi
lter.java:50)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl
er.java:360)
> >         at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHa
ndler.java:216)
> >         at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandl
er.java:181)
> >         at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandl
er.java:726)
> >         at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.
java:405)
> >         at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(Co
ntextHandlerCollection.java:188)
> >         at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCo
llection.java:114)
> >         at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapp
er.java:152)
> >         at
org.mortbay.jetty.Server.handle(Server.java:324)
> >         at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnectio
n.java:505)
> >         at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComple
te(HttpConnection.java:828)
> >         at
org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
> >         at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:
211)
> >         at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:
380)
> >         at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEn
dPoint.java:395)
> >         at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedT
hreadPool.java:450)
> >  2008-04-11 12:29:35.769::WARN:  /pebble.css
> >  java.lang.NullPointerException
> >         at
net.sourceforge.pebble.web.filter.GZIPResponseWrapper.flushB
uffer(GZIPResponseWrapper.java:70)
> >         at
org.mortbay.jetty.servlet.DefaultServlet.passConditionalHead
ers(DefaultServlet.java:553)
> >         at
org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServle
t.java:405)
> >         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

> >         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

> >         at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder
.java:487)
> >         at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl
er.java:362)
> >         at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHa
ndler.java:216)
> >         at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandl
er.java:181)
> >         at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandl
er.java:726)
> >         at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.
java:405)
> >         at
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java
:285)
> >         at
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java
:126)
> >         at
net.sourceforge.pebble.web.filter.DispatchingFilter.doFilter
(DispatchingFilter.java:80)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
net.sourceforge.pebble.web.filter.LoggingFilter.doFilter(Log
gingFilter.java:115)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
net.sourceforge.pebble.web.filter.PreProcessingFilter.doFilt
er(PreProcessingFilter.java:172)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:264)
> >         at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.in
voke(FilterSecurityInterceptor.java:107)
> >         at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.do
Filter(FilterSecurityInterceptor.java:72)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:274)
> >         at
net.sourceforge.pebble.security.PrivateBlogSecurityIntercept
or.invoke(PrivateBlogSecurityInterceptor.java:110)
> >         at
net.sourceforge.pebble.security.PrivateBlogSecurityIntercept
or.doFilter(PrivateBlogSecurityInterceptor.java:79)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:274)
> >         at
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(Exc
eptionTranslationFilter.java:110)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:274)
> >         at
org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.d
oFilter(RememberMeProcessingFilter.java:135)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:274)
> >         at
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(Abstr
actProcessingFilter.java:217)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:274)
> >         at
org.acegisecurity.context.HttpSessionContextIntegrationFilte
r.doFilter(HttpSessionContextIntegrationFilter.java:191)
> >         at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:274)
> >         at
org.acegisecurity.util.FilterChainProxy.doFilter(FilterChain
Proxy.java:148)
> >         at
org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBe
anProxy.java:90)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
net.sourceforge.pebble.web.filter.TransformingFilter.doFilte
r(TransformingFilter.java:127)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
net.sourceforge.pebble.web.filter.BlogLookupFilter.doFilter(
BlogLookupFilter.java:142)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
net.sourceforge.pebble.web.filter.GZIPFilter.doFilter(GZIPFi
lter.java:50)
> >         at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilte
r(ServletHandler.java:1084)
> >         at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl
er.java:360)
> >         at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHa
ndler.java:216)
> >         at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandl
er.java:181)
> >         at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandl
er.java:726)
> >         at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.
java:405)
> >         at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(Co
ntextHandlerCollection.java:188)
> >         at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCo
llection.java:114)
> >         at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapp
er.java:152)
> >         at
org.mortbay.jetty.Server.handle(Server.java:324)
> >         at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnectio
n.java:505)
> >         at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComple
te(HttpConnection.java:828)
> >         at
org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
> >         at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:
211)
> >         at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:
380)
> >         at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEn
dPoint.java:395)
> >         at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedT
hreadPool.java:450)
> >

------------------------------------------------------------
-------------
This SF.net email is sponsored by the 2008 JavaOne(SM)
Conference 
Don't miss this year's exciting event. There's still time to
save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;1987
57673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Pebble-user mailing list
Pebble-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pebble-user


Re: NPEs when loading css/js
user name
2008-04-17 22:40:48
> > I don't know how much servlets/JSP experience you
have, but basically,
> > the "filters" defined in the
/WEB-INF/web.xml file (e.g.
> > TransformingFilter, DispatchingFilter, GZIPFilter)
are executed upon
> > every request. 

> > There shouldn't be much happening for the CSS and
JS
> > files though because they are publicly accessible
from the web
> > application (i.e. they are served up directly).

I looked at web.xml again.  GZIPFilter is set to apply on
REQUESTs
for *.html, *.js, and *.css from the looks of it.  So does
that mean
GZIPFilter is "invoked" every time one of those
files is requested by
the browser?

It seems this is the case.  I hit

http://pebblete
st.com:8080/pebble.css

in my browser.  The first time I got the css file displayed
(as text).
I hit Ctrl-R to reload in my browser (Firefox2).  Then I got
a page that
displayed 

       My blog
Error | Sorry , there has been a problem with your request.

And NPEs galore in the stderr/stdout log.

If I continue to hit Ctrl-R (or click the browser reload
button), I
alternate between a styled version of the text above (with
"My blog" in
a 40px or so font) and an unstyled version (with "My
blog" completely
unstyled).  View Source shows, indeed, the contents of
pebble.css.

If I put the cursor in the address bar (behind pebble.css)
and hit
"enter", then the contents of pebble.css are once
again display
correctly.

At this point, I don't know if it's Jetty or Firefox.  But I
really
don't want to use Tomcat (as I have run Tomcat for years and
would like
some experience with something else), and most of my
expected traffic is
going to come from firefox (maybe, who knows--the site isn't
live yet).

Thinking it was Firefox, I tried Safari.  No problem.  Was
able to
reload /pebble.css all night long with no trouble or
GZIPResponseWrapper
NPE.

There's a lightweight (to the point of being ridiculously
feature-free
an kind of ugly) browser called dillo.  Loaded /pebble.css
with dillo
over and over--no problem.

Another browser, galeon, however, produced the same 

Nested in javax.servlet.ServletException:
java.lang.NullPointerException:
java.lang.NullPointerException
	at
net.sourceforge.pebble.web.filter.GZIPResponseWrapper.flushB
uffer(GZIPResponseWrapper.java:70)
 
and behaves exactly like firefox.  It is interesting to note
that galeon 
is also gecko-based, using the same rendering and networking
engines.  
Is there something to this?  

I suppose all you Tomcat-abiding users have no problems
from
Firefox/Gecko....

Any light to be shed would be appreciated.

Brendan

------------------------------------------------------------
-------------
This SF.net email is sponsored by the 2008 JavaOne(SM)
Conference 
Don't miss this year's exciting event. There's still time to
save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;1987
57673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Pebble-user mailing list
Pebble-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pebble-user


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )