Results 1 to 5 of 5

Thread: Grails mssing jar

  1. #1

    Default Grails mssing jar

    Hi
    I am using dom4j in grails project for parsing xml. but I think jaxen.jar is missing , I am getting following error.

    Exception in thread "main" java.lang.NoClassDefFoundError: org/jaxen/JaxenException
    at org.dom4j.DocumentFactory.createXPath(DocumentFact ory.java:230)
    at org.dom4j.tree.AbstractNode.createXPath(AbstractNo de.java:207)
    at org.dom4j.tree.AbstractNode.selectNodes(AbstractNo de.java:164)

    Do I need to add any dependency so that this is added to my classpath?

  2. #2
    Join Date
    Jun 2010
    Location
    London
    Posts
    304

    Default

    I don't know for sure, but adding this to your BuildConfig.groovy dependencies should work:

    Code:
    dependencies {
        ...
        runtime "jaxen:jaxen:1.1.1", {
            transitive = false
        }
        ...
    }

  3. #3

    Default

    Thanks Peter.

    I did download the jar file and then put it into lib folder and executed

    grails install-dependency jaxen:jaxen:1.1.1

    that worked for me. I think this would be better option as it would help us us document which dependencies we are using.

  4. #4
    Join Date
    Jun 2010
    Location
    London
    Posts
    304

    Default

    You shouldn't need to run
    Code:
    install-dependency
    . Grails automatically looks in the project's 'lib' directory and adds all the JARs it finds in there to the classpath. BTW, why is that better than declaring the dependency in BuildConfig.groovy? That documents the dependency much better than the above approach in my view.

  5. #5

    Default

    I thought your approach is better because we have documented dependencies in Buildconfig.groovy... miscommunication.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •