Back Forum Reply New

OSGIBundleXmlWebApplicationContext -Refresh error

mons.logging,org..context.support,org..ui,org..web.context,org..web.context.support,org..web.servlet,org..web.servlet.mvc,org..web.servlet.mvc.support,org..web.servlet.view,org..osgi.web.context.support,org.w3c.dom,org.xml.sax;resolution:=optional,org.xml.sax.helpers;resolution:=optionalAm I missing something not mentioned in the Ref Docs? Any suggestions are welcomed. Thanks.

This is a bug that will be fixed shortly:
browse/OSGI-476
If you're interested, please follow the issue.

hi costin,

I am reading the book named lt;Modular javagt; now, and testing the samples in the book.

when i run the quot;web bundlequot; example and found the following error:
[Timer-2] DEBUG org..osgi.extender.internal.support  .NamespacePlugins - Trying to resolving namespace handler for schema/context
[Timer-2] DEBUG org..osgi.extender.internal.support  .NamespacePlugins - Namespace handler for schema/context found inside Spring Context (org..context)
[Timer-2] DEBUG org..osgi.web.context.support.OsgiB  undleXmlWebApplicationContext - Refresh error
org..beans.factory.BeanDefinitionSt  oreException: Unexpected exception parsing XML document from ucl [bundleentry--53.fwk22068557/WEB-INF/dude-servlet.xml]; nested exception is java.lang.NullPointerException
at org..beans.factory.xml.XmlBeanDefin  itionReader.doLoadBeanDefinitions(XmlBeanDefinitio  nReader.java:420)
at org..beans.factory.xml.XmlBeanDefin  itionReader.loadBeanDefinitions(XmlBeanDefinitionR  eader.java:342)
at org..beans.factory.xml.XmlBeanDefin  itionReader.loadBeanDefinitions(XmlBeanDefinitionR  eader.java:310)
at org..beans.factory.support.Abstract  BeanDefinitionReader.loadBeanDefinitions(AbstractB  eanDefinitionReader.java:143)
at org..beans.factory.support.Abstract  BeanDefinitionReader.loadBeanDefinitions(AbstractB  eanDefinitionReader.java:178)
at org..beans.factory.support.Abstract  BeanDefinitionReader.loadBeanDefinitions(AbstractB  eanDefinitionReader.java:149)
at org..osgi.context.support.OsgiBundl  eXmlApplicationContext.loadBeanDefinitions(OsgiBun  dleXmlApplicationContext.java:176)
at org..osgi.context.support.OsgiBundl  eXmlApplicationContext.loadBeanDefinitions(OsgiBun  dleXmlApplicationContext.java:142)
at org..context.support.AbstractRefres  hableApplicationContext.refreshBeanFactory(Abstrac  tRefreshableApplicationContext.java:123)
at org..context.support.AbstractApplic  ationContext.obtainFreshBeanFactory(AbstractApplic  ationContext.java:422)
at org..context.support.AbstractApplic  ationContext.refresh(AbstractApplicationContext.ja  va:352)
at org..osgi.context.support.AbstractD  elegatedExecutionApplicationContext.access$301(Abs  tractDelegatedExecutionApplicationContext.java:69)
...........
Caused by: java.lang.NullPointerException
at org.eclipse.osgi.framework.util.KeyedHashSet.hash(  KeyedHashSet.java:376)
at org.eclipse.osgi.framework.util.KeyedHashSet.add(K  eyedHashSet.java:83)
at org.eclipse.osgi.internal.loader.BundleLoader.find  RequiredSource(BundleLoader.java:1103)
at org.eclipse.osgi.internal.loader.BundleLoader.find  Source(BundleLoader.java:1042)
at org.eclipse.osgi.internal.loader.BundleLoader.getP  ackageSource(BundleLoader.java:1114)
at org.eclipse.osgi.framework.internal.core.ExportedP  ackageImpl.getImportingBundles(ExportedPackageImpl  .java:70)
at org..osgi.io.internal.resolver.Pack  ageAdminResolver.getImportedBundles(PackageAdminRe  solver.java:112)
at org..osgi.io.OsgiBundleResourcePatt  ernResolver.findClassPathMatchingResources(OsgiBun  dleResourcePatternResolver.java:229)

and I have checked the jira issue you metioned, but I can not solve my problem. Can you help me?

my web.xml file:
lt;context-paramgt;
lt;param-namegt;contextClasslt;/param-namegt;
lt;param-valuegt;org..osgi.web.context.support  .OsgiBundleXmlWebApplicationContextlt;/param-valuegt;
lt;/context-paramgt;

lt;context-paramgt;
lt;param-namegt;contextConfigLocationlt;/param-namegt;
lt;param-valuegt;/WEB-INF/dude-osgi.xmllt;/param-valuegt;
lt;/context-paramgt;

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

