Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolution of transitive maven dependencies not working in some cases #2403

Open
marklester opened this issue Oct 29, 2015 · 11 comments
Open

Comments

@marklester
Copy link

module.xml:

native("jvm")
module test.examples.ceylon.postgres "1.0.0" {
    import ceylon.dbc "1.2.0";
    import ceylon.test "1.2.0";
    import examples.ceylon.postgres "1.0.0";
    import "de.flapdoodle.embed:de.flapdoodle.embed.process" "1.41.2";
    import "ru.yandex.qatools.embed:postgresql-embedded" "1.4";
    import "postgresql:postgresql" "9.1-901-1.jdbc4";
}

stack trace when I try to run the test

java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
    at ru.yandex.qatools.embed.postgresql.config.AbstractPostgresConfig$Storage.<init>(AbstractPostgresConfig.java:87)
    at ru.yandex.qatools.embed.postgresql.config.AbstractPostgresConfig$Storage.<init>(AbstractPostgresConfig.java:82)
    at ru.yandex.qatools.embed.postgresql.config.PostgresConfig.<init>(PostgresConfig.java:19)
    at ru.yandex.qatools.embed.postgresql.config.PostgresConfig.defaultWithDbName(PostgresConfig.java:40)
    at test.examples.ceylon.postgres.testStoreAndLoad_.testStoreAndLoad(ModelTests.ceylon:30)
    at com.redhat.ceylon.compiler.java.runtime.metamodel.meta.FunctionImpl.$call$(FunctionImpl.java:290)
    at com.redhat.ceylon.compiler.java.Util.apply(Util.java:1450)
    at com.redhat.ceylon.compiler.java.runtime.metamodel.Metamodel.apply(Metamodel.java:1822)
    at com.redhat.ceylon.compiler.java.runtime.metamodel.meta.FunctionImpl.apply(FunctionImpl.java:442)
    at com.redhat.ceylon.compiler.java.runtime.metamodel.decl.FunctionDeclarationImpl.invoke(FunctionDeclarationImpl.java:237)
    at com.redhat.ceylon.compiler.java.runtime.metamodel.decl.FunctionDeclarationImpl.invoke(FunctionDeclarationImpl.java:226)
    at com.redhat.ceylon.compiler.java.runtime.metamodel.decl.FunctionDeclarationImpl.invoke(FunctionDeclarationImpl.java:219)
    at ceylon.test.core.DefaultTestExecutor.invokeFunction$priv$(DefaultTestExecutor.ceylon:237)
    at ceylon.test.core.DefaultTestExecutor.access$100(DefaultTestExecutor.ceylon:20)
    at ceylon.test.core.DefaultTestExecutor$4.$call$(DefaultTestExecutor.ceylon:205)
    at ceylon.test.core.DefaultTestExecutor$2.$call$(DefaultTestExecutor.ceylon:172)
    at ceylon.test.core.DefaultTestExecutor$3.$call$(DefaultTestExecutor.ceylon:179)
    at ceylon.test.core.DefaultTestExecutor$1.$call$(DefaultTestExecutor.ceylon:152)
    at ceylon.test.core.DefaultTestExecutor.execute(DefaultTestExecutor.ceylon:32)
    at ceylon.test.core.DefaultTestRunner$5$1.next(DefaultTestRunner.ceylon:60)
    at ceylon.language.Array.createArrayFromIterable(Array.java:157)
    at ceylon.language.Array.<init>(Array.java:106)
    at ceylon.language.Iterable$impl.sequence(Iterable.ceylon:251)
    at ceylon.language.impl.BaseIterable.sequence(bases.ceylon)
    at ceylon.test.core.DefaultTestRunner.run(DefaultTestRunner.ceylon:60)
    at com.redhat.ceylon.testjvm.Runner.run(tool.ceylon:84)
    at com.redhat.ceylon.testjvm.run_.run(tool.ceylon:36)
    at com.redhat.ceylon.testjvm.run_.main(tool.ceylon)
    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:497)
    at ceylon.modules.api.runtime.SecurityActions.invokeRunInternal(SecurityActions.java:57)
    at ceylon.modules.api.runtime.SecurityActions.invokeRun(SecurityActions.java:48)
    at ceylon.modules.api.runtime.AbstractRuntime.invokeRun(AbstractRuntime.java:75)
    at ceylon.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:122)
    at ceylon.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:106)
    at ceylon.modules.Main.execute(Main.java:69)
    at ceylon.modules.Main.main(Main.java:42)
    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:497)
    at org.jboss.modules.Module.run(Module.java:312)
    at org.jboss.modules.Main.main(Main.java:460)
    at ceylon.modules.bootstrap.CeylonRunTool.run(CeylonRunTool.java:244)
    at ceylon.modules.bootstrap.CeylonTestTool.run(CeylonTestTool.java:174)
    at com.redhat.ceylon.common.tools.CeylonTool.run(CeylonTool.java:491)
    at com.redhat.ceylon.common.tools.CeylonTool.execute(CeylonTool.java:380)
    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:497)
    at com.redhat.ceylon.launcher.Launcher.runInJava7Checked(Launcher.java:114)
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:41)
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:34)
    at com.redhat.ceylon.launcher.Launcher.main(Launcher.java:27)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils from [Module "ru.yandex.qatools.embed:postgresql-embedded:1.4" from Ceylon ModuleLoader: RootRepositoryManager: FileContentStore: /home/mark/.ceylon/cache]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
    ... 57 more
@FroMage FroMage added this to the 1.3 milestone Oct 29, 2015
@FroMage
Copy link
Member

FroMage commented Oct 29, 2015

Try adding the import manually:

import "org.apache.commons:commons-lang3" "3.4";

And run with --flat-classpath. I still have to check why it doesn't work but it may unblock you.

@marklester
Copy link
Author

I checked "Use a flat classpath" in the ide and still the same problem.

@FroMage
Copy link
Member

FroMage commented Oct 29, 2015

That's weird, can you try from the command-line? In theory with that option it should not even use jboss modules at all.

@marklester
Copy link
Author

ceylon compile --flat-classpath
Note: Created module test.examples.ceylon.postgres/1.0.0
Note: Created module examples.ceylon.postgres/1.0.0

then

ceylon test test.examples.ceylon.postgres/1.0.0

same error

@FroMage
Copy link
Member

FroMage commented Oct 29, 2015

No, use the flag on Ceylon run ;)

@FroMage
Copy link
Member

FroMage commented Oct 29, 2015

Ah good point, perhaps we forgot to add it to Ceylon test...

@marklester
Copy link
Author

I don't have a run yet. I wanted to start with tests

@FroMage
Copy link
Member

FroMage commented Oct 29, 2015

Damn, I forgot to add it to the test tool indeed. Meanwhile try it with the run tool, possibly by running the test tool manually:

print("Test results: ``createTestRunner([`module`], []).run()``);

I haven't tried it so not sure it will work as is, but it should be close enough, right @thradec?

@FroMage
Copy link
Member

FroMage commented Oct 29, 2015

#2404

@marklester
Copy link
Author

awesome. Are you still going to figure out why it dies without the --flat-classpath argument?

@marklester
Copy link
Author

yeah just moved the test into a run and it kicked the can further down the road. Thanks for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants