Sanjeeb Kumar Sahoo wrote:
> Hi Ken,
>
> Would you mind taking a look at this issue? I have attached the actual
> test cases (ear as well as war files). I don't understand why there is
> a difference in behavior.
Hi Sahoo,
I spoke with Ken Cavanaugh about this. This is a known RMI-IIOP issue
with marshalling JDK 1.5 enumerations. Right now in the cross-app case
a new instance of the enum constant is created during unmarshalling,
which is why the equality test fails even though the classloader for
both instances is the same. There would need to be some clarifications
made within one or more of the ORB/RMI-IIOP specs to describe special
handling for enumerations. In the JDK, the serialization framework has
special code for ensuring that duplicate enum instances are not created.
Ken said he'll be updating the issue report sometime soon.
--ken
>
>
> Thanks,
> Sahoo
>
> ------------------------------------------------------------------------
>
> Subject:
> [Issue 193] enum unmarshalling creates new instance of the value
> From:
> ss141213_at_dev.java.net
> Date:
> Fri, 24 Feb 2006 16:33:50 +0000
> To:
> issues_at_glassfish.dev.java.net
>
>
>https://glassfish.dev.java.net/issues/show_bug.cgi?id=193
>
>
>
>User ss141213 changed the following:
>
> What |Old value |New value
>================================================================================
> Status|NEW |STARTED
>--------------------------------------------------------------------------------
>
>
>
>
>------- Additional comments from ss141213_at_dev.java.net Fri Feb 24 16:33:49 +0000 2006 -------
>I tried two different things:
>1. servlet and ejb were part of the same ear file as follows:
>app.ear
> web.war (contains TheServlet.class, Bean.class, TheEnum.class)
> ejb.jar (contains Bean.class, TheBean.class, TheEnum.class)
>
>In this case, when I accessed the servlet, response was:
>
>It is a GRAPE.
>
>This is what you expected, right?
>
>2. servlet was deployed as a standalone web module and ejb was deployed as a
>standalone ejb module.
>Basically, I deployed web.war and ejb.jar separately.
>In this case, when I accessed the servlet, response was:
>
>It is not a GRAPE.
>
>This is what you are observing.
>
>Question is, are you doing #1 or #2? I guess, you are doing #2. In this case I
>am suspecting something like this is happenning:
>Since Servlet and the session bean have been deployed as two stand alone
>modules, they will be using two different class loaders. When the servlet is
>sending the TheEnum object it is getting the serialized. During serialization in
>the ejb end, a new object of type TheEnum is being created. This object has a
>different object reference from the enum constants defined in TheEnum class. So
>you are seeing == returning false.
>
>I am also surprised to see a different result for case #1 & 2. In case #1 also,
>serialization and deserialization has to happen. I will follow it up with folks
>that work in this layer and update this issue.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: issues-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: issues-help_at_glassfish.dev.java.net
>
>
>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ejb-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: ejb-help_at_glassfish.dev.java.net
>
>