lt;servletgt;
lt;servlet-namegt;dudelt;/servlet-namegt;
lt;servlet-classgt;org..web.servlet.DispatcherSe  rvletlt;/servlet-classgt;
lt;init-paramgt;
lt;param-namegt;contextClasslt;/param-namegt;
lt;param-valuegt;org..osgi.web.context.support  .OsgiBundleXmlWebApplicationContextlt;/param-valuegt;
lt;/init-paramgt;
lt;load-on-startupgt;1lt;/load-on-startupgt;
lt;/servletgt;

lt;servlet-mappinggt;
lt;servlet-namegt;dudelt;/servlet-namegt;
lt;ucl-patterngt;*.htmlt;/ucl-patterngt;
lt;/servlet-mappinggt;

---------------------------------------------------------------------
osgi.bnd file as following:
Bundle-ClassPath: .,WEB-INF/classes

Import-Package: *,\
org..osgi.web.context.support,\
org..web.servlet,\
org..web.servlet.handler,\
org..web.servlet.mvc,\
org..web.servlet.view,\
dwmj.domain,\
org..web.servlet.mvc.annotation,\
org..web.context, \
javax.servlet.from, \
javax.servlet.resources, \
javax.xml.parsers;resolution:=optional, \
org.w3c.dom, \
org.xml.sax;resolution:=optional, \
org.xml.sax.helpers;resolution:=optional
Require-Bundle: org..osgi.jstl.osgi
Web-ContextPath: dude

oh sorry, I forgot to write my spring-dm verion,

spring-dm: 1.2.0
spring-core : 2.5.6.A

By the way, could you explain to me what difference between 2.5.6 and 2.5.6, because I use maven to import dependencies about spring-dm, it may import 2.5.6.A and 2.5.6 all, but it can confilct.

.apache.commons.logging_  1.5.0
17ACTIVE      com..slf4j.api_1.5.0Fragments=18
18RESOLVED    com..slf4j.log4j_1.5.0Master=17
19ACTIVE      org..osgi.log4j.osgi_1.2.15.SNAPSHO  TFragments=50
20ACTIVE      org..osgi.core_1.2.0
21ACTIVE      org..osgi.io_1.2.0
22ACTIVE      org..osgi.web_1.2.0
23ACTIVE      org..osgi.web.extender_1.2.0
24ACTIVE      org..osgi.extender_1.2.0
25ACTIVE      org..web_2.5.6.A
26ACTIVE      org..web.servlet_2.5.6.A
27ACTIVE      org..osgi.jasper.osgi_5.5.23.SNAPSH  OT
28ACTIVE      org..osgi.jstl.osgi_1.1.2.SNAPSHOT
29ACTIVE      com..org.apache.catalina_6.0.24Fragments=37, 51
30ACTIVE      com..javax.annotation_1.0.0
31ACTIVE      com..javax.ejb_3.0.0
32ACTIVE      com..javax.mail_1.4.0
33ACTIVE      com..javax.persistence_1.0.0
34ACTIVE      com..javax.servlet_2.5.0
35ACTIVE      com..javax.xml.ws_2.1.1
36ACTIVE      com..org.apache.juli.extras_6.0.24
37RESOLVED    com..org.apache.coyote_6.0.24Master=29
38ACTIVE      com..javax.xml.rpc_1.1.0
39ACTIVE      com..javax.activation_1.1.0
40ACTIVE      com..javax.xml.bind_2.0.0
41ACTIVE      com..javax.xml.soap_1.3.0
42ACTIVE      com..javax.xml.stream_1.0.1
43ACTIVE      org..osgi.catalina.start.osgi_1.0.0
44ACTIVE      org.compass-project.compass_2.2.0
45ACTIVE      com.dudewheresmyjar.domain_1.0.0.SNAPSHOT
46ACTIVE      com.dudewheresmyjar.index_1.0.0.SNAPSHOT
47ACTIVE      com.dudewheresmyjar.spider_1.0.0.SNAPSHOT
48ACTIVE      com.dudewheresmyjar.web_1.0.0.SNAPSHOT
49ACTIVE      org..osgi.servlet-api.osgi_2.5.0.SNAPSHOT
50RESOLVED    com.dudewheresmyjar.logging.cfg_0.0.0Master=19
51RESOLVED    com.dudewheresmyjar.catalina.cfg_0.0.0Master=29

I borrowed the two configuration project for logging and catalina.

In these steps, there are a problem like this:
* ServletException: Could not get RequestDispatcher .....
* DigesterFactory] - Could not get ucl for /javax/servlet/resources/j2ee_1_4.xsd
, and this reason of these problems is the catalina's configuration is missed.
¥
Back Forum Reply New