Re: Starting work on Agorava again & need some help

34 views
Skip to first unread message

Antoine Sabot-Durand

unread,
Nov 10, 2013, 4:43:41 PM11/10/13
to agora...@googlegroups.com, John Schneider
Hi John,

No problem, I know what is it to not having enough time ;).
Be sure, that your contribution will be appreciated in its time.

The bug bug you’re experiencing is due to the new OAuhtSession and OAuthRepo mechanism I put in place.

You can stop this ambiguity by specifying how you want your OauthSession to be produced in your agorava.properties file (in WEB-INF or your class path)
You have to choose between this choices :

- application —> you’ve got one OAuthSession (one connexion for a given Social Network account) for the whole application. This is not suitable for Web App, but useful for desktop or server side apps
- session —> your OauthSession are stored in Http Session. This was the previous behavior but was too stageful for whole use case
- request —>  your OauthSession are managed for each web user but stored in ApplicationScope. You keep your session repo by an id in the url
- cookie —> your OauthSession are managed for each web user but stored in ApplicationScope. You keep your session repo by a cookie on client

To activate one mode you’ll have to add
producerScope=<your choice>

in agorava.properties.

for instance

producerScope=cookie

Check how it is done in Agorava with cookie mode

And don’t hesitate to check the code of the different producers. It can be helpful


etc...

Sorry for the inconvenient. Apprently when producerScope property is not defined all producers get activated.

Antoine Sabot-Durand
———————————————
Senior Software engineer
CDI co-spec lead
CDI eco-system development

PS : I forwarded this thread to Agorava ML / group  since, I think it could be profitable to everyone 


Le 10 nov. 2013 à 18:14, John Schneider <john.a.s...@gmail.com> a écrit :

Hi guys,

Sorry I haven't had time to start contributing to the Agorava project as I spoke of several weeks ago.  I'm getting back into the swing of things again after some business travel and looking forward to providing some code contributions in the coming weeks.

Antoine, I see that you've been working hard on Agorava core and I've seen many of the JIRA updates you've made recently. It's great to see such rapid progression for the project!

Using the latest 0.7.0-SNAPSHOT, I'm trying to deploy a test app on Glassfish 4 using an updated Weld - 2.0.4-Final. I'm getting an ambiguous CDI bean error.  It seems the javax.enterprise.context.*Scoped annotations are not being considered as qualifiers for the getCurrentRepo method in the In*Producer classes.  Looking at the source code for the javax.enterprise.context.*Scoped annotations from Weld 2.0.4, I don't see them annotated with @javax.inject.Qualifier. An exception with the following message is thrown:
WELD-001414 Bean name is ambiguous. Name currentRepo resolves to beans: [
Producer Method [UserSessionRepository] with qualifiers [@Current @Any @Named] declared as [[BackedAnnotatedMethod] @Produces @Current @Named @SessionScoped public org.agorava.cdi.InSessionProducer.getCurrentRepo()],
Producer Method [UserSessionRepository] with qualifiers [@Current @Any @Named] declared as [[BackedAnnotatedMethod] @Produces @Current @Named @RequestScoped public org.agorava.cdi.InCookieProducer.getCurrentRepo()],
Producer Method [UserSessionRepository] with qualifiers [@Current @Any @Named] declared as [[BackedAnnotatedMethod] @Produces @Current @Named @ApplicationScoped public org.agorava.cdi.InApplicationProducer.getCurrentRepo()],
Producer Method [UserSessionRepository] with qualifiers [@Current @Any @Named] declared as [[BackedAnnotatedMethod] @Produces @Current @Named @RequestScoped public org.agorava.cdi.InRequestProducer.getCurrentRepo()]]


Have you run into the same problem?  In any case, what version of Weld are you using?  Perhaps we need custom qualifiers to be annotated on these methods.

Thanks,
John

Jérémie Gauthier

unread,
Nov 10, 2013, 5:35:01 PM11/10/13
to agora...@googlegroups.com
Thanks for the forward, i was working on the Instagram connector earlier today and was stucked on the same issue...But now i have another issue when running my test on Weld1.x or Weld 2.x with a producerScope=application : 

WELD-001308 Unable to resolve any beans for Types: [interface org.agorava.spi.UserProfileService]; Bindings: [@javax.enterprise.inject.Any(), @org.agorava.instagram.Instagram()]

