users@glassfish.java.net

Re: third party jars

From: Hong Zhang <hong.hz.zhang_at_oracle.com>
Date: Tue, 10 Aug 2010 09:27:25 -0400

Hi,
     In v3, we have enforced the jar visibility more strictly based on
the EE spec to encourage portable packaging. It's not a portable way to
package the library jars at the root level of the ejb module (I assume
your library jar is packaged at the ejb jar root level). The portable
packaging way is to put the libraries that the ejb module needs in the
ear lib directory. Ideally, the ejb module should have an equivalent of
WEB-INF/lib directory like war file to put all the library jars. I have
talked with Ken Saks (spec lead of EJB3.1) in the past about this and
this is one of the areas that need to be addressed in the future EJB spec.
    Other than packaging the libraries inside the application, you can
also reference any application specific libraries through the
--libraries option during deployment. See the libraries option here for
more details:
http://docs.sun.com/app/docs/doc/820-7701/deploy-1?l=en&a=view.
    Above being said, we did introduce a flag called "compatibility" to
preserve v2 compatibility for jar visibility. So try this with your
application to see if it makes a difference:
     asadmin deploy --property compatibility=v2 <your archive file>
   
    Thanks,

- Hong

On 8/10/2010 7:33 AM, Martin, Ray wrote:
>
> Using netbeans 6.8
>
>
>
> Have been working in glassfish v2 -- yesterday switched to v3 -- wow.
> (big changes in the JPA.)
>
>
>
> After many hours of work, got all the errors out of the EJBModule
> project.
>
> It deploys.
>
> It starts when commanded from the SOAP interface.
>
> It crashes as soon as a third party library is called -- JSON in this
> case. Though the oracle library must have been seen because database
> connections are working. The JSON jar has other dependencies like
> commons-*.
>
>
>
> All third party jars have been packaged into the EJBModule jar.
>
>
>
> I built the project in SE using JPA and the third party jars -- runs
> great.
>
> I built a similar project as a web app where the EJBs, JPA, and third
> party jars are used -- runs great.
>
>
>
> Wow -- am I sorry that I changed to v3.
>
>
>
> I have searched and searched -- I cannot be the only guy who has this
> problem -- but, I can find no solution.
>
>
>
> Thought maybe it was netbeans' fault -- so, deployed using admin
> console -- same problem. So, I guess it is a packaging problem??? A
> manifest problem??? wow
>
>
>