[Javalist] Spring Inject probléma

Komáromi, Zoltán komaromi.zoltan at horticosoft.hu
2013. Jan. 29., K, 23:51:11 CET


Semmi kavarodás nincs, én néztem be. Tudtam padig, hogy valami triviális
dolog lesz. :(

Az történt, hogy az adott osztályok nem @Autowired-del kerültek beállításra
a Controllerben, hanem a saját statikus metódusukban voltak példányosítva.
Ekkor persze a containernek esélye sincs inicializálni. E fölött persze
mindig elsiklottam.

Betettem logot a setterbe, és láttam, hogy a container inicializálja szépen
a mezőket, de a híváskor null.

Köszi mindenkinek a segítséget,sokat tanultam.

KoZo

2013/1/29 Baranyi Zoltán <blaze at madein.hu>

> Szia!
>
>
>  A @Component sem segített :(
>>
>
> Logokat nézted, hogy miket mond context init közben? Valami context
> kavarodásod van szerintem:
>
> "Note that <context:annotation-config/> only looks for annotations on
> beans in the same application context it is defined in. This means that, if
> you put <context:annotation-config/> in a WebApplicationContext for a
> DispatcherServlet, it only checks for @Autowired beans in your controllers,
> and not your services. See Section 16.2, “The DispatcherServlet” for more
> information."
>
> http://static.springsource.**org/spring/docs/3.0.0.M3/**
> reference/html/ch04s11.html<http://static.springsource.org/spring/docs/3.0.0.M3/reference/html/ch04s11.html>
>
>
> üdv,
> BlaZe
>
> ______________________________**_________________
> Javalist mailing list
> Javalist at lists.javaforum.hu
> http://lists.javaforum.hu/**mailman/listinfo/javalist<http://lists.javaforum.hu/mailman/listinfo/javalist>
>
--------- következő rész ---------
Egy csatolt HTML állomány át lett konvertálva...
URL: <http://lists.javaforum.hu/pipermail/javalist/attachments/20130129/581c21d7/attachment.html>


További információk a(z) Javalist levelezőlistáról