APT processing in Eclipse

116 views
Skip to first unread message

Damien B

unread,
Sep 24, 2013, 3:54:40 AM9/24/13
to ju...@googlegroups.com
Hi,
I'm currently initiating a project with Juzu 0.7b17, and trying to use the APT processing inside Eclipse, I encounter a ClassNotFoundException. Here is the processor.log:
1:41:50:841 [ProcessingContext] Retrieved options {-target=1.6, -d=C:\test\workspace\projet\target\classes, -s=C:\test\workspace\projet\.apt_generated, -classpath=[huge number of ';' separated paths]}
1:41:50:841 [ProcessingContext] Found sourcepath C:\test\workspace\projet\src\main\java;C:\test\workspace\projet\src\test\java;C:\test\workspace\projet\target\generated-sources\annotations;C:\test\workspace\projet\.apt_generated
1:41:50:849 [ProcessingContext] Found classpath [huge number of ';' separated paths]
1:41:50:854 [ProcessingContext] Using processing tool ECLIPSE_IDE
1:41:50:854 [ProcessingContext] Using processing org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeBuildProcessingEnvImpl@7aea9c5
1:41:50:854 [ProcessingContext] Using source path null
1:41:50:854 [MainProcessor] Using processing env juzu.impl.compiler.ProcessingContext
1:41:50:856 [MainProcessor] Created new meta model
1:41:50:860 [ProcessingContext] Loading services implementation of juzu.impl.plugin.module.metamodel.ModuleMetaModelPlugin
1:41:50:870 [ProcessingContext] Using plugins: application
1:41:50:870 [ProcessingContext] Loading services implementation of juzu.impl.plugin.application.metamodel.ApplicationMetaModelPlugin
1:41:50:891 [ProcessingContext] Using plugins: controller template ajax asset binding router amd
1:41:50:892 [ProcessingContext] Plugin controller supports [juzu.Consumes, juzu.View, juzu.Action, juzu.Resource]
1:41:50:892 [ProcessingContext] Plugin template supports [juzu.Path]
1:41:50:892 [ProcessingContext] Plugin ajax supports [juzu.plugin.ajax.Ajax]
1:41:50:893 [ProcessingContext] Plugin asset supports [juzu.plugin.asset.Assets]
1:41:50:893 [ProcessingContext] Plugin binding supports [juzu.plugin.binding.Bindings]
1:41:50:893 [ProcessingContext] Plugin router supports [juzu.Route]
1:41:50:893 [ProcessingContext] Plugin amd supports [juzu.plugin.amd.Defines, juzu.plugin.amd.Requires]
1:41:50:893 [ProcessingContext] Plugin application supports [juzu.plugin.amd.Defines, juzu.Application, juzu.Consumes, juzu.plugin.binding.Bindings, juzu.plugin.ajax.Ajax, juzu.View, juzu.Route, juzu.plugin.asset.Assets, juzu.Path, juzu.Resource, juzu.Action, juzu.plugin.amd.Requires]
1:41:50:895 [MainProcessor] Starting APT round #0
1:41:50:895 [MainProcessor] Activating model
1:41:50:895 [ProcessingContext] Loading services implementation of juzu.impl.template.spi.TemplateProvider
1:41:50:898 [MainProcessor] Processing elements for annotation for juzu.Application
1:41:50:899 [MainProcessor] Processing element package test.paquet
1:41:50:907 [MainProcessor] Processing elements for annotation for juzu.Path
1:41:50:908 [MainProcessor] Processing element index
1:41:50:908 [MainProcessor] Processing elements for annotation for juzu.View
1:41:50:908 [MainProcessor] Processing element public void index() throws java.io.IOException
1:41:50:909 [MainProcessor] Process annotations
1:41:50:915 [ProcessingContext] Adding template ref test.paquet.Default#index Path[index.gtmpl]
1:41:50:919 [MainProcessor] Post processing model
1:41:50:919 [MainProcessor] Process events
1:41:50:919 [ProcessingContext] Creating source file for name=test.paquet.Application elements=[package test.paquet]
1:41:50:921 [ProcessingContext] Generated application test.paquet.Application as file:/C:/shared/projects/irsn_portail/workspace/projet/.apt_generated/test/paquet/Application.java
1:41:50:927 [MainProcessor] Post process events
1:41:50:928 [ProcessingContext] Creating source file for name=test.paquet.Default_ elements=[test.paquet.Default]
1:41:50:930 [ProcessingContext] Generated controller companion test.paquet.Default_ as file:/C:/shared/projects/irsn_portail/workspace/projet/.apt_generated/test/paquet/Default_.java
1:41:50:931 [ProcessingContext] Processing templates of ElementHandle.Package[qn=test.paquet]
1:41:50:931 [TemplateResolver] Synchronizing existing templates []
1:41:50:932 [TemplateResolver] Building missing templates
1:41:50:932 [TemplateResolver] Compiling template Path[index.gtmpl]
1:41:50:935 [ProcessingContext] Trying to find a native file system for package test.paquet
1:41:50:935 [ProcessingContext] Found package test.paquet annotations [@juzu.Application, @juzu.plugin.portlet.Portlet] will use first one
1:41:50:936 [ProcessingContext] Could not resolve package ElementHandle.Package[qn=test.paquet]
java.lang.ClassNotFoundException: com.sun.source.util.Trees
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at juzu.impl.compiler.ProcessingContext.getSourcePath(ProcessingContext.java:250)
    at juzu.impl.compiler.ProcessingContext.resolveResourceFromSourcePath(ProcessingContext.java:321)
    at juzu.impl.compiler.ProcessingContext.resolveResourceFromSourcePath(ProcessingContext.java:302)
    at juzu.impl.plugin.application.metamodel.ApplicationMetaModel.resolveResource(ApplicationMetaModel.java:108)
    at juzu.impl.plugin.template.metamodel.ModelTemplateProcessContext.resolveResource(ModelTemplateProcessContext.java:107)
    at juzu.impl.template.spi.ProcessContext.resolveTemplate(ProcessContext.java:63)
    at juzu.impl.template.spi.ProcessContext.resolveTemplate(ProcessContext.java:49)
    at juzu.impl.plugin.template.metamodel.ModelTemplateProcessContext$1.call(ModelTemplateProcessContext.java:71)
    at juzu.impl.plugin.template.metamodel.ModelTemplateProcessContext$1.call(ModelTemplateProcessContext.java:68)
    at juzu.impl.compiler.ProcessingContext.executeWithin(ProcessingContext.java:203)
    at juzu.impl.compiler.ProcessingContext.executeWithin(ProcessingContext.java:198)
    at juzu.impl.plugin.template.metamodel.ModelTemplateProcessContext.resolve(ModelTemplateProcessContext.java:68)
    at juzu.impl.plugin.template.metamodel.TemplateResolver.process(TemplateResolver.java:133)
    at juzu.impl.plugin.template.metamodel.TemplateMetaModelPlugin.postProcessEvents(TemplateMetaModelPlugin.java:147)
    at juzu.impl.plugin.template.metamodel.TemplateMetaModelPlugin.postProcessEvents(TemplateMetaModelPlugin.java:47)
    at juzu.impl.metamodel.MetaModelContext.postProcessEvents(MetaModelContext.java:238)
    at juzu.impl.plugin.application.metamodel.ApplicationModuleMetaModelPlugin.postProcessEvents(ApplicationModuleMetaModelPlugin.java:255)
    at juzu.impl.plugin.application.metamodel.ApplicationModuleMetaModelPlugin.postProcessEvents(ApplicationModuleMetaModelPlugin.java:55)
    at juzu.impl.metamodel.MetaModelContext.postProcessEvents(MetaModelContext.java:238)
    at juzu.impl.plugin.module.metamodel.ModuleMetaModel.postProcessEvents(ModuleMetaModel.java:77)
    at juzu.impl.metamodel.MetaModelProcessor.doProcess(MetaModelProcessor.java:170)
    at juzu.impl.compiler.BaseProcessor.process(BaseProcessor.java:170)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
    at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134)
    at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:820)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:434)
    at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:365)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178)
    at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:302)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:394)
    at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
    at org.eclipse.core.internal.resources.Project.build(Project.java:114)
    at org.eclipse.jdt.internal.ui.util.CoreUtility$BuildJob.run(CoreUtility.java:161)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
