users@glassfish.java.net

Re: Problems with Glassfish v3 preview classloader

From: <glassfish_at_javadesktop.org>
Date: Tue, 09 Feb 2010 00:40:26 PST

> I see. All library jars need to be placed in the lib
> directory of the ear (instead of at the ear root)
> according to the EE spec. You can try to repackage
> your app according to the EE spec, or you could use
> this flag to deploy your app (where we try to
> preserve backward compatibility of the v2 behavior,

Hi,

In my opinion, this is simply not true. This is not what Java EE 5 specs say. They were clear as where you could put lib files. Java EE 6 specs did change regarding this. This means they aren't compatible with Java EE 5. If I understand the jcp correctly, it shouldn't be like this. I think this is a bug in the specification.

Here follows an excerpt from Java EE 5. Line marked with "*****" was removed from Java EE 6. This means Glassfish 3 is Java EE 6 compatible, but not Java EE 5.

"ejb 3 core specifications, §6.2, http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html

A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF
directory contains the persistence.xml file is termed the root of the persistence unit. In Java EE,
the root of a persistence unit may be one of the following:
• an EJB-JAR file
• the WEB-INF/classes directory of a WAR file[40]
• a jar file in the WEB-INF/lib directory of a WAR file
*****• a jar file in the root of the EAR
++++• a jar file in the EAR library directory
• an application client jar file"

I wouldn't even bother if this wasn't just the way Netbeans does the packaging. I don't know how to tell netbeans to put all libraries in lib/ . I know how to hack it on a per-lib basis, but this isn't a real option for our project (20 modules, 6 developers). And I didn't have any success with the compatibility switch: my persistence context is in a jar which cannot be found in glassfish 3, even with this magic switch.
[Message sent by forum member 'ymajoros' (yannick.majoros_at_gmail.com)]

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