Re: Karaf 2.2 issue with org.apache.xerces.jaxp.SAXParserFactoryImpl not found

2011-03-21 Thread dobi
Hello,

I finally got this working. The problem was that the jre org.w3.dom 
package has no class ElementTraversal, which is added by the batik-ext 
package in a standard java environment. But as osgi can only wire a 
package from one bundle, the batik-ext bundle I installed was used for 
wiring (but instead org.w3c.dom came from the system bundle).

I just put the batik-ext.jar to karaf/lib/ext, so that it is added to 
the jre dom package. Seems so simple after all the headache.

marcus


--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-2-2-issue-with-org-apache-xerces-jaxp-SAXParserFactoryImpl-not-found-tp2676053p2710084.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 2.2 issue with org.apache.xerces.jaxp.SAXParserFactoryImpl not found

2011-03-15 Thread dobi
Thanks, 

the package is available in the xerces bundle.

exports | grep org.apache.xerces.jaxp

karaf@root exports | grep org.apache.xerces.jaxp
81 org.apache.xerces.jaxp.validation   
81 org.apache.xerces.jaxp  
81 org.apache.xerces.jaxp.datatype   

bundle 81 is
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xerces/2.9.1_4

I had to add the following packages to the MANIFEST import:

org.apache.xerces.jaxp,
org.apache.xerces.parsers,
org.apache.xerces.impl.dv.dtd,
org.apache.xerces.impl.dv.xs,

then I got more of these problems, which required imports in other batik
bundles until the class org.w3c.dom.ElementTraversal is not found in the jre
org.w3c.dom package. 

Caused by: java.lang.ClassNotFoundException: *** Package 'org.w3c.dom' is
imported by bundle wrap_mvn_org.apache.xmlgraphics_batik-dom_1.7 [64] from
bundle org.apache.felix.framework [0], but the exported package from bundle
org.apache.felix.framework [0] does not contain the requested class
'org.w3c.dom.ElementTraversal'. Please verify that the class name is correct
in the importing bundle wrap_mvn_org.apache.xmlgraphics_batik-dom_1.7 [64]
and/or that the exported package is correctly bundled in
org.apache.felix.framework [0]. ***

It is contained in the batik-ext package, so I should convince the framework
to wire that package from bundle batik-ext to bundle 64.
I'll try adding a version to the wrapped packages and using import-package
with the 'uses' directive. The problem is that I don't know exactly if some
packages can still come from the jre or if all org.w3c.dom.x packages have
to then come from the the batik dependencies (batik-ext and the others from
xml-apis).

--marcus


--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-2-2-issue-with-org-apache-xerces-jaxp-SAXParserFactoryImpl-not-found-tp2676053p2680982.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Karaf 2.2 issue with org.apache.xerces.jaxp.SAXParserFactoryImpl not found

2011-03-14 Thread dobi
Hello, 

I am porting an apache batik user interface that displays svg files to osgi.
Currently the application displays a simple about window. I got all osgi
dependencies solved by wrapping them or using bundles from servicemix, now
the following error occurs:

javax.xml.parsers.FactoryConfigurationError: Provider
org.apache.xerces.jaxp.SAXParserFactoryImpl not found

After searching and reading some posts, I think I need to change the
etc/jre.properties to comment out the jre provided xml libraries that
xml-apis provide. But after removing all xml.* libraries that the header of
the xml-apis bundle shows, karaf does not start anymore. I should probably
load the xml-apis earlier in the bundle startup order, but I don't know
exactly how to do that. 
Do I need that xml-apis bundle at all? My other thought is that I leave
xml-apis away and somehow tell the jre where to find the correct
SAXParserFactory.

Thanks for any hints.

-marcus

environment:
---
Karaf 2.2.0
Sun Java HotSpot(TM) Server VM version 16.3-b01
version 1.6.0_20
Ubuntu 9.04, Linux version 2.6.28-19-generic, i386

stacktrace:
-
14:24:58,286 | ERROR | ExtenderThread-2 | ContextLoaderListener|
BundleApplicationContextListener   50 | 54 -
org.springframework.osgi.extender - 1.2.1 | Application context refresh
failed (OsgiBundleXmlApplicationContext(bundle=fi.somebundle.ui-display,
config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'springActivated' defined in URL
[bundle://57.1:0/META-INF/spring/applicationContext.xml]: Invocation of init
method failed; nested exception is
javax.xml.parsers.FactoryConfigurationError: Provider
org.apache.xerces.jaxp.SAXParserFactoryImpl not found
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)[47:org.springframework.beans:3.0.5.RELEASE]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[47:org.springframework.beans:3.0.5.RELEASE]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)[47:org.springframework.beans:3.0.5.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)[47:org.springframework.beans:3.0.5.RELEASE]
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)[47:org.springframework.beans:3.0.5.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)[47:org.springframework.beans:3.0.5.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)[47:org.springframework.beans:3.0.5.RELEASE]
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)[47:org.springframework.beans:3.0.5.RELEASE]
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)[49:org.springframework.context:3.0.5.RELEASE]
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[53:org.springframework.osgi.core:1.2.1]
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[53:org.springframework.osgi.core:1.2.1]
at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[53:org.springframework.osgi.core:1.2.1]
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[53:org.springframework.osgi.core:1.2.1]
at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[54:org.springframework.osgi.extender:1.2.1]
at java.lang.Thread.run(Thread.java:619)[:1.6.0_20]
Caused by: javax.xml.parsers.FactoryConfigurationError: Provider
org.apache.xerces.jaxp.SAXParserFactoryImpl not found
at javax.xml.parsers.SAXParserFactory.newInstance(Unknown
Source)[:1.6.0_20]
at
org.apache.batik.dom.util.SAXDocumentFactory.(SAXDocumentFactory.java:393)
at fi.somebundle.uidisplay.internal.About.(About.java:316)
at
fi.somebundle.uidisplay.internal.SpringActivated.showAbout(SpringActivated.java:78)
at
fi.somebundle.uidisplay.internal.SpringActivated.start(SpringActivated.java:33)
at