dev@glassfish.java.net

Re: debugging ClassNotFoundException runtime exception in hk2/OSGi?

From: Snjezana Sevo-Zenzerovic <snjezana.sevozenzerovic_at_oracle.com>
Date: Tue, 29 Jun 2010 11:52:31 -0700

There is nothing wrong with your Maven dependencies, but you probably
need to check OSGi exports in shoal-gms-impl.jar and imports in
shoal-gms-api.jar. If I remember correctly, these jars are OSGi-fied in
Shoal build itself and not repackaged in GlassFish, right?


Bobby Bissett wrote:
> Hi,
>
> How in the world do I debug a ClassNotFoundException during runtime in
> GF? I think I have my dependencies ok, and the module compiles without
> any issues, but then at runtime I get a NoClassDefFoundError caused by
> a ClassNotFoundException. I'm not using reflection; the class in
> question is explicitly imported and the compiler is happy. Just not
> runtime.
>
> The situation: I've split the shoal-gms.jar from the Shoal workspace
> into shoal-gms-api and shoal-gms-impl jars.
>
> Inside GF, cluster/gms-bootstrap depends only on the shoal-gms-api
> bits. So far so good. When needed, the gms-bootstrap module loads the
> gms-adapter module. This module depends on shoal-gms-api and
> shoal-gms-impl (and on the gms-bootstrap mod in GF). The class it
> can't find at runtime is in the shoal-gms-impl jar.
>
> I see that the jar is present in the modules dir and it includes the
> class I need. The pom of the gms-adapter module includes this:
>
> <dependency>
> <groupId>org.shoal</groupId>
> <artifactId>shoal-gms-impl</artifactId>
> </dependency>
>
> ...and the full dependency is declared in the top-level pom. So how do
> I figure out what my actual classpath is when this runs? Is there
> something I need in my dependency element that's missing? Am lost in
> the whole OSGi world on this one.
>
> Thanks,
> Bobby
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>


-- 
Oracle <http://www.oracle.com>
Snjezana Sevo-Zenzerovic
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to 
developing practices and products that help protect the environment