users@glassfish.java.net

Re: Can't deploy an EAR with a third party library in Glassfish V3

From: <glassfish_at_javadesktop.org>
Date: Thu, 12 Nov 2009 16:05:38 PST

Thanks guys, your comments pointed me in the right direction and I was able to make the correct modifications.

Yes, I was using <java> not <jar>. Typo.

I am using the maven ear plugin and its usage threw me off a bit, and had that <java> module included in the application.xml. the documentation wasn't clear on the third party library vs client jar thing. Since both use the jarModule to specify themselves. I disabled it from putting it in the application.xml in this case.

That in addition to have the library in the default /lib directory as specified by the spec when no explicit <library-directory> element is specified in the application.xml. I could have also put this element in there like this <library-directory>lib</library-directory> to get the same effect, but I kept it out.

So for anyone who might have a similar issue, the final and correct structure looked like this:

test.ear
  META-INF/application.xml
  /lib/jsch.jar
  applicaton1.jar
  application2.jar
  application3.jar

<?xml version="1.0" encoding="UTF-8"?>
<application version="5"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/application_5.xsd">
  
  <display-name>test</display-name>
  <module>
    <ejb>application1.jar</ejb>
  </module>
  <module>
    <ejb>application2.jar</ejb>
  </module>
  <module>
    <ejb>application3.jar</ejb>
  </module>
</application>
[Message sent by forum member 'bkatnich' ]

http://forums.java.net/jive/thread.jspa?messageID=371644