New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.11/2.12 StackOverflowError in SpecializeTypes.specializedTypeVars #10239
Comments
Imported From: https://issues.scala-lang.org/browse/SI-10239?orig=1 |
I tracked down what was going on here, and it's quite strange. I had
It turns out that were linking against the 3.4.0 version of mybatis, but our version of mybatis-scala was linked against 3.2(I think .8). One notable difference between these two versions of mybatis are that some arguments of functions of the Session class are generic in 3.4 and not in 3.2. For example, in mybatis-scala's Session:
In 3.4 mybatis, ResultHandler takes a type parameter. When I re-compiled mybatis-scala against 3.4, and fixed the compile errors resulting from missing type parameters, our code then compiled successfully. This is such a crazy scenario, that I'm not even sure what to recommend, so the best I can hope for is that someone who stumbles across this in the future might have a lead on tracking down the problem. |
I'm also getting the same issue can u check with the below error for confirmation and help me object java.lang.Object in compiler mirror not found.
|
That's a different stack trace. Mine was a StackOverflowError at the root, and yours is a MissingRequirementError. I would search for the root cause, rather than the top-level exception. In this case, the following results might give you hints:
|
I'm not using sbt in my project and also i'm using the java 8 for the project.Scala version is 2.10 is using for my project |
I would review ALL of your jar dependencies (direct and transitive) and make sure nothing is bringing in a dependency that conflicts. Maybe something has a 2.11 dependency down in the list or something like that. The process I went through was just whittling down chunks of code until I found something that reliably failed to compile with the smallest set of code and dependencies possible, then I started whittling down jar dependencies to see what might be wrong. Not sure there's an easy or fast answer to this one. |
With the same configuaration it working for all of my colleagues but not for me.I'm not sure about it why it is behaving weired to me. buildscript {
repositories {
mavenLocal()
maven {
url "${artifactory_contextUrl}/plugins-release"
credentials {
username = "${artifactoryUser}"
password = "${artifactoryPassword}"
}
}
maven {
url "${artifactory_contextUrl}/libs-release"
credentials {
username = "${artifactoryUser}"
password = "${artifactoryPassword}"
}
maven {
url "https://mvnrepository.com"
}
}
maven {
url "http://repository.mapr.com/maven/"
}
}
dependencies {
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1'
classpath 'org.oneplatform.plugin:oneplatform-plugin-release:9.1.1'
classpath 'org.oneplatform.plugin:oneplatform-plugin-qualitycheck:5.+'
classpath 'org.oneplatform.plugin:oneplatform-plugin-microbuild:12.+'
classpath 'org.oneplatform:oneplatform-cloudfoundry-gradle-plugin:1.+'
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.3.3.RELEASE'
classpath "net.saliman:gradle-properties-plugin:1.4.4"
classpath "org.asciidoctor:asciidoctor-gradle-plugin:1.5.3"
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.2.1"
}
configurations.classpath {
resolutionStrategy {
cacheDynamicVersionsFor 0, 'seconds'
}
}
configurations {
runtime.exclude module: 'oneplatform-commons-auditing'
}
}
apply plugin: org.oneplatform.plugin.microbuild.MicroBuildDependencyPlugin
apply plugin: 'net.saliman.properties'
apply plugin: 'org.asciidoctor.gradle.asciidoctor'
apply plugin: 'org.asciidoctor.convert'
apply plugin: "oneplatform-plugin-qualitycheck"
apply plugin: 'oneplatform-plugin-release'
apply plugin: 'scala'
apply plugin: "org.sonarqube"
apply plugin: "org.sonarqube"
apply plugin: 'com.github.johnrengelman.shadow'
findMainClass.enabled = false
bootRepackage.enabled = false
//set Java compiler -source and -target options
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
ext {
scalaVersion = '2.10.4'
scalaLibVersion = '2.10'
}
configurations {
springBootJars
springBootJars.exclude group: 'ch.qos.logback', module: 'logback-classic'
springBootJars.exclude group: 'org.slf4j', module: 'log4j-over-slf4j'
}
dependencies {
// Commons
compile ('org.oneplatform:oneplatform-commons-framework:23.+') {
changing = true
exclude module: 'liquibase-core'
}
// oneplatform-commons-framework included in oneplatform-bigdata-commons
compile ('com.paysafe.bigdata:oneplatform-bigdata-commons:5.+') {
changing = true
}
compile ('com.paysafe.grse:paysafe-grse-recon-commons:1.+'){
changing = true
}
// Scala
compile("org.scala-lang:scala-library:$scalaVersion")
compile("org.scala-lang:scala-reflect:$scalaVersion")
// Spark and hbase
compile "org.apache.spark:spark-core_$scalaLibVersion:1.6.1"
compile "org.apache.spark:spark-sql_$scalaLibVersion:1.6.1"
compile "org.apache.spark:spark-streaming_$scalaLibVersion:1.6.1"
compile "org.apache.hbase:hbase-server:1.1.1-mapr-1602-m7-5.1.0"
compile "com.databricks:spark-xml_$scalaLibVersion:0.3.3"
compile "com.databricks:spark-csv_$scalaLibVersion:1.4.0"
compile "com.mapr.db:maprdb:5.1.0-mapr"
compile "org.apache.spark:spark-hive_2.10:1.6.1"
compile "org.mockito:mockito-core:1.9.5"
compile "com.jcraft:jsch:0.1.53"
compile "com.googlecode.json-simple:json-simple:1.1.1"
compile "org.projectlombok:lombok:1.16.10"
compile 'org.apache.poi:poi-ooxml:3.15'
// https://mvnrepository.com/artifact/org.apache.commons/commons-io
compile group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'
// Spring batch integration
compile "org.springframework.boot:spring-boot-starter-batch:1.3.3.RELEASE"
compile "org.springframework.data:spring-data-hadoop-boot:2.3.0.M2"
compile "org.apache.spark:spark-yarn_2.10:1.6.1"
// Fixed format text file parsing
compile "com.ancientprogramming.fixedformat4j:fixedformat4j:1.2.2"
compile "org.springframework.boot:spring-boot-starter-web:1.3.3.RELEASE"
compile "org.springframework.boot:spring-boot-starter-actuator:1.3.3.RELEASE"
compile "org.springframework.boot:spring-boot-starter-jetty:1.3.3.RELEASE"
compile "org.springframework.cloud:spring-cloud-starter-config:1.1.0.RELEASE"
compile "org.springframework.cloud:spring-cloud-starter-eureka:1.1.0.RELEASE"
//jsoup for html parsing
compile 'org.jsoup:jsoup:1.10.1'
//Mist
compile group: 'io.hydrosphere', name: 'mist-lib-spark1_2.10', version: '0.11.0'
//smokeTest
compile group: 'net.sourceforge.jexcelapi', name: 'jxl', version: '2.6.12'
compile group: 'org.testng', name: 'testng', version: '6.10'
compile group: 'org.mvel', name: 'mvel2', version: '2.2.8.Final'
compile group: 'org.apache.avro', name:'avro-mapred', version:'1.8.1'
springBootJars group: 'org.springframework.boot', name: 'spring-boot-starter-parent', version: '1.3.0.M5'
springBootJars group: 'org.springframework.boot', name: 'spring-boot-starter-batch', version: '1.3.3.RELEASE'
springBootJars group: 'org.springframework.data', name: 'spring-data-hadoop-boot', version: '2.3.0.M2'
springBootJars group: 'org.apache.hadoop', name: 'hadoop-common', version:'2.7.0-mapr-1506'
springBootJars group: 'org.apache.spark', name: 'spark-yarn_2.10', version:'1.6.1'
// Test
testCompile("org.scalatest:scalatest_$scalaLibVersion:2.1.4")
testCompile("junit:junit:4.11")
testCompile("org.apache.hadoop:hadoop-hdfs:2.6.0")
testCompile("org.apache.hadoop:hadoop-common:2.6.0")
testCompile("org.apache.hadoop:hadoop-client:2.6.0")
testCompile("org.apache.hadoop:hadoop-mapreduce-client-jobclient:2.6.0")
testCompile("org.apache.hadoop:hadoop-yarn-server-tests:2.6.0")
testCompile("org.apache.hadoop:hadoop-yarn-server-web-proxy:2.6.0")
testCompile("com.holdenkarau:spark-testing-base_2.10:1.6.1_0.3.3")
testCompile "org.apache.hadoop:hadoop-common:2.7.0"
compile('ch.qos.logback:logback-classic:1.1.5') {
exclude group: 'org.slf4j', module: 'slf4j-api' //by both name and group
}
compile('com.fasterxml.jackson.core:jackson-databind:2.4.6')
}
//Java compiler settings
tasks.withType(JavaCompile) {
//ignore conjunction warning
options.compilerArgs << '-Xlint:-options'
}
tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = ["-feature", "-language:implicitConversions", "-language:reflectiveCalls"]
scalaCompileOptions.useAnt = false
}
sonarqube {
properties {
property "sonar.exclusions", "**/deploy/**,**/domain/**,**/fixedformat/**,**/repository/**,**/Constants.java,**/FileUploadUtility.java"
}
}
sourceSets.main.java.srcDirs = []
sourceSets.main.scala.srcDirs = ["src/main/java","src/main/scala"]
sourceSets.test.scala.srcDirs = ["src/test/java","src/test/scala"]
shadowJar {
zip64 true
configurations = [project.configurations.compile , project.configurations.springBootJars]
} |
On my machine, the problem was due to a recent upgrade from Java v8 to Java v11. I was able to fix my Scala Gradle builds by updating my Scala library dependency: dependencies {
compile 'org.scala-lang:scala-library:2.11.12'
} According to the official Scala / Java compatibility matrix: https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html Though of course the fat JAR I built with com.github.johnrengelman.shadow v4.0.4 somehow doesn't get all the Scala library classes, so my Scala JAR artifacts are borked. I can fix that by updating to Scala library 2.12.4. |
reading this over, it doesn't appear that any bug in Scala itself has been clearly identified, so I'm going to close the ticket |
We're upgrading a project from scala 2.10.4 to 2.11.8 and we're getting a StackOverflowError out of the compiler. Unfortunately, there's zero additional debug or context provided, but when I build with Gradle 3.4.1 (though it happens on every gradle version I've tried), zinc 0.3.13 (though it fails on every zinc I'm tried, too), and Scala 2.11.0 – 2.12.1, I get the following:
The text was updated successfully, but these errors were encountered: