[JBoss JIRA] (TEIID-5183) NPE in Swagger translator
by dalex dalex (JIRA)
[ https://issues.jboss.org/browse/TEIID-5183?page=com.atlassian.jira.plugin... ]
dalex dalex edited comment on TEIID-5183 at 1/5/18 9:16 AM:
------------------------------------------------------------
> Please spawn another issue to capture that.
Ok, will do it asap.
was (Author: dalex005):
> Please spawn another issue to capture that.
> NPE in Swagger translator
> -------------------------
>
> Key: TEIID-5183
> URL: https://issues.jboss.org/browse/TEIID-5183
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.3.4
> Environment: teiid-9.3.4 on WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Fix For: 10.1, 9.3.6, 10.0.2
>
> Attachments: swagger_null_values.jpg
>
>
> 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:
> {code:noformat}
> 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)
> {code}
> 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.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months
[JBoss JIRA] (TEIID-5183) NPE in Swagger translator
by dalex dalex (JIRA)
[ https://issues.jboss.org/browse/TEIID-5183?page=com.atlassian.jira.plugin... ]
dalex dalex commented on TEIID-5183:
------------------------------------
> Please spawn another issue to capture that.
> NPE in Swagger translator
> -------------------------
>
> Key: TEIID-5183
> URL: https://issues.jboss.org/browse/TEIID-5183
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.3.4
> Environment: teiid-9.3.4 on WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Fix For: 10.1, 9.3.6, 10.0.2
>
> Attachments: swagger_null_values.jpg
>
>
> 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:
> {code:noformat}
> 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)
> {code}
> 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.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months
[JBoss JIRA] (TEIID-5183) NPE in Swagger translator
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5183?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5183:
---------------------------------------
> I applied all changes from the issue and it's really better now. Could you please check another interesting case? It seems there is some bug related to swagger procs execution.
That is possible. I've already seen issues with null handling, it's likely there are additional kinks. I'll take a look at this to see if it's related to the metadata. If not, it will be moved to it's own issue.
> another problem, if you change the endpoint which I used above to use secured http without any security domains:
Please spawn another issue to capture that.
> NPE in Swagger translator
> -------------------------
>
> Key: TEIID-5183
> URL: https://issues.jboss.org/browse/TEIID-5183
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.3.4
> Environment: teiid-9.3.4 on WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Fix For: 10.1, 9.3.6, 10.0.2
>
> Attachments: swagger_null_values.jpg
>
>
> 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:
> {code:noformat}
> 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)
> {code}
> 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.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months
[JBoss JIRA] (TEIID-5183) NPE in Swagger translator
by dalex dalex (JIRA)
[ https://issues.jboss.org/browse/TEIID-5183?page=com.atlassian.jira.plugin... ]
dalex dalex commented on TEIID-5183:
------------------------------------
[~shawkins] another problem, if you change the endpoint which I used above to use secured http without any security domains:
{code:xml}
<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">
https://api.apis.guru/v2/specs/deutschebahn.com/fahrplan/v1/
</config-property>
</connection-definition>
</connection-definitions>
</resource-adapter>
{code}
you will get the following stacktrace with errors:
{code:noformat}
2018-01-05 12:19:24,102 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (Worker1_async-teiid-threads0) Interceptor for {https://api.apis.guru/v2/specs/deutschebahn.com/fahrplan
/v1/swagger.json}WebClient has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Could not send Message.
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:649)
at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1093)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:894)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:865)
at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:331)
at org.teiid.resource.adapter.ws.WSConnectionImpl$HttpDispatch.invoke(WSConnectionImpl.java:204)
at org.teiid.resource.adapter.ws.WSConnectionImpl$HttpDispatch.invoke(WSConnectionImpl.java:123)
at org.teiid.translator.ws.BinaryWSProcedureExecution.execute(BinaryWSProcedureExecution.java:156)
at org.teiid.translator.swagger.SwaggerMetadataProcessor.getSchema(SwaggerMetadataProcessor.java:682)
at org.teiid.translator.swagger.SwaggerMetadataProcessor.process(SwaggerMetadataProcessor.java:177)
at org.teiid.translator.swagger.SwaggerMetadataProcessor.process(SwaggerMetadataProcessor.java:70)
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)
Caused by: javax.net.ssl.SSLHandshakeException: SSLHandshakeException invoking https://api.apis.guru/v2/specs/deutschebahn.com/fahrplan/v1/swagger.json: Received fatal alert: handsha
ke_failure
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1376)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1360)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 24 more
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
{code}
but I can get swagger.json directly using even secured http, so I think to get all metadata there are no needs to provide security domains at all.
> NPE in Swagger translator
> -------------------------
>
> Key: TEIID-5183
> URL: https://issues.jboss.org/browse/TEIID-5183
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.3.4
> Environment: teiid-9.3.4 on WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Fix For: 10.1, 9.3.6, 10.0.2
>
> Attachments: swagger_null_values.jpg
>
>
> 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:
> {code:noformat}
> 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)
> {code}
> 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.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months
[JBoss JIRA] (TEIID-5183) NPE in Swagger translator
by dalex dalex (JIRA)
[ https://issues.jboss.org/browse/TEIID-5183?page=com.atlassian.jira.plugin... ]
dalex dalex edited comment on TEIID-5183 at 1/5/18 5:46 AM:
------------------------------------------------------------
Hi [~shawkins] first of all thx a lot for the quick fix, I applied all changes from the issue and it's really better now. Could you please check another interesting case? It seems there is some bug related to swagger procs execution.
1. Configure the following swagger ra (it uses http://api.apis.guru/v2/specs/deutschebahn.com/fahrplan/v1/ endpoint):
{code:xml}
<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/deutschebahn.com/fahrplan/v1/
</config-property>
</connection-definition>
</connection-definitions>
</resource-adapter>
{code}
2. Try to run the following query:
{code:sql}
call mswagger."location/name"('Hannover');;
{code}
it will return a table containing only null values:
!swagger_null_values.jpg|thumbnail!
though if you have a look at the https://api.deutschebahn.com/freeplan/v1/location/Hannover link you will see that all values are correct and should be shown as values in the table.
was (Author: dalex005):
Hi [~shawkins] first of all thx a lot for the quick fix, I applied all changes from the issue and it's really better now. Could you please check another interesting case, seems there is some bug related to swagger procs execution.
1. Configure the following swagger ra (it uses http://api.apis.guru/v2/specs/deutschebahn.com/fahrplan/v1/ endpoint):
{code:xml}
<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/deutschebahn.com/fahrplan/v1/
</config-property>
</connection-definition>
</connection-definitions>
</resource-adapter>
{code}
2. Try to run the following query:
{code:sql}
call mswagger."location/name"('Hannover');;
{code}
it will return a table containing only null values:
!swagger_null_values.jpg|thumbnail!
though if you have a look at the https://api.deutschebahn.com/freeplan/v1/location/Hannover link you will see that all values are correct and should be shown as values in the table.
> NPE in Swagger translator
> -------------------------
>
> Key: TEIID-5183
> URL: https://issues.jboss.org/browse/TEIID-5183
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.3.4
> Environment: teiid-9.3.4 on WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Fix For: 10.1, 9.3.6, 10.0.2
>
> Attachments: swagger_null_values.jpg
>
>
> 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:
> {code:noformat}
> 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)
> {code}
> 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.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months
[JBoss JIRA] (TEIID-5183) NPE in Swagger translator
by dalex dalex (JIRA)
[ https://issues.jboss.org/browse/TEIID-5183?page=com.atlassian.jira.plugin... ]
dalex dalex edited comment on TEIID-5183 at 1/5/18 5:45 AM:
------------------------------------------------------------
Hi [~shawkins] first of all thx a lot for the quick fix, I applied all changes from the issue and it's really better now. Could you please check another interesting case, seems there is some bug related to swagger procs execution.
1. Configure the following swagger ra (it uses http://api.apis.guru/v2/specs/deutschebahn.com/fahrplan/v1/ endpoint):
{code:xml}
<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/deutschebahn.com/fahrplan/v1/
</config-property>
</connection-definition>
</connection-definitions>
</resource-adapter>
{code}
2. Try to run the following query:
{code:sql}
call mswagger."location/name"('Hannover');;
{code}
it will return a table containing only null values:
!swagger_null_values.jpg|thumbnail!
though if you have a look at the https://api.deutschebahn.com/freeplan/v1/location/Hannover link you will see that all values are correct and should be shown as values in the table.
was (Author: dalex005):
Hi [~shawkins] first of all thx a lot for the quick fix, I applied all changes from the issue and it's really better now. Could you please check another interesting case, seems there is some bug related to swagger procs execution.
1. Configure the following swagger ra (it uses http://api.apis.guru/v2/specs/deutschebahn.com/fahrplan/v1/ endpoint):
{code:xml}
<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/deutschebahn.com/fahrplan/v1/
</config-property>
</connection-definition>
</connection-definitions>
</resource-adapter>
{code}
2. Try to run the following query:
{code:sql}
call mswagger."location/name"('Hannover');;
{code}
it will return a table containing only null values though if you have a look at the https://api.deutschebahn.com/freeplan/v1/location/Hannover link you will see that all values are correct and should be shown as values in the table.
> NPE in Swagger translator
> -------------------------
>
> Key: TEIID-5183
> URL: https://issues.jboss.org/browse/TEIID-5183
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 9.3.4
> Environment: teiid-9.3.4 on WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Fix For: 10.1, 9.3.6, 10.0.2
>
> Attachments: swagger_null_values.jpg
>
>
> 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:
> {code:noformat}
> 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)
> {code}
> 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.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months
[JBoss JIRA] (TEIID-4960) Problems when using External Materialized Views
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4960?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-4960:
------------------------------------------------
Jan Stastny <jstastny(a)redhat.com> changed the Status of [bug 1467913|https://bugzilla.redhat.com/show_bug.cgi?id=1467913] from ON_QA to VERIFIED
> Problems when using External Materialized Views
> -----------------------------------------------
>
> Key: TEIID-4960
> URL: https://issues.jboss.org/browse/TEIID-4960
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 9.3
> Environment: * Teiid Server 9.3.0
> * Wildfly 10
> * Mysql 5.7.18
> Reporter: Pedro Inácio
> Assignee: Steven Hawkins
> Fix For: 10.0, 8.12.x-6.4, 9.3.1, 9.2.5, 8.12.12.6_3
>
> Attachments: server.log, teiid4960-server.log, teiid4960-vdb.xml
>
>
> The following problem occurs when, apparently, we have two views where one depend on another, and also we use External Materialization.
> The dependent view is never updated due to a "Transaction already associated with request." exception.
> Logs attached.
> The error:
> {panel:title=The exception in logs}
> 2017-06-14 13:51:51,753 WARN [org.teiid.MATVIEWS] (Worker14_QueryProcessorQueue365) Hlbq3jmDWXNl org.teiid.jdbc.TeiidSQLException: TEIID30328 Unable to evaluate mvstatus('NumberingPlan', 'numbering_plan'): TEIID30384 Error while evaluating function mvstatus
> 2017-06-14 13:52:51,803 INFO [org.teiid.MATVIEWS] (Worker14_QueryProcessorQueue368) XAtcLA8RBrLm Materialization of view NumberingPlanRaw.numbering_plan_raw started.
> 2017-06-14 13:52:51,867 ERROR [org.teiid.PROCESSOR] (Worker14_QueryProcessorQueue372) XAtcLA8RBrLm TEIID30019 Unexpected exception for request XAtcLA8RBrLm.-2514910280603581440: java.lang.AssertionError: Transaction already associated with request.
> {panel}
> The VDB:
> {code:xml}
> <model name="MnomMaterialized" type="PHYSICAL">
> <property name="importer.useFullSchemaName" value="false"/>
> <property name="query-timeout" value="600000"/>
> <source name="MnomMaterializedView" translator-name="mysql-override" connection-jndi-name="java:/mnomDs"/>
> </model>
>
> <model name="NumberingPlanCsvData">
> <source name="numberingPlanCsv-connector" translator-name="file" connection-jndi-name="java:/numberingPlanCsvDs"/>
> </model>
> <model name="NumberingPlan" type="VIRTUAL">
> <metadata type="DDL"><![CDATA[
> CREATE VIEW numbering_plan (
> id integer PRIMARY KEY,
> global_title varchar(20)
> )
> OPTIONS(
> MATERIALIZED 'TRUE',
> UPDATABLE 'TRUE',
> MATERIALIZED_TABLE 'MnomMaterialized.numbering_plan_cache',
> "teiid_rel:MATVIEW_TTL" 86400000,
> "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" 'true',
> "teiid_rel:MATVIEW_LOADNUMBER_COLUMN" 'LoadNumber',
> "teiid_rel:MATVIEW_STATUS_TABLE" 'MnomMaterialized.status'
> )
> AS
> SELECT ROW_NUMBER() OVER (ORDER BY cns) as id,
> cns
> FROM (EXEC NumberingPlanCsvData.getTextFiles('NumberingPlan.csv')) AS f,
> TEXTTABLE(f.file COLUMNS cns string DELIMITER ';' SKIP 1) AS A;
>
> ]]>
> </metadata>
> </model>
>
> <model name="NumberingPlanRaw" type="VIRTUAL">
> <metadata type="DDL">
> <![CDATA[
> CREATE VIEW numbering_plan_raw (
> id integer PRIMARY KEY,
> global_title varchar(20)
> )
> OPTIONS(
> MATERIALIZED 'TRUE',
> UPDATABLE 'FALSE',
> MATERIALIZED_TABLE 'MnomMaterialized.numbering_plan_raw_cache',
> "teiid_rel:MATVIEW_TTL" 86400000,
> "teiid_rel:ALLOW_MATVIEW_MANAGEMENT" 'true',
> "teiid_rel:MATVIEW_LOADNUMBER_COLUMN" 'LoadNumber',
> "teiid_rel:MATVIEW_STATUS_TABLE" 'MnomMaterialized.status'
> )
> AS
> SELECT ROW_NUMBER() OVER (ORDER BY network) as id,
> global_title
> FROM numbering_plan np;
>
> ]]>
> </metadata>
> </model>
> </model>
> {code}
> The Materialized table:
> {code:sql}
> CREATE TABLE status (
> VDBName VARCHAR(50) NOT NULL,
> VDBVersion VARCHAR(50) NOT NULL,
> SchemaName VARCHAR(50) NOT NULL,
> Name VARCHAR(256) NOT NULL,
> TargetSchemaName VARCHAR(50),
> TargetName VARCHAR(256) NOT NULL,
> Valid BOOLEAN NOT NULL,
> LoadState VARCHAR(25) NOT NULL,
> Cardinality BIGINT,
> Updated TIMESTAMP NOT NULL,
> LoadNumber BIGINT NOT NULL,
> NodeName varchar(25) not null,
> StaleCount BIGINT,
> PRIMARY KEY (VDBName , VDBVersion , SchemaName , Name)
> );
> CREATE TABLE numbering_plan_cache (
> id integer,
> global_title varchar(20),
> LoadNumber BIGINT,
> PRIMARY KEY(id)
> );
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months