dev@glassfish.java.net

Re: Error integrating promoted glassfish-api.jar in jruby connector

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Wed, 14 Jan 2009 18:13:10 -0800

Sahoo wrote:
> Vivek Pandey wrote:
>> Sahoo wrote:
>>> Vivek,
>>>
>>> The problem is 3.0.0-b31 is < 3.0.0.SNAPSHOT. It is lexicographic
>>> comparison using String.compare. I suggest, you change your pom.xml
>>> or osgi.bundle file in scripting project to Import-Package with
>>> version=3.0.0.
>>>
>> You mean I hardcode packages and give the version number '3.0.0.'? I
>> guess this would require hard coding all the packages I depend and
>> then stipoff suffixes. This is ugly and will make regular integration
>> harder and error prone.
> You already hardcode the package names, don't you?
No, I dont have any package name defined in my pom file. It is just *.
The maven plugin puts all the imported packages in the manifest
automatically.

Here is the pom fragment:

           <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <supportedProjectTypes>
                        <supportedProjectType>hk2-jar</supportedProjectType>
                        <supportedProjectType>jar</supportedProjectType>
                        <supportedProjectType>bundle</supportedProjectType>
                    </supportedProjectTypes>
                    <instructions>
                        <Import-Package>
                             *
                        </Import-Package>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>


> If you use regular expression, then you can also specify a version for
> a pattern of package names. See maven-bundle-plugin [1]. It is not
> that error prone. Look at some osgi.bundle file in v3 workspace.
Ok. I will look at those. BTW, can I also have wildcard (*) along with a
regexp, such as one below? For other packages, such as grizzly I just
want bnd to generate the Import-Package entries automatically.

                        <Import-Package>
                             org.glassfish.api.*;version=3.0.0., *
                        </Import-Package>


>>
>> We should think about other option - can we add some attribute in the
>> maven plugin that creates OSGi bundle to do such version mangling?
>>
> Let's discuss this in next engg. meeting.
>
sure.

thanks,

-vivek.
> Thanks,
> Sahoo
>
> [1]
> http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
>> thanks,
>>
>> -vivek.
>>
>>> Thanks,
>>> Sahoo
>>>
>>> Vivek Pandey wrote:
>>>> I tried updating to glassfish-api version 3.0-b31 but while
>>>> deployment OSGI throws this error below. See the bdn output for
>>>> gf-jruby-connector.jar attached. I looked at glassfish-api.jar on
>>>> the trunk and it exports org.glassfish.api.deployment.archive,
>>>> version 3.0.0.SNAPSHOT.
>>>>
>>>> Not sure how OSGi compares versions with letters suffixes. Do you
>>>> think I need to do something here to fix the jruby connector manifest?
>>>>
>>>> -vivek.
>>>>
>>>> INFO: GlassFish v3 startup time : Felix(1076ms) startup
>>>> services(774ms) total(1850ms)
>>>> Jan 13, 2009 10:56:22 PM INFO: ERROR: Error starting
>>>> file:/myhome/vivekmz/dev/glassfish/modules/gf-jruby-connector-0.7.1-SNAPSHOT.jar
>>>> (org.osgi.framework.BundleException: Unresolved constraint in
>>>> bundle 11: package;
>>>> (&(package=org.glassfish.api.deployment.archive)(version>=3.0.0.b31)))
>>>> Jan 13, 2009 10:56:22 PM SEVERE:
>>>> org.osgi.framework.BundleException: Unresolved constraint in bundle
>>>> 11: package;
>>>> (&(package=org.glassfish.api.deployment.archive)(version>=3.0.0.b31))
>>>> Jan 13, 2009 10:56:22 PM SEVERE: at
>>>> org.apache.felix.framework.Felix._resolveBundle(Felix.java:1725)
>>>> Jan 13, 2009 10:56:22 PM SEVERE: at
>>>> org.apache.felix.framework.Felix._startBundle(Felix.java:1588)
>>>> Jan 13, 2009 10:56:22 PM SEVERE: at
>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1541)
>>>> Jan 13, 2009 10:56:22 PM SEVERE: at
>>>> org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1135)
>>>>
>>>> Jan 13, 2009 10:56:22 PM SEVERE: at
>>>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:267)
>>>> Jan 13, 2009 10:56:22 PM SEVERE: at
>>>> java.lang.Thread.run(Thread.java:619)
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>