Muki-SkyWalker / specs

Automatically exported from code.google.com/p/specs
Other
0 stars 0 forks source link

NoSuchFieldError: bitmap$3 #190

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Got a Scala 2.9.1 project which I'm building in Scala IDE.

I frequently (almost every time I change something in the test class) get the 
error below. It goes away when I rebuild the project.

org.specs.runner.UserError: java.lang.NoSuchFieldError: bitmap$3
    at RestIntegrationTest.brands(RestIntegrationTest.scala:39)
    at RestIntegrationTest$$anonfun$1$$anonfun$apply$3.apply(RestIntegrationTest.scala:54)
    at RestIntegrationTest$$anonfun$1$$anonfun$apply$3.apply(RestIntegrationTest.scala:53)
    at org.specs.specification.LifeCycle$class.withCurrent(ExampleLifeCycle.scala:66)
    at org.specs.specification.Examples.withCurrent(Examples.scala:52)
    at org.specs.specification.Examples$$anonfun$specifyExample$1.apply(Examples.scala:114)
    at org.specs.specification.Examples$$anonfun$specifyExample$1.apply(Examples.scala:114)
    at org.specs.specification.ExampleExecution$$anonfun$3$$anonfun$apply$5.apply(ExampleLifeCycle.scala:219)
    at scala.Option.getOrElse(Option.scala:108)
    at org.specs.specification.LifeCycle$class.executeExpectations(ExampleLifeCycle.scala:90)
    at org.specs.specification.BaseSpecification.executeExpectations(BaseSpecification.scala:58)
    at org.specs.specification.ExampleContext$$anonfun$executeExpectations$3$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:81)
    at org.specs.specification.ExampleContext$$anonfun$executeExpectations$3$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:81)
    at scala.Option.map(Option.scala:133)
    at org.specs.specification.ExampleContext$$anonfun$executeExpectations$3$$anonfun$apply$3.apply(ExampleContext.scala:81)
    at org.specs.specification.ExampleContext$$anonfun$executeExpectations$3$$anonfun$apply$3.apply(ExampleContext.scala:81)
    at org.specs.specification.ExampleContext$class.id$1(ExampleContext.scala:32)
    at org.specs.specification.ExampleContext$$anonfun$1.apply(ExampleContext.scala:33)
    at org.specs.specification.ExampleContext$$anonfun$1.apply(ExampleContext.scala:33)
    at org.specs.specification.ExampleContext$$anonfun$executeExpectations$3.apply(ExampleContext.scala:81)
    at org.specs.specification.ExampleContext$$anonfun$executeExpectations$3.apply(ExampleContext.scala:80)
    at scala.Option.map(Option.scala:133)
    at org.specs.specification.ExampleContext$class.executeExpectations(ExampleContext.scala:80)
    at org.specs.specification.Examples.executeExpectations(Examples.scala:52)
    at org.specs.specification.ExampleContext$$anonfun$executeExpectations$3$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:81)
    at org.specs.specification.ExampleContext$$anonfun$executeExpectations$3$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:81)
    at scala.Option.map(Option.scala:133)
    at org.specs.specification.ExampleContext$$anonfun$executeExpectations$3$$anonfun$apply$3.apply(ExampleContext.scala:81)
    at org.specs.specification.ExampleContext$$anonfun$executeExpectations$3$$anonfun$apply$3.apply(ExampleContext.scala:81)
    at org.specs.specification.ExampleContext$class.id$1(ExampleContext.scala:32)
    at org.specs.specification.ExampleContext$$anonfun$1.apply(ExampleContext.scala:33)
    at org.specs.specification.ExampleContext$$anonfun$1.apply(ExampleContext.scala:33)
    at org.specs.specification.ExampleContext$$anonfun$executeExpectations$3.apply(ExampleContext.scala:81)
    at org.specs.specification.ExampleContext$$anonfun$executeExpectations$3.apply(ExampleContext.scala:80)
    at scala.Option.map(Option.scala:133)
    at org.specs.specification.ExampleContext$class.executeExpectations(ExampleContext.scala:80)
    at org.specs.specification.Examples.executeExpectations(Examples.scala:52)
    at org.specs.specification.ExampleExecution$$anonfun$3.apply(ExampleLifeCycle.scala:219)
    at org.specs.specification.ExampleExecution$$anonfun$3.apply(ExampleLifeCycle.scala:198)
    at org.specs.specification.ExampleExecution$$anonfun$2.apply(ExampleLifeCycle.scala:181)
    at org.specs.specification.ExampleExecution.execute(ExampleLifeCycle.scala:252)
    at org.specs.specification.SpecificationExecutor$$anonfun$executeExample$3.apply(SpecificationExecutor.scala:70)
    at org.specs.specification.SpecificationExecutor$$anonfun$executeExample$3.apply(SpecificationExecutor.scala:70)
    at scala.Option.map(Option.scala:133)
    at org.specs.specification.SpecificationExecutor$class.executeExample(SpecificationExecutor.scala:70)
    at org.specs.specification.BaseSpecification.executeExample(BaseSpecification.scala:58)
    at org.specs.specification.BaseSpecification.executeExample(BaseSpecification.scala:58)
    at org.specs.specification.ExampleLifeCycle$$anonfun$executeExample$1.apply(ExampleLifeCycle.scala:125)
    at org.specs.specification.ExampleLifeCycle$$anonfun$executeExample$1.apply(ExampleLifeCycle.scala:125)
    at scala.Option.map(Option.scala:133)
    at org.specs.specification.ExampleLifeCycle$class.executeExample(ExampleLifeCycle.scala:125)
    at org.specs.specification.Examples.executeExample(Examples.scala:52)
    at org.specs.specification.Examples.executeExample(Examples.scala:52)
    at org.specs.specification.Examples$$anonfun$executeExamples$2.apply(Examples.scala:80)
    at org.specs.specification.Examples$$anonfun$executeExamples$2.apply(Examples.scala:80)
    at scala.Option.map(Option.scala:133)
    at org.specs.specification.Examples.executeExamples(Examples.scala:80)
    at org.specs.specification.ExampleStructure$class.ownSkipped(ExampleStructure.scala:60)
    at org.specs.specification.Examples.ownSkipped(Examples.scala:52)
    at org.specs.runner.ExampleTestCase.run(JUnit.scala:205)
    at junit.framework.TestSuite.runTest(TestSuite.java:243)
    at junit.framework.TestSuite.run(TestSuite.java:238)
    at org.specs.runner.JUnitSuite$class.run(JUnit.scala:62)
    at org.specs.runner.ExamplesTestSuite.run(JUnit.scala:167)
    at junit.framework.TestSuite.runTest(TestSuite.java:243)
    at junit.framework.TestSuite.run(TestSuite.java:238)
    at org.specs.runner.JUnitSuite$class.run(JUnit.scala:62)
    at org.specs.SpecificationWithJUnit.run(SpecificationWithJUnit.scala:29)
    at org.specs.runner.JUnitSuiteRunner.run(JUnitSuiteRunner.scala:45)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Here's a sample of a test case where it occurs