1:41:50:936 [ProcessingContext] Attempt to resolve FileKey[packageName=test.paquet.templates,rawName=index,ext=gtmpl] from SOURCE_PATH
1:41:50:937 [ProcessingContext] Could not resolve resource FileKey[packageName=test.paquet.templates,rawName=index,ext=gtmpl] from SOURCE_PATH
java.lang.IllegalArgumentException: Unsupported location: SOURCE_PATH
    at org.eclipse.jdt.internal.apt.pluggable.core.filer.IdeFilerImpl.getFileFromOutputLocation(IdeFilerImpl.java:188)
    at org.eclipse.jdt.internal.apt.pluggable.core.filer.IdeFilerImpl.getResource(IdeFilerImpl.java:154)
    at juzu.impl.compiler.ProcessingContext.getResource(ProcessingContext.java:647)
    at juzu.impl.compiler.ProcessingContext.getResource(ProcessingContext.java:639)
    at juzu.impl.compiler.ProcessingContext.resolveResourceFromSourcePath(ProcessingContext.java:342)
    at juzu.impl.compiler.ProcessingContext.resolveResourceFromSourcePath(ProcessingContext.java:302)
    at juzu.impl.plugin.application.metamodel.ApplicationMetaModel.resolveResource(ApplicationMetaModel.java:108)
    at juzu.impl.plugin.template.metamodel.ModelTemplateProcessContext.resolveResource(ModelTemplateProcessContext.java:107)
    at juzu.impl.template.spi.ProcessContext.resolveTemplate(ProcessContext.java:63)
    at juzu.impl.template.spi.ProcessContext.resolveTemplate(ProcessContext.java:49)
    at juzu.impl.plugin.template.metamodel.ModelTemplateProcessContext$1.call(ModelTemplateProcessContext.java:71)
    at juzu.impl.plugin.template.metamodel.ModelTemplateProcessContext$1.call(ModelTemplateProcessContext.java:68)
    at juzu.impl.compiler.ProcessingContext.executeWithin(ProcessingContext.java:203)
    at juzu.impl.compiler.ProcessingContext.executeWithin(ProcessingContext.java:198)
    at juzu.impl.plugin.template.metamodel.ModelTemplateProcessContext.resolve(ModelTemplateProcessContext.java:68)
    at juzu.impl.plugin.template.metamodel.TemplateResolver.process(TemplateResolver.java:133)
    at juzu.impl.plugin.template.metamodel.TemplateMetaModelPlugin.postProcessEvents(TemplateMetaModelPlugin.java:147)
    at juzu.impl.plugin.template.metamodel.TemplateMetaModelPlugin.postProcessEvents(TemplateMetaModelPlugin.java:47)
    at juzu.impl.metamodel.MetaModelContext.postProcessEvents(MetaModelContext.java:238)
    at juzu.impl.plugin.application.metamodel.ApplicationModuleMetaModelPlugin.postProcessEvents(ApplicationModuleMetaModelPlugin.java:255)
    at juzu.impl.plugin.application.metamodel.ApplicationModuleMetaModelPlugin.postProcessEvents(ApplicationModuleMetaModelPlugin.java:55)
    at juzu.impl.metamodel.MetaModelContext.postProcessEvents(MetaModelContext.java:238)
    at juzu.impl.plugin.module.metamodel.ModuleMetaModel.postProcessEvents(ModuleMetaModel.java:77)
    at juzu.impl.metamodel.MetaModelProcessor.doProcess(MetaModelProcessor.java:170)
    at juzu.impl.compiler.BaseProcessor.process(BaseProcessor.java:170)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
    at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134)
    at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:820)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:434)
    at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:365)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178)
    at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:302)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:394)
    at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
    at org.eclipse.core.internal.resources.Project.build(Project.java:114)
    at org.eclipse.jdt.internal.ui.util.CoreUtility$BuildJob.run(CoreUtility.java:161)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
