BeanNotOfRequiredTypeException aber war eigentlich der Typ, $Proxy
Ich brauche Hilfe bei einem problem mit dem Frühlings-und proxy.
org.springframework.Bohnen.factory.BeanNotOfRequiredTypeException: Bean mit dem Namen 'fooAPIService' muss vom Typ [com.foo.clientapi.service.FooAPIService], aber eigentlich war der Typ [Kom.Sonne.proxy.$Proxy110]
org.springframework.Bohnen.factory.BeanCreationException: Fehler beim erstellen bean mit dem Namen 'activityController': Injektion von Ressourcen-Abhängigkeiten fehlgeschlagen; verschachtelte Ausnahme ist org.springframework.Bohnen.factory.BeanNotOfRequiredTypeException: Bean mit dem Namen 'fooAPIService' muss vom Typ [com.foo.clientapi.service.FooAPIService], aber eigentlich war der Typ [Kom.Sonne.proxy.$Proxy110]
Webapp Projekt ->
Spring-Kontext
<context:annotation-config/>
<context:component-scan base-package="com.foo.controller"/>
<aop:aspectj-autoproxy />
<aop:config proxy-target-class="true"/>
<mvc:annotation-driven/>
ActivityController.class
import com.foo.clientapi.service.FooAPIService;
...
@Controller
@RequestMapping(value = "/toto")
public class ActivityController {
@Resource
private FooAPIService fooAPIService;
...
}
Einem anderen Projekt (micro-service) ->
FooAPIService.class
@Path("/foos")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface FooAPIService {
...
}
Jaxrs Config:
<jaxrs:client id="fooAPIService"
address="${toto}"
threadSafe="true"
serviceClass="com.foo.clientapi.service.FooAPIService"
inheritHeaders="true">
...
</jaxrs:client>
Version :
aspectjweaver : 1.6.10
aspectjrt : 1.6.11
cglib : 2.2
Frühjahr 3.2.2
InformationsquelleAutor MaximeF | 2014-10-14
Du musst angemeldet sein, um einen Kommentar abzugeben.
War das problem, dass ich hatte zwei Bohnen(jaxrs:client) mit der gleichen id (name).
InformationsquelleAutor MaximeF