Search code examples
deploymentpayarapayara-micro

Payara loading old class After change class file and Restart


After deploy I am changing .class file in applications directory and I am restarting to server. But Payara loading old .class file (I think from war file). This is happening on some servers. Is there any parameter for disable this?


Solution

  • You shouldn't change anything in the applications directory. This is an internal directory for caching applicaiton files and isn't guaranteed that your change will be reflected.

    If you want to change .class files without completely redeploying an application, you should deploy your application as an exploded archive (not a WAR but an unpacked WAR file as a directory) via the autodeployment mechanism. You need to unpack your WAR file into the autodeploy directory in the domain directory.

    If you're deploying to a remote server, you first need to copy the WAR file to the server and unpack it there.

    See https://eclipse-ee4j.github.io/glassfish/docs/5.1.0/application-deployment-guide/deploying-applications.html#GSDPG00041 (or Application Deployment Guide in PDF here: https://eclipse-ee4j.github.io/glassfish/docs/)