Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Equinox in a servlet container and container dependencies
Equinox in a servlet container and container dependencies [message #89176] Fri, 01 June 2007 07:15 Go to next message
Eclipse UserFriend
Originally posted by: xuiterlinden.be-value.nl

Hi,

I'm running equinox in a servlet container (JBoss 4.0.3-Tomcat) using
the servletbridge.
Now I want to use spring-jmx to expose a bean through the jmx console.
I have created a spring plugin which contains the necessary spring jars
and exports those packages.
My plugin loads the application context fine, but gives a
ClassNotFoundException on JBoss classes it doesn't see.
Can I somehow make the JBoss classes visible to the modules in my
Equinox container ?, or should these dependencies handled differently.

A similar problem occurs when log4j is used on JBoss. It comlains about
not being able to find a JBoss specific appender.

Thanks,

Xander
Re: Equinox in a servlet container and container dependencies [message #89206 is a reply to message #89176] Fri, 01 June 2007 12:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: viy.net.gmail.com

Xander Uiterlinden wrote:
> A similar problem occurs when log4j is used on JBoss. It comlains about
> not being able to find a JBoss specific appender.

Look at web.xml of your HTTP bridge web-app
you can specify all "system" packages should be visible here.

I made log4j and junit visible to my plugins just by adding:
(comments just fyi)

<!--
org.eclipse.equinox.servletbridge and the Servlet API are exported
automatically to the underlying OSGi framework.
The extendedFrameworkExports parameter allows the specification of
additional java package exports.
The format is a comma separated list of exports as specified by the
"Export-Package" bundle manifest header.
For example: com.mycompany.exports; version=1.0.0,
com.mycompany.otherexports; version=1.0.0
-->

<init-param>
<param-name>extendedFrameworkExports</param-name>
<param-value>org.apache.log4j,junit.framework;version="3.8.1 "</param-value>

</init-param>
Re: Equinox in a servlet container and container dependencies [message #89535 is a reply to message #89206] Tue, 05 June 2007 08:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: xuiterlinden.be-value.nl

Thanks for your reply. This is still confusing me.

I have two situations where the JBoss classes are needed:
- logging
- add a bean to the jmx registry

The only way I can get both to work is to set
osgi.parentClassloader=fwk
org.osgi.framework.bootdelegation=*
in the launch.ini, but this is not the preferred solution, but it works
like a charm.

When I try the alternative approach, using the servlet init-param, or
using a extensionbundle plugin for the servletbridge, it still doens't
seem to find the classes it's looking for, even when I specified the
corresponding packages in the Export-Package :-S
As a final attempt I tried exporting nearly everything in the JBoss lib
directory, but it all gives the same result.

What is the relation between the ExtendedFrameworkExports and the
osgi.parentClassloader parameter ?

Can anyone shed some light on this confusion ?

Thanks,

Xander

Eugene Voytitsky schreef:
> Xander Uiterlinden wrote:
>> A similar problem occurs when log4j is used on JBoss. It comlains about
>> not being able to find a JBoss specific appender.
>
> Look at web.xml of your HTTP bridge web-app
> you can specify all "system" packages should be visible here.
>
> I made log4j and junit visible to my plugins just by adding:
> (comments just fyi)
>
> <!--
> org.eclipse.equinox.servletbridge and the Servlet API are exported
> automatically to the underlying OSGi framework.
> The extendedFrameworkExports parameter allows the specification of
> additional java package exports.
> The format is a comma separated list of exports as specified by the
> "Export-Package" bundle manifest header.
> For example: com.mycompany.exports; version=1.0.0,
> com.mycompany.otherexports; version=1.0.0
> -->
>
> <init-param>
> <param-name>extendedFrameworkExports</param-name>
> <param-value>org.apache.log4j,junit.framework;version="3.8.1 "</param-value>
> </init-param>
Re: Equinox in a servlet container and container dependencies [message #89666 is a reply to message #89535] Tue, 05 June 2007 13:45 Go to previous message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
"Xander Uiterlinden" <xuiterlinden@be-value.nl> wrote in message
news:f437h5$pcg$1@build.eclipse.org...
> Thanks for your reply. This is still confusing me.
>
> I have two situations where the JBoss classes are needed:
> - logging
> - add a bean to the jmx registry

What packages are involved here? This might take a bit of work but you'll
have to sort out your exact dependencies if you want to export packages from
the server/webapp.
>
> The only way I can get both to work is to set
> osgi.parentClassloader=fwk
> org.osgi.framework.bootdelegation=*
> in the launch.ini, but this is not the preferred solution, but it works
> like a charm.

You're right -- this is not particularly safe.
This approach can sometimes be made to work in very specific environments
however it inevitably will lead to a host of class loader problems and
linkage errors as your product gets more sophisticated.

>
> When I try the alternative approach, using the servlet init-param, or
> using a extensionbundle plugin for the servletbridge, it still doens't
> seem to find the classes it's looking for, even when I specified the
> corresponding packages in the Export-Package :-S
> As a final attempt I tried exporting nearly everything in the JBoss lib
> directory, but it all gives the same result.
>
> What is the relation between the ExtendedFrameworkExports and the
> osgi.parentClassloader parameter ?
>
> Can anyone shed some light on this confusion ?

Did you use Import-Package in the bundles where you have the dependency?
This is the "big" difference between getting your requirements via boot
delegation instead of using package or bundle resolution.
Your bundles should import every non-java.* package (this includes
javax.xml.parsers and other non java.* packages from the JRE)

HTH
-Simon

>
> Thanks,
>
> Xander
>
> Eugene Voytitsky schreef:
>> Xander Uiterlinden wrote:
>>> A similar problem occurs when log4j is used on JBoss. It comlains about
>>> not being able to find a JBoss specific appender.
>>
>> Look at web.xml of your HTTP bridge web-app
>> you can specify all "system" packages should be visible here.
>>
>> I made log4j and junit visible to my plugins just by adding:
>> (comments just fyi)
>>
>> <!--
>> org.eclipse.equinox.servletbridge and the Servlet API are exported
>> automatically to the underlying OSGi framework.
>> The extendedFrameworkExports parameter allows the specification of
>> additional java package exports.
>> The format is a comma separated list of exports as specified by the
>> "Export-Package" bundle manifest header.
>> For example: com.mycompany.exports; version=1.0.0,
>> com.mycompany.otherexports; version=1.0.0
>> -->
>>
>> <init-param>
>> <param-name>extendedFrameworkExports</param-name>
>> <param-value>org.apache.log4j,junit.framework;version="3.8.1 "</param-value>
>> </init-param>
Previous Topic:Exception during processing of http post
Next Topic:OSGi Bundle Dependency Question
Goto Forum:
  


Current Time: Sat Apr 20 01:08:47 GMT 2024

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

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

Back to the top