1:41:50:937 [ProcessingContext] Attempt to resolve FileKey[packageName=test.paquet.templates,rawName=index,ext=gtmpl] from CLASS_OUTPUT
1:41:50:960 [ProcessingContext] Creating source file for name=test.paquet.templates.index elements=[test.paquet.Default]
1:41:50:963 [TemplateResolver] Generated template class Path[index.gtmpl] as file:/C:/shared/projects/irsn_portail/workspace/projet/.apt_generated/test/paquet/templates/index.java with originating elements [test.paquet.Default]
1:41:50:971 [ProcessingContext] Creating resource file for location=CLASS_OUTPUT pkg=test.paquet.templates relativeName=index_.groovy elements=[test.paquet.Default]
1:41:50:972 [TemplateResolver] Generated template script Path[index_.groovy] as file:/C:/shared/projects/irsn_portail/workspace/projet/target/classes/test/paquet/templates/index_.groovy with originating elements [test.paquet.Default]
1:41:50:973 [MainProcessor] Ending APT round #0
1:41:50:983 [MainProcessor] Starting APT round #1
1:41:50:983 [MainProcessor] Process annotations
1:41:50:986 [MainProcessor] Post processing model
1:41:50:986 [MainProcessor] Process events
1:41:50:986 [MainProcessor] Post process events
1:41:50:986 [ProcessingContext] Processing templates of ElementHandle.Package[qn=test.paquet]
1:41:50:986 [TemplateResolver] Synchronizing existing templates [Path[index.gtmpl]]
1:41:50:986 [ProcessingContext] Trying to find a native file system for package test.paquet
1:41:50:986 [ProcessingContext] Found package test.paquet annotations [@juzu.Application, @juzu.plugin.portlet.Portlet] will use first one
1:41:50:987 [ProcessingContext] Could not resolve package ElementHandle.Package[qn=test.paquet]
java.lang.ClassNotFoundException: com.sun.source.util.Trees
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at juzu.impl.compiler.ProcessingContext.getSourcePath(ProcessingContext.java:250)
    at juzu.impl.compiler.ProcessingContext.resolveResourceFromSourcePath(ProcessingContext.java:321)
    at juzu.impl.compiler.ProcessingContext.resolveResourceFromSourcePath(ProcessingContext.java:302)
    at juzu.impl.plugin.application.metamodel.ApplicationMetaModel.resolveResource(ApplicationMetaModel.java:108)
    at juzu.impl.plugin.template.metamodel.TemplateResolver.process(TemplateResolver.java:109)
    at juzu.impl.plugin.template.metamodel.TemplateMetaModelPlugin.postProcessEvents(TemplateMetaModelPlugin.java:147)
    at juzu.impl.plugin.template.metamodel.TemplateMetaModelPlugin.postProcessEvents(TemplateMetaModelPlugin.java:47)
    at juzu.impl.metamodel.MetaModelContext.postProcessEvents(MetaModelContext.java:238)
    at juzu.impl.plugin.application.metamodel.ApplicationModuleMetaModelPlugin.postProcessEvents(ApplicationModuleMetaModelPlugin.java:255)
    at juzu.impl.plugin.application.metamodel.ApplicationModuleMetaModelPlugin.postProcessEvents(ApplicationModuleMetaModelPlugin.java:55)
    at juzu.impl.metamodel.MetaModelContext.postProcessEvents(MetaModelContext.java:238)
    at juzu.impl.plugin.module.metamodel.ModuleMetaModel.postProcessEvents(ModuleMetaModel.java:77)
    at juzu.impl.metamodel.MetaModelProcessor.doProcess(MetaModelProcessor.java:170)
    at juzu.impl.compiler.BaseProcessor.process(BaseProcessor.java:170)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:110)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
    at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134)
    at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:820)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:434)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:451)
    at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:365)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178)
    at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:302)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:394)
    at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
    at org.eclipse.core.internal.resources.Project.build(Project.java:114)
    at org.eclipse.jdt.internal.ui.util.CoreUtility$BuildJob.run(CoreUtility.java:161)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
