By throwing an exception in the @PostConstruct marked method in a @Startup marked bean, I am currently able to give a warning message when deploying the application on a Glassfish 3.1 server. However, it remains deployed (so it's in the list of applications) and the error message is a rather vague one, instead of the message given with the exception.
I wish to make the deployment fail completely, and give an appropriate message, to indicate what went wrong exactly. Is this doable from standard Java EE without customizing the Glassfish server? And if so, how?
The current given message is the following
Warning Command succeeded with Warning
"http://localhost:4848/management/domain/applications/application/applicationname" created successfully. WARNING: Command _deploy did not complete successfully on server instance instance1: remote failure: Failed to load the application on instance instance1. The application will not run properly. Please fix your application and redeploy. Exception while shutting down application container : java.lang.NullPointerException. Please see server.log for more details. WARNING: Command _deploy did not complete successfully on server instance instance1: remote failure: Failed to load the application on instance instance1. The application will not run properly. Please fix your application and redeploy. Exception while shutting down application container : java.lang.NullPointerException. Please see server.log for more details.
Aucun commentaire:
Enregistrer un commentaire