[2.0] LinkageError: loader constraint violation

145 views
Skip to first unread message

Leone

unread,
May 12, 2012, 4:27:28 PM5/12/12
to play-fr...@googlegroups.com
I was playing with this project https://github.com/bjartek/computer-database-mongo in Play 2.0.1 and every time it recompiles I get the error attatched in the next reload.

Do you have any idea what is going on?

Thanks.
error.png

Andy Czerwonka

unread,
May 13, 2012, 3:15:19 AM5/13/12
to play-fr...@googlegroups.com

Andy Czerwonka

unread,
May 13, 2012, 10:17:07 AM5/13/12
to play-fr...@googlegroups.com
Are you saying its happening to you on the vanilla project? No changes?

Leone

unread,
May 13, 2012, 4:55:39 PM5/13/12
to play-fr...@googlegroups.com
Yes. It's happening on the vanilla project. Every time I try to edit the Computer model. There is a Page helper object and the error rise in view. I don't know what's going on.

Leone

unread,
May 13, 2012, 5:49:51 PM5/13/12
to play-fr...@googlegroups.com
After deleting ALL ivy and maven related directories (~/.ivi2, ~/.m2, PLAY_HOME/repository/cache and PLAY_HOME/repository/local), I'm getting this error.


Em domingo, 13 de maio de 2012 11h17min07s UTC-3, Andy Czerwonka escreveu:
routes_error.png

Andy Czerwonka

unread,
May 14, 2012, 9:38:53 AM5/14/12
to play-fr...@googlegroups.com
It would be awesome to get some feedback from the Play team as we're not sure how to deal with this issue. I am having the same problem. I assume it's a bug, but I don't know.

Leone

unread,
May 15, 2012, 10:20:51 AM5/15/12
to play-fr...@googlegroups.com

Guillaume Bort

unread,
May 16, 2012, 12:41:37 PM5/16/12
to play-fr...@googlegroups.com
Anyway there is nothing we can do on the Play side. To be able to
reload your code, everything must be fully stateless. If any lib try
to keep reference on old classLoader/classes it will lead to
ClassCastException/LinkageError problems.

The only solution is to have a proper Salat plugin for Play 2.0 that
take care to clean all the dirty Salat cache on application reloading.
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/P8UWwlYmV54J.
>
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.



--
Guillaume Bort

Andy Czerwonka

unread,
May 17, 2012, 7:35:08 PM5/17/12
to play-fr...@googlegroups.com
I'm not sure how this interacts with the latest Salat plugin - 1.0.3. I tried the approach used in https://github.com/andypetrella/classloading-problem and it messes with the persistence in that it wraps each object. For example, without the implicit salatctx saving a user object gives me the following:

{ "_id" : ObjectId("4fb586b7ccf2ddffeb898b87"), "username" : "aczerwonka", "email" : "andycz...@myemail.com" }

That's what I expect. When I search by username, I find the right version and everything is great. But, when I import the implicit salatctx, the same operation results in:

{ "_id" : ObjectId("4fb58a3dccf268cf9d43720e"), "_typeHint" : "models.User", "id" : ObjectId("4fb58a2fccf268cf9d43720c"), "username" : "aczerwonka", "email" : "andycz...@myemail.com" }

This is not what I expect. My findByUsername obviously fails and I end up creating many User objects in the mongo database. I'm not sure what is happening the the implicit salatctx magic is magically messing up everything.

git revert :-(
> To post to this group, send email to play-framework@googlegroups.com.
> To unsubscribe from this group, send email to
Reply all
Reply to author
Forward
0 new messages