Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » ServiceConfigurationError(Intermittenly getting java.util.ServiceConfigurationError Exception)
ServiceConfigurationError [message #1716618] Sun, 06 December 2015 13:38 Go to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi all,

I intermittenly getting below exception when deploying my application on Virgo:

Caused by: java.util.ServiceConfigurationError: org.axonframework.serializer.ContentTypeConverter: Provider org.axonframework.serializer.converters.ByteArrayToInputStreamConverter not a subtype
	at java.util.ServiceLoader.access$300(
	at java.util.ServiceLoader$
	at java.util.ServiceLoader$
	at org.axonframework.serializer.ChainingConverterFactory.<init>(
	at org.axonframework.serializer.AbstractXStreamSerializer.<init>(
	at org.axonframework.serializer.AbstractXStreamSerializer.<init>(
	at org.axonframework.serializer.AbstractXStreamSerializer.<init>(
	at org.axonframework.serializer.xml.XStreamSerializer.<init>(
	at org.axonframework.contextsupport.spring.FileSystemEventStoreBeanDefinitionParser.doParse(
	at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(
	at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(
	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(
	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(
	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(
	... 21 common frames omitted

The above error does not always show up, but even if so, if I restart Virgo the error could be thrown.

I suspect that this is a classloading issue but I'm not sure where to begin investigating since I never encountered this in non-OSGI environment or when I launch OSGI via Eclipse OSGI framework launcher.

Below is the version:

Virgo Tomcat/Jetty Server : 3.6.4
Spring: 3.2.5

Any help would be greatly appreciated.

Re: ServiceConfigurationError [message #1716843 is a reply to message #1716618] Tue, 08 December 2015 14:10 Go to previous messageGo to next message
daniel marthaler is currently offline daniel marthalerFriend
Messages: 77
Registered: April 2012
Location: Z├╝rich
Hi Setya

Usually when you try to consume frameworks which use java.util.ServiceLoader in an OSGi environment you will have a number of issues. Please read the article [1] which explains in more detail what is causing those issues.

To get it to work you must use an implementation of the OSGi ServiceLoader Mediator specification, chapter 133 in the OSGi Enterprise Specification Version 5.
As far as i know there is only one implementation of this specification from Apache Aries called SPI Fly [2].


Re: ServiceConfigurationError [message #1717141 is a reply to message #1716843] Thu, 10 December 2015 09:19 Go to previous messageGo to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi Daniel,

Thank you for your information.

I've tried SPI Fly and get confirmed by the author that the problem is different from what SPI Fly addresses.

The problem comes from the fact the service interface & implementation were loaded by different classloader hence considered not assignable.

I've added -XX:+TraceClassLoading JVM parameter when starting Virgo and found the following when the problem occurs:
[Loaded org.axonframework.serializer.AnnotationRevisionResolver from file:/usr/apps/virgo-jetty-server-3.6.4.RELEASE/work/deployer/s/axonframework.plan-2.4/5/0/axon-core-2.4.jar/]
[Loaded org.axonframework.serializer.ChainingConverterFactory from file:/usr/apps/virgo-jetty-server-3.6.4.RELEASE/work/deployer/s/axonframework.plan-2.4/5/0/axon-core-2.4.jar/]
[Loaded org.axonframework.serializer.ContentTypeConverter from file:/usr/apps/virgo-jetty-server-3.6.4.RELEASE/work/deployer/s/axonframework.plan-2.4/5/0/axon-core-2.4.jar/]
[Loaded org.axonframework.serializer.ContentTypeConverter from file:/usr/apps/virgo-jetty-server-3.6.4.RELEASE/./repository/usr/axon-core-2.4.jar]
[Loaded org.axonframework.serializer.AbstractContentTypeConverter from file:/usr/apps/virgo-jetty-server-3.6.4.RELEASE/./repository/usr/axon-core-2.4.jar]
[Loaded org.axonframework.serializer.converters.ByteArrayToInputStreamConverter from file:/usr/apps/virgo-jetty-server-3.6.4.RELEASE/./repository/usr/axon-core-2.4.jar]
[Loaded java.util.ServiceConfigurationError from /usr/lib/jvm/jdk1.7.0_71-x64/jre/lib/rt.jar]
[Loaded org.springframework.core.NestedExceptionUtils from file:/usr/apps/virgo-jetty-server-3.6.4.RELEASE/repository/ext/org.springframework.core-3.2.5.RELEASE.jar]

From above log we see that class org.axonframework.serializer.ContentTypeConverter was loaded twice from different location, when the problem does not occure, it only gets loaded from repository/usr folder.

Thanks & Regards,
Re: ServiceConfigurationError [message #1718132 is a reply to message #1717141] Sun, 20 December 2015 15:49 Go to previous message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi Daniel,

Any insight on this ?

Previous Topic:Problem with Spring NamespaceHandler
Next Topic:VIRGO NANO doesn't respond for multiple requests
Goto Forum:

Current Time: Wed Jun 16 11:43:08 GMT 2021

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

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

Back to the top