You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Emond Papegaaij (JIRA)" <ji...@apache.org> on 2014/09/10 11:54:28 UTC

[jira] [Commented] (WICKET-5696) @SpringBean(required=false) is no longer respected if @Inject is present

    [ https://issues.apache.org/jira/browse/WICKET-5696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14128289#comment-14128289 ] 

Emond Papegaaij commented on WICKET-5696:
-----------------------------------------

Some further investigation shows that it's a combination of wicket's and spring's perception of required that's causing this. Spring allows you to make an autowired field optional using @Autowired(required=false). As injection was handled by spring, this used to work in 6.16, but now Wicket complains and I'm forced to also add @SpringBean(required=false). Shouldn't wicket respect the @Autowired annotation?

> @SpringBean(required=false) is no longer respected if @Inject is present
> ------------------------------------------------------------------------
>
>                 Key: WICKET-5696
>                 URL: https://issues.apache.org/jira/browse/WICKET-5696
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-spring
>    Affects Versions: 7.0.0-M3, 6.17.0
>            Reporter: Emond Papegaaij
>            Assignee: Emond Papegaaij
>
> The change made with WICKET-5686 makes it impossible to inject CDI beans in an application where Spring and CDI are combined. CDI requires @Inject, but this now makes the bean required for Spring, even if @SpringBean(required=false) is specified. However, as the bean is injected by CDI, Spring does not know it, triggering an exception.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)