Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 9.3.4
    • Fix Version/s: 10.1, 9.3.6, 10.0.2
    • Component/s: Misc. Connectors
    • Labels:
      None
    • Environment:

      teiid-9.3.4 on WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final)

    • Steps to Reproduce:
      Hide

      1. add in standalone-teiid.xml the following resource adapter:

                      <resource-adapter id="swagger">
                          <module slot="main" id="org.jboss.teiid.resource-adapter.webservice"/>
                          <transaction-support>NoTransaction</transaction-support>
                          <connection-definitions>
                              <connection-definition class-name="org.teiid.resource.adapter.ws.WSManagedConnectionFactory" jndi-name="java:/swagger" enabled="true" use-java-context="true" pool-name="teiid-swagger-ds">
                                  <config-property name="EndPoint">
                                      http://api.apis.guru/v2/specs/azure.com/redis/2017-10-01/
                                  </config-property>
                              </connection-definition>
                          </connection-definitions>
                      </resource-adapter>
      

      2. in test-vdb.xml add the following model:

          <model visible="true" name="mswagger">
              <source name="swagger" translator-name="swagger" connection-jndi-name="java:/swagger"/>
          </model>
      

      3. run teiid server

      Show
      1. add in standalone-teiid.xml the following resource adapter: < resource -adapter id = "swagger" > < module slot = "main" id = "org.jboss.teiid.resource-adapter.webservice" /> < transaction -support>NoTransaction</ transaction -support> < connection -definitions> < connection -definition class-name = "org.teiid.resource.adapter.ws.WSManagedConnectionFactory" jndi-name = "java:/swagger" enabled = "true" use-java-context = "true" pool-name = "teiid-swagger-ds" > < config -property name = "EndPoint" > http://api.apis.guru/v2/specs/azure.com/redis/2017-10-01/ </ config -property> </ connection -definition> </ connection -definitions> </ resource -adapter> 2. in test-vdb.xml add the following model: < model visible = "true" name = "mswagger" > < source name = "swagger" translator-name = "swagger" connection-jndi-name = "java:/swagger" /> </ model > 3. run teiid server

      Description

      When using the http://api.apis.guru/v2/specs/azure.com/redis/2017-10-01/ link as an endpoint for swagger resource adapter Teiid throws up the following error message (in bootstrapping phase), though with http://petstore.swagger.io/v2 endpoint according to the https://teiid.gitbooks.io/documents/reference/Swagger_Translator.html documentation the translator works:

      2017-12-18 16:14:43,975 WARN  [org.teiid.RUNTIME] (Worker1_async-teiid-threads1)  TEIID50036 VDB test.1 model "mswagger" metadata failed to load. Reason:java.lang.NullPointerExceptio
      n: java.lang.NullPointerException
              at org.teiid.metadata.MetadataFactory.setUUID(MetadataFactory.java:155)
              at org.teiid.metadata.MetadataFactory.addProcedureParameter(MetadataFactory.java:421)
              at org.teiid.translator.swagger.SwaggerMetadataProcessor.addProcedureParameters(SwaggerMetadataProcessor.java:560)
              at org.teiid.translator.swagger.SwaggerMetadataProcessor.addProcedure(SwaggerMetadataProcessor.java:261)
              at org.teiid.translator.swagger.SwaggerMetadataProcessor.process(SwaggerMetadataProcessor.java:206)
              at org.teiid.translator.swagger.SwaggerMetadataProcessor.process(SwaggerMetadataProcessor.java:74)
              at org.teiid.translator.ExecutionFactory.getMetadata(ExecutionFactory.java:961)
              at org.teiid.query.metadata.NativeMetadataRepository.getMetadata(NativeMetadataRepository.java:96)
              at org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:62)
              at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55)
              at org.teiid.jboss.VDBService$6.run(VDBService.java:341)
              at org.teiid.jboss.VDBService$7.run(VDBService.java:392)
              at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:284)
              at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
              at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      

      The http://api.apis.guru/v2/specs/azure.com/redis/2017-10-01/ endpoint supports swagger API according to the https://apis.guru/browse-apis/ link and I can see json output when requesting the http://api.apis.guru/v2/specs/azure.com/redis/2017-10-01/swagger.json link. Probably the NPE appears because of RefParameter type which is not handled in SwaggerMetadataProcessor.addProcedureParameters method which leads to name = null.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shawkins Steven Hawkins
                Reporter:
                dalex005 dalex dalex
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: