ceylon-ide-eclipse icon indicating copy to clipboard operation
ceylon-ide-eclipse copied to clipboard

New Ceylon-aware Java Launcher does not work

Open FroMage opened this issue 8 years ago • 4 comments

I have a Ceylon proejct with CeylonType and a Java project with JavaUser which uses that type. The Java project has the Ceylon project's output .car file in its build path (Add Jar).

When I run my Java main, with the Ceylon-aware runner I get the same exception as the non-Ceylon-aware one:

Exception in thread "main" java.lang.NoClassDefFoundError: com/redhat/ceylon/compiler/java/runtime/model/ReifiedType
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at com.javafoo.bar.JavaUser.main(JavaUser.java:7)
Caused by: java.lang.ClassNotFoundException: com.redhat.ceylon.compiler.java.runtime.model.ReifiedType
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 13 more

FroMage avatar Apr 27 '16 09:04 FroMage

I have to add that when I import the Ceylon project from the Java project (as opposed to just its .car file) then I do get further:


Exception in thread "main" com.redhat.ceylon.model.loader.ModelResolutionException: Failed to resolve com.foo.bar.CeylonType
    at com.redhat.ceylon.model.loader.AbstractModelLoader.convertToDeclaration(AbstractModelLoader.java:1675)
    at com.redhat.ceylon.model.loader.AbstractModelLoader.convertToDeclaration(AbstractModelLoader.java:1634)
    at com.redhat.ceylon.model.loader.AbstractModelLoader.getDeclaration(AbstractModelLoader.java:5008)
    at com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor$Class.toProducedType(TypeDescriptor.java:312)
    at com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor$Class.toType(TypeDescriptor.java:304)
    at com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.getProducedType(Metamodel.java:356)
    at com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.getAppliedMetamodel(Metamodel.java:366)
    at ceylon.language.meta.typeLiteral_.typeLiteral(typeLiteral_.java:28)
    at com.foo.bar.CeylonType.work(run.ceylon:9)
    at com.javafoo.bar.JavaUser.main(JavaUser.java:8

But that's about setting up the metamodel, which I think the Ceylon-aware runner doesnt do.

FroMage avatar Apr 27 '16 09:04 FroMage

you mean the error changed after you exported the Ceylon-related classpath entries in the used Ceylon project ?

davidfestal avatar Apr 27 '16 09:04 davidfestal

yes

FroMage avatar Apr 27 '16 09:04 FroMage

@FroMage : Since I now export Ceylon-related classpath containers by default, and the second error is related to the fact that the model loader was not initiated, I assume I can close this issue ?

davidfestal avatar Sep 09 '16 12:09 davidfestal