Bistro!
Alexis Moussine-Pouchkine's Weblog
public enum Topic { Java, GlassFish, Tools, Sun, InFrenchInZeText, SDPY }

20090112 lundi janvier 12, 2009

AppServer killed, no log! (reloaded)

In response to my previous blog about calling System.exit() from code hosted in an app server, Nicoz reminded me that this is one of the things security managers are meant for.

By default in the "developer" profile of GlassFish, there is no security manager in place, but there is a policy file ready to use in (with the appropriate -Djava.security.policy= option in domain.xml).

To add a security manager, simply start GlassFish with this additional startup option: -Djava.security.manager
(edit domain.xml or better yet, use asadmin create-jvm-options -Djava.security.manager)

Any subsequent attempt to call System.exit() will trigger the following error message:
java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM.0)
... with the stack trace leading back to the faulty code.

Update: as a reminder on security managers, they can be very useful (if not life saviors) but they do come at a performance price. Check out this short GlassFish documentation page to understand the implications of using a security manager.

( janv. 12 2009, 03:54:14 PM CET ) Permalink Comments [2]

Java EE 6 et GlassFish demain au Paris JUG


Antonio Goncalves "himself" nous parlera demain (mardi 13) de Java EE 6 au Paris JUG. Quant à moi, je vous présenterai en deuxième partie GlassFish v3 "Prelude". Un petit cadeau pour ceux qui seront là lors du buffet (en espérant en avoir assez pour tout le monde!). Details sur la soirée ici.

( janv. 12 2009, 02:53:51 PM CET ) Permalink Comments [4]


GlassFish Podcast
Get GlassFish V3
Support GlassFish Enterprise

Today's Page Hits: 30




bea conference glassfish groovy ips java javaee javafx javaone javazone jug mysql netbeans openesb openoffice opensource paris performance pkg podcast presentation sdpy spring sun swing techdays tips updatecenter v3 webservices
Links