perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.64k stars 1.56k forks source link

Remove spark.LambdaTest from JAR #166

Closed davsclaus closed 8 years ago

davsclaus commented 10 years ago

This seems like an unit test class or something.

It causes problems if you use Spark in a servlet container, such as Jetty (not the embedded Jetty) which reports a WARN on startup with

2014-06-30 13:43:30.980:WARN:oeja.AnnotationParser:Problem processing jar entry spark/LambdaTest.class
java.lang.ArrayIndexOutOfBoundsException: 7786
    at org.objectweb.asm.ClassReader.readClass(Unknown Source)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at org.objectweb.asm.ClassReader.accept(Unknown Source)
    at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:899)
    at org.eclipse.jetty.annotations.AnnotationParser$2.processEntry(AnnotationParser.java:857)
    at org.eclipse.jetty.webapp.JarScanner.matched(JarScanner.java:161)
    at org.eclipse.jetty.util.PatternMatcher.matchPatterns(PatternMatcher.java:100)
    at org.eclipse.jetty.util.PatternMatcher.match(PatternMatcher.java:82)
    at org.eclipse.jetty.webapp.JarScanner.scan(JarScanner.java:84)
    at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:869)
    at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:884)
    at org.eclipse.jetty.annotations.AnnotationConfiguration.parseWebInfLib(AnnotationConfiguration.java:422)
    at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:120)
    at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:468)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1237)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)

Seems like this Test class could be move our of the main JAR.

amarseillan-zz commented 10 years ago

+1 what is that doing there anyway

shayneoneill commented 8 years ago

Is there a solution to this? I'm having big problems with this exploding all over my code.