ceylon / ceylon-runtime

DEPRECATED
24 stars 5 forks source link

CMR tries to use `javax.xml.parsers` and fails #38

Closed FroMage closed 11 years ago

FroMage commented 11 years ago

When @vietj uses a module.xml descriptor, he gets this:

[ceylon-run] ceylon run: Fatal error: java.lang.ClassNotFoundException: javax.xml.parsers.
[ceylon-run] DocumentBuilderFactory from [Module "com.redhat.ceylon.module-resolver:0.5"
[ceylon-run] from local module loader @1e85e47e (roots: /Users/julien/java/ceylon-0.5/repo)]
[ceylon-run] java.lang.RuntimeException: java.lang.ClassNotFoundException: javax.xml.parsers.DocumentBuilderFactory from [Module "com.redhat.ceylon.module-resolver:0.5" from local module loader @1e85e47e (roots: /Users/julien/java/ceylon-0.5/repo)]
[ceylon-run]    at ceylon.modules.bootstrap.CeylonRunTool.run(CeylonRunTool.java:167)
[ceylon-run]    at com.redhat.ceylon.tools.CeylonTool.run(CeylonTool.java:236)
[ceylon-run]    at com.redhat.ceylon.tools.CeylonTool.bootstrap(CeylonTool.java:205)
[ceylon-run]    at com.redhat.ceylon.tools.CeylonTool.start(CeylonTool.java:178)
[ceylon-run]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ceylon-run]    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

Probably we're missing a dependence in the CMR module descriptor.

alesj commented 11 years ago

Could be yes. I'll have a closer look on how this is dealt in AS7.

alesj commented 11 years ago

@vietj is there some more stacktrace to this?

vietj commented 11 years ago

