Really seems like we have the same problem. I belive the solution shown in the other tread is only a workaround for the RichClient Solution. My Guess is that the Proxy is not working the same way as in a plain XML configuration.
With the following applicationContext.xml I get no Problems:
Code:
<beans>
<bean id="serviceBenutzerkonto" class="....BenutzerkontoServiceImpl" scope="session">
<aop:scoped-proxy proxy-target-class="false"/>
<property name="userDao" ref="userDAO" />
<property name="lockingService" ref="serviceLocking" />
<property name="maxId" ref="maxIdDAO" />
</bean>
...
</beans>
But with confiruration by the JavaConfig, I get the IllegalStateException as well. If I access the service later, everything works fine, but I get the warning at application start (And my guess is that the other problems would be solved as well).
Code:
<beans>
<bean class="....AdminServiceConfig"/>
<bean class="org.springframework.config.java.process.ConfigurationPostProcessor"/>
</beans>
Code:
@Configuration
public abstract class AdminServiceConfig {
@Bean(scope = DefaultScopes.SESSION)
@ScopedProxy(proxyTargetClass = false)
public BenutzerkontoServiceImpl serviceBenutzerkonto() {
BenutzerkontoServiceImpl service = new BenutzerkontoServiceImpl();
service.setLockingService(serviceLocking());
service.setMaxId(maxIdDAO());
service.setUserDao(userDAO());
service.setPasswordsDao(passwordsDAO());
return service;
}
...
}