Eclipse Plugin weirdness

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Eclipse Plugin weirdness

Alex Shneyderman
I am trying to mix and match groovy and java in the same project
(trying to instantiate groovy class inside a java class) but for some
reason JDT does not see the compiled class. I am also getting an error
while compiling. It seems that groovyc does not like class and groovy
files to be on the classpath at the same time here is an error:

BUG! exception in phase 'conversion' in source unit
'C:\eclipse\workspace\GroovyEnabledProject\bin\simple\pack\SimpleTest.groovy'
Error: duplicate class declaration for name: simple.pack.SimpleTest
and class: org.codehaus.groovy.ast.ClassNode@17a916b[name:
simple.pack.SimpleTest]
        at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:902)
        at org.codehaus.groovy.control.CompilationUnit.convert(CompilationUnit.java:624)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:447)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:422)
        at org.codehaus.groovy.eclipse.model.GroovyProject.buildGroovyContent(GroovyProject.java:153)
        at org.codehaus.groovy.eclipse.model.GroovyModel.buildGroovyContent(GroovyModel.java:87)
        at org.codehaus.groovy.eclipse.builder.GroovyBuilder.build(GroovyBuilder.java:38)
        at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:603)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:167)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
        at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:230)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:233)
        at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:252)
        at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:285)
        at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:145)
        at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:208)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.lang.RuntimeException: Error: duplicate class
declaration for name: simple.pack.SimpleTest and class:
org.codehaus.groovy.ast.ClassNode@17a916b[name:
simple.pack.SimpleTest]
        at org.codehaus.groovy.ast.CompileUnit.addClass(CompileUnit.java:141)
        at org.codehaus.groovy.ast.CompileUnit.addClasses(CompileUnit.java:129)
        at org.codehaus.groovy.ast.CompileUnit.addModule(CompileUnit.java:85)
        at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:636)
        at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:898)
        ... 18 more


all of this with the latest (just compiled groovy IDE) Any ideas?

--
Alex.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Eclipse Plugin weirdness

Scott Hickey-3
When I have the groovy nature enabled, there is an exclusion filter that prevents the .groovy files from being copied into the bin directory. If I click on the project properties and look at Java Compiler -> Building ->Output Folder, this is what's in my filtered resource: *.launch,*.groovy

I am currently mixing Java and Groovy but, I only have Groovy calling Java class files, not the other way around - inside of Eclipse. What you're describing may be a problem to implement in Eclipse right now.

The only way I was able to duplicate what your describing was to create a one project with the Groovy classes and another with Java that calls the groovy. Then I added the bin directory from the Groovy project to the build path of the Java project. If I added the Groovy project to the classpath, the JDT presented compile errors in the Java project.
 
Scott


----- Original Message ----
From: Alex Shneyderman <[hidden email]>
To: [hidden email]
Sent: Tuesday, May 9, 2006 5:29:33 PM
Subject: [groovy-user] Eclipse Plugin weirdness

I am trying to mix and match groovy and java in the same project
(trying to instantiate groovy class inside a java class) but for some
reason JDT does not see the compiled class. I am also getting an error
while compiling. It seems that groovyc does not like class and groovy
files to be on the classpath at the same time here is an error:

BUG! exception in phase 'conversion' in source unit
'C:\eclipse\workspace\GroovyEnabledProject\bin\simple\pack\SimpleTest.groovy'
Error: duplicate class declaration for name: simple.pack.SimpleTest
and class: org.codehaus.groovy.ast.ClassNode@17a916b[name:
simple.pack.SimpleTest]
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:902)
    at org.codehaus.groovy.control.CompilationUnit.convert(CompilationUnit.java:624)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:447)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:422)
    at org.codehaus.groovy.eclipse.model.GroovyProject.buildGroovyContent(GroovyProject.java:153)
    at org.codehaus.groovy.eclipse.model.GroovyModel.buildGroovyContent(GroovyModel.java:87)
    at org.codehaus.groovy.eclipse.builder.GroovyBuilder.build(GroovyBuilder.java:38)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:603)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:167)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:230)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:233)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:252)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:285)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:145)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:208)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.lang.RuntimeException: Error: duplicate class