1:41:50:987 [ProcessingContext] Attempt to resolve FileKey[packageName=test.paquet.templates,rawName=index,ext=gtmpl] from SOURCE_PATH
1:41:50:987 [ProcessingContext] Could not resolve resource FileKey[packageName=test.paquet.templates,rawName=index,ext=gtmpl] from SOURCE_PATH
java.lang.IllegalArgumentException: Unsupported location: SOURCE_PATH
    at org.eclipse.jdt.internal.apt.pluggable.core.filer.IdeFilerImpl.getFileFromOutputLocation(IdeFilerImpl.java:188)
    at org.eclipse.jdt.internal.apt.pluggable.core.filer.IdeFilerImpl.getResource(IdeFilerImpl.java:154)
    at juzu.impl.compiler.ProcessingContext.getResource(ProcessingContext.java:647)
    at juzu.impl.compiler.ProcessingContext.getResource(ProcessingContext.java:639)
    at juzu.impl.compiler.ProcessingContext.resolveResourceFromSourcePath(ProcessingContext.java:342)
    at juzu.impl.compiler.ProcessingContext.resolveResourceFromSourcePath(ProcessingContext.java:302)
    at juzu.impl.plugin.application.metamodel.ApplicationMetaModel.resolveResource(ApplicationMetaModel.java:108)
    at juzu.impl.plugin.template.metamodel.TemplateResolver.process(TemplateResolver.java:109)
    at juzu.impl.plugin.template.metamodel.TemplateMetaModelPlugin.postProcessEvents(TemplateMetaModelPlugin.java:147)
    at juzu.impl.plugin.template.metamodel.TemplateMetaModelPlugin.postProcessEvents(TemplateMetaModelPlugin.java:47)
    at juzu.impl.metamodel.MetaModelContext.postProcessEvents(MetaModelContext.java:238)
    at juzu.impl.plugin.application.metamodel.ApplicationModuleMetaModelPlugin.postProcessEvents(ApplicationModuleMetaModelPlugin.java:255)
    at juzu.impl.plugin.application.metamodel.ApplicationModuleMetaModelPlugin.postProcessEvents(ApplicationModuleMetaModelPlugin.java:55)
    at juzu.impl.metamodel.MetaModelContext.postProcessEvents(MetaModelContext.java:238)
    at juzu.impl.plugin.module.metamodel.ModuleMetaModel.postProcessEvents(ModuleMetaModel.java:77)
    at juzu.impl.metamodel.MetaModelProcessor.doProcess(MetaModelProcessor.java:170)
    at juzu.impl.compiler.BaseProcessor.process(BaseProcessor.java:170)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:110)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
    at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134)
    at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:820)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:434)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:451)
    at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:365)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178)
    at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:302)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:394)
    at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
    at org.eclipse.core.internal.resources.Project.build(Project.java:114)
    at org.eclipse.jdt.internal.ui.util.CoreUtility$BuildJob.run(CoreUtility.java:161)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
