diff -r compass-2.2.0/src/main/src/org/compass/gps/device/jpa/extractor/JBossNativeJpaExtractor.java /Users/marcus/gapp_java/org.compass/src/main/src/org/compass/gps/device/jpa/extractor/JBossNativeJpaExtractor.java
18a19,20
> import java.lang.reflect.Method;
> 
23d24
< import org.jboss.ejb3.entity.InjectedEntityManagerFactory;
26a28
>  * @author Marcus Ilgner <mail@marcusilgner.com>
30,48c32,60
<     /**
<      * Extracts the native entity manager factory from a managed JBoss one. If JBoss
<      * has not wrapped the factory, will return it as is.
<      *
<      * @param entityManagerFactory The (possibly) managed JBoss entity manager factory
<      * @return The native entity manager factory
<      * @throws org.compass.gps.device.jpa.JpaGpsDeviceException
<      *
<      */
<     public EntityManagerFactory extractNative(EntityManagerFactory entityManagerFactory) throws JpaGpsDeviceException {
<         if (entityManagerFactory instanceof InjectedEntityManagerFactory) {
<             return ((InjectedEntityManagerFactory) entityManagerFactory).getDelegate();
<         }
<         return entityManagerFactory;
<     }
---
> 	private final static String	JBOSS4_FACTORY_CLASS_NAME	= "org.jboss.ejb3.entity.InjectedEntityManagerFactory";
> 	private final static String	JBOSS5_FACTORY_CLASS_NAME	= "org.jboss.jpa.injection.InjectedEntityManagerFactory";
> 
> 	/**
> 	 * Extracts the native entity manager factory from a managed JBoss one. If
> 	 * JBoss has not wrapped the factory, will return it as is.
> 	 * 
> 	 * @param entityManagerFactory
> 	 *            The (possibly) managed JBoss entity manager factory
> 	 * @return The native entity manager factory
> 	 * @throws org.compass.gps.device.jpa.JpaGpsDeviceException
> 	 * 
> 	 */
> 	public EntityManagerFactory extractNative(EntityManagerFactory entityManagerFactory) throws JpaGpsDeviceException {
> 		if (entityManagerFactory.getClass().getName().equals(JBOSS4_FACTORY_CLASS_NAME)
> 				|| entityManagerFactory.getClass().getName().equals(JBOSS5_FACTORY_CLASS_NAME)) {
> 			try {
> 				Method method = entityManagerFactory.getClass().getMethod("getDelegate", null);
> 				return (EntityManagerFactory) method.invoke(entityManagerFactory, (Object[])null);
> 			} catch (Exception e) {
> 				return entityManagerFactory;
> 			}
> 		}
> 		return entityManagerFactory;
> 	}

