Back Forum Reply New

Can't load web.context.ContextLoaderListener in osgi

Hi,
I'm trying to my wepapp in OSGI following the reference guide (Chapter 8.7).
I put the following in the web.xml:

lt;listenergt; lt;listener-classgt;org..web.context.ContextLoade  rListenerlt;/listener-classgt;                        
lt;/listenergt;

But the class to not accessable to the runtime. It's not in any of the Spring DM files. How can I get it to work?

Thanks,

Ming

Make sure you import org.springframwork.web.context package. Take a look at the samples included in 1.2.0 since they'll help you jumpstart the project with regard to imports and exports.

.aopalliance_1.0.0
5ACTIVE      com..slf4j.api_1.5.0Fragments=6
6RESOLVED    com..slf4j.log4j_1.5.0Master=5
7ACTIVE      com..slf4j.org.apache.commons.logging_  1.5.0
8ACTIVE      org..osgi.jasper.osgi_5.5.23.SNAPSH  OT  lt;---
9ACTIVE      org..osgi.servlet-api.osgi_2.5.0.SNAPSHOT  lt;---
10ACTIVE      org..osgi.jsp-api.osgi_2.0.0.SNAPSHOT  lt;---
11ACTIVE      org..osgi.jstl.osgi_1.1.2.SNAPSHOT  lt;---
12ACTIVE      org..osgi.log4j.osgi_1.2.15.SNAPSHO  TFragments=13
13RESOLVED    com.manning.osgi-log4j-config_1.0.0.SNAPSHOTMaster=12
15ACTIVE      org..bundle.spring.aop_2.5.5
16ACTIVE      org..bundle.spring.beans_2.5.5
17ACTIVE      org..bundle.spring.context_2.5.5
18ACTIVE      org..bundle.spring.core_2.5.5
19ACTIVE      org..bundle.osgi.core_1.1.2
20ACTIVE      org..bundle.osgi.extender_1.1.2
21ACTIVE      org..bundle.osgi.io_1.1.2
22ACTIVE      org..bundle.osgi.web_1.1.2  lt;---
23ACTIVE      org..bundle.osgi.web.extender_1.1.2  lt;---
24ACTIVE      org..bundle.spring.web_2.5.5  lt;---

You can see above several kinds of bundles for the Web:
- Tomcat (you can see jetty if you want)
- Web bundles (servlets, jsp, el, jstl)
- Spring / Spring DM Web bundles.

Once this done, the org..web.context package is available in the OSGi container (provided by the org..bundle.osgi.web bundle) and you must specify it in the Import-Package header of the MANFEST file of your Web bundle in order to be able to use it.

Hope it helps you,
Thierry

There is a little misunderstanding that I'd like to clear out. Thierry's configuration works out just fine but the package quot;org..web.contextquot; is exported by the Spring Web bundle. Spring DM Web bundle exports package quot;org..osgi.web.contextquot; .
¥
Back Forum Reply New