Announcement Announcement Module
Collapse
No announcement yet.
Strange MongoAnnotationProcessor error when using SLF4J Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange MongoAnnotationProcessor error when using SLF4J

    I've got this odd error when using the MongoAnnotationProcessor with the APT plugin to create my QueryDSL objects from my Domain model. Everything was working great until I added an SLF4J logger on my domain model to do some debugging. I suddenly get an IndexOutOfBoundsException when the APT plugin runs. I've spent the past day looking through dependency graphs and comparing versions. If I comment out the logger field, not the log call, but the private static field that the factory sets, it all works! And... if I put the same line in my super class (an abstract base domain class), and set it as a protected field so I can use it in my sub-classes... it works! If I use JUL Logging... it works! But I can't seem to use SLF4J on the domain class itself. Hoping someone can point me in the right direction. All seems very odd. Thanks in advance.
    Code:
    private static final Logger LOGGER = LoggerFactory.getLogger(Event.class);
    Spring version: 3.1.2.RELEASE
    Spring Data Mongo version: 1.1.0.RC1 (also tried the current release version)
    QueryDSL verions: 2.6.0 (I always use the same version as Spring Data Mongo)
    SLF4J version: 1.7.0 (also tried other versions)

    Here's the Error:

    Code:
    [apt:process]
    execute error
    java.lang.RuntimeException: java.lang.IndexOutOfBoundsException: -1
    	at com.sun.tools.javac.main.Main.compile(Main.java:469)
    	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132)
    	at com.mysema.maven.apt.AbstractProcessorMojo.execute(AbstractProcessorMojo.java:182)
    	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    	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:84)
    	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:601)
    	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    Caused by: java.lang.IndexOutOfBoundsException: -1
    	at com.sun.tools.javac.util.List.get(List.java:414)
    	at com.mysema.query.apt.TypeExtractor.visitDeclared(TypeExtractor.java:62)
    	at com.mysema.query.apt.TypeExtractor.visitDeclared(TypeExtractor.java:32)
    	at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:731)
    	at javax.lang.model.util.AbstractTypeVisitor6.visit(AbstractTypeVisitor6.java:95)
    	at com.mysema.query.apt.AbstractQuerydslProcessor.processFromProperties(AbstractQuerydslProcessor.java:377)
    	at com.mysema.query.apt.AbstractQuerydslProcessor.getTypeFromProperties(AbstractQuerydslProcessor.java:347)
    	at com.mysema.query.apt.AbstractQuerydslProcessor.collectElements(AbstractQuerydslProcessor.java:220)
    	at com.mysema.query.apt.AbstractQuerydslProcessor.processAnnotations(AbstractQuerydslProcessor.java:118)
    	at com.mysema.query.apt.AbstractQuerydslProcessor.process(AbstractQuerydslProcessor.java:104)
    	at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
    	at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
    	at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
    	at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
    	at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
    	at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
    	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
    	at com.sun.tools.javac.main.Main.compile(Main.java:439)
    	... 23 more
    Last edited by MAndrews; Oct 6th, 2012, 05:44 PM.

  • #2
    Should also say I've tried different APT versions as well 1.0.4 of the maven-apt-plugin and 1.0.6 of the apt-maven-plugin.... and all the versions in between. Same results.

    Comment


    • #3
      Could you create a ticket for this on the Querydsl GitHub page?

      Comment


      • #4
        Originally posted by timowest View Post
        Could you create a ticket for this on the Querydsl GitHub page?
        Created the ticket and fixed it already https://github.com/mysema/querydsl/issues/246

        Comment


        • #5
          ah! Fantastic. Thanks so much. Just left a message over on GitHub for you. Thanks again. M

          Comment

          Working...
          X