You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Roland <wg...@ids.de> on 2013/09/12 13:08:38 UTC

Cannot create MetaType providing ManagedService; not providing Metatype information but just accepting configuration

I implemented a ConfigurationListener. After registering the service I get
following exception:

ERROR: Cannot create MetaType providing ManagedService; not providing
Metatype information but just accepting configuration
java.lang.NoClassDefFoundError: org/osgi/service/metatype/MetaTypeProvider
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
	at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
	at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
	at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at
org.apache.felix.scr.impl.config.ScrManagedServiceServiceFactory.getService(ScrManagedServiceServiceFactory.java:52)
	at
org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)
	at
org.apache.felix.framework.ServiceRegistrationImpl.access$100(ServiceRegistrationImpl.java:35)
	at
org.apache.felix.framework.ServiceRegistrationImpl$ServiceFactoryPrivileged.run(ServiceRegistrationImpl.java:372)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:214)
	at
org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:320)
	at org.apache.felix.framework.Felix.getService(Felix.java:3568)
	at
org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)
	at
org.apache.felix.cm.impl.helper.BaseTracker.getRealService(BaseTracker.java:200)
	at
org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:98)
	at
org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:81)
	at
org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1436)
	at
org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1392)
	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:103)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: *** Package
'org.osgi.service.metatype' is not imported by bundle org.apache.felix.scr
[22], nor is there any bundle that exports package
'org.osgi.service.metatype'. However, the class
'org.osgi.service.metatype.MetaTypeProvider' is available from the system
class loader. There are two fixes: 1) Add package
'org.osgi.service.metatype' to the
'org.osgi.framework.system.packages.extra' property and modify bundle
org.apache.felix.scr [22] to import this package; this causes the system
bundle to export class path packages. 2) Add package
'org.osgi.service.metatype' to the 'org.osgi.framework.bootdelegation'
property; a library or VM bug can cause classes to be loaded by the wrong
class loader. The first approach is preferable for preserving modularity.
***
	at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1968)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	... 24 more
Caused by: java.lang.ClassNotFoundException:
org.osgi.service.metatype.MetaTypeProvider not found by org.apache.felix.scr
[22]
	at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
	at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
	at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)

	
I have a mental block. Is this a security issue?

Thx!!

Roland



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Cannot-create-MetaType-providing-ManagedService-not-providing-Metatype-information-but-just-acceptinn-tp5004954.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Cannot create MetaType providing ManagedService; not providing Metatype information but just accepting configuration

Posted by Roland <wg...@ids.de>.
ok, I've got it! Thx. you for your support!!



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Cannot-create-MetaType-providing-ManagedService-not-providing-Metatype-information-but-just-acceptinn-tp5004954p5004962.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Cannot create MetaType providing ManagedService; not providing Metatype information but just accepting configuration

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

Am 12.09.2013 um 14:08 schrieb Roland:

> What reason could there be why it fails during MetaTypeProvider
> initialization?

The SCR ManagedService tries to implement the MetaTypeProvider interface to support provisioning GUI such as the Web Console with descirptions of the configuration properties supported. This interface is provided by the Metatype Service API. If this API is not provided (e.g. by installing the Felix Metatype Service implementation), the SCR ManagedService cannot implement it and thus loading the respective class fails. SCR then falls back to a ManagedService implementation without the MetaTypeProvider addons.

Regards
Felix

Re: Cannot create MetaType providing ManagedService; not providing Metatype information but just accepting configuration

Posted by Roland <wg...@ids.de>.
What reason could there be why it fails during MetaTypeProvider
initialization?

Thx!



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Cannot-create-MetaType-providing-ManagedService-not-providing-Metatype-information-but-just-acceptinn-tp5004954p5004960.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Cannot create MetaType providing ManagedService; not providing Metatype information but just accepting configuration

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

Ah, taking a second look at the stack trace clarifies it, sorry for the confusion.

The configuration is hitting the SCR ManagedService which is registered as a ServiceFactory. This ServiceFactory tries to instantiate with MetaTypeProvider functionality. If that fails, it falls back to a ManagedService without MetaTypeProvider functionality. The log message is just reporting this fact.

It looks like it is confusing to log this as an error message. Rather it should probably just be logged as a warning and better indicating the consequences.

In any case, functionality should not be reduced (unless you require MetaTypeProvider functionality from the SCR bundle)

Regards
Felix



Am 12.09.2013 um 13:33 schrieb Roland:

