0

After deploying an EAR module in GlassFish 4.1, I observed that it appeared to have loaded the previous version of some of the classes. It seems like GlassFish is caching previous classes. Is it possible that GlassFish keeps a cache of old classes?

Mike
  • 4,852
  • 1
  • 29
  • 48
Lakshi
  • 490
  • 4
  • 10

1 Answers1

0

Yes this is quite possible, especially in Windows. The cause of some of these issues (in Windows and some Linux filesystems) is how filehandles are dealt with. Typically, this doesn't stop classes from being unloaded in Linux, but often can with Windows.

To be 100% sure that classes are removed after an undeployment, restart GlassFish.

Payara Server has included a number of fixes around undeployment over the last year or so, so you may want to try that if you are still having problems.

Mike
  • 4,852
  • 1
  • 29
  • 48
  • I'm using Linux and I restart server after ecery undeployment. You have mention it's deu to how file hadlers are delt. If so what and how can Payara server does it better? – Lakshi Sep 14 '16 at 07:34
  • If you're using Linux and already restart the server, then it's unlikely to be the problem I described. How are you building and deploying your archive? E.g. are you running the maven goal `clean` as well as `install`? – Mike Sep 14 '16 at 07:49
  • Yes I'm running marven clean and install with jenkins. I checked the jar file of the version that I uploded and the latest version was there. After I restated the server once again for the second time it was alright. This is nearly impossible to figure out what there happend. ( that has happend to me severl times now)thats why I am so curious about that matter – Lakshi Sep 14 '16 at 08:32