ManagedPersistenceContextProxyHandler.java not correctly handling "getProvider"
method.
---------------------------------------------------------------------------------------
Key: SEAMPERSIST-17
URL:
https://issues.jboss.org/browse/SEAMPERSIST-17
Project: Seam Persistence
Issue Type: Bug
Affects Versions: 3.0.0.Beta2
Reporter: Derrick Ampy
While trying to leverage Seam Managed Persistence Contexts as described in the associated
seam-persistence reference documentation, I ran into an issue where the
ManagedPersistenceContext::getProvider method is invoked in the PersistenceContextImpl
class (line 131). The problem is that this method call when proxied with a
ManagedPersistenceContextProxyHandler will currently result in an attempt to call the
"getProvider" method on the delegated object (which in my case is an
EntityManager instance). Obviously, the EntityManager interface does not define a method
called "getProvider" and so I get an error.
Looking into the problem, I believe the root issue is that the
ManagedPersistenceContextProxyHandler::invoke method is expecting the supplied method name
to be "getPersistenceProvider" rather than "getProvider" (see line
100). Moreover, the ManagedPersistenceContext class defines a "getProvider"
method rather than a "getPersistenceProvider" method (suggesting that perhaps
the name was refactored at some point in the past and
ManagedPersistenceContextProxyHandler::invoke wasn't updated).
If I modify the code on line 100 to use "getProvider" rather than
"getPersistenceProvider", I'm able to load my SMPC properly in my
application.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira