Grails

create-app fails on Mac OSX in 1.2M4

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Cannot Reproduce
  • Affects Version/s: 1.2-M4
  • Fix Version/s: 1.2-RC1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Mac OSX 10.6.1, JDK 1.6 or 1.5

Description

With 1.2M4 if I download the distro, set my GRAILS_HOME and put $GRAILS_HOME/bin in my path and run

grails create-app Temp

I get the error below. If I switch back to 1.2M2 no error

mb:development mike$ grails create-app Temp
Welcome to Grails 1.2-M4 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /Users/mike/development/tools/grails/grails-1.2-M4

Base Directory: /Users/mike/development
Resolving dependencies...
Dependencies resolved in 1316ms.
Running script /Users/mike/development/tools/grails/grails-1.2-M4/scripts/CreateApp_.groovy
Environment set to development
     [copy] Copying 1 resource to /Users/mike/development/Temp
    [unjar] Expanding: /Users/mike/development/Temp/grails-shared-files.jar into /Users/mike/development/Temp
   [delete] Deleting: /Users/mike/development/Temp/grails-shared-files.jar
     [copy] Copying 1 resource to /Users/mike/development/Temp
    [unjar] Expanding: /Users/mike/development/Temp/grails-app-files.jar into /Users/mike/development/Temp
   [delete] Deleting: /Users/mike/development/Temp/grails-app-files.jar
     [move] Moving 1 file to /Users/mike/development/Temp
     [move] Moving 1 file to /Users/mike/development/Temp
     [move] Moving 1 file to /Users/mike/development/Temp
     [move] Moving 1 file to /Users/mike/development/Temp
     [move] Moving 1 file to /Users/mike/development/Temp
     [move] Moving 1 file to /Users/mike/development/Temp
Error executing script CreateApp: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/xml/sax/SAXParseException"
java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/xml/sax/SAXParseException"
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
	at java.lang.Class.getDeclaredMethods(Class.java:1791)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:33)
	at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:20)
	at _PluginDependencies_groovy.readMetadataFromZip(_PluginDependencies_groovy:887)
	at _PluginDependencies_groovy.this$4$readMetadataFromZip(_PluginDependencies_groovy)
	at _PluginDependencies_groovy$_run_closure24.doCall(_PluginDependencies_groovy:876)
	at _PluginDependencies_groovy$_run_closure31_closure88.doCall(_PluginDependencies_groovy:1176)
	at _PluginDependencies_groovy$_run_closure31_closure88.doCall(_PluginDependencies_groovy)
	at _PluginDependencies_groovy.withPluginInstall(_PluginDependencies_groovy:1221)
	at _PluginDependencies_groovy.this$4$withPluginInstall(_PluginDependencies_groovy)
	at _PluginDependencies_groovy$_run_closure31.doCall(_PluginDependencies_groovy:1175)
	at _PluginDependencies_groovy$_run_closure31.call(_PluginDependencies_groovy)
	at _GrailsPlugins_groovy$_run_closure3.doCall(_GrailsPlugins_groovy:96)
	at _GrailsCreateProject_groovy$_run_closure1.doCall(_GrailsCreateProject_groovy:46)
	at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
	at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
	at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
	at gant.Gant.withBuildListeners(Gant.groovy:344)
	at gant.Gant.this$2$withBuildListeners(Gant.groovy)
	at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
	at gant.Gant.dispatch(Gant.groovy:334)
	at gant.Gant.this$2$dispatch(Gant.groovy)
	at gant.Gant.invokeMethod(Gant.groovy)
	at gant.Gant.processTargets(Gant.groovy:495)
	at gant.Gant.processTargets(Gant.groovy:480)
Error executing script CreateApp: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/xml/sax/SAXParseException"

Activity

Hide
Graeme Rocher added a comment -

Hmm works fine for me, but I'm on Leopard. You're on Snow Leopard right?

Show
Graeme Rocher added a comment - Hmm works fine for me, but I'm on Leopard. You're on Snow Leopard right?
Hide
Mike Brevoort added a comment -

Yep, on Snow Leopard

Show
Mike Brevoort added a comment - Yep, on Snow Leopard
Hide
Graeme Rocher added a comment -

Marc is on Snow Leopard and he was unable to reproduce the issue. Can you add "export JAVA_OPTS=-verbose" and see where the XML apis are being loaded from. I think you have a local classpath issue

Show
Graeme Rocher added a comment - Marc is on Snow Leopard and he was unable to reproduce the issue. Can you add "export JAVA_OPTS=-verbose" and see where the XML apis are being loaded from. I think you have a local classpath issue
Hide
Mike Brevoort added a comment -

Attached output from export JAVA_OPTS=-verbose

Show
Mike Brevoort added a comment - Attached output from export JAVA_OPTS=-verbose
Hide
Graeme Rocher added a comment -

The reason for the error the xml-api.jar is being pulled in from your ivy cache:

[Loaded org.xml.sax.SAXParseException from file:/Users/mike/.ivy2/cache/xml-apis/xml-apis/jars/xml-apis-1.3.04.jar]
[Loaded org.apache.tools.ant.DemuxInputStream from file:/Users/mike/.ivy2/cache/org.apache.ant/ant/jars/ant-1.7.1.jar]
[Loaded org.apache.tools.ant.BuildLogger from file:/Users/mike/.ivy2/cache/org.apache.ant/ant/jars/ant-1.7.1.jar]

I imagine if you wipe your ivy cache the problem will go away, but its worry that transitive data is causing this corruption. Do you now how to build Grails from sources? If so could you add the following line to the constructor of IvyDependencyManager and rebuild?:

Message.setDefaultLogger new DefaultMessageLogger(Message.MSG_DEBUG); break

In the meantime I will add the ability to enable ivy logging via a system property so people don't have to do this again.

Show
Graeme Rocher added a comment - The reason for the error the xml-api.jar is being pulled in from your ivy cache:
[Loaded org.xml.sax.SAXParseException from file:/Users/mike/.ivy2/cache/xml-apis/xml-apis/jars/xml-apis-1.3.04.jar]
[Loaded org.apache.tools.ant.DemuxInputStream from file:/Users/mike/.ivy2/cache/org.apache.ant/ant/jars/ant-1.7.1.jar]
[Loaded org.apache.tools.ant.BuildLogger from file:/Users/mike/.ivy2/cache/org.apache.ant/ant/jars/ant-1.7.1.jar]
I imagine if you wipe your ivy cache the problem will go away, but its worry that transitive data is causing this corruption. Do you now how to build Grails from sources? If so could you add the following line to the constructor of IvyDependencyManager and rebuild?:
Message.setDefaultLogger new DefaultMessageLogger(Message.MSG_DEBUG); break
In the meantime I will add the ability to enable ivy logging via a system property so people don't have to do this again.
Hide
Mike Brevoort added a comment -

I can build grails from the sources, this was from the m4 distribution I downloaded, but I have build several versions in the past so the ivy cache residual might be from those previous builds. Just to confirm, deleting ~/.ivy2/cache cleaned up the problem. Thanks Graeme.

Show
Mike Brevoort added a comment - I can build grails from the sources, this was from the m4 distribution I downloaded, but I have build several versions in the past so the ivy cache residual might be from those previous builds. Just to confirm, deleting ~/.ivy2/cache cleaned up the problem. Thanks Graeme.
Hide
Graeme Rocher added a comment -

we'll need a reproducible example of the ivy cache issue, until then closing this

Show
Graeme Rocher added a comment - we'll need a reproducible example of the ivy cache issue, until then closing this

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: