Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Making shared classes available on the classpath of an OSGi application deployed on Tomcat
Making shared classes available on the classpath of an OSGi application deployed on Tomcat [message #92780] Tue, 24 July 2007 10:05 Go to next message
Eclipse UserFriend
Originally posted by: mehow.infogenia.pl

Hi,

I guess the title says it all. I wish to make some classes shared
between web applications deployed on Tomcat available to bundles
deployed using servletbridge. How can I achieve that?

I tried to use extendedFrameworkExports property, but I don't think it's
the way to go. Well, at least it doesn't work.

Help will be appreciated,

Michal
Re: Making shared classes available on the classpath of an OSGi application deployed on Tomcat [message #92837 is a reply to message #92780] Tue, 24 July 2007 13:38 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
Hi Michal,

Using extendedFrameworkExports is the way to go and should work for usecase.
These exports are not made available to your bundles automatically; you
still have to explicitly import them.
Also, you have to make sure the visible dependencies of these shared classes
are also imported.

-Simon



"Micha
Re: Making shared classes available on the classpath of an OSGi application deployed on Tomcat [message #92991 is a reply to message #92837] Wed, 25 July 2007 09:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mehow.infogenia.pl

Simon Kaegi pisze:
> Hi Michal,
>
> Using extendedFrameworkExports is the way to go and should work for usecase.
> These exports are not made available to your bundles automatically; you
> still have to explicitly import them.

If I edit web.xml like follows:

<init-param>
<param-name>extendedFrameworkExports</param-name>
<param-value>my.imported.package</param-value>
</init-param>

I still get

org.osgi.framework.BundleException: The bundle could not be resolved.
Reason: Missing Constraint: Import-Package: my.imported.package;
version="0.0.0"
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:305)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:260)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:252)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandPro vider._start(FrameworkCommandProvider.java:260)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInt erpreter.execute(FrameworkCommandInterpreter.java
:145)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.do command(FrameworkConsole.java:294)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.co nsole(FrameworkConsole.java:279)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.ru n(FrameworkConsole.java:214)
at java.lang.Thread.run(Thread.java:619)

even though in MANIFEST.MF I have

Import-Package: my.imported.package

> Also, you have to make sure the visible dependencies of these shared classes
> are also imported.

Could this be the reason of the above behaviour?

Thanks,

Michal

> -Simon
>
>
>
> "Michał Tkacz" <mehow@infogenia.pl> wrote in message
> news:f84iua$ijl$1@build.eclipse.org...
>> Hi,
>>
>> I guess the title says it all. I wish to make some classes shared between
>> web applications deployed on Tomcat available to bundles deployed using
>> servletbridge. How can I achieve that?
>>
>> I tried to use extendedFrameworkExports property, but I don't think it's
>> the way to go. Well, at least it doesn't work.
>>
>> Help will be appreciated,
>>
>> Michal
>
>
Re: Making shared classes available on the classpath of an OSGi application deployed on Tomcat [message #93006 is a reply to message #92991] Wed, 25 July 2007 12:47 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
> even though in MANIFEST.MF I have
>
> Import-Package: my.imported.package
>
>> Also, you have to make sure the visible dependencies of these shared
>> classes are also imported.
>
> Could this be the reason of the above behaviour?
>
It shouldn't be since we're just try to resolve the dependency.
It is possible that the old version of the extension bundle is around.
Perhaps try either running "sp_redeploy" or cleaning out the "work"
directory for your web application.

-Simon
Re: Making shared classes available on the classpath of an OSGi application deployed on Tomcat [message #93048 is a reply to message #93006] Thu, 26 July 2007 08:45 Go to previous message
Eclipse UserFriend
Originally posted by: mehow.infogenia.pl

Simon Kaegi wrote:
>> even though in MANIFEST.MF I have
>>
>> Import-Package: my.imported.package
>>
>>> Also, you have to make sure the visible dependencies of these shared
>>> classes are also imported.
>> Could this be the reason of the above behaviour?
>>
> It shouldn't be since we're just try to resolve the dependency.
> It is possible that the old version of the extension bundle is around.
> Perhaps try either running "sp_redeploy" or cleaning out the "work"
> directory for your web application.

That did the job! Thanks!

Michal
Previous Topic:How does my plugin know if it's running headless?
Next Topic:JMS/ActiveMQ Equinox OSGi bundle
Goto Forum:
  


Current Time: Fri Apr 26 11:58:54 GMT 2024

Powered by FUDForum. Page generated in 0.03381 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top