tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Sébastien Scrève <>
Subject Enum class loading in a session bean
Date Wed, 27 May 2009 16:56:11 GMT


I have a pretty annoying problem with Enum types.

I have the following session bean implementation : 

@Stateless (name =
@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,

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.


Jean-Sébastien Scrève.

View this message in context:
Sent from the OpenEJB User mailing list archive at

View raw message