Annotation processors: Where is StandardLocation.CLASS_OUTPUT

72 views
Skip to first unread message

Marco Ladermann

unread,
Mar 12, 2017, 6:44:44 AM3/12/17
to ceylon-users
Hi all!

I'm trying to create a Griffon Application with ceylon. It was quite demanding for me to get that up and compiling, 'cause Griffon uses Guice and several other libraries for injection and aop.

In the moment I'm stuck with a griffon annotation processor, that looks for "artifacts", that are annotated as models, view and controllers. The processor generates files under META-INF/griffon containing the class names of the files, so that the griffon runtime can create models and views and inject them into the MVC objects.

Running the processor (.ceylon/config: apt=org.codehaus.griffon:griffon-core-compile/2.9.1) yields:

com.redhat.ceylon.compiler.SystemErrorException: com.redhat.ceylon.langtools.tools.javac.processing.AnnotationProcessingError: java.lang.NullPointerException
       at com.redhat.ceylon.compiler.CeylonCompileTool.handleExitCode(CeylonCompileTool.java:917)
       at com.redhat.ceylon.compiler.CeylonCompileTool.run(CeylonCompileTool.java:901)
       at com.redhat.ceylon.common.tools.CeylonTool.run(CeylonTool.java:547)
       at com.redhat.ceylon.common.tools.CeylonTool.execute(CeylonTool.java:423)
       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:498)
       at com.redhat.ceylon.launcher.Launcher.runInJava7Checked(Launcher.java:108)
       at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:38)
       at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:31)
       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:498)
       at com.redhat.ceylon.launcher.Bootstrap.runVersion(Bootstrap.java:162)
       at com.redhat.ceylon.launcher.Bootstrap.runInternal(Bootstrap.java:117)
       at com.redhat.ceylon.launcher.Bootstrap.run(Bootstrap.java:93)
       at com.redhat.ceylon.launcher.Bootstrap.main(Bootstrap.java:85)
Caused by: com.redhat.ceylon.langtools.tools.javac.processing.AnnotationProcessingError: java.lang.NullPointerException
       at com.redhat.ceylon.langtools.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:834)
       at com.redhat.ceylon.langtools.tools.javac.processing.JavacProcessingEnvironment.access$200(JavacProcessingEnvironment.java:95)
       at com.redhat.ceylon.langtools.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.runContributingProcs(JavacProcessingEnvironment.java:646)
       at com.redhat.ceylon.langtools.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1064)
       at com.redhat.ceylon.langtools.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1231)
       at com.redhat.ceylon.langtools.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1173)
       at com.redhat.ceylon.langtools.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
       at com.redhat.ceylon.compiler.java.tools.LanguageCompiler.compile(LanguageCompiler.java:272)
       at com.redhat.ceylon.compiler.java.launcher.Main.compile(Main.java:659)
       at com.redhat.ceylon.compiler.java.launcher.Main.compile(Main.java:565)
       at com.redhat.ceylon.compiler.java.launcher.Main.compile(Main.java:557)
       at com.redhat.ceylon.compiler.java.launcher.Main.compile(Main.java:546)
       at com.redhat.ceylon.compiler.CeylonCompileTool.run(CeylonCompileTool.java:900)
       ... 17 more
Caused by: java.lang.NullPointerException
       at java.io.Writer.<init>(Writer.java:88)
       at java.io.FilterWriter.<init>(FilterWriter.java:55)
       at com.redhat.ceylon.langtools.tools.javac.processing.JavacFiler$FilerWriter.<init>(JavacFiler.java:291)
       at com.redhat.ceylon.langtools.tools.javac.processing.JavacFiler$FilerOutputFileObject.openWriter(JavacFiler.java:141)
       at com.redhat.ceylon.langtools.tools.javac.processing.wrappers.FileObjectFacade.openWriter(FileObjectFacade.java:57)
       at org.kordamp.jipsy.processor.AbstractResourcePersistence.createWriter(AbstractResourcePersistence.java:91)
       at org.kordamp.jipsy.processor.AbstractPersistence.write(AbstractPersistence.java:55)
       at org.codehaus.griffon.compile.core.processor.artifact.ArtifactProviderProcessor.writeData(ArtifactProviderProcessor.java:103)
       at org.kordamp.jipsy.processor.AbstractSpiProcessor.process(AbstractSpiProcessor.java:72)
       at com.redhat.ceylon.langtools.tools.javac.processing.wrappers.ProcessorWrapper.process(ProcessorWrapper.java:66)
       at com.redhat.ceylon.langtools.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:822)
       ... 29 more


It seems that a call to the filers createResource is the root of the problem
fo = filer.createResource(StandardLocation.CLASS_OUTPUT,"", "Test.properties");

BTW: Creating the files by hand and putting them under "<module>/ROOT/META-INF/griffon/..." works.

Best regards,
Marco

Stephane Epardaud

unread,
Mar 16, 2017, 6:19:30 AM3/16/17
to ceylon...@googlegroups.com
Hi,

I'd have to test this to figure out what best to do. Can you report an issue with some test code I can run on https://github.com/ceylon/ceylon/issues ?

Thanks.

--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users+unsubscribe@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/2fcae4ec-41cb-4b74-a158-d69571069711%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Stéphane Épardaud

Marco Ladermann

unread,
Mar 16, 2017, 8:26:06 AM3/16/17
to ceylon-users
Hi Stéphane.

Of course. I will do so tomorrow.

Marco.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users...@googlegroups.com.



--
Stéphane Épardaud

Marco Ladermann

unread,
Mar 17, 2017, 2:51:23 PM3/17/17
to ceylon-users
Here is the issue: Annotation processor throws NullPointer

Thanks!
Reply all
Reply to author
Forward
0 new messages