-
Notifications
You must be signed in to change notification settings - Fork 304
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
InitialContext can not do lookup against separate endpoints #1566
Comments
Hi @chammerman I spent some time this week looking into this, but didn't have much luck reproducing. Do you have a "Short, Self Contained, Correct (Compilable), Example" that shows the problem? My setup was slightly different to yours in that I created 2 "hello world" EJBs and deployed EJB1 to Payara Server instance 1 and EJB2 to Payara Server instance 2, so each lookup was only contacting a single endpoint rather than multiple endpoints. |
Hi Mike,
I think that the single vs multiple endpoint item you mention is not the problem here. It should still reproduce that way.
Are your hello world EJBs unique per server instance? If not then the test will always succeed because it is still referencing the first endpoint, which also has the object of desire.
The only other thing I can think to check is to make sure the cluster iiop ports are not the same on Payara Server instance 1/2. (I have not verified if this matters, but it is how our system is currently set up.)
It will take me a day or so to get the SSCCE together, which I assume would include the 2 test ejb applications and a compliable test. Let me know if I am missing anything else.
Charles
|
Internal issue PAYARA-1685 |
@mikecroft @lprimak I was able to test with the patched version and I can confirm the issue is resolved. Thanks so much guys! |
Description
A naming exception is thrown if new endpoints are defined for an existing InitialContext object and lookup(SomeClass.class.getName()) is called. This seems to be because it continues to use the original endpoints defined instead of the new ones.
Expected Outcome
InitialContext should be able to be re-instantiated with new endpoints that replace the old ones and perform name lookups against those new endpoints.
This was the behavior in GF3 but became broken in GF4.
Current Outcome
InitialContext is instantiated with endpoints and a lookup(RemoteSessionBeanOnEndpoint1) is performed and returned successfully.
InitialContext is then re-instantiated with different endpoints (different server:iiop ports) and lookup(RemoteSessionBeanOnEndpoint2) fails with a NamingException because it is still attempting to connect to the former endpoints.
Steps to reproduce (Only for bug reports)
Create 2 separate payara server installs on two separate servers.
Create a Cluster on each server that use a different iiop listener port.
Create an instance for each cluster.
Deploy an application to each cluster where each application has a set of mutually exclusive remote session beans.
Create a client application/test that instantiates InitialContext using endpoints for the first server defined in a Properties Object and named "com.sun.appserv.iiop.endpoints"
Perform a lookup to retrieve a remote session bean against the first server's application. It should succeed.
Re-instantiate the InitialContext object with a new Properties Object using endpoints for the second server.
Perform a lookup to retrieve a remote session bean against the second server's application. It will fail to find the bean and throw a NamingException.
Samples
Here is the relevant stacktrace from the sample above:
FWIW com.sun.enterprise.naming.impl.SerialContext.lookup lives in glassfish-naming.jar
Context (Optional)
We have an application that loads and executes subclassed workflows written by other application teams.
The main application defines an InitialContext with endpoints. The subclass workflow also tries to define the super.ctx with different endpoints which causes their application to throw a naming exception and fail.
Environment
The text was updated successfully, but these errors were encountered: