users@glassfish.java.net

Re: Migrate EAR applicaton from Glassfish v2.1 to 3.1.1?

From: <hong.hz.zhang_at_oracle.com>
Date: Wed, 26 Oct 2011 11:45:32 -0400

Where are the jars packaged? If they are just packaged at the root of
the ear, they should be moved to the lib directory under ear root,
that's the spec defined portable way of packaging ear library jars. In
v3, we had enforced the EE spec jar visibility rule so the jars at ear
root level are no longer added to the classpath by default.
There is a compatibility flag you could use if you don't want to
repackage the application (this flag is used to keep product backward
compatibility).

asadmin deploy --property compatibility=v2 foo.ear

- Hong

On 10/26/2011 11:38 AM, forums_at_java.net wrote:
> Hi all
>
> i have some working ear applications that run quite good at glassfish
> v2.1.
> The ear contains some webapps, some ejb jars and some other jars.
>
> I cannot deploy them on Glassfish v3 because of ClassLoading-errors.
> Glassfish does not find the classes in the jar files, wether they are
> ejbs or
> not.
>
> Caused by: java.lang.NoClassDefFoundError: ...
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
> at
> com.sun.enterprise.deployment.util.TypeUtil.getMethod(TypeUtil.java:399)
> at
> com.sun.enterprise.deployment.MethodDescriptor.getMethod(MethodDescriptor.java:333)
>
> at
> com.sun.enterprise.deployment.annotation.handlers.AbstractAuthAnnotationHandler.processAnnotation(AbstractAuthAnnotationHandler.java:115)
>
> at
> com.sun.enterprise.deployment.annotation.handlers.AbstractCommonAttributeHandler.processAnnotation(AbstractCommonAttributeHandler.java:156)
>
> at
> com.sun.enterprise.deployment.annotation.handlers.RolesAllowedHandler.processAnnotation(RolesAllowedHandler.java:60)
>
> at
> org.glassfish.apf.impl.AnnotationProcessorImpl.process(AnnotationProcessorImpl.java:344)
>
> ... 34 more
> Caused by: java.lang.ClassNotFoundException: ...
> at
> com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:808)
>
> at
> com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> at
> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
> ... 42 more
>
>
>
> There are tons of this exceptions.
>
> How do I have to migrate this applications to run them on Glassfish v3?
>
> Regards
>
> Michael
>
>
>
>
> --
>
> [Message sent by forum member 'michael.szalay']
>
> View Post: http://forums.java.net/node/857336
>
>