javax.enterprise.inject.UnsatisfiedResolutionException: Unable to resolve a bean for 'org.springframework.data.neo4j.support.mapping.Neo4jMappingContext' with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()].

Spring JIRA | Remigio Di Muzio | 3 years ago
  1. 0

    I'm trying to migrate an SDN project from the 2.3.3 version to the 3.0.0.RELEASE. The project is a WAR which is deployed on a Glassfish 3.1.2.2 server and uses EJBs which access Neo4j via an *@Autowired Neo4jOperations* object and *GraphRepository<T>* objects. The auto wiring is supported using the *SpringBeanAutowiringInterceptor* interceptor annotation on the EJBs. The SDN configuration is given by the following lines in the spring xml configuration file: {quote} <context:annotation-config/> <context:spring-configured/> <bean id="graphDatabaseService" class="org.springframework.data.neo4j.support.GraphDatabaseServiceFactoryBean" destroy-method="shutdown" scope="singleton"> <constructor-arg value="target/config-test"/> <constructor-arg> <map> <entry key="allow_store_upgrade" value="true"/> </map> </constructor-arg> </bean> <neo4j:config graphDatabaseService="graphDatabaseService"/> <neo4j:repositories base-package="com.my.neo4j.repository"/> <tx:annotation-driven mode="aspectj" transaction-manager="transactionManager"/> {quote} Everything works fine when using the 2.3.3 SDN version, whereas 3.0.0 gives the following error while deploying: {quote} javax.enterprise.inject.UnsatisfiedResolutionException: Unable to resolve a bean for 'org.springframework.data.neo4j.support.mapping.Neo4jMappingContext' with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]. at org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.createRepositoryBean(Neo4jCdiRepositoryExtension.java:107) at org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.afterBeanDiscovery(Neo4jCdiRepositoryExtension.java:82) ... {quote}

    Spring JIRA | 3 years ago | Remigio Di Muzio
    javax.enterprise.inject.UnsatisfiedResolutionException: Unable to resolve a bean for 'org.springframework.data.neo4j.support.mapping.Neo4jMappingContext' with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()].
  2. 0

    I'm trying to deploy on a Glassfish 3.1.2.2 server a web application which uses the Neo4j embedded database from EJB objects. Everything worked fine until 2.3.5, but 3.x gives the following error while deploying: {quote} javax.enterprise.inject.UnsatisfiedResolutionException: Unable to resolve a bean for 'org.springframework.data.neo4j.support.mapping.Neo4jMappingContext' with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]. at org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.createRepositoryBean(Neo4jCdiRepositoryExtension.java:107) at org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.afterBeanDiscovery(Neo4jCdiRepositoryExtension.java:82) ... {quote} After some code examination I found that the graphDatabase object is never processed by the CDI infrastructure, so the createRepositoryBean method in the Neo4jCdiRepositoryExtension throws the above listed exception. The graphDatabase object is never discovered for two reasons: 1. in the META-INF folder of SDN there is no beans.xml file and this prevents Java EE from starting bean discovery; 2. the DelegatingGraphDatabase has no default constructor and so it's never considered as a bean. I've fixed both issues and now everything works fine. I've submitted both fixes as pull requests on the GitHub project: https://github.com/spring-projects/spring-data-neo4j/pull/179 https://github.com/spring-projects/spring-data-neo4j/pull/180

    Spring JIRA | 3 years ago | Remigio Di Muzio
    javax.enterprise.inject.UnsatisfiedResolutionException: Unable to resolve a bean for 'org.springframework.data.neo4j.support.mapping.Neo4jMappingContext' with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()].
  3. 0

    I'm trying to migrate an SDN project from the 2.3.3 version to the 3.0.0.RELEASE. The project is a WAR which is deployed on a Glassfish 3.1.2.2 server and uses EJBs which access Neo4j via an *@Autowired Neo4jOperations* object and *GraphRepository<T>* objects. The auto wiring is supported using the *SpringBeanAutowiringInterceptor* interceptor annotation on the EJBs. The SDN configuration is given by the following lines in the spring xml configuration file: {quote} <context:annotation-config/> <context:spring-configured/> <bean id="graphDatabaseService" class="org.springframework.data.neo4j.support.GraphDatabaseServiceFactoryBean" destroy-method="shutdown" scope="singleton"> <constructor-arg value="target/config-test"/> <constructor-arg> <map> <entry key="allow_store_upgrade" value="true"/> </map> </constructor-arg> </bean> <neo4j:config graphDatabaseService="graphDatabaseService"/> <neo4j:repositories base-package="com.my.neo4j.repository"/> <tx:annotation-driven mode="aspectj" transaction-manager="transactionManager"/> {quote} Everything works fine when using the 2.3.3 SDN version, whereas 3.0.0 gives the following error while deploying: {quote} javax.enterprise.inject.UnsatisfiedResolutionException: Unable to resolve a bean for 'org.springframework.data.neo4j.support.mapping.Neo4jMappingContext' with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]. at org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.createRepositoryBean(Neo4jCdiRepositoryExtension.java:107) at org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.afterBeanDiscovery(Neo4jCdiRepositoryExtension.java:82) ... {quote}

    Spring JIRA | 3 years ago | Remigio Di Muzio
    javax.enterprise.inject.UnsatisfiedResolutionException: Unable to resolve a bean for 'org.springframework.data.neo4j.support.mapping.Neo4jMappingContext' with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()].
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I'm trying to deploy on a Glassfish 3.1.2.2 server a web application which uses the Neo4j embedded database from EJB objects. Everything worked fine until 2.3.5, but 3.x gives the following error while deploying: {quote} javax.enterprise.inject.UnsatisfiedResolutionException: Unable to resolve a bean for 'org.springframework.data.neo4j.support.mapping.Neo4jMappingContext' with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]. at org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.createRepositoryBean(Neo4jCdiRepositoryExtension.java:107) at org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.afterBeanDiscovery(Neo4jCdiRepositoryExtension.java:82) ... {quote} After some code examination I found that the graphDatabase object is never processed by the CDI infrastructure, so the createRepositoryBean method in the Neo4jCdiRepositoryExtension throws the above listed exception. The graphDatabase object is never discovered for two reasons: 1. in the META-INF folder of SDN there is no beans.xml file and this prevents Java EE from starting bean discovery; 2. the DelegatingGraphDatabase has no default constructor and so it's never considered as a bean. I've fixed both issues and now everything works fine. I've submitted both fixes as pull requests on the GitHub project: https://github.com/spring-projects/spring-data-neo4j/pull/179 https://github.com/spring-projects/spring-data-neo4j/pull/180

    Spring JIRA | 3 years ago | Remigio Di Muzio
    javax.enterprise.inject.UnsatisfiedResolutionException: Unable to resolve a bean for 'org.springframework.data.neo4j.support.mapping.Neo4jMappingContext' with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()].
  6. 0

    Issue with Spring Data Neo4j migration from 2.3.3 to 3.0.0 RC1

    Stack Overflow | 3 years ago | remigio
    javax.enterprise.inject.UnsatisfiedResolutionException: Unable to resolve a bean for 'org.springframework.data.neo4j.support.mapping.Neo4jMappingContext' with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()].

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.enterprise.inject.UnsatisfiedResolutionException

      Unable to resolve a bean for 'org.springframework.data.neo4j.support.mapping.Neo4jMappingContext' with qualifiers [@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()].

      at org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.createRepositoryBean()
    2. Spring Data Neo4j
      Neo4jCdiRepositoryExtension.afterBeanDiscovery
      1. org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.createRepositoryBean(Neo4jCdiRepositoryExtension.java:107)
      2. org.springframework.data.neo4j.repository.cdi.Neo4jCdiRepositoryExtension.afterBeanDiscovery(Neo4jCdiRepositoryExtension.java:82)
      2 frames