[JBoss JIRA] (TEIID-5216) JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
by Pushkar Kamra (JIRA)
[ https://issues.jboss.org/browse/TEIID-5216?page=com.atlassian.jira.plugin... ]
Pushkar Kamra commented on TEIID-5216:
--------------------------------------
Hello Steven,
Verified the code on the lateral branch as well and issue seems to be persisting in it too.
Attached, the screenshot for reference.
> JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
> --------------------------------------------------------------------
>
> Key: TEIID-5216
> URL: https://issues.jboss.org/browse/TEIID-5216
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 9.2.1
> Environment: All
> Reporter: Pushkar Kamra
> Assignee: Steven Hawkins
> Attachments: screenshot-1.png
>
>
> During the time of requesting ODatatype - DateTimeOffset from the from the following service - http://services.odata.org/V4/Northwind/Northwind.svc/
> Query - Select * from Employees.
> Using the above query it is unable to return DateTimeOffset values for it and returns the
> following error -
> java.lang.IllegalArgumentException: No enum constant org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.TimeOffset
> at java.lang.Enum.valueOf(Enum.java:238)
> at org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.valueOf(EdmPrimitiveTypeKind.java:24)
> at org.teiid.olingo.common.ODataTypeManager.parseLiteral(ODataTypeManager.java:332)
> at org.teiid.olingo.common.ODataTypeManager.convertToTeiidRuntimeType(ODataTypeManager.java:184)
> at org.teiid.translator.odata4.BaseQueryExecution.buildRow(BaseQueryExecution.java:244)
> at org.teiid.translator.odata4.ODataQueryExecution.next(ODataQueryExecution.java:122)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:435)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:238)
> at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:220)
> at com.sun.proxy.$Proxy398.more(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:309)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:282)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> From the initial level analysis and observation is has been observed teiid class - ODataTypeManager in that parselitreals method where ODatatype.Substring(4) is done which is causing the issue which is changing DateTimeOffset to TimeOffset and when it tries to find the Enum constant from the EdmPrimitiveTypeKind list it is unable find the changed name and this seems to be causing the issue in accessing the DateTimeOffset type datas from the containing tables.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 2 months
[JBoss JIRA] (TEIID-5216) JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5216?page=com.atlassian.jira.plugin... ]
Ramesh Reddy commented on TEIID-5216:
-------------------------------------
I ran into similar issues today, I need to go back and check to see if I was handling the creation of the NavigationProperties correctly.
> JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
> --------------------------------------------------------------------
>
> Key: TEIID-5216
> URL: https://issues.jboss.org/browse/TEIID-5216
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 9.2.1
> Environment: All
> Reporter: Pushkar Kamra
> Assignee: Steven Hawkins
>
> During the time of requesting ODatatype - DateTimeOffset from the from the following service - http://services.odata.org/V4/Northwind/Northwind.svc/
> Query - Select * from Employees.
> Using the above query it is unable to return DateTimeOffset values for it and returns the
> following error -
> java.lang.IllegalArgumentException: No enum constant org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.TimeOffset
> at java.lang.Enum.valueOf(Enum.java:238)
> at org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.valueOf(EdmPrimitiveTypeKind.java:24)
> at org.teiid.olingo.common.ODataTypeManager.parseLiteral(ODataTypeManager.java:332)
> at org.teiid.olingo.common.ODataTypeManager.convertToTeiidRuntimeType(ODataTypeManager.java:184)
> at org.teiid.translator.odata4.BaseQueryExecution.buildRow(BaseQueryExecution.java:244)
> at org.teiid.translator.odata4.ODataQueryExecution.next(ODataQueryExecution.java:122)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:435)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:238)
> at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:220)
> at com.sun.proxy.$Proxy398.more(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:309)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:282)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> From the initial level analysis and observation is has been observed teiid class - ODataTypeManager in that parselitreals method where ODatatype.Substring(4) is done which is causing the issue which is changing DateTimeOffset to TimeOffset and when it tries to find the Enum constant from the EdmPrimitiveTypeKind list it is unable find the changed name and this seems to be causing the issue in accessing the DateTimeOffset type datas from the containing tables.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 2 months
[JBoss JIRA] (TEIID-5216) JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5216?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5216:
---------------------------------------
The substring logic assumes the "edm." prefix. However, there appears to be some additional issues on master. Just importing the northwind metadata results in foreign key errors for me. Did you try this scenario on a later branch as well?
> JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
> --------------------------------------------------------------------
>
> Key: TEIID-5216
> URL: https://issues.jboss.org/browse/TEIID-5216
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 9.2.1
> Environment: All
> Reporter: Pushkar Kamra
> Assignee: Steven Hawkins
>
> During the time of requesting ODatatype - DateTimeOffset from the from the following service - http://services.odata.org/V4/Northwind/Northwind.svc/
> Query - Select * from Employees.
> Using the above query it is unable to return DateTimeOffset values for it and returns the
> following error -
> java.lang.IllegalArgumentException: No enum constant org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.TimeOffset
> at java.lang.Enum.valueOf(Enum.java:238)
> at org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.valueOf(EdmPrimitiveTypeKind.java:24)
> at org.teiid.olingo.common.ODataTypeManager.parseLiteral(ODataTypeManager.java:332)
> at org.teiid.olingo.common.ODataTypeManager.convertToTeiidRuntimeType(ODataTypeManager.java:184)
> at org.teiid.translator.odata4.BaseQueryExecution.buildRow(BaseQueryExecution.java:244)
> at org.teiid.translator.odata4.ODataQueryExecution.next(ODataQueryExecution.java:122)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:435)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:238)
> at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:220)
> at com.sun.proxy.$Proxy398.more(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:309)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:282)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> From the initial level analysis and observation is has been observed teiid class - ODataTypeManager in that parselitreals method where ODatatype.Substring(4) is done which is causing the issue which is changing DateTimeOffset to TimeOffset and when it tries to find the Enum constant from the EdmPrimitiveTypeKind list it is unable find the changed name and this seems to be causing the issue in accessing the DateTimeOffset type datas from the containing tables.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 2 months
[JBoss JIRA] (TEIID-5216) JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5216?page=com.atlassian.jira.plugin... ]
Work on TEIID-5216 started by Steven Hawkins.
---------------------------------------------
> JBOSS - Teiid 9.2.1 unable to return DateTimeOffset ODatatype values
> --------------------------------------------------------------------
>
> Key: TEIID-5216
> URL: https://issues.jboss.org/browse/TEIID-5216
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 9.2.1
> Environment: All
> Reporter: Pushkar Kamra
> Assignee: Steven Hawkins
>
> During the time of requesting ODatatype - DateTimeOffset from the from the following service - http://services.odata.org/V4/Northwind/Northwind.svc/
> Query - Select * from Employees.
> Using the above query it is unable to return DateTimeOffset values for it and returns the
> following error -
> java.lang.IllegalArgumentException: No enum constant org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.TimeOffset
> at java.lang.Enum.valueOf(Enum.java:238)
> at org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind.valueOf(EdmPrimitiveTypeKind.java:24)
> at org.teiid.olingo.common.ODataTypeManager.parseLiteral(ODataTypeManager.java:332)
> at org.teiid.olingo.common.ODataTypeManager.convertToTeiidRuntimeType(ODataTypeManager.java:184)
> at org.teiid.translator.odata4.BaseQueryExecution.buildRow(BaseQueryExecution.java:244)
> at org.teiid.translator.odata4.ODataQueryExecution.next(ODataQueryExecution.java:122)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:435)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:238)
> at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:220)
> at com.sun.proxy.$Proxy398.more(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:309)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:282)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> From the initial level analysis and observation is has been observed teiid class - ODataTypeManager in that parselitreals method where ODatatype.Substring(4) is done which is causing the issue which is changing DateTimeOffset to TimeOffset and when it tries to find the Enum constant from the EdmPrimitiveTypeKind list it is unable find the changed name and this seems to be causing the issue in accessing the DateTimeOffset type datas from the containing tables.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 2 months
[JBoss JIRA] (TEIID-5213) Required Restful to be able to set/update CLOB value.
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5213?page=com.atlassian.jira.plugin... ]
Steven Hawkins edited comment on TEIID-5213 at 1/16/18 4:07 PM:
----------------------------------------------------------------
Actually this is addressed TEIID-5069. I'll add a unit test specific to this case on master.
was (Author: shawkins):
Even on master there still seems to be an issue. There is a read pending exception that is thrown instead.
> Required Restful to be able to set/update CLOB value.
> -----------------------------------------------------
>
> Key: TEIID-5213
> URL: https://issues.jboss.org/browse/TEIID-5213
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 8.12
> Environment: JDV 6.3.8
> Reporter: xu zhang
> Assignee: Steven Hawkins
>
> In a table of MySql, if a column's type is *TEXT*, it is impossible to use restful way to set/update this column.
> The code like:
> {code}
> public void doTest() throws Exception {
> HttpClient httpClient = new HttpClient();
> httpClient.start();
> URI uri = new URI("http://localhost:8080/odata4/Test/test/");
> String realm = "yourdomain.com";
> String user = "teiidUser";
> String pass = "Redhat!23";
> // Add authentication credentials
> AuthenticationStore auth = httpClient.getAuthenticationStore();
> auth.addAuthentication(new BasicAuthentication(uri, realm, user, pass));
> ContentResponse response = httpClient.GET(uri.toString() + "$metadata");
> System.out.println(response.getContentAsString());
> response = httpClient.GET(uri.toString() + "test_tbl");
> System.out.println(response.getContentAsString());
>
> String jsonPayload =
> "{\"title\":\"title 2\",\"author\":\"author 2\", \"price\":567890.01, \"submission_date\":\"2018-01-05\"}";
> response = httpClient.newRequest(uri.toString() + "test_tbl")
> .method("POST")
> .content(new StringContentProvider(jsonPayload))
> .header("Content-Type", "application/json")
> .header("Prefer", "return=representation")
> .send();
> System.out.println(response.getContentAsString());
> response = httpClient.newRequest(uri.toString() + "test_tbl(2)/memo")
> .method("PUT")
> .content(new StringContentProvider("this is clob test 2"))
> .send();
> System.out.println(response.getContentAsString());
>
> }
> {code}
> Error shows:
> {code}
> 11:19:06,442 WARN [org.teiid.CONNECTOR] (Worker0_QueryProcessorQueue2) Connector worker process failed for atomic-request=zlEfhij2vSNv.0.0.2: org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11013:TEIID11004 Error executing statement(s): [Prepared Values: ['org.teiid.core.types.ClobImpl@6a52c49c'] SQL: UPDATE "test_tbl" SET "memo" = ? WHERE "test_tbl"."id" = 2]
> at org.teiid.translator.jdbc.JDBCUpdateExecution.executeTranslatedCommand(JDBCUpdateExecution.java:293) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.translator.jdbc.JDBCUpdateExecution.execute(JDBCUpdateExecution.java:84) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem$1.execute(ConnectorWorkItem.java:401)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:363)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_151]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_151]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_151]
> at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_151]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy82.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_151]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> 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:1149) [rt.jar:1.8.0_151]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151]
> at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151]
> Caused by: java.sql.SQLException: java.io.IOException: JBWEB000059: Stream closed
> at org.teiid.core.types.ClobImpl.getSubString(ClobImpl.java:171) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.core.types.ClobType.getSubString(ClobType.java:77) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at com.mysql.jdbc.PreparedStatement.setClob(PreparedStatement.java:3529)
> at com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:4098)
> at com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:3981)
> at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.setObject(WrappedPreparedStatement.java:957)
> at org.teiid.translator.jdbc.JDBCExecutionFactory.bindValue(JDBCExecutionFactory.java:965) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.translator.jdbc.JDBCBaseExecution.bind(JDBCBaseExecution.java:107) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.translator.jdbc.JDBCUpdateExecution.executeTranslatedCommand(JDBCUpdateExecution.java:262) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> ... 20 more
> Caused by: java.io.IOException: JBWEB000059: Stream closed
> at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:391)
> at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)
> at java.nio.channels.Channels$ReadableByteChannelImpl.read(Channels.java:385) [rt.jar:1.8.0_151]
> at org.teiid.core.util.InputStreamReader.read(InputStreamReader.java:80) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.core.util.ObjectConverterUtil.write(ObjectConverterUtil.java:159) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.core.util.ObjectConverterUtil.convertToCharArray(ObjectConverterUtil.java:316) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.core.types.ClobImpl.getSubString(ClobImpl.java:166) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> ... 28 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 2 months
[JBoss JIRA] (TEIID-5213) Required Restful to be able to set/update CLOB value.
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5213?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-5213.
-----------------------------------
Fix Version/s: (was: 10.1)
Resolution: Duplicate Issue
Duplicate of TEIID-5069
> Required Restful to be able to set/update CLOB value.
> -----------------------------------------------------
>
> Key: TEIID-5213
> URL: https://issues.jboss.org/browse/TEIID-5213
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 8.12
> Environment: JDV 6.3.8
> Reporter: xu zhang
> Assignee: Steven Hawkins
>
> In a table of MySql, if a column's type is *TEXT*, it is impossible to use restful way to set/update this column.
> The code like:
> {code}
> public void doTest() throws Exception {
> HttpClient httpClient = new HttpClient();
> httpClient.start();
> URI uri = new URI("http://localhost:8080/odata4/Test/test/");
> String realm = "yourdomain.com";
> String user = "teiidUser";
> String pass = "Redhat!23";
> // Add authentication credentials
> AuthenticationStore auth = httpClient.getAuthenticationStore();
> auth.addAuthentication(new BasicAuthentication(uri, realm, user, pass));
> ContentResponse response = httpClient.GET(uri.toString() + "$metadata");
> System.out.println(response.getContentAsString());
> response = httpClient.GET(uri.toString() + "test_tbl");
> System.out.println(response.getContentAsString());
>
> String jsonPayload =
> "{\"title\":\"title 2\",\"author\":\"author 2\", \"price\":567890.01, \"submission_date\":\"2018-01-05\"}";
> response = httpClient.newRequest(uri.toString() + "test_tbl")
> .method("POST")
> .content(new StringContentProvider(jsonPayload))
> .header("Content-Type", "application/json")
> .header("Prefer", "return=representation")
> .send();
> System.out.println(response.getContentAsString());
> response = httpClient.newRequest(uri.toString() + "test_tbl(2)/memo")
> .method("PUT")
> .content(new StringContentProvider("this is clob test 2"))
> .send();
> System.out.println(response.getContentAsString());
>
> }
> {code}
> Error shows:
> {code}
> 11:19:06,442 WARN [org.teiid.CONNECTOR] (Worker0_QueryProcessorQueue2) Connector worker process failed for atomic-request=zlEfhij2vSNv.0.0.2: org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11013:TEIID11004 Error executing statement(s): [Prepared Values: ['org.teiid.core.types.ClobImpl@6a52c49c'] SQL: UPDATE "test_tbl" SET "memo" = ? WHERE "test_tbl"."id" = 2]
> at org.teiid.translator.jdbc.JDBCUpdateExecution.executeTranslatedCommand(JDBCUpdateExecution.java:293) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.translator.jdbc.JDBCUpdateExecution.execute(JDBCUpdateExecution.java:84) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem$1.execute(ConnectorWorkItem.java:401)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:363)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_151]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_151]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_151]
> at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_151]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy82.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_151]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> 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:1149) [rt.jar:1.8.0_151]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151]
> at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151]
> Caused by: java.sql.SQLException: java.io.IOException: JBWEB000059: Stream closed
> at org.teiid.core.types.ClobImpl.getSubString(ClobImpl.java:171) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.core.types.ClobType.getSubString(ClobType.java:77) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at com.mysql.jdbc.PreparedStatement.setClob(PreparedStatement.java:3529)
> at com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:4098)
> at com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:3981)
> at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.setObject(WrappedPreparedStatement.java:957)
> at org.teiid.translator.jdbc.JDBCExecutionFactory.bindValue(JDBCExecutionFactory.java:965) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.translator.jdbc.JDBCBaseExecution.bind(JDBCBaseExecution.java:107) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.translator.jdbc.JDBCUpdateExecution.executeTranslatedCommand(JDBCUpdateExecution.java:262) [translator-jdbc-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> ... 20 more
> Caused by: java.io.IOException: JBWEB000059: Stream closed
> at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:391)
> at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)
> at java.nio.channels.Channels$ReadableByteChannelImpl.read(Channels.java:385) [rt.jar:1.8.0_151]
> at org.teiid.core.util.InputStreamReader.read(InputStreamReader.java:80) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.core.util.ObjectConverterUtil.write(ObjectConverterUtil.java:159) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.core.util.ObjectConverterUtil.convertToCharArray(ObjectConverterUtil.java:316) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> at org.teiid.core.types.ClobImpl.getSubString(ClobImpl.java:166) [teiid-common-core-8.12.13.6_3-redhat-1.jar:8.12.13.6_3-redhat-1]
> ... 28 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 2 months
[JBoss JIRA] (TEIID-5218) Better exception for positional parameter in virtual layer
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-5218:
-------------------------------------
Summary: Better exception for positional parameter in virtual layer
Key: TEIID-5218
URL: https://issues.jboss.org/browse/TEIID-5218
Project: Teiid
Issue Type: Quality Risk
Components: Query Engine
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 10.1
A check for errant references is only performed on user level queries and not on view or procedure definitions. This results in cryptic errors at runtime.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 2 months