I have a three-tier application design with Glassfish 3.1.2.2, MySQL 5.5 Server and a stand-alone Swing client application.
I am currently facing the problem of automatically updating / redeploying a server-side application (* .ear-file) on Glassfish.
My clients periodically check for new updates on my update server, where I put the updated files (client-jar files and server-ear files). As soon as a new version appears, the client downloads it from my update server and saves it in the database that is connected to the Glassfish instance.
My question is how to programmatically redeploy a new * .ear file in Glassfish?
I tried a workaround by opening a new process and using the asadmin tool that came with Glassfish to force the redistribution:
Runtime.getRuntime().exec("./asadmin --user admin --passwordfile "+getPathToPwdFile()+" deploy --force=true "+getPathToNewEarFile());
But this solution is unpleasant, because during the redistribution the process breaks down before the process is completed, because the server application, which is a forked process, is redistributed ... This leads to some errors on the application server.
The JMX / AMX project for Glassfish v3 seems dead (latest update 2009) ...
Does anyone have the right solution to this problem?
source share