declaration for name: simple.pack.SimpleTest and class:
org.codehaus.groovy.ast.ClassNode@17a916b[name:
simple.pack.SimpleTest]
    at org.codehaus.groovy.ast.CompileUnit.addClass(CompileUnit.java:141)
    at org.codehaus.groovy.ast.CompileUnit.addClasses(CompileUnit.java:129)
    at org.codehaus.groovy.ast.CompileUnit.addModule(CompileUnit.java:85)
    at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:636)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:898)
    ... 18 more


all of this with the latest (just compiled groovy IDE) Any ideas?

--
Alex.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RES: Eclipse Plugin weirdness

Marcos César de Oliveira
I was able to use groovy classes from java classes by changing the eclipse plugin to write the .class files in another directory (eg, groovy-bin). After that, this directory must be in the classpath of the project.


De: Scott Hickey [mailto:[hidden email]]
Enviada em: quarta-feira, 10 de maio de 2006 13:41
Para: [hidden email]
Assunto: Re: [groovy-user] Eclipse Plugin weirdness

When I have the groovy nature enabled, there is an exclusion filter that prevents the .groovy files from being copied into the bin directory. If I click on the project properties and look at Java Compiler -> Building ->Output Folder, this is what's in my filtered resource: *.launch,*.groovy

I am currently mixing Java and Groovy but, I only have Groovy calling Java class files, not the other way around - inside of Eclipse. What you're describing may be a problem to implement in Eclipse right now.

The only way I was able to duplicate what your describing was to create a one project with the Groovy classes and another with Java that calls the groovy. Then I added the bin directory from the Groovy project to the build path of the Java project. If I added the Groovy project to the classpath, the JDT presented compile errors in the Java project.
 
Scott


----- Original Message ----
From: Alex Shneyderman <[hidden email]>
To: [hidden email]
Sent: Tuesday, May 9, 2006 5:29:33 PM
Subject: [groovy-user] Eclipse Plugin weirdness

I am trying to mix and match groovy and java in the same project
(trying to instantiate groovy class inside a java class) but for some
reason JDT does not see the compiled class. I am also getting an error
while compiling. It seems that groovyc does not like class and groovy
files to be on the classpath at the same time here is an error:

BUG! exception in phase 'conversion' in source unit
'C:\eclipse\workspace\GroovyEnabledProject\bin\simple\pack\SimpleTest.groovy'
Error: duplicate class declaration for name: simple.pack.SimpleTest
and class: org.codehaus.groovy.ast.ClassNode@17a916b[name:
simple.pack.SimpleTest]
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:902)
    at org.codehaus.groovy.control.CompilationUnit.convert(CompilationUnit.java:624)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:447)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:422)
    at org.codehaus.groovy.eclipse.model.GroovyProject.buildGroovyContent(GroovyProject.java:153)
    at org.codehaus.groovy.eclipse.model.GroovyModel.buildGroovyContent(GroovyModel.java:87)
    at org.codehaus.groovy.eclipse.builder.GroovyBuilder.build(GroovyBuilder.java:38)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:603)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:167)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:230)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:233)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:252)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:285)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:145)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:208)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.lang.RuntimeException: Error: duplicate class
declaration for name: simple.pack.SimpleTest and class:
org.codehaus.groovy.ast.ClassNode@17a916b[name:
simple.pack.SimpleTest]
    at org.codehaus.groovy.ast.CompileUnit.addClass(CompileUnit.java:141)
    at org.codehaus.groovy.ast.CompileUnit.addClasses(CompileUnit.java:129)
    at org.codehaus.groovy.ast.CompileUnit.addModule(CompileUnit.java:85)
    at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:636)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:898)
    ... 18 more


all of this with the latest (just compiled groovy IDE) Any ideas?

--
Alex.


__________ NOD32 1.1454 (20060321) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RES: Eclipse Plugin weirdness

Scott Hickey-3
That's a good idea. For full/clean builds, it might be necessary to reorder the builders and put the groovy builder ahead of the Java builder so the groovy .class files exist when the Java builder runs.
 
Scott


----- Original Message ----
From: Marcos César de Oliveira <[hidden email]>
To: [hidden email]; Scott Hickey <[hidden email]>
Sent: Wednesday, May 10, 2006 1:51:28 PM
Subject: RES: [groovy-user] Eclipse Plugin weirdness

I was able to use groovy classes from java classes by changing the eclipse plugin to write the .class files in another directory (eg, groovy-bin). After that, this directory must be in the classpath of the project.


De: Scott Hickey [mailto:[hidden email]]
Enviada em: quarta-feira, 10 de maio de 2006 13:41
Para: [hidden email]
Assunto: Re: [groovy-user] Eclipse Plugin weirdness

When I have the groovy nature enabled, there is an exclusion filter that prevents the .groovy files from being copied into the bin directory. If I click on the project properties and look at Java Compiler -> Building ->Output Folder, this is what's in my filtered resource: *.launch,*.groovy

I am currently mixing Java and Groovy but, I only have Groovy calling Java class files, not the other way around - inside of Eclipse. What you're describing may be a problem to implement in Eclipse right now.

The only way I was able to duplicate what your describing was to create a one project with the Groovy classes and another with Java that calls the groovy. Then I added the bin directory from the Groovy project to the build path of the Java project. If I added the Groovy project to the classpath, the JDT presented compile errors in the Java project.
 
Scott


----- Original Message ----
From: Alex Shneyderman <[hidden email]>
To: [hidden email]
Sent: Tuesday, May 9, 2006 5:29:33 PM
Subject: [groovy-user] Eclipse Plugin weirdness

I am trying to mix and match groovy and java in the same project
(trying to instantiate groovy class inside a java class) but for some
reason JDT does not see the compiled class. I am also getting an error
while compiling. It seems that groovyc does not like class and groovy
files to be on the classpath at the same time here is an error:

BUG! exception in phase 'conversion' in source unit
'C:\ eclipse\ workspace\ GroovyEnabledProject\ bin\ simple\ pack\ SimpleTest.groovy'
Error: duplicate class declaration for name: simple.pack.SimpleTest
and class: org.codehaus.groovy.ast.ClassNode@17a916b[name:
simple.pack.SimpleTest]
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:902)
    at org.codehaus.groovy.control.CompilationUnit.convert(CompilationUnit.java:624)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:447)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:422)
    at org.codehaus.groovy.eclipse.model.GroovyProject.buildGroovyContent(GroovyProject.java:153)
    at org.codehaus.groovy.eclipse.model.GroovyModel.buildGroovyContent(GroovyModel.java:87)
    at org.codehaus.groovy.eclipse.builder.GroovyBuilder.build(GroovyBuilder.java:38)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:603)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:167)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:230)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:233)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:252)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:285)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:145)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:208)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.lang.RuntimeException: Error: duplicate class
declaration for name: simple.pack.SimpleTest and class:
org.codehaus.groovy.ast.ClassNode@17a916b[name:
simple.pack.SimpleTest]
    at org.codehaus.groovy.ast.CompileUnit.addClass(CompileUnit.java:141)
    at org.codehaus.groovy.ast.CompileUnit.addClasses(CompileUnit.java:129)
    at org.codehaus.groovy.ast.CompileUnit.addModule(CompileUnit.java:85)
    at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:636)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:898)
    ... 18 more


all of this with the latest (just compiled groovy IDE) Any ideas?

--
Alex.


__________ NOD32 1.1454 (20060321) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com
Loading...