is the a way to enable java asserts on GAE production?

170 views
Skip to first unread message

Dmitry Kuznetsov

unread,
Feb 26, 2011, 10:48:11 PM2/26/11
to google-a...@googlegroups.com
of course, I can do it on local host, but is the a way to do it via some tag in e.g. appengine-web.xml?
I tried to put
    static {
        ClassLoader.getSystemClassLoader().setDefaultAssertionStatus(true);
    }
but this does make servlet loading fail... (almost as expected).

Any help would be appreciated.

PS: It really helps to have asserts working in production environment.

Toby Reyelts

unread,
Mar 2, 2011, 5:43:53 PM3/2/11
to google-a...@googlegroups.com, Dmitry Kuznetsov
Try doing YourClass.class.getClassLoader().setDefaultAssertionStatus(true);

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Dmitry Kuznetsov

unread,
Mar 2, 2011, 11:14:35 PM3/2/11
to Google App Engine
Hi Toby,

Thank you very much. I juste verified on GAE production. It works.
(I wonder why nobody has asked before - everyone figured it out on his/
her own or no one bothered?)
PS: May be a word or two in GAE docs about assertions in java may help
(I've searched and found nothing).

Thanks again

Leo

On Mar 2, 2:43 pm, Toby Reyelts <to...@google.com> wrote:
> Try doing YourClass.class.getClassLoader().setDefaultAssertionStatus(true);
>
Reply all
Reply to author
Forward
0 new messages