Also looking at this info:  https://issues.apache.org/jira/browse/OPENJPA-646

Jean-Sébastien, if you have a stacktrace of the ClassNotFoundException that'd be great.


-David


On May 27, 2009, at 4:58 PM, David Blevins wrote:

Moving this to the dev list.

Still looking over the info but the svn revision for the isEnum method pulls up this info:

http://svn.apache.org/viewvc?view=rev&revision=720223
http://issues.apache.org/jira/browse/OPENEJB-951

-David


On May 27, 2009, at 9:56 AM, Jean-Sébastien Scrève wrote:


Hi,

I have a pretty annoying problem with Enum types.

I have the following session bean implementation :

@WebService
@Stateless (name =
"net.atos.xastory.csm.contract.CatalogueStockManagementService")
@Local (CatalogueStockManagementService.class)
public class CatalogueStockManagementServiceImpl implements
net.atos.xastory.csm.contract.CatalogueStockManagementService {

        public Price getPrice() {
                return new Price();
        }
        
        private Currency getCurrency() {
                return net.atos.xastory.csm.core.product.Currency.EUR;
        }
}

Price is a POJO. Currency is an Enum type.
I have a Class Not Found exception on the Currency type at OpenEJB startup.
(OpenEJB + Tomcat).

I dug into the problem and I think I found the problem.

In TempClassLoader I see the following change :

// Annotation classes must be loaded by the normal classloader
// So must Enum classes to prevent problems with the sun jdk.
if (isAnnotationClass(bytes) || isEnum(bytes)) {
          return Class.forName(name, resolve,
getClass().getClassLoader());
}

isEnum was added recently and causes my problem. Was is the problem we want
to avoid with Jdk ?
Shouldn't we try loading from TempClassLoader first then do a
Class.forName() ?

I can fill up a JIRA if want to.

Regards,

Jean-Sébastien Scrève.


--
View this message in context: 
http://www.nabble.com/Enum-class-loading-in-a-session-bean-tp23746554p23746554.html
Sent from the OpenEJB User mailing list archive at Nabble.com.





Reply via email to