Here is my XML snippet:
<jdbc:initialize-database data-source="dataSource">
<jdbc:script location="/WEB-INF/sqlscripts/age.sql" encoding="UTF-8" />
</jdbc:initialize-database>
When starting my Spring web application via Jetty, I got the following error:
Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jdbc.datasource.init.DataSourceInitializer#0': Invocation of init method failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Failed to execute database script; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement at line 1 of resource ServletContext resource [/WEB-INF/sqlscripts/age.sql]: I?N?S?E?R?T? ?A?g?e?G?r?o?u?p? ?(?d?e?f?a?u?l?t?O?p?t?i?o?n?,? ?d?e?s?c?r?i?p?t?i?o?n?,? ?d?i?s?p?l?a?y?S?o?r?t?,? ?n?a?m?e?,? ?c?o?d?e?,? ?l?o?c?a?l?e?)? ?V?A?L?U?E?S? ?(?1?,? ?N?U?L?L?,? ?1?,? ?N?'?1?6?-?2?0?'?,? ?N?'?1?6?-?2?0?'?,? ?N?'?e?n?_?U?S?'?)?
.....
com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'S'.
....
I don't know whether these question marks in the error message come from. The SQL statement in the age.sql has one line:
INSERT age(defaultOption, description, displaySort, name, code, locale) VALUES (1, NULL, 1, N'16-20', N'16-20', N'en_US');
I was able to run the same SQL statement successfully within MS SQL server manually. My SQL statement can have foreign characters.
I am using Spring 3.2.
What went wrong?
Thanks!
The file (example age.sql) having SQL inserts has encoding UTF-8 because it has characters of different languages. I changed it to UTF-8 No BOM. Then it worked.
Hope this helps someone else.
Related
I am trying connection to the Oracle database but this error display :
An error was encountered performing the requested operation:ORA-00604: error occurred at recursive SQL level 1ORA-01756: quoted string not properly terminated00604. 00000 - "error occurred at recursive SQL level %s"*Cause: An error occurred while processing a recursive SQL statement(a statement applying to internal dictionary tables).*Action: If the situation described in the next error on the stackcan be corrected, do so; otherwise contact Oracle Support.
what is the wrong and how can I solve it ?
Using PutDatabaseRecord processor i trying to migrate the varbinary datatype to another destination. Inside i tried avro reader using "Use Embedded Avro schema". While migrating, processor showing error as "THE CONVERSION FROM UNKNOWN TO ARRAY IS UNSUPPORTED".
Please provide solution for above issue. Thanks in advance
Error log:
17:04:34 ISTERROR5e288c7d-24fc-3619-7c08-e964a2113c7c
PutDatabaseRecord[id=5e288c7d-24fc-3619-7c08-e964a2113c7c] Failed to process session due to Failed to process StandardFlowFileRecord[uuid=bd2a3c28-d19b-466d-a8cd-1a397a1ebb6d,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1608723136100-388, container=default, section=388], offset=6847, length=45776044],offset=0,name=a241d7c9-7098-4161-bb77-bf205ef5bc2c,size=45775924] due to com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from UNKNOWN to ARRAY is unsupported.: org.apache.nifi.processor.exception.ProcessException: Failed to process StandardFlowFileRecord[uuid=bd2a3c28-d19b-466d-a8cd-1a397a1ebb6d,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1608723136100-388, container=default, section=388], offset=6847, length=45776044],offset=0,name=a241d7c9-7098-4161-bb77-bf205ef5bc2c,size=45775924] due to com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from UNKNOWN to ARRAY is unsupported.
Error log
I am trying to call Liquibase Stored Procedure Through Tag
it gives me error as sql code
DB2 SQL Error: SQLCODE=-440, SQLSTATE=42884
I Am Tring to call as follows : :
<sql> CALL TestProcedure('abc','xyz') </sql>
it executed well from outside command line Client and not using liquibase
i also tried calling using schema name no luck Open to suggestions
SQL440N is routine not found. The error message should give the text of the rountine name. Does it match what you have in your database. Is is a case sensitive problem? (i.e. try in upper case?)
SQL0440N No authorized routine named "<routine-name>" of type
"<routine-type>" having compatible arguments was found.
I log the error to Google StackDriver Logging.
But the Google Cloud Error Reporting doesn't recognise it (work for others).
Is my formatting so different that error reporter can not recognise it ?
What's the parsing rule of Google Cloud Error Report ?
The logs is:
02:05:12 ERROR application -
! #78in3pjc5 - Internal server error, for (GET) [/api/news/page/1] ->
play.api.UnexpectedException: Unexpected exception[NonNullableColumnRead: SQL `NULL` read at column 5 (JDBC type Array) but mapping is to a non-Option type; use Option here. Note that JDBC column indexing is 1-based.]
at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:247)
at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:178)
at play.core.server.AkkaHttpServer$$anonfun$1.applyOrElse(AkkaHttpServer.scala:363)
at play.core.server.AkkaHttpServer$$anonfun$1.applyOrElse(AkkaHttpServer.scala:361)
at scala.concurrent.Future.$anonfun$recoverWith$1(Future.scala:413)
at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
Caused by: doobie.util.invariant$NonNullableColumnRead: SQL `NULL` read at column 5 (JDBC type Array) but mapping is to a non-Option type; use Option here. Note that JDBC column indexing is 1-based.
at doobie.util.meta$Meta.unsafeGetNonNullable(meta.scala:50)
at doobie.util.composite$Composite$$anon$6$$anon$7.$anonfun$get$3(composite.scala:121)
at doobie.util.composite$Composite$$anon$6$$anon$7.$anonfun$get$3$adapted(composite.scala:121)
at doobie.util.kernel$Kernel$$anon$6.$anonfun$get$3(kernel.scala:80)
at doobie.util.kernel$Kernel$$anon$6.$anonfun$get$3$adapted(kernel.scala:80)
at doobie.util.kernel$Kernel$$anon$6.$anonfun$get$3(kernel.scala:80)
at doobie.util.kernel$Kernel$$anon$6.$anonfun$get$3$adapted(kernel.scala:80)
at doobie.util.kernel$Kernel$$anon$6.$anonfun$get$3(kernel.scala:80)
at doobie.util.kernel$Kernel$$anon$6.$anonfun$get$3$adapted(kernel.scala:80)
at doobie.util.kernel$Kernel$$anon$6.$anonfun$get$3(kernel.scala:80)
Could you provide the full log entry (e.g. as it appears then fully expanded in https://console.cloud.google.com/logs)?
The problem doesn't appear to be in the format of the stacktrace. The error is captured by if I:
go to the Cloud Console API explorer
enter "projects/[PROJECT_NAME]" for projectName
copy your content (i.e. starting from 02:05:12)
replace newlines with "\n"
paste that as a message in the Request Body
hit "Execute"
SELECT UCase(LTRIM(RTRIM(c.F2))) AS Name,c.F2 AS NameProperCase,c.F3 As Initials, c.F4 As CountryCode
FROM `Country$` c
I have the above query in an SSIS Excel Source as its SQL command. In the Excel Source Editor, i can successfully click preview and see the sample data returned by the query from the Excel file.
I have configured my Excel Connection Manager that the First row DOES NOT have column headers.
When i try to execute my package, it fails at this Excel source and the errors below are logged to my text Log file.
The SQL command requires 3 parameters, but the parameter mapping only has 0 parameters.
The SQL command requires 3 parameters, but the parameter mapping only
has 0 parameters.
The SQL command requires 3 parameters, but the parameter mapping only
has 0 parameters.
"Excel Source 2" (2303) failed the pre-execute phase and returned
error code 0xC0207013.
"Excel Source 2" (2303) failed the pre-execute phase and returned
error code 0xC0207013.
"Excel Source 2" (2303) failed the pre-execute phase and returned
error code 0xC0207013.
If i reconfigure the Excel Connection Manager that the First row HAS column names, and then replace the Excel source query with the one below, the package runs fine with out errors
SELECT UCase(LTRIM(RTRIM(c.Name))) AS Name,c.Name AS NameProperCase,c.Initials, c.CountryCode
FROM `Country$` c
I don't have any parameters in the query but i am getting "The SQL command requires 3 parameters, but the parameter mapping only has 0 parameters." in the log file.
The only difference between the failing and succeeding Excel sources is the setting that First row has column names (Success with out error), AND First row does NOT have column names (Fails with errors posted above)
I haved faced the same issue, First i ran package by changing excel connection manager properties-> FirstRowHasColumn to False. I could preview the data, but only at run time, this error came.
After few googling no answer. Then found out myself.
Reason was i did not change excel connection string in config file or in properites. After changing connection string HDR to NO, it worked fine.
HDR=NO
Right click excel connection manager-> properties-> connection string locate the value HDR.
if HDR=YES then change it to NO. Ensure the same thing is done in config file as well if you have one. Cheers!