spring-attic / spring-social

Allows you to connect your applications with SaaS providers such as Facebook and Twitter.
http://projects.spring.io/spring-social
Apache License 2.0
619 stars 351 forks source link

about customize application url #174

Open liu-shiyuan opened 9 years ago

liu-shiyuan commented 9 years ago

Hello: Let's talk about this issue. Both ConnectController and ProviderSignInController implement the InitializingBean, which make the configuration likes this would occur NullPointerException: @Bean public ConnectController connectController( ConnectionFactoryLocator connectionFactoryLocator, ConnectionRepository connectionRepository) throws Exception { ConnectController conn = new ConnectController(connectionFactoryLocator, connectionRepository); conn.setApplicationUrl("github.com"); return conn; }

Even invoked afterPropertiesSet() before setting application url, spring framework would autoinvoke afterPropertiesSet() one more time and clean up the properties of ConnectSupport instance: @Bean public ConnectController connectController( ConnectionFactoryLocator connectionFactoryLocator, ConnectionRepository connectionRepository) throws Exception { ConnectController conn = new ConnectController(connectionFactoryLocator, connectionRepository); conn.afterPropertiesSet(); conn.setApplicationUrl("github.com"); return conn; }

Maybe there are other ways to customize my appilcaiton url, but I could not find out. I checked this issue on stackoverflow, only found more similiar questions without the answer, such as: http://stackoverflow.com/questions/25626064/nullpointer-bug-in-spring-social-connectcontroller-configuration

liu-shiyuan commented 9 years ago

and this https://jira.spring.io/browse/SOCIAL-432