diff --git a/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java b/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java index 5d430de779..84cdeb15ed 100644 --- a/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java +++ b/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java @@ -405,7 +405,16 @@ public Class getProxyClass() { proxyClassName = proxyClassName.replaceFirst(JAKARTA, WELD_PROXY_PREFIX); } Class proxyClass = null; - Class originalClass = bean != null ? bean.getBeanClass() : proxiedBeanType; + Class originalClass; + if (bean == null) { + originalClass = proxiedBeanType; + } else { + if (bean instanceof AbstractBuiltInBean) { + originalClass = ((AbstractBuiltInBean) bean).getType(); + } else { + originalClass = bean.getBeanClass(); + } + } BeanLogger.LOG.generatingProxyClass(proxyClassName); try { // First check to see if we already have this proxy class