Is there any new configuration that must be add ?

Thanks
Jérémie


2013/11/10 Antoine Sabot-Durand <antoine.s...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Agorava Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to agorava-dev...@googlegroups.com.
To post to this group, send an email to agora...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/agorava-dev/C31C51C0-D04A-403D-9343-B846506B14C0%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Antoine Sabot-Durand

unread,
Nov 10, 2013, 6:07:38 PM11/10/13
to agora...@googlegroups.com
Yes,

One of your API service class must implement org.agorava.spi.UserProfileService and have the qualifier @Instagram. That’s how Agorava retrieve the service that resolve user profile.
Check how it is done in Twitter module :

Implementation : http://s.shr.lc/HQsiaZ


In previous version we used to have an event (@Observes OAuthComplete) to that, I deprecated this behavior for 2 reasons:

1) not compatible with other JSR 330 impl

The event is still fired but it’s no more used for user profile resolution (done before the event to solve AGOVA-53). See the endDance() method of the brand new OauthLifeCycleService classes


Thanks for your patience, API are now frozen and release 0.7 around the corner.

Antoine Sabot-Durand
———————————————
Senior Software engineer
CDI co-spec lead
CDI eco-system development

John Schneider

unread,
Nov 10, 2013, 6:29:13 PM11/10/13
to Antoine Sabot-Durand, agora...@googlegroups.com
Thanks for the helpful information Antoine.  I'm now past that error.

However, I've come to a new exception, also thrown on initial deployment.  It appears that there is a problem with the passivation of the GlobalRepositoryImpl class.  Following the interface hierarchy up to org.agorava.api.storage.Repository, I see that Repository does extend Serializable.  Perhaps serialVersionUID simply needs to be added to GlobalRepositoryImpl.

The message of the exception thrown is:
org.jboss.weld.exceptions.UnserializableDependencyException: WELD-001413 The bean Managed Bean [class org.agorava.cdi.InSessionProducer] with qualifiers [@Any @Default] declares passivating scope but has non-passivation-capable dependency Managed Bean [class org.agorava.oauth.GlobalRepositoryImpl] with qualifiers [@Any @Default]


Thanks,
John

Antoine Sabot-Durand

unread,
Nov 10, 2013, 7:29:06 PM11/10/13
to agora...@googlegroups.com, John Schneider
Hmm this doesn’t happen on JBoss 7.1.1. I guess it’s due by CDI 1.1 more restrictive approach.
Could you create a ticket on Jira ? I’ll try to fix this tomorrow.

Thanks


Antoine Sabot-Durand
———————————————
Senior Software engineer
CDI co-spec lead
CDI eco-system development

Antoine Sabot-Durand

unread,
Nov 11, 2013, 11:58:33 AM11/11/13
to agora...@googlegroups.com, John Schneider
John,

Your previous bug (https://issues.jboss.org/browse/AGOVA-62) is now fix.
But now I’m stumbling on (http://issues.jboss.org/browse/AGOVA-63) preventing 0.7 to work with weld 2.x.
I have to fix this issue before the release (should have do more integration test on CDI 1.1).

In the meantime you can continue your testing/devs on glass fish 3 (or JBoss AS 7) if it’s possible for you.

thanks,

Antoine Sabot-Durand


Le 11 nov. 2013 à 02:05, John Schneider <john.a.s...@gmail.com> a écrit :

Thanks Antoine.  I created AGOVA-62 for this.

https://issues.jboss.org/browse/AGOVA-62

Antoine Sabot-Durand

unread,
Nov 12, 2013, 10:26:49 AM11/12/13
to agora...@googlegroups.com, John Schneider
John,

Everything should work now for Glassfish 4.0. I changed the code with clean workaround but escalated the bug in AGOVA-63 to the Weld Team (https://issues.jboss.org/browse/WELD-1552).

I still have issues in Socializer, but they are mainly due to JSF and Primefaces issues : not relevant for 0.7 release.

I smell the 0.7 release (yes I know keep saying that since 1 month)

regards,


Antoine Sabot-Durand
———————————————
CDI co-spec lead
CDI eco-system development
Agorava tech lead
Reply all
Reply to author
Forward
0 new messages