Announcement Announcement Module
Collapse
No announcement yet.
Grails mssing jar Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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
        }
        ...
    }

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment


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

          Comment

          Working...
          X