Random behavior

20 views
Skip to first unread message

Brian Fox

unread,
May 20, 2013, 1:50:45 PM5/20/13
to google-s...@googlegroups.com
Hi -

I'm developing restful apps against an already established sitebricks / jetty app.  I'm getting some frustratingly weird behavior from the default renderer returning 500 - "Sitebricks received a null reply from the resourse".  This is intermittent.  Sitebricks seems to use the default renderer often.

The error seems intermittent.  Most of the time I get 500, every once in a while it toggles and starts serving 200.  It seems to resolve itself during runtime.  It even resolved itself while I was dubbing it and watching the behavior.  I don't see any environment settings that might be affecting it. 

Here's the Get code I'm using.  I stripped it down for debugging.
@Service
public class MyService {
    @Get
    public Reply<RestResponse> getMethod(Request request) {
        return new RestResponse();
    }
}

Any ideas on what might cause this type of error?  Has anyone seen similar behavior before?

Thanks a ton for help and or clues.
Brian

Dhanji R. Prasanna

unread,
May 20, 2013, 10:34:44 PM5/20/13
to google-s...@googlegroups.com
Very strange, are you sure there aren't some singletons in your way somewhere?

What is the @At() mapping? If you could post more of your example I'd love to see it. In the 500 error it should provide you a stack trace of exactly where it is throwing the exception. Sounds like your code is throwing an NPE somewhere.




Brian

--
You received this message because you are subscribed to the Google Groups "Google Sitebricks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-sitebri...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Brian Fox

unread,
May 22, 2013, 5:20:31 PM5/22/13
to google-s...@googlegroups.com
Hi Dhanji -

Thanks for your reply.  While debugging, I saw yet more weirdness.  My project seemed to be executing a jar from a week ago.

I ran the vm with -verbose:class and found the two similarly named jars.  Both were loaded late, but very close in time.
[Loaded com.company.UserDAOImpl from file:/Users/brian/Developer/project/subproject/target/classes/]
[Loaded com.company.UserDAOImpl$$FastClassByGuice$$e3f6e0e9 from file:/Users/brian/.m2/repository/com/google/inject/guice/3.0/guice-3.0.jar]

I'm not a class loader guru.  But it looks like a race condition perhaps? 

I should give Guice a closer look (especially in regards to forcing no caching).
And perhaps I need a better clean target for my project.

If you have any suggestions, I'm all ears.

Best,
Brian

Dhanji R. Prasanna

unread,
May 22, 2013, 6:31:28 PM5/22/13
to google-s...@googlegroups.com
Hi, that is not a problem. It is just a Guice proxy which is needed for some of Guice's functionality. I shouldnt affect anything unless you have explicitly bound interceptors somewhere (example: guice-persist transcations?)

I think I'd need to be able to reproduce this somehow before I can offer more advice. Generally these turn out to be easy to spot once you have the big picture in place.. So if you can assemble a tiny dummy project that simulates just this behavior then I'd be glad to help.

Thanks,
Dhanji.
Reply all
Reply to author
Forward
0 new messages