1:41:50:987 [ProcessingContext] Attempt to resolve FileKey[packageName=test.paquet.templates,rawName=index,ext=gtmpl] from CLASS_OUTPUT
1:41:50:987 [TemplateResolver] Template Path[index.gtmpl] is valid
1:41:50:987 [TemplateResolver] Building missing templates
1:41:50:987 [TemplateResolver] Template class Path[index.gtmpl] was found in cache
1:41:50:987 [TemplateResolver] Template Path[index.gtmpl] was found in cache
1:41:50:987 [MainProcessor] Ending APT round #1
1:41:50:987 [MainProcessor] APT processing over
1:41:50:987 [MainProcessor] Passivating model
1:41:50:987 [ProcessingContext] Emitting module config
1:41:50:990 [ProcessingContext] Creating resource file for location=CLASS_OUTPUT pkg=juzu relativeName=config.json elements=[]
1:41:50:991 [ProcessingContext] Passivating template resolver for ElementHandle.Package[qn=test.paquet]
1:41:50:991 [TemplateResolver] Evicting cache [Path[index.gtmpl]]
1:41:50:991 [ProcessingContext] Passivating templates
1:41:50:991 [ProcessingContext] Emitting application ElementHandle.Package[qn=test.paquet] config
1:41:50:991 [ProcessingContext] Creating resource file for location=CLASS_OUTPUT pkg=test.paquet relativeName=config.json elements=[]
1:41:50:992 [ProcessingContext] Creating resource file for location=SOURCE_OUTPUT pkg=juzu relativeName=metamodel.ser elements=[]

Maybe it's related to the fact that this branch of code is reached because ProcessingContext splits path along ':' (see Pull Request 43), but I'm not sure about. Any advice?

Damien

Julien Viet

unread,
Sep 24, 2013, 4:05:36 AM9/24/13
to ju...@googlegroups.com
Hello Damien,

you are totally right.

this is due to wrong parsing of sourcepath in your env.

In the log we can see:

Found sourcepath C:\test\workspace\projet\src\main\java;C:\test\workspace\projet\src\test\java;C:\test\workspace\projet\target\generated-sources\annotations;C:\test\workspace\projet\.apt_generated

