Togglz in appengine

47 views
Skip to first unread message

Fábio Uechi

unread,
Oct 20, 2013, 9:02:11 PM10/20/13
to toggl...@googlegroups.com
Hi Christian,

I had some issues with the AcitvationStrategy auto discovery mechanism in GAE. See details below:

java.util.ServiceConfigurationError: org.togglz.core.spi.ActivationStrategy: Provider org.togglz.core.activation.ServerIpActivationStrategy could not be instantiated: java.lang.NullPointerException
	at java.util.ServiceLoader.fail(ServiceLoader.java:224)
	at java.util.ServiceLoader.access$100(ServiceLoader.java:181)
	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:377)
	at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
	at org.togglz.core.util.Lists.asList(Lists.java:12)
	at org.togglz.core.manager.DefaultFeatureManager.<init>(DefaultFeatureManager.java:40)
	at org.togglz.core.manager.FeatureManagerBuilder.build(FeatureManagerBuilder.java:96)

Since I was not really interested in the auto discovery feature and the DefaultFeatureManager performs the service lookup in its only public constructor I had to create my own implementation of FeatureManager where I explcitly set the ActivationStrategies (none, which is my case). Besides that I also wrote a new Builder.

What do you think?
Shall I commit these new classes to the appengine module ? Or should we refactor the current implementation in core to give users more flexibility when building the FeatureManager ?

BTW, apart from that, everything seems to be working fine!

Thanks in advance

Fábio


Christian Kaltepoth

unread,
Oct 21, 2013, 5:09:46 AM10/21/13
to toggl...@googlegroups.com
Hey Fábio,

thanks a lot for reporting this.

Hmmm. Looks like there is some problem with ServerIpActivationStrategy on GAE. This strategy tries to lookup the server's IP address using the JDK's NetworkInterface class. Very weird. The class is on the GAE white list. But according to the error message, it could be possible that the constructor of the strategy throws a NPE.

IMHO this is a bug in the strategy. So I think we should address this bug directly. I just committed some changes to the strategy that makes the construct more safe against NPEs. Perhaps GAE returns null for some method call that would normally always return a valid result on the JDK.

Unfortunately I've currently some technical problems deploying snapshots. Seems to be some issue with the Sonatype repository. But I pused the latest changes to GitHub, so you could give them a try.

Thanks

Christian




2013/10/21 Fábio Uechi <fue...@ciandt.com>

Christian Kaltepoth

unread,
Oct 23, 2013, 3:12:15 AM10/23/13
to toggl...@googlegroups.com
Hey,

I just managed to deploy new snapshots. I ran into a Maven bug [1] that was causing the problems with the snapshot deployment. So the latest 2.1.0-SNAPSHOT version on the Sonatype Repo should (hopefully) fix the problems with ServerIpActivationStrategy.

Christian




2013/10/21 Christian Kaltepoth <chri...@kaltepoth.de>
Reply all
Reply to author
Forward
0 new messages