java.lang.IllegalStateException: endPosTable already set

3,128 views
Skip to first unread message

BJ Esmailbegui

unread,
Sep 26, 2014, 6:04:52 PM9/26/14
to mapstru...@googlegroups.com
Hello all, 

I'm working on testing out mapstruct and ran into an issue while building. Everything seems to work fine  with eclipse (Luna) however while trying to compile my project via maven command line,  I get the following dump  

$mvn clean compile


java
.lang.IllegalStateException: endPosTable already set
        at com
.sun.tools.javac.util.DiagnosticSource.setEndPosTable(DiagnosticSource.java:136)
        at com
.sun.tools.javac.util.Log.setEndPosTable(Log.java:350)
        at com
.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:667)
        at com
.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:950)
        at com
.sun.tools.javac.processing.JavacProcessingEnvironment$Round.<init>(JavacProcessingEnvironment.java:892)
        at com
.sun.tools.javac.processing.JavacProcessingEnvironment$Round.next(JavacProcessingEnvironment.java:921)
        at com
.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1187)
        at com
.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
        at com
.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
        at com
.sun.tools.javac.main.Main.compile(Main.java:523)
        at com
.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
        at com
.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
        at org
.bsc.maven.plugin.processor.AbstractAnnotationProcessorMojo.executeWithExceptionsHandled(AbstractAnnotationProcessorMojo.java:545)
        at org
.bsc.maven.plugin.processor.AbstractAnnotationProcessorMojo.execute(AbstractAnnotationProcessorMojo.java:285)
        at org
.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
        at org
.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        at org
.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org
.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org
.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org
.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org
.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org
.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
        at org
.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
        at org
.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
        at org
.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
        at org
.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org
.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java
.lang.reflect.Method.invoke(Method.java:483)
        at org
.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org
.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org
.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org
.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] error on execute: error during compilation


Java/Maven Version: 
$ mvn -version
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T16:58:10-04:00)
Maven home: C:\apache-maven-3.2.3\bin\..
Java version: 1.8.0_20, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_20\jre
Default locale: en_US, platform encoding: Cp1252
OS name
: "windows 7", version: "6.1", arch: "amd64", family: "dos"


I attached the projects pom file. In the parent i define 
<mapstruct.version>1.0.0.Beta2</mapstruct.version>


Anybody else experiencing this? 

-BJ


pom.xml

Gunnar Morling

unread,
Sep 27, 2014, 1:10:44 AM9/27/14
to BJ Esmailbegui, mapstru...@googlegroups.com
Hi,

I'm wondering whether it's an issue with MapStruct actually as it doesn't show up in the stack trace. Does it compile when you don't apply the MapStruct annotation processor to your project? Another thing to try would be to use the latest JDK 7 and see whether that works.

Could you provide a minimal test case just with those class(es) which expose the issue? I then can give it a look.

--Gunnar



--
You received this message because you are subscribed to the Google Groups "mapstruct-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstruct-use...@googlegroups.com.
To post to this group, send email to mapstru...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

BJ Esmailbegui

unread,
Oct 2, 2014, 12:41:15 AM10/2/14
to mapstru...@googlegroups.com, bj.esma...@gmail.com
Hello Gunnar,

Here is an example of a project I just created

https://github.com/begui/java-mapping

When I run
mvn compile

i get the same error. Happens on both windows and linux.

$ mvn --version
Apache Maven 3.0.5
Maven home: /usr/share/maven

Java version: 1.8.0_20, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-36-generic", arch: "amd64", family: "unix"

Everything looks ok to me however maybe I have some maven misconfiguration? I'm going to debug it shortly and let you know what I find.

-BJ

Gunnar Morling

unread,
Oct 9, 2014, 6:15:48 PM10/9/14
to BJ Esmailbegui, mapstru...@googlegroups.com
Hi,

As it seems, the problem is related to the fact that you use "src/main/java" as the target folder for the generated classes. If I change it into something such as "src/target/generated-sources" everything works as expected.

Hth,

--Gunnar

BJ Esmailbegui

unread,
Oct 9, 2014, 9:22:41 PM10/9/14
to Gunnar Morling, mapstru...@googlegroups.com
Oh shoot... I forgot to update you on that... I did discover that was part of the reason why it was throwing that error. Basically the reason why I added the path there is to deploy the generated sources into my actual package to check in. I couldn't find if there is another way to do this.

I did manage to find another potential issue dealing with lambda expressions.. I'll send you some info on that shortly. It may also be due to the path issue as well.

Thank you for replying..

-BJ
Reply all
Reply to author
Forward
0 new messages