2017-03-06 4 views
0

Ich habe kürzlich von Weblogic 11g auf 12c aktualisiert. Immer diese Fehlermeldung in der Standardausgabe, wenn MyOtherBean versucht MyStartupBean mit der @EJB Anmerkung zu injizieren:Dependency Injection-Fehler nach dem Upgrade auf Weblogic 12c

[exec] <Mar 6, 2017, 9:39:45,547 AM EST> <Warning> <EJB> <BEA-010065> <MessageDrivenBean threw an Exception in onMessage(). The exception is: 
[exec] javax.enterprise.inject.InjectionException: Exception trying to inject java EE injection point into class: com.foo.My.cache.ejb.MyOtherBean.. 
[exec] javax.enterprise.inject.InjectionException: Exception trying to inject java EE injection point into class: com.foo.My.cache.ejb.MyOtherBean. 
[exec]  at com.oracle.injection.integration.ModuleContainerIntegrationService.performJavaEEInjection(ModuleContainerIntegrationService.java:405) 
[exec]  at com.oracle.injection.provider.weld.WeldInjectionServicesAdapter.aroundInject(WeldInjectionServicesAdapter.java:49) 
[exec]  at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46) 
[exec]  at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:72) 
[exec]  at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:121) 
[exec]  Truncated. see log file for complete stacktrace 
[exec] Caused By: com.bea.core.repackaged.springframework.beans.factory.BeanCreationException: Dependency injection failure: can't inject the value '[email protected]' into the field 'private com.foo.My.common.interfaces.MyStartup com.foo.My.cache.ejb.MyOtherBean.startup'; nested exception is java.lang.IllegalArgumentException: Can not set com.foo.My.common.interfaces.MyStartup field com.foo.My.cache.ejb.MyOtherBean.startup to com.sun.proxy.$Proxy352 
[exec]  at com.oracle.pitchfork.inject.FieldInjection.apply(FieldInjection.java:45) 
[exec]  at com.oracle.pitchfork.inject.Jsr250Metadata.performInjection(Jsr250Metadata.java:228) 
[exec]  at com.oracle.pitchfork.inject.Jsr250Metadata.applyInjections(Jsr250Metadata.java:215) 
[exec]  at com.oracle.pitchfork.inject.Jsr250Metadata.inject(Jsr250Metadata.java:197) 
[exec]  at com.oracle.injection.integration.ModuleContainerIntegrationService.performJavaEEInjection(ModuleContainerIntegrationService.java:398) 
[exec]  Truncated. see log file for complete stacktrace 
[exec] Caused By: java.lang.IllegalArgumentException: Can not set com.foo.My.common.interfaces.MyStartup field com.foo.My.cache.ejb.MyOtherBean.startup to com.sun.proxy.$Proxy352 
[exec]  at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) 
[exec]  at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) 
[exec]  at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) 
[exec]  at java.lang.reflect.Field.set(Field.java:764) 
[exec]  at com.oracle.pitchfork.inject.FieldInjection.apply(FieldInjection.java:43) 
[exec]  Truncated. see log file for complete stacktrace 

Dies ist die MyStartup Schnittstelle:

@Remote 
public interface MyStartup extends my.base.BaseObj 
{ 
    public java.util.Collection getX() ; 
    public java.util.Collection getY() ; 
} 

Und die MyStartupBean ejb:

@Stateless 
@CallByReference 
@TransactionAttribute(TransactionAttributeType.SUPPORTS) 
@TransactionManagement(TransactionManagementType.CONTAINER) 
public class MyStartupBean extends BaseSessionBean implements MyStartup 
{ 
    public java.util.Collection getX(){ 
     //do stuff 
    } 

    public java.util.Collection getY(){ 
     //do stuff 
    } 
} 

Und schließlich die MyOtherBean-Klasse, die die MyStartup-Schnittstelle/MyStartupBean ejb aufruft:

@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic") }, mappedName="jms/CacheRefreshTopic") 
@MessageDestinationConfiguration(connectionFactoryJNDIName="jms/CacheRefreshCF") 
@TransactionAttribute(value=TransactionAttributeType.SUPPORTS) 
@TransactionManagement(value=TransactionManagementType.CONTAINER) 
public class MyOtherBean implements MessageListener 
{ 
    ... 
    @EJB private MyStartup startup; 
    ... 
} 

Antwort

0

Warum ist MyStartup markiert als @Remote aber Sie versuchen, eine Implementierer von ihm als lokaler Bohne der Anmerkung @EJB mit zu injizieren?

Nachdem ich die Marker Annotation @Local geändert, wird der Code begonnen auf meiner Oracle WebLogic 12.2.1.2.0 Domäne erfolgreich eingesetzt werden.

Verwandte Themen