Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5936

Metatype XML Namespace 1.4 not supported

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • metatype-1.2.0
    • metatype-1.2.2
    • Metatype Service
    • None

    Description

      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

      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;
          }
      }

      this is the metatype generated by bnd-maven-plugin v4.0.0

      <?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>                                                                           

      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

      Attachments

        Activity

          People

            cziegeler Carsten Ziegeler
            rakeshk15 Rakesh Kumar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: