0

I'm developing under IBM RAD 9 the application for WebSphere 8.5, using EJB 3 :(

I've split the project to following maven modules:

  • dto (only 'stupid' transfer objects)
  • ejb (the business logic)
  • web (the REST channels, build type is WAR)
  • ear (well, build type is EAR)

EJB module has empty beans.xml file in META-INF. There's a producer class there, that produces some my.ejb.HelperClass

 @ApplicationScoped
public class MyHelperProducer {
    @Produces
    @ApplicationScoped
    public HelperClass produceGenWsClient() {
        ....
    }
}

The usage is quite trivial:

@Inject
private HelperClass helper;

It was already functioning! After some changes in the code (involving refactoring of many fields in many classes, but not those involved!) Everything stopped to function. Now I get error messages like that:

[8/27/14 16:33:38:960 CEST] 00000063 BeansDeployer E BeansDeployer deploy javax.enterprise.inject.UnsatisfiedResolutionException: Api type [my.ejb.HelperClass] is not found with the qualifiers Qualifiers: [@javax.enterprise.inject.Default()] for injection into Field Injection Point, field : private my.ejb.HelperClass my.web.MyChannel.helper, Bean Owner : [WSEjbBean [businessLocals=[my.web.MyChannel], ejbName=MyChannel1710565165,Name:null,WebBeans Type:ENTERPRISE,API Types:[java.lang.Object,my.web.MyChannel],Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]] InjectionType : [class my.ejb.HelperClass] Annotated : [Annotated Field,Base Type : class my.ejb.HelperClass,Type Closures : [class my.ejb.HelperClass, class java.lang.Object],Annotations : [@javax.inject.Inject()],Java Member Name : helper] Qualifiers : [[@javax.enterprise.inject.Default()]] at org.apache.webbeans.util.InjectionExceptionUtils.throwUnsatisfiedResolutionException(InjectionExceptionUtils.java:92) at org.apache.webbeans.container.ResolutionUtil.checkResolvedBeans(ResolutionUtil.java:96) at org.apache.webbeans.container.InjectionResolver.checkInjectionPoints(InjectionResolver.java:189) at org.apache.webbeans.container.BeanManagerImpl.validate(BeanManagerImpl.java:1092) at org.apache.webbeans.config.BeansDeployer.validate(BeansDeployer.java:394) at org.apache.webbeans.config.BeansDeployer.validateInjectionPoints(BeansDeployer.java:332) at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:183) at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:124) at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:78) at com.ibm.ws.webbeans.common.CommonLifeCycle.startApplication(CommonLifeCycle.java:106)

The 'funny' thing there is, I've already got such errors in other application, but then I've solved them by starting server clean and deleting and reimporting the project to the workspace. Now, however, even that didn't work.

What is actually a problem here? Is there a big bug in the RAD? Or I'm doing something wrong, that was only incidentally working before? How can I diagnose such errors?

Danubian Sailor
  • 1
  • 38
  • 145
  • 223
  • Actually, the problem 'disappeared' after reversing the changes in OpenJPA mapping. But why the exception was shown on bean, that has no references to OpenJPA, and why no OpenJPA exceptions were shown? – Danubian Sailor Aug 28 '14 at 07:44

1 Answers1

0

Check this link Troubleshooting contexts and dependency injection. Maybe it will help you. Quoting:

  1. Resolve an unsatisfiable dependency.
    An unsatisfiable dependency, or javax.enterprise.inject.UnsatisfiedResolutionException, occurs when there is no corresponding source for objects matching an injection point in the application. The API type of the field, along with the optional set of qualifier annotations, dictates the set of beans that are valid to satisfy the dependency. Causes of unsatisfiable dependency are as follows:

    • There is no managed bean that is assignable to the type on the injection point.
    • There is no producer method of any managed bean whose return type is assignable to the injection point.
    • There is no producer field in any managed bean whose type is assignable to the injection point.
    • One of the previously mentioned scenarios are valid, but the Qualifier annotations on the injection point are not present on the bean or producer.

Resolve the error by making a dependency with the API type and qualifiers available by introducing a new bean, removing qualifiers, or adding producers fields or methods

Maybe you are missing some classpath dependencies, if bean is created in one module and used in other?

Gas
  • 17,601
  • 4
  • 46
  • 93
  • The claspath dependecies has not changed. Actually, nothing with the classes that are mentioned in the stack trace has changed. – Danubian Sailor Aug 28 '14 at 06:42