You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Rakesh Kumar (JIRA)" <ji...@apache.org> on 2018/09/22 18:59:00 UTC

[jira] [Created] (FELIX-5936) MetaDataReader does not parse v1.4 namespace

Rakesh Kumar created FELIX-5936:
-----------------------------------

             Summary: MetaDataReader does not parse v1.4 namespace
                 Key: FELIX-5936
                 URL: https://issues.apache.org/jira/browse/FELIX-5936
             Project: Felix
          Issue Type: Bug
          Components: Metatype Service
    Affects Versions: metatype-1.2.0
            Reporter: Rakesh Kumar


*org.apache.felix.metatype.MetaDataReader* throws exception if the namespace in metatype xml is [http://www.osgi.org/xmlns/scr/v1.4.0]

and corresponding metatype is not being generated in Felix Web console when I deploy the bundle.

Following code only checks namespaces till v1.3
{code:java}
private void checkMetatypeNamespace() throws IOException
{
    final String namespace = this.parser.getNamespace();
    if (namespace != null && !"".equals(namespace.trim()))
    {
        if (!NAMESPACE_1_0.equals(namespace) && !NAMESPACE_1_1.equals(namespace) && !NAMESPACE_1_2.equals(namespace) && !NAMESPACE_1_3.equals(namespace))
        {
            throw new IOException("Unsupported Namespace: '" + namespace + "'");
        }
        this.namespace = namespace;
    }
}{code}
this is the metatype generated by bad-maven-plugin v4.0.0
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.4.0" localization="OSGI-INF/l10n/com.adeptj.modules.jaxrs.resteasy.ResteasyConfig">
<OCD id="com.adeptj.modules.jaxrs.resteasy.ResteasyConfig" name="AdeptJ RESTEasy Configuration" description="Configuration for RESTEasy Framework">
<AD id="showException" type="Boolean" name="Show Exception Message as JSON" description="Whether to show exception message in error response" default="true"/>
</OCD>
<Designate pid="com.adeptj.modules.jaxrs.resteasy.internal.ResteasyLifecycle">
<Object ocdref="com.adeptj.modules.jaxrs.resteasy.ResteasyConfig"/>
</Designate>
</metatype:MetaData>                                                                           {code}
IMHO, *Felix Metatype Service 1.2.0* is implementing the *OSGi Metatype Service Specification Version 1.4* and therefore should not fail for namespace v1.4.0

Please look into this.

Thanks,

Rakesh



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)