HOT deployment doesn't support static object repalce

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

HOT deployment doesn't support static object repalce

Kapil
Hi,

We are using javax.mail.Session.getDefaultInstance() in our code, and it returns static object. Now if we do any changes then still this static object is returned, if we do hot deployment and do the changes for it then still it returns the same object instead of updated object.
When we restart jetty then it works fine. Please let me know why the static objects are not replaced in hot deployment.

Thanks,
Kapil

_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: HOT deployment doesn't support static object repalce

Joakim Erdfelt-8
`javax.mail.Session.getDefaultInstance()` is singleton and based on the fact that it's in the `javax` package namespace that means it's loaded by the Server classpath.

A hot (re)deploy of a webapp will have no impact on a server loaded component.

You'll have to restart your server when you make those kinds of changes.

Joakim Erdfelt / [hidden email]


On Wed, Mar 13, 2019 at 6:29 AM kapil gupta <[hidden email]> wrote:
Hi,

We are using javax.mail.Session.getDefaultInstance() in our code, and it returns static object. Now if we do any changes then still this static object is returned, if we do hot deployment and do the changes for it then still it returns the same object instead of updated object.
When we restart jetty then it works fine. Please let me know why the static objects are not replaced in hot deployment.

Thanks,
Kapil
_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users

_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: HOT deployment doesn't support static object repalce

Kapil
Thanks Joakim for explanation.

On Thu, Mar 14, 2019 at 7:54 PM Joakim Erdfelt <[hidden email]> wrote:
`javax.mail.Session.getDefaultInstance()` is singleton and based on the fact that it's in the `javax` package namespace that means it's loaded by the Server classpath.

A hot (re)deploy of a webapp will have no impact on a server loaded component.

You'll have to restart your server when you make those kinds of changes.

Joakim Erdfelt / [hidden email]


On Wed, Mar 13, 2019 at 6:29 AM kapil gupta <[hidden email]> wrote:
Hi,

We are using javax.mail.Session.getDefaultInstance() in our code, and it returns static object. Now if we do any changes then still this static object is returned, if we do hot deployment and do the changes for it then still it returns the same object instead of updated object.
When we restart jetty then it works fine. Please let me know why the static objects are not replaced in hot deployment.

Thanks,
Kapil
_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users
_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users

_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users