that is not well parsed because of ";" separator

that is confirmed by 

[ProcessingContext] Using source path null

Normally the source path should be not null and therefore the "getSourcePath" method should not go in the Oracle specific compiler part:

if (sourcePath != null) {
   log.log("Found eclipse source path " + sourcePath + " for package " + context.getPackage());
   return sourcePath;
}

your pull request should fix this issue, I will release a beta for this issue now.

congrats for digging in that very low level part of Juzu!

--
You received this message because you are subscribed to the Google Groups "Juzu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to juzu+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Damien B

unread,
Sep 24, 2013, 11:36:42 AM9/24/13
to ju...@googlegroups.com
Re,
I've tested the beta20: the analysis was right, my patch wrong, so I've submitted another Pull Request (45).

This time it's tested more thoroughly, and I encounter another problem, that is not related to Windows (as far as my analysis goes).
Here is the test case:
@juzu.Application
@juzu.plugin.portlet.Portlet
package test.juzu;

The project classpath in Eclipse is fine, meanwhile:
java.lang.NoClassDefFoundError: javax/portlet/Portlet
    [snip]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at juzu.plugin.portlet.impl.PortletMetaModelPlugin.emitPortlet(PortletMetaModelPlugin.java:118)
    at juzu.plugin.portlet.impl.PortletMetaModelPlugin.postProcessEvents(PortletMetaModelPlugin.java:98)
    at juzu.plugin.portlet.impl.PortletMetaModelPlugin.postProcessEvents(PortletMetaModelPlugin.java:45)

    at juzu.impl.metamodel.MetaModelContext.postProcessEvents(MetaModelContext.java:238)
    at juzu.impl.plugin.application.metamodel.ApplicationModuleMetaModelPlugin.postProcessEvents(ApplicationModuleMetaModelPlugin.java:255)
    at juzu.impl.plugin.application.metamodel.ApplicationModuleMetaModelPlugin.postProcessEvents(ApplicationModuleMetaModelPlugin.java:1)

    at juzu.impl.metamodel.MetaModelContext.postProcessEvents(MetaModelContext.java:238)
    at juzu.impl.plugin.module.metamodel.ModuleMetaModel.postProcessEvents(ModuleMetaModel.java:77)
    at juzu.impl.metamodel.MetaModelProcessor.doProcess(MetaModelProcessor.java:170)
    at juzu.impl.compiler.BaseProcessor.process(BaseProcessor.java:170)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139)

This is caused by this line in PortletMetaModelPlugin:
writer.append("public class ").append(names[0]).append(" extends ").append(JuzuPortlet.class.getName()).append(" {\n");

In order to call getName() on JuzuPortlet.class, it has to load the JuzuPortlet class, which requires (of course) the loading of javax.portlet.Portlet. The thing is that PortletMetaModelPlugin has not the serviceCL defined in ProcessingContext as its Thread context classloader and thus relies on the OSGi provided classloading, which of course doesn't know anything about Portlet. There is a quick workaround, which is to put portlet-api.jar in the APT Factory Path of the project (all the jar listed there are put in the processing tools classpath, even if they don't contain any annotation processor, we're lucky).
For the right course of action, I'm not sure... From a classpath isolation point of view, it's right that PortletMetaModelPlugin has no reason to expect to have Portlet in its classpath, but asking JuzuPortlet.class to give its full name is the best thing to do to prevent breakage on class refactoring/moving.

Damien

Julien Viet

unread,
Sep 24, 2013, 12:22:59 PM9/24/13
to ju...@googlegroups.com
can you replace the JuzuPortlet.class.getName() by a String of the name ?

we had a similar issue a long time ago with @Inject and the BindingMetaModelPlugin and that fixed this issue.

Damien B

unread,
Sep 24, 2013, 12:25:30 PM9/24/13
to ju...@googlegroups.com
I can, I was just wondering wether it was considered acceptable for this project :-)

Damien B

unread,
Sep 24, 2013, 12:32:02 PM9/24/13
to ju...@googlegroups.com
Pull Request 45 updated with that change.

Julien Viet

unread,
Sep 25, 2013, 3:29:15 AM9/25/13
to ju...@googlegroups.com
thanks will proceed both soon.
Reply all
Reply to author
Forward
0 new messages