dev@glassfish.java.net

Re: Export-Package and the mandatory-directive

From: Richard S. Hall <heavy_at_ungoverned.org>
Date: Tue, 26 Oct 2010 15:36:49 -0400

On 10/26/10 13:57, Sheetal Vartak wrote:
> Hi,
>
> I am trying to add the following constraint in the jsf-api.jar :
>
> Export-Package: javax.faces.*;version=2.0,\
> com.sun.faces.application.view.StateHolderSaver;version=2.0;password="com.sun.faces.application.view";mandatory:=password

Are you really specifying "javax.faces.*" ? If so, wildcards are not
allowed in the Export-Package header. You must specify exported packages
explicitly. You can use wildcards with BND to expand exported files.

-> richard

>
> My jsf-impl.jar has the following :
>
> Import-Package:
> ......
> com.sun.faces.application.view.StateHolderSaver;version=2.0;password="com.sun.faces.application.view",
> \
> ......
>
> Now when I drop these 2 jars in the v3.1 workspace and try to start
> the server, I see the following error message in server.log :
>
> [#|2010-10-25T16:12:04.901-0700|SEVERE|glassfish3.1|null|_ThreadID=16;_ThreadName=Thread-1;|Caused
> by: org.osgi.framework.BundleException: Unresolved constraint in
> bundle org.glassfish.web.weld-integration [20]: Unable to resolve
> 20.0: missing requirement [20.0] package;
> (&(package=com.sun.faces.spi)(version>=2.0.0)) [caused by: Unable to
> resolve 50.0: missing requirement [50.0] package;
> (&(package=com.sun.faces.application.view.StateHolderSaver)(password=com.sun.faces.application.view)(version>=2.0.0))]|#]
>
> I checked the Manifest.MF of weld-integration.jar. It has an
> Import-Package attr specifying "com.sun.faces.spi" as one of them. As
> you can see above, the mandatory-directive is only
> for com.sun.faces.application.view.StateHolderSaver. Then what am I
> missing here?
>
> Does weld-integration.jar's Manifest.MF somehow need the
> mandatory-directive to be specified? And why?
>
> Thanks
> Sheetal
>
>