import java.util.Date
import java.io.File
import scala.Option.option2Iterable
import scala.xml.Elem
import scala.xml.NodeBuffer
import scala.xml.XML
import org.joda.time.DateTime
import org.joda.time.DateTimeZone
import org.junit.runner.RunWith
import org.specs.runner.JUnit
import org.specs.Specification
import org.specs.SpecificationWithJUnit
import org.specs.runner.JUnitSuiteRunner
import org.apache.commons.io.IOUtils
import org.apache.commons.lang.StringUtils
import org.apache.commons.io.FileUtils
import sm.ds._
import sm.ds.DSJsonMapper._
import com.fasterxml.jackson.core.JsonParseException

/**
 * Specs test of JSON parsing functionality
 */

@RunWith(classOf[JUnitSuiteRunner])
class RestIntegrationTest extends SpecificationWithJUnit {

  def getFile(s: String) = new File((classOf[RestIntegrationTest].getClassLoader().getResource(s).getFile()))

  def getFileContent(s: String): String = {
    FileUtils.readFileToString(
      new File((classOf[RestIntegrationTest].getClassLoader().getResource(s).getFile())))
  }
  def getFileContentArray(s: String): List[String] = {
    import collection.JavaConversions._
    FileUtils.readLines(getFile(s)).toList
  }

  lazy val brands = getFileContentArray("brand_list.txt")

  def getQueryReg(s: String): Either[String, Tuple2[Long, String]] = {
    val QRegex = """^"([0-9]*)","(\"itunes\")$"""".r
    s match {
      case QRegex(a, b) => try {
        Right(a.toLong, b)
      } catch { case e => Left(format("Can't parse %s:%s", s, e)) }
      case _ => Left(s)
    }
  }

  lazy val existing_queries = getFileContent("brand_list.txt")
  "conversions" should {
    "parse a query add instruction correctly" in {
      val res = brands.map(getQueryReg)
      val good = res.filter(_.isRight)
      val bad = res.filter(_.isLeft)
      bad.length must_== 0
      good.length must_== res.length
    }
  }
}

object RestIntegrationTest {
  def main(args: Array[String]) {
    new RestIntegrationTest().main(args)
  }
}

Original issue reported on code.google.com by sentimen...@gmail.com on 26 Jun 2012 at 11:37

GoogleCodeExporter commented 9 years ago
I'm not sure there is much which can be done at the specs level to fix this 
issue. It looks like an incremental build problem which you should submit to 
the Scala-IDE project.

Original comment by etorrebo...@gmail.com on 9 Jul 2012 at 9:46

GoogleCodeExporter commented 9 years ago
OK. Will do. It's strange that it only happens with Specs though. Perhaps the 
syntax stretches Scala to it's limit. Thanks for replying, Bryan.

Original comment by sentimen...@gmail.com on 10 Jul 2012 at 8:57