timperrett / lift-shiro

Lift Integration with the Shiro security framework
http://blog.getintheloop.eu/2011/08/23/using-apache-shiro-with-lift/
Apache License 2.0
50 stars 32 forks source link

/login seems to be broken #22

Closed alebon closed 10 years ago

alebon commented 10 years ago

I don't know if i misconfigured shiro or something, but with the latest SNAPSHOT the /login reoute fails with:

HTTP ERROR 500

Problem accessing /login. Reason:

shiro.sitemap.Locs$DefaultLogin$.snippets()Lscala/PartialFunction;

Caused by:

java.lang.AbstractMethodError: shiro.sitemap.Locs$DefaultLogin$.snippets()Lscala/PartialFunction; at net.liftweb.sitemap.Loc$$anonfun$calcSnippets$1.applyOrElse(Loc.scala:247) at net.liftweb.sitemap.Loc$$anonfun$calcSnippets$1.applyOrElse(Loc.scala:247) at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33) at scala.collection.TraversableLike$$anonfun$collect$1.apply(TraversableLike.scala:278) at scala.collection.immutable.List.foreach(List.scala:318) at scala.collection.TraversableLike$class.collect(TraversableLike.scala:278) at scala.collection.AbstractTraversable.collect(Traversable.scala:105) at net.liftweb.sitemap.Loc$class.calcSnippets(Loc.scala:247) at net.liftweb.sitemap.Loc$UnitLoc.calcSnippets$lzycompute(Loc.scala:485) at net.liftweb.sitemap.Loc$UnitLoc.calcSnippets(Loc.scala:485) at net.liftweb.sitemap.Loc$class.snippet(Loc.scala:256) .......

Any chance to get it fixed?

I already got it working with 0.0.8-SNAPSHOT but someone pushed an update to the repo an now it fails. :(

fmpwizard commented 10 years ago

Hi,

Which version of Lift and scala are you using? And how is the shiro dependency in your sbt file? (so I see exactly what you are using) Could you remove the lift jars from the ivy cache and do a clean compile of your project?

I normally do rm -rf ~/.ivy2/cache/net/liftweb*

Thanks

alebon commented 10 years ago

Hey Diego, i am using the latest lift 3.0 Snapshot.

lazy val lift_shiro_module = "eu.getintheloop" %% "lift-shiro_3.0" % "0.0.8-SNAPSHOT"

Thats my dependency. Removing the cache was not successful :(

fmpwizard commented 10 years ago

ok, I'll look into it and let you know, just in case, which scala 2.10 are you using? I know they are all supposed to be binary compatible (the 2.10.x but you never know with Scala)

alebon commented 10 years ago

For the moment, 2.10.3, but i can check other versions if you want me to.

Thanks a lot diego!

fmpwizard commented 10 years ago

I'm looking into this but also note that it would be better if you move to using Lift 3.0-M1, as the 3.0-snapshot will get some breaking changes real soon.

fmpwizard commented 10 years ago

ok, delete the cache for the shiro jars, sonatype now has updated jars, let me know if this works for you now.

alebon commented 10 years ago

Yep, fixed the problem. May i ask what the problem was? Just had no clue what the exception mean

fmpwizard commented 10 years ago

it is usually related to binary incompatibility between versions of scala or libraries you use.

To "fix it" I went into the lift-shiro project and:

>++2.10.0
>project lift-shiro-root
> set liftVersion := "3.0-M1"
>project lift-shiro-examples
> set liftVersion := "3.0-M1"
>project lift-shiro
> set liftVersion := "3.0-M1"
>project lift-shiro-root
>publish

and that set:

  1. the right scala version
  2. the right Lift version for all subprojects
  3. sent the jars to sonatype

if you ever run into this issue and can't wait for someone to publish the right jars, you can substitute publish for publish-local (or publishLocal if/when we move to sbt 0.13.x

Thanks and glad it is working now!

alebon commented 10 years ago

Thanks a lot for the quick help!