Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.5.5, 1.5.7
-
None
-
JDK 1.8.0.25
Windows Server 2012
MariaDB 10.1.19
JPA 2.1.0
Description
We have a stored procedure called by Java using JPA:
StoredProcedureQuery storedProcedure = em.createStoredProcedureQuery(EXPORT_PROCEDURE_NAME);
storedProcedure.registerStoredProcedureParameter(OUTPUT_ATTRIBUT_NAME, String.class, ParameterMode.OUT);
storedProcedure.execute();
String jsonResult = (String) storedProcedure.getOutputParameterValue(OUTPUT_ATTRIBUT_NAME);
The last line raises an error:
java.lang.ClassCastException: [B cannot be cast to java.lang.String.
The output of our stored procedure is a string containing JSON formatted data looking like this: [
]
Here is the header of the "show create procedure" query:
STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | CREATE DEFINER=`xxxx`@`localhost` PROCEDURE `EXPORT_TRANSFER_ALL`(OUT json_result TEXT)
This error seems similar is similar to the one reported here: https://mariadb.atlassian.net/browse/CONJ-28
It seems that we're receiving a byte array instead of string though we're not using a secured connexion to the database.
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
We have a stored procedure called by Java using JPA:
StoredProcedureQuery storedProcedure = em.createStoredProcedureQuery(EXPORT_PROCEDURE_NAME); storedProcedure.registerStoredProcedureParameter(OUTPUT_ATTRIBUT_NAME, String.class, ParameterMode.OUT); storedProcedure.execute(); String jsonResult = (String) storedProcedure.getOutputParameterValue(OUTPUT_ATTRIBUT_NAME); The last line raises an error: java.lang.ClassCastException: [B cannot be cast to java.lang.String. The output of our stored procedure is a string containing JSON formatted data looking like this: [{param1: info1, param2: info2}] This error seems similar is similar to the one reported here: https://mariadb.atlassian.net/browse/CONJ-28 It seems that we're receiving a byte array instead of string though we're not using a secured connexion to the database. |
We have a stored procedure called by Java using JPA:
{{StoredProcedureQuery storedProcedure = em.createStoredProcedureQuery(EXPORT_PROCEDURE_NAME); storedProcedure.registerStoredProcedureParameter(OUTPUT_ATTRIBUT_NAME, String.class, ParameterMode.OUT); storedProcedure.execute(); String jsonResult = (String) storedProcedure.getOutputParameterValue(OUTPUT_ATTRIBUT_NAME);}} The last line raises an error: {{java.lang.ClassCastException: [B cannot be cast to java.lang.String.}} The output of our stored procedure is a string containing JSON formatted data looking like this: [{param1: info1, param2: info2}] This error seems similar is similar to the one reported here: https://mariadb.atlassian.net/browse/CONJ-28 It seems that we're receiving a byte array instead of string though we're not using a secured connexion to the database. |
Description |
We have a stored procedure called by Java using JPA:
{{StoredProcedureQuery storedProcedure = em.createStoredProcedureQuery(EXPORT_PROCEDURE_NAME); storedProcedure.registerStoredProcedureParameter(OUTPUT_ATTRIBUT_NAME, String.class, ParameterMode.OUT); storedProcedure.execute(); String jsonResult = (String) storedProcedure.getOutputParameterValue(OUTPUT_ATTRIBUT_NAME);}} The last line raises an error: {{java.lang.ClassCastException: [B cannot be cast to java.lang.String.}} The output of our stored procedure is a string containing JSON formatted data looking like this: [{param1: info1, param2: info2}] This error seems similar is similar to the one reported here: https://mariadb.atlassian.net/browse/CONJ-28 It seems that we're receiving a byte array instead of string though we're not using a secured connexion to the database. |
We have a stored procedure called by Java using JPA:
{{StoredProcedureQuery storedProcedure = em.createStoredProcedureQuery(EXPORT_PROCEDURE_NAME);}} {{storedProcedure.registerStoredProcedureParameter(OUTPUT_ATTRIBUT_NAME, String.class, ParameterMode.OUT);}} {{storedProcedure.execute();}} {{String jsonResult = (String) storedProcedure.getOutputParameterValue(OUTPUT_ATTRIBUT_NAME);}} The last line raises an error: {{java.lang.ClassCastException: [B cannot be cast to java.lang.String.}} The output of our stored procedure is a string containing JSON formatted data looking like this: [{param1: info1, param2: info2}] This error seems similar is similar to the one reported here: https://mariadb.atlassian.net/browse/CONJ-28 It seems that we're receiving a byte array instead of string though we're not using a secured connexion to the database. |
Description |
We have a stored procedure called by Java using JPA:
{{StoredProcedureQuery storedProcedure = em.createStoredProcedureQuery(EXPORT_PROCEDURE_NAME);}} {{storedProcedure.registerStoredProcedureParameter(OUTPUT_ATTRIBUT_NAME, String.class, ParameterMode.OUT);}} {{storedProcedure.execute();}} {{String jsonResult = (String) storedProcedure.getOutputParameterValue(OUTPUT_ATTRIBUT_NAME);}} The last line raises an error: {{java.lang.ClassCastException: [B cannot be cast to java.lang.String.}} The output of our stored procedure is a string containing JSON formatted data looking like this: [{param1: info1, param2: info2}] This error seems similar is similar to the one reported here: https://mariadb.atlassian.net/browse/CONJ-28 It seems that we're receiving a byte array instead of string though we're not using a secured connexion to the database. |
We have a stored procedure called by Java using JPA:
{{StoredProcedureQuery storedProcedure = em.createStoredProcedureQuery(EXPORT_PROCEDURE_NAME);}} {{storedProcedure.registerStoredProcedureParameter(OUTPUT_ATTRIBUT_NAME, String.class, ParameterMode.OUT);}} {{storedProcedure.execute();}} {{String jsonResult = (String) storedProcedure.getOutputParameterValue(OUTPUT_ATTRIBUT_NAME);}} The last line raises an error: {{java.lang.ClassCastException: [B cannot be cast to java.lang.String.}} The output of our stored procedure is a string containing JSON formatted data looking like this: [{param1: info1, param2: info2}] Here is the header of the "show create procedure" query: {{STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | CREATE DEFINER=`xxxx`@`localhost` PROCEDURE `EXPORT_TRANSFER_ALL`(OUT json_result TEXT)}} This error seems similar is similar to the one reported here: https://mariadb.atlassian.net/browse/CONJ-28 It seems that we're receiving a byte array instead of string though we're not using a secured connexion to the database. |
Affects Version/s | 1.5.7 [ 22500 ] | |
Priority | Major [ 3 ] | Critical [ 2 ] |
Attachment | classcast_java_exception.txt [ 43311 ] | |
Attachment | classcast_procedure.txt [ 43312 ] |
Fix Version/s | 1.5.8 [ 22509 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Priority | Critical [ 2 ] | Major [ 3 ] |
Component/s | Other [ 12201 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 79525 ] | MariaDB v4 [ 134951 ] |