Hi,
This ClassCastException in OSGi container generally means Calss A and B are 
loaded by different classloaders,  that means you have multiple copy of 
org.apache.xerces.jaxp.SAXParserFactoryImpl or 
javax.xml.parsers.SAXParserFactory in your container, as in SMX 4.5.2 we 
already endorse the xercesImpl and xml-apis you shouldn't install those bundle 
yourself.

Could you please post the result of 
package:export |grep javax.xml.parsers
and
package:export |grep org.apache.xerces.jaxp
from the console
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-8-28, at 上午1:10, Bratislav Stojanovic wrote:

> Hi all,
> 
> I have created a bundle with tika-app-1.4.jar inside. When I export this
> bundle
> in Eclipse as a plugin and try to load it into ServiceMix 4.5.2 usign
> webconsole, I
> get the following exception i the log :
> 
> Caused by: java.lang.ClassCastException:
> org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to
> javax.xml.parsers.SAXParserFactory
> at javax.xml.parsers.SAXParserFactory.newInstance(Unknown
> Source)[169:ca.cloudscraper.tika:1.4]
> at
> org.apache.tika.mime.MimeTypesReader.read(MimeTypesReader.java:117)[169:ca.cloudscraper.tika:1.4]
> at
> org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:64)[169:ca.cloudscraper.tika:1.4]
> at
> org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:93)[169:ca.cloudscraper.tika:1.4]
> at
> org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:149)[169:ca.cloudscraper.tika:1.4]
> at
> org.apache.tika.mime.MimeTypes.getDefaultMimeTypes(MimeTypes.java:499)[169:ca.cloudscraper.tika:1.4]
> at
> org.apache.tika.config.TikaConfig.getDefaultMimeTypes(TikaConfig.java:60)[169:ca.cloudscraper.tika:1.4]
> at
> org.apache.tika.config.TikaConfig.<init>(TikaConfig.java:169)[169:ca.cloudscraper.tika:1.4]
> at
> org.apache.tika.config.TikaConfig.getDefaultConfig(TikaConfig.java:268)[169:ca.cloudscraper.tika:1.4]
> at org.apache.tika.Tika.<init>(Tika.java:93)[169:ca.cloudscraper.tika:1.4]
> at
> ca.cloudscraper.core.impl.TikaServiceImpl.<init>(TikaServiceImpl.java:23)[170:ca.cloudscraper.core:1.0.0]
> at
> ca.cloudscraper.core.Activator.start(Activator.java:25)[170:ca.cloudscraper.core:1.0.0]
> at
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:629)[org.apache.felix.framework-3.2.2.jar:]
> at
> org.apache.felix.framework.Felix.activateBundle(Felix.java:1904)[org.apache.felix.framework-3.2.2.jar:]
> ... 7 more
> 
> I know that this is because ServiceMix has xercesImpl jar on it's classpath
> but how
> to fix this? Do I have to import some package explicitely or to customize
> tika jar?
> 
> Please help.
> 
> -- 
> Bratislav Stojanovic, M.Sc.

Reply via email to