-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Report: InitialContext lookup returns clone of the binded java.util.Hashtable/FISH-7944 #6449
Comments
Hello @sabrieker, I was able to reproduce the issue using your description, but I was not able to verify the functionality with a wrapped Hashtable as a bean. Could you please send here a reproducer for this case, so I can raise up the issue with all the information necessary, to make the development process easier for the Platform Development team. |
@felixif here you can find my simple test servlet. Source lookupSample and lookupSample2 from InitialContext both have same instance of the "table" object. I tried to put some comments , I hope it helps.
|
Thank you for the update, I just managed to get it working on my own. I have raised an internal issue with the reference Best regards, |
Brief Summary
InitialContext lookup returns clone of binded java.util.Hashtable
Expected Outcome
We bind java.util.Hashtable to InitialContext. Later when we lookup the Hashtable Payara6 returns a clone of the source object. However if we wrap Hashtable within a class as a bean then it works, it returns same reference object of the Hashtable with the binded.
Current Outcome
Every time when we asked InitialContext with lookup we retrieve different reference of the java.util.Hashtable.
Reproducer
If you can execute following code within a simple Servlet. When you execute it you can see the log as "ERROR : Record is not in this Hashtable.".
In this code we bind a Hashtable to InitialContext later we put record to it. Then we get Hashtable from InitialContext via lookup but it is a cloned object and empty.
Operating System
macOS Monterey / Version 6.2023.6
JDK Version
openjdk/17.0.2
Payara Distribution
Payara Server Full Profile
The text was updated successfully, but these errors were encountered: