dev@glassfish.java.net

Re: The mistery of ant dependency...

From: Sahoo <Sahoo_at_Sun.COM>
Date: Tue, 07 Jul 2009 11:44:25 +0530

Snjezana Sevo-Zenzerovic wrote:
> I am trying to remove ant jar from v3 distributions since we should
> not need it anymore and as per maven dependency plugin output the only
> module still depending on it is packager/glassfish-common package.
>
> However, if ant jar is removed from the distribution I get the
> following OSGi error during server startup:
>
> [#|2009-07-06T16:48:29.312-0700|SEVERE|glassfish|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=18;_ThreadName=Thread-1;|HTTP
> Processing error
> com.sun.enterprise.module.ResolveError: Failed to start
> org.glassfish.web.beans-integration(Web Beans integration for
> glassfish):3.0.0.SNAPSHOT
> at
> org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:149)
> at
> org.jvnet.hk2.osgiadapter.OSGiModuleImpl$1$1$1.loadClass(OSGiModuleImpl.java:308)
>
> at com.sun.hk2.component.LazyInhabitant.fetch(LazyInhabitant.java:91)
> at com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:106)
> at
> com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60)
>
> at org.jvnet.hk2.component.Habitat$1.get(Habitat.java:252)
> at java.util.AbstractList$Itr.next(AbstractList.java:345)
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.initializeFileURLPattern(ContainerMapper.java:231)
>
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:177)
>
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:746)
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:655)
> at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:905)
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:161)
>
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:136)
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
>
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
>
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
>
> at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>
> at java.lang.Thread.run(Thread.java:619)
> Caused by: org.osgi.framework.BundleException: Unresolved constraint
> in bundle 152: package; (package=org.apache.tools.ant)
> at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3111)
> at org.apache.felix.framework.Felix.startBundle(Felix.java:1441)
> at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:779)
> at
> org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:144)
>
> So, if I am reading this correctly,
> org.glassfish.web.beans-integration is trying to import
> org.apache.tools.ant package - why and where is this coming from? I
> don't see it listed in jar's manifest...
>
I don't think the conclusion is correct. Bundle 152 may not be
org.glassfish.web.beans-integration. You need to use Felix shell to find
out which is bundle 152. Instructions are available at [1]. I actually
experimented by removing ant.jar from modules dir and found
apache-commons.jar was failing to resolve because of missing ant
packages. I don't know what all is there in that jar, but I definitely
think at least the package org.apache.commons.modeler.ant [2] in
apache-commons.jar depends on ant classes. If we don't use that modeler
package, you can try removing it from the list of exported packages in
distributions/external/apache-commons/pom.xml and see how it goes.

Thanks,
Sahoo

[1]
http://weblogs.java.net/blog/ss141213/archive/2009/02/telnet_to_glass.html
[2]
http://commons.apache.org/modeler/apidocs/org/apache/commons/modeler/ant/package-summary.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>