takcy / openid4java

Automatically exported from code.google.com/p/openid4java
Apache License 2.0
0 stars 0 forks source link

ConsumerAssociationStore never created in ConsumerManager (NPE thrown) #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The ConsumerAssociationStore named "_associations" in ConsumerMangager
doesn't appear to ever get instantiated.  Upon normal use of
ConsumerManager, I get the following error:

Caused by: java.lang.NullPointerException
    at net.openid.consumer.ConsumerManager.associate(ConsumerManager.java:620)
    at net.openid.consumer.ConsumerManager.associate(ConsumerManager.java:588)  

Please provide any additional information below.

Suggested Fix:
In the ConsumerManager constructor, add a create statement to create an
InMemoryConsumerAssociationStore().

Original issue reported on code.google.com by sappenin on 6 Feb 2007 at 3:14

GoogleCodeExporter commented 8 years ago
Good point. The original intent was to leave these members uninitialized so that
whoever is using the manager classes makes a conscious decision on the actual
implementations.

We should have set them in the sample classes though.

Not 100% sure that this is the right approach, but for now (revision 83) we
initialize all of them in the manager classes.

Original comment by mscurte...@pingidentity.com on 6 Feb 2007 at 8:12

GoogleCodeExporter commented 8 years ago

Original comment by marius.s...@gmail.com on 6 Feb 2007 at 8:18

GoogleCodeExporter commented 8 years ago
Thanks!  Yeah, that's a good point.  Ideally there should be some way to tell 
people
to implement these themselves, although I don't think there is anything wrong 
with a
reference implementation.  Maybe consider moving the existing Managers into a
"sample" or "refimpl" package?  Downside is that might make that packages 
messier
than needed....

Original comment by sappenin on 6 Feb 2007 at 8:59