eclipse-archived/ceylon-ide-intellij

IntelliJ fails to compile Google guice

Closed this issue · 10 comments

I'm trying to run the following example in IntelliJ and it results in following errors for Google guice. This runs fine using commandline:

illegal argument types in invocation of overloaded method or class: there must be exactly one overloaded declaration of 'createInjector' which accepts the given argument types 'AbstractModule'

the 'TypeVisitor' caused an exception visiting a 'BaseType' node: '"com.redhat.ceylon.model.loader.ModelResolutionException: Failed to find declaration for org.aopalliance.intercept.MethodInterceptor"' at 'com.redhat.ceylon.model.loader.AbstractModelLoader.getNonPrimitiveType(AbstractModelLoader.java:5671)'

illegal argument types in invocation of overloaded method or class: there must be exactly one overloaded declaration of 'bind' which accepts the given argument types 'Class<unknown>'

class cannot be instantiated: 'AbstractModule' does not have a parameter list or default constructor

Could you provide a code sample please? Also, does the problem happen if you build with the CLI?

I'm trying to execute the following example: https://github.com/ceylon/ceylon-examples-di
The issue occurs only when I work with either IntelliJ or eclipse.
It runs successfully with CLI.

It works fine here in Ceylon IDE for IntelliJ 1.3.1 and a fairly recent Ceylon IDE for Eclipse 1.3.2-SNAPSHOT. What version of the IDEs are you using? (Ceylon IDE for IntelliJ 1.3.2-SNAPSHOT is currently broken because of eclipse-archived/ceylon#6840).

I'm also using IntelliJ 1.3.1. And I'm using Ubuntu OS. May be its specific to OS as I once had a discussion with Gavin on google-groups about this issue but he said its working on Mac OS (https://groups.google.com/forum/#!msg/ceylon-users/K7_ZOwdRgps/O_27RQv9CAAJ;context-place=forum/ceylon-users)
ceyloinide-version1 3 1

And my Eclipse version is
eclipse-ide

Interesting, I'll set up a VM to reproduce the problem.

It's working fine on an Ubuntu 15.04... Could you try removing some artifacts from your local Maven repository to see if they might be corrupt?

  • aopalliance:aopalliance 1.0
  • com.google.inject:guice 4.0

Then reopen the project in Eclipse or IntelliJ

Unfortunately it doesn't work for me even after following the steps you mentioned. And now even CLI fails to build it. I tried it twice on two different systems but in vain.
And on a Windows 7 m/c I setup Mac OS 10.9.5 and followed the above steps but still results in exceptions. Not sure why it is not working for me.

I'm now able to run it successfully using IntelliJ, eclipse and CLI.
First I deleted the complete project and then created a new one in its place and it built successfully.
I repeated the same steps for eclipse too and it built successfully.

I also tried manually removing modules directory and other directories except source and resource directories but it did not helped and the issue was recurring so now I'm sticking to above steps.

OK, perhaps you had local modifications, or an old version of the project? Anyway, I can close the issue now :)