users@glassfish.java.net

ASURLClassLoader exception while deploying ear

From: Jürgen Link <juergen.link_at_freenet.de>
Date: Mon, 21 Dec 2009 16:34:58 +0100

Hi all,
I'm facing a strange problem when deploying an enterprise application
into glassfish v3.
Tha application comprises of two web apps (contained as war), both using
hibernate and spring.
On application start, the following exception is thrown:

Caused by: java.io.IOException: Cannot open a foreign URL;
this.url=jar:file:/opt/glassfishv3/glassfish/domains/yoochoose-pmr/applications/pmr-app-0.9-SNAPSHOT/lib/recom
mender-core-api-0.0.1-SNAPSHOT.jar!/com/yoochoose/core/api/;
foreign.url=jar:file:/opt/glassfishv3/glassfish/domains/yoochoose-pmr/applications/pmr-app-0.9-SNAPSHOT/lib/
rc-core-api-0.0.1-SNAPSHOT.jar!/com/yoochoose/core/api/objects/AbstractProfileType.class
        at
com.sun.enterprise.loader.ASURLClassLoader$InternalURLStreamHandler.openConnection(ASURLClassLoader.java:1281)
        at java.net.URL.openConnection(URL.java:945)
        at
org.springframework.core.io.UrlResource.getInputStream(UrlResource.java:121)
        at
org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:74)
        at
org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:68)
        at
org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean.scanPackages(AnnotationSessionFactoryBean.java:191)
        ... 120 more

The ASURLClassLoader is running into trouble (from source code comment,
this is _very_ unexpected) and the application cannot start due to
subsequent hibernate mapping errors.

Any help appreciated!

Regards
Jürgen