[ceylon-run] ceylon run: Fatal error: java.lang.ClassNotFoundException: javax.xml.parsers. [ceylon-run] DocumentBuilderFactory from [Module "com.redhat.ceylon.module-resolver:0.5" [ceylon-run] from local module loader @32861ec (roots: /Users/julien/java/ceylon-0.5/repo)] [ceylon-run] java.lang.RuntimeException: java.lang.ClassNotFoundException: javax.xml.parsers.DocumentBuilderFactory from [Module "com.redhat.ceylon.module-resolver:0.5" from local module loader @32861ec (roots: /Users/julien/java/ceylon-0.5/repo)] [ceylon-run] at ceylon.modules.bootstrap.CeylonRunTool.run(CeylonRunTool.java:167) [ceylon-run] at com.redhat.ceylon.tools.CeylonTool.run(CeylonTool.java:236) [ceylon-run] at com.redhat.ceylon.tools.CeylonTool.bootstrap(CeylonTool.java:205) [ceylon-run] at com.redhat.ceylon.tools.CeylonTool.start(CeylonTool.java:178) [ceylon-run] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ceylon-run] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [ceylon-run] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [ceylon-run] at java.lang.reflect.Method.invoke(Method.java:601) [ceylon-run] at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:68) [ceylon-run] at com.redhat.ceylon.ant.CeylonAntTask.executeCommandline(CeylonAntTask.java:112) [ceylon-run] at com.redhat.ceylon.ant.CeylonAntTask.execute(CeylonAntTask.java:95) [ceylon-run] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) [ceylon-run] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ceylon-run] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [ceylon-run] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [ceylon-run] at java.lang.reflect.Method.invoke(Method.java:601) [ceylon-run] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [ceylon-run] at org.apache.tools.ant.Task.perform(Task.java:348) [ceylon-run] at org.apache.tools.ant.Target.execute(Target.java:435) [ceylon-run] at org.apache.tools.ant.Target.performTasks(Target.java:456) [ceylon-run] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) [ceylon-run] at org.apache.tools.ant.Project.executeTarget(Project.java:1364) [ceylon-run] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) [ceylon-run] at org.apache.tools.ant.Project.executeTargets(Project.java:1248) [ceylon-run] at org.apache.tools.ant.Main.runBuild(Main.java:851) [ceylon-run] at org.apache.tools.ant.Main.startAnt(Main.java:235) [ceylon-run] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) [ceylon-run] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) [ceylon-run] Caused by: java.lang.ClassNotFoundException: javax.xml.parsers.DocumentBuilderFactory from [Module "com.redhat.ceylon.module-resolver:0.5" from local module loader @32861ec (roots: /Users/julien/java/ceylon-0.5/repo)] [ceylon-run] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [ceylon-run] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [ceylon-run] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [ceylon-run] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [ceylon-run] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [ceylon-run] at com.redhat.ceylon.cmr.impl.XmlDependencyResolver.parseXml(XmlDependencyResolver.java:205) [ceylon-run] at com.redhat.ceylon.cmr.impl.XmlDependencyResolver.parse(XmlDependencyResolver.java:184) [ceylon-run] at com.redhat.ceylon.cmr.impl.XmlDependencyResolver.resolve(XmlDependencyResolver.java:57) [ceylon-run] at com.redhat.ceylon.cmr.api.DependencyResolvers.resolve(DependencyResolvers.java:47) [ceylon-run] at com.redhat.ceylon.cmr.impl.AbstractCeylonArtifactResult.dependencies(AbstractCeylonArtifactResult.java:51) [ceylon-run] at ceylon.modules.jboss.runtime.CeylonModuleLoader.findModule(CeylonModuleLoader.java:232) [ceylon-run] at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275) [ceylon-run] at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222) [ceylon-run] at ceylon.modules.jboss.runtime.CeylonModuleLoader.preloadModule(CeylonModuleLoader.java:185) [ceylon-run] at org.jboss.modules.Module.addExportedPaths(Module.java:987) [ceylon-run] at org.jboss.modules.Module.addPaths(Module.java:893) [ceylon-run] at org.jboss.modules.Module.link(Module.java:1206) [ceylon-run] at org.jboss.modules.Module.relinkIfNecessary(Module.java:1235) [ceylon-run] at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:208) [ceylon-run] at ceylon.modules.jboss.runtime.AbstractJBossRuntime.createClassLoader(AbstractJBossRuntime.java:56) [ceylon-run] at ceylon.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:105) [ceylon-run] at ceylon.modules.Main.execute(Main.java:69) [ceylon-run] at ceylon.modules.Main.main(Main.java:42) [ceylon-run] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ceylon-run] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [ceylon-run] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [ceylon-run] at java.lang.reflect.Method.invoke(Method.java:601) [ceylon-run] at org.jboss.modules.Module.run(Module.java:270) [ceylon-run] at org.jboss.modules.Main.main(Main.java:294) [ceylon-run] at ceylon.modules.bootstrap.CeylonRunTool.run(CeylonRunTool.java:151) [ceylon-run] ... 27 more

BUILD FAILED

quintesse commented 11 years ago

Probably just need to add

    <path name="javax/xml/parsers"/>

to com/redhat/ceylon/module-resolver/0.6/module.xml

(... or is javax.xml.parsers the name of the class? The error is a bit confusing. Also because javax.xml is already included in the list of allowed JDK packages.)

alesj commented 11 years ago

Yes, looking at module.xml in Runtime for CMR, we should just add the path @quintesse suggests.

Although it would be more proper to have javax.xml module as dependency. (but that means we need to create that module and set its paths)

quintesse commented 11 years ago

I think this was fixed long ago, but we'd have to create some kind of test for this. Problem of course is how to know that we're actually writing the correct test?

FroMage commented 11 years ago

I see the paths were added indeed, but we need to at least run a manual test to confirm it is fixed.

quintesse commented 11 years ago

Yesterday while working on ceylon/ceylon-module-resolver#70 and #46 I had a moment where some of the dependencies were missing from the module-resolver's module.xml file which gave me errors like the above when running the language module ant tests. So it seems confirmed that what we have is at least somewhat correct. Closing because "everything seems to work, let's ship!"