> Hello Felix,
> thank you for your quick response!
> 
> 
> I'm using version 1.6.2.
> 
> Regards
> Roland
> 
> 
> 
> --
> View this message in context: http://apache-felix.18485.x6.nabble.com/Cannot-create-MetaType-providing-ManagedService-not-providing-Metatype-information-but-just-acceptinn-tp5004954p5004956.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


Re: Cannot create MetaType providing ManagedService; not providing Metatype information but just accepting configuration

Posted by Roland <wg...@ids.de>.
I added the property Constants.FRAMEWORK_BOOTDELEGATION
"org.osgi.service.metatype" as suggested in the error message but that does
not solve the problem.

following felix-bundles are installed.

      <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.scr</artifactId>
        <version>1.6.2</version>
      </dependency>
      <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.configadmin</artifactId>
        <version>1.6.0</version>
      </dependency>





--
View this message in context: http://apache-felix.18485.x6.nabble.com/Cannot-create-MetaType-providing-ManagedService-not-providing-Metatype-information-but-just-acceptinn-tp5004954p5004958.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Cannot create MetaType providing ManagedService; not providing Metatype information but just accepting configuration

Posted by Roland <wg...@ids.de>.
Hello Felix,
thank you for your quick response!


I'm using version 1.6.2.

Regards
Roland



--
View this message in context: http://apache-felix.18485.x6.nabble.com/Cannot-create-MetaType-providing-ManagedService-not-providing-Metatype-information-but-just-acceptinn-tp5004954p5004956.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Cannot create MetaType providing ManagedService; not providing Metatype information but just accepting configuration

Posted by Felix Meschberger <fm...@adobe.com>.
What version of the SCR bundle are you using ?

IIRC older versions don't cope well with Configuration Admin updates if the Metatype Service is not (properly) deployed.

Regards
Felix

Am 12.09.2013 um 13:08 schrieb Roland:

> I implemented a ConfigurationListener. After registering the service I get
> following exception:
> 
> ERROR: Cannot create MetaType providing ManagedService; not providing
> Metatype information but just accepting configuration
> java.lang.NoClassDefFoundError: org/osgi/service/metatype/MetaTypeProvider
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
> 	at
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
> 	at
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
> 	at
> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
> 	at
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> 	at
> org.apache.felix.scr.impl.config.ScrManagedServiceServiceFactory.getService(ScrManagedServiceServiceFactory.java:52)
> 	at
> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)
> 	at
> org.apache.felix.framework.ServiceRegistrationImpl.access$100(ServiceRegistrationImpl.java:35)
> 	at
> org.apache.felix.framework.ServiceRegistrationImpl$ServiceFactoryPrivileged.run(ServiceRegistrationImpl.java:372)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at
> org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:214)
> 	at
> org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:320)
> 	at org.apache.felix.framework.Felix.getService(Felix.java:3568)
> 	at
> org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)
> 	at
> org.apache.felix.cm.impl.helper.BaseTracker.getRealService(BaseTracker.java:200)
> 	at
> org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:98)
> 	at
> org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:81)
> 	at
> org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1436)
> 	at
> org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1392)
> 	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:103)
> 	at java.lang.Thread.run(Thread.java:662)
> Caused by: java.lang.ClassNotFoundException: *** Package
> 'org.osgi.service.metatype' is not imported by bundle org.apache.felix.scr
> [22], nor is there any bundle that exports package
> 'org.osgi.service.metatype'. However, the class
> 'org.osgi.service.metatype.MetaTypeProvider' is available from the system
> class loader. There are two fixes: 1) Add package
> 'org.osgi.service.metatype' to the
> 'org.osgi.framework.system.packages.extra' property and modify bundle
> org.apache.felix.scr [22] to import this package; this causes the system
> bundle to export class path packages. 2) Add package
> 'org.osgi.service.metatype' to the 'org.osgi.framework.bootdelegation'
> property; a library or VM bug can cause classes to be loaded by the wrong
> class loader. The first approach is preferable for preserving modularity.
> ***
> 	at
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1968)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> 	... 24 more
> Caused by: java.lang.ClassNotFoundException:
> org.osgi.service.metatype.MetaTypeProvider not found by org.apache.felix.scr
> [22]
> 	at
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
> 	at
> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
> 	at
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
> 
> 	
> I have a mental block. Is this a security issue?
> 
> Thx!!
> 
> Roland
> 
> 
> 
> --
> View this message in context: http://apache-felix.18485.x6.nabble.com/Cannot-create-MetaType-providing-ManagedService-not-providing-Metatype-information-but-just-acceptinn-tp5004954.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>