java.lang.SecurityException: class "javax.servlet.FilterRegistration"'s signer information ....

2,862 views
Skip to first unread message

Damian Helme

unread,
Oct 31, 2012, 1:39:26 PM10/31/12
to lif...@googlegroups.com
Just to give people a heads up ...

I've been working on a project based on Lift 2.5 lift_basic template and when I ran a test that involved starting up a jetty server, I got: 

[info] Exception encountered when attempting to run suite damianhelme.snippet.UserTest: class "javax.servlet.FilterRegistration"'s signer information does not match signer information of other classes in the same package *** ABORTED ***
[info]   java.lang.SecurityException: class "javax.servlet.FilterRegistration"'s signer information does not match signer information of other classes in the same package
[info]   at java.lang.ClassLoader.checkCerts(ClassLoader.java:806)
[info]   at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487)
[info]   at java.lang.ClassLoader.defineClassCond(ClassLoader.java:625)
[info]   at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
[info]   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
[info]   at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
[info]   at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
[info]   at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
[info]   at java.security.AccessController.doPrivileged(Native Method)
[info]   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

I seems that it can be fixed by adding the 'compile' configuration to the sbt dependency ...

     "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container,test,compile" artifacts Artifact("javax.servlet", "jar", "jar"),

(although, I don't fully understand why).

Worth changing in the Lift 2.5 getting started templates? Should I open a ticket?

Damian.

David Pollak

unread,
Oct 31, 2012, 3:54:44 PM10/31/12
to lif...@googlegroups.com
Yes & Yes
 

Damian.

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
 
 



--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net


Jeppe Nejsum Madsen

unread,
Oct 31, 2012, 5:02:43 PM10/31/12
to lif...@googlegroups.com
Perhaps javax.servlet is being included by some other dependency?

/Jeppe

Diego Medina

unread,
Oct 31, 2012, 5:50:31 PM10/31/12
to Lift
> Perhaps javax.servlet is being included by some other dependency?

if we add compile, wouldn't that mean that the war we create will
include this jar?

@Damian: could you include a sample repo with a test that start jetty?
(unless there i already one there), just so we could try different
options)

Thanks for all the things you have been finding and reporting lately!

Diego


>
> /Jeppe
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>
>



--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com

Damian Helme

unread,
Nov 8, 2012, 4:47:03 AM11/8/12
to lif...@googlegroups.com

I've isolated the problem to adding the jetty WebAppContext in the Specs test:
 

   class HelloWorldTestSpecs extends Specification {
      val server = new Server
      val scc = new SelectChannelConnector
      scc.setPort(8080)
      server.setConnectors(Array(scc))
      val context = new WebAppContext() // this line breaks it

If I change the test to a 'ScalaTest' one, it works fine - so I guess it's pointing to a clash between Specs2 and Jetty8 

Here's a repo demonstrating the problem:

https://github.com/dph01/lift-jetty-test

@jeppe - I can recreate the problem from lift_25_sbt/lift_basic without adding any other dependencies.

I'll carry on looking into it, but if anyone has any ideas in the meantime, please shout.

Thanks

Damian.

Damian Helme

unread,
Nov 8, 2012, 9:03:38 AM11/8/12
to lif...@googlegroups.com
ah, hang back on that last message, it's not as clear as I made out. Investigating further ...

Damian Helme

unread,
Nov 8, 2012, 9:20:52 AM11/8/12
to lif...@googlegroups.com
fixed it!

A selenium dependency was contributing to the problem:

    "org.seleniumhq.selenium" % "selenium-server" % "2.25.0" % "compile,test",

when I removed this dependency from the 'compile' configuration it worked:

    "org.seleniumhq.selenium" % "selenium-server" % "2.25.0" % "test",

sorry for the noise!

Diego Medina

unread,
Nov 22, 2012, 4:05:07 PM11/22/12
to Lift
glad you found the issue!
Reply all
Reply to author
Forward
0 new messages