I'm currently upgrading an application that uses DB2/400 database, and I'm migrating to the new java time api (LocalDate, LocalTime, ...), using the latest version of jt400.jar.
However, when executing statement setObject as follows
stmt.setObject(++columns, LocalDate.now());
I'm getting this exception
Thread[main,5,main] Ter jan 18 10:46:56:852 GMT 2022 as400: PreparedStatementImpl STMT0001 (1588970020) : setObject().
Thread[main,5,main] Ter jan 18 10:46:56:852 GMT 2022 as400: PreparedStatementImpl STMT0001 (1588970020) : parameter index: 2 type: java.time.LocalDate toString():2022-01-18.
Thread[main,5,main] Ter jan 18 10:46:56:853 GMT 2022 as400: Unknown com.ibm.as400.access.SQLDate#3c679bde (1013423070) : Unable to assign object(2022-01-18) of class(class java.time.LocalDate).
Thread[main,5,main] Ter jan 18 10:46:56:853 GMT 2022 as400: Unknown com.ibm.as400.access.SQLDate#3c679bde (1013423070) : Throwing exception, sqlState: 07006 reason: Data type mismatch. vendor code -99999.java.sql.SQLException: Data type mismatch.
at com.ibm.as400.access.JDError.createSQLExceptionSubClass(JDError.java:891)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:436)
at com.ibm.as400.access.SQLDate.set(SQLDate.java:452)
at com.ibm.as400.access.AS400JDBCPreparedStatementImpl.setValue(AS400JDBCPreparedStatementImpl.java:3655)
at com.ibm.as400.access.AS400JDBCPreparedStatementImpl.setObject(AS400JDBCPreparedStatementImpl.java:3124)
at mypackage.jdbc.LocalDateTester.main(LocalDateTester.java:26)
Also, when trying to read from the DB using
rs.getObject(2, LocalDate.class)
I'm also getting the exception
Exception in thread "main" java.sql.SQLException: Data type not valid.
at com.ibm.as400.access.JDError.createSQLExceptionSubClass(JDError.java:985)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:436)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:413)
at com.ibm.as400.access.AS400JDBCResultSet.getObject(AS400JDBCResultSet.java:7457)
at mypackage.jdbc.LocalDateTester.main(LocalDateTester.java:47)
The DB column type on iSeries is Date.
I'm I doing something wrong, or is the new java.time api not supported?
If so, does anyone know if there are any plans for Java Time API support?
Thanks in advance
You must use java.sql.date with JDBC. Convert with :
java.sql.Date.valueOf(LocalDate.now());
Related
OpenKM Installed on
OS: Windows Server 2016
VM: ESX 6.5
After the successful Installation, the Apache Service is not showing in Microsoft Services Console (MSC).
Find below the error generated after a login attempt :
http://192.168.0.28:8080/OpenKM/login.jsp
Application error
Class: org.apache.jasper.JasperException
Message: An exception occurred processing JSP page [/login_desktop.jsp] at line [230] 227:
Date: Wed Jul 22 15:59:10 PKT 2020
Regards,
Anwar
I Try load data from ODI 12c to OBIEE 12c, I use reverse engineer and Knowledge Modules. I create connect from ODI to OBIEE, but after run mapping which should create new table and insert data I get
WARNING: SQLCommand execution failure: java.io.IOException: prepare query failed[nQSError: 43113] Message returned from OBIS.
[nQSError: 27002] Near <table>: Syntax error [nQSError: 26012] .
Failed query text:
drop table "Sample Targets Lite"...C_0DEFAULT
Feb 04, 2019 11:39:08 PM oracle.odi.runtime.agent.execution.sql.SQLCommand
WARNING: SQLCommand execution failure: java.io.IOException: prepare query failed[nQSError: 43113] Message returned from OBIS.
[nQSError: 27002] Near <table>: Syntax error [nQSError: 26012] .
Failed query text:
create table "Sample Targets Lite"...C_0DEFAULT
(DEPARTMENT_NAME VARCHAR(30)
);
Feb 04, 2019 11:39:09 PM oracle.odi.agent
WARNING: Agent Internal encountered an error: ODI-1226: Step Physical_STEP fails after 1 attempt(s).
Feb 04, 2019 11:39:09 PM oracle.odi.agent
SEVERE: Session ggfgfggf_Physical_SESS (59) fails with return code ODI-1298.
ODI-1217: Session ggfgfggf_Physical_SESS (59) fails with return code ODI-1298.
ODI-1226: Step Physical_STEP fails after 1 attempt(s).
ODI-1227: Task SERIAL-MAP_MAIN- fails on the source connection <Empty Value>.
ODI-1298: Serial task "SERIAL-MAP_MAIN- (10)" failed because child task "SERIAL-EU-LS_HR_CLASS_PROJECT_1_UNIT (20)" is in error.
ODI-1298: Serial task "SERIAL-EU-LS_HR_CLASS_PROJECT_1_UNIT (20)" failed because child task "Create work table-LKM SQL to SQL (JYTHON)- (40)" is in error.
ODI-1228: Task Create work table-LKM SQL to SQL (JYTHON)- fails on the target connection BI_connect.
Caused By: java.sql.SQLException: java.io.IOException: prepare query failed[nQSError: 43113] Message returned from OBIS.
[nQSError: 27002] Near <table>: Syntax error [nQSError: 26012] .
at oracle.bi.jdbc.AnaJdbcStatementImpl.executeQuery(AnaJdbcStatementImpl.java:387)
...
Feb 04, 2019 11:39:09 PM oracle.odi.agent
SEVERE: Agent encountered an error: ODI-1217: Session ggfgfggf_Physical_SESS (59) fails with return code ODI-1298. Caused by: ODI-1226: Step Physical_STEP fails after 1 attempt(s).
Feb 04, 2019 11:58:51 PM null
INFO: Disconnecting from Source.
Feb 04, 2019 11:58:51 PM null
INFO: Disconnecting from Repository
Feb 04, 2019 11:58:51 PM null
INFO: Reverse End.
I use all LKM but all throw same error or can't run.
Using AWS CLI
aws --version
aws-cli/1.11.21 Python/2.7.12 Darwin/15.3.0 botocore/1.4.78
Creating a POST method for API Gateway as explained at https://github.com/arun-gupta/serverless/tree/master/aws/microservice#post-method. This method can be invoked successfully using test-invoke-method and AWS Console.
Creating a GET method using AWS CLI https://github.com/arun-gupta/serverless/tree/master/aws/microservice#get-method. Invoking this method using test-invoke-method and AWS Console gives the following error:
{
"status": 500,
"body": "{\"message\": \"Internal server error\"}",
"log": "Execution log for request test-request\nThu Dec 29 00:58:56 UTC 2016 : Starting execution for request: test-invoke-request\nThu Dec 29 00:58:56 UTC 2016 : HTTP Method: GET, Resource Path: /books\nThu Dec 29 00:58:56 UTC 2016 : Method request path: {}\nThu Dec 29 00:58:56 UTC 2016 : Method request query string: {}\nThu Dec 29 00:58:56 UTC 2016 : Method request headers: {}\nThu Dec 29 00:58:56 UTC 2016 : Method request body before transformations: \nThu Dec 29 00:58:56 UTC 2016 : Endpoint request URI: https://lambda.us-west-1.amazonaws.com/2015-03-31/functions/arn:aws:lambda:us-west-1:598307997273:function:MicroserviceGetAll/invocations\nThu Dec 29 00:58:56 UTC 2016 : Endpoint request headers: {x-amzn-lambda-integration-tag=test-request, Authorization=******************************************************************************************************************************************************************************************************************************************************************************************************482377, X-Amz-Date=20161229T005856Z, x-amzn-apigateway-api-id=sofl9ilki7, X-Amz-Source-Arn=arn:aws:execute-api:us-west-1:598307997273:sofl9ilki7/null/GET/books, Accept=application/json, User-Agent=AmazonAPIGateway_sofl9ilki7, Host=lambda.us-west-1.amazonaws.com, X-Amzn-Trace-Id=Root=1-58645fd0-7d733ae3c383f4378fcc0338}\nThu Dec 29 00:58:56 UTC 2016 : Endpoint request body after transformations: \nThu Dec 29 00:58:56 UTC 2016 : Endpoint response body before transformations: <AccessDeniedException>\n <Message>Unable to determine service/operation name to be authorized</Message>\n</AccessDeniedException>\n\nThu Dec 29 00:58:56 UTC 2016 : Endpoint response headers: {x-amzn-RequestId=f95a8659-cd61-11e6-80f6-ddd6ce5b7e8b, Connection=keep-alive, Content-Length=130, Date=Thu, 29 Dec 2016 00:58:56 GMT}\nThu Dec 29 00:58:56 UTC 2016 : Lambda invocation failed with status: 403\nThu Dec 29 00:58:56 UTC 2016 : Execution failed due to configuration error: \nThu Dec 29 00:58:56 UTC 2016 : Method completed with status: 500\n",
"latency": 39
}
The ARN identified in the error message is arn:aws:execute-api:us-west-1:598307997273:sofl9ilki7/null/GET/books. Wondering if null instead of test is causing this to fail?
I think you are using "GET" for your Lambda function endpoint on your GET method as well. Please change it to use "POST" for the Lambda integration HTTP method.
Using GET for lambda integrations on AWS API Gateway may leave you wondering why POST integrations are working but GET integrations don't work. GET AWS_PROXY integrations will fail if GET is used as the method on the integration. POST should be used for the lambda integration, even if the OPEN API specification is for a get method.
To invoke a lambda function the http method should be POST as per the lambda API:
Visit http://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html.
The null in the source ARN is because test-invoke does not have a stage to associate with your API. This is not usually a problem, unless the policy on your Lambda function is expecting an incompatible source ARN. Check the policy on your Lambda function and see if it includes a restriction on the source ARN. If it does, edit it to be compatible with the test-invoke ARN or deploy the API to a stage and call the method directly without test-invoke.
Note carefully API Gateway use POST method by to call Lambda, while allowing any method to be able to call it via x-amazon-apigateway-any-method.
I have written a simple expression transformation where the mapping concatenates the first and last name and based on salary of the customer it stores the string high,low or medium into the target table.
The workflow is validated and there are no errors. But when the workflow is started it reads the rows from the database and then applies the transformation and then tries to load the target table. Here while loading the data into the target table it doesn't move forward and gets struck and after long time when Integration service gets disconnected it throws a repository error.
The interesting thing is when I run some other workflows it doesn't give any error. Below are the session logs:
<pre><code>
DIRECTOR> TM_6014 Initializing session [s_mp_person_exp_person] at [Thu Feb
18 22:21:21 2016].
DIRECTOR> TM_6683 Repository Name: [infa_training]
DIRECTOR> TM_6684 Server Name: [infa_training_IS]
DIRECTOR> TM_6686 Folder: [training]
DIRECTOR> TM_6685 Workflow: [wf_person_exp_person] Run Instance Name: [] Run Id: [38]
DIRECTOR> TM_6101 Mapping name: mp_person_exp_person.
DIRECTOR> TM_6964 Date format for the Session is [MM/DD/YYYY HH24:MI:SS.US]
DIRECTOR> TM_6708 Using configuration property [EnableDataEncryption,no]
DIRECTOR> TM_6708 Using configuration property [StoreHAPersistenceInDB,no]
DIRECTOR> TM_6703 Session [s_mp_person_exp_person] is run by 64-bit Integration Service [node01_Gizmo], version [9.6.1], build [0606].
MANAGER> PETL_24058 Running Partition Group [1].
MANAGER> PETL_24000 Parallel Pipeline Engine initializing.
MANAGER> PETL_24001 Parallel Pipeline Engine running.
MANAGER> PETL_24003 Initializing session run.
MAPPING> CMN_1569 Server Mode: [ASCII]
MAPPING> CMN_1570 Server Code page: [MS Windows Latin 1 (ANSI), superset of Latin1]
MAPPING> TM_6151 The session sort order is [Binary].
MAPPING> TM_6156 Using low precision processing.
MAPPING> TM_6180 Deadlock retry logic will not be implemented.
MAPPING> TM_6187 Session target-based commit interval is [10000].
MAPPING> TM_6307 DTM error log disabled.
MAPPING> TE_7022 TShmWriter: Initialized
MAPPING> TM_6007 DTM initialized successfully for session [s_mp_person_exp_person]
DIRECTOR> PETL_24033 All DTM Connection Info: [<NONE>].
MANAGER> PETL_24004 Starting pre-session tasks. : (Thu Feb 18 22:21:21 2016)
MANAGER> PETL_24027 Pre-session task completed successfully. : (Thu Feb 18 22:21:21 2016)
DIRECTOR> PETL_24006 Starting data movement.
MAPPING> TM_6660 Total Buffer Pool size is 1219648 bytes and Block size is 65536 bytes.
READER_1_1_1> DBG_21438 Reader: Source is [orcl], user [kakarrot]
READER_1_1_1> BLKR_16003 Initialization completed successfully.
WRITER_1_*_1> WRT_8147 Writer: Target is database [orcl], user [target], bulk mode [OFF]
WRITER_1_*_1> WRT_8124 Target Table PERSON :SQL INSERT statement:
INSERT INTO PERSON(ID,FULLNAME,TOTALSAL,ANNUALSAL,CITY,STATE,MOB,SALSTATUS) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?)
WRITER_1_*_1> WRT_8124 Target Table PERSON :SQL UPDATE statement:
UPDATE PERSON SET FULLNAME = ?, TOTALSAL = ?, ANNUALSAL = ?, CITY = ?, STATE = ?, MOB = ?, SALSTATUS = ? WHERE ID = ?
WRITER_1_*_1> WRT_8124 Target Table PERSON :SQL DELETE statement:
DELETE FROM PERSON WHERE ID = ?
WRITER_1_*_1> WRT_8270 Target connection group #1 consists of target(s) [PERSON]
WRITER_1_*_1> WRT_8003 Writer initialization complete.
READER_1_1_1> BLKR_16007 Reader run started.
WRITER_1_*_1> WRT_8005 Writer run started.
WRITER_1_*_1> WRT_8158
*****START LOAD SESSION*****
Load Start Time: Thu Feb 18 22:21:21 2016
Target tables:
PERSON
READER_1_1_1> RR_4010 SQ instance [SQ_PERSON] SQL Query [SELECT kakarrot.Person.ID, kakarrot.Person.FNAME, kakarrot.Person.LNAME, kakarrot.Person.SALPERMONTH, kakarrot.Person.COMMISION, kakarrot.Person.CITY, kakarrot.Person.STATE, kakarrot.Person.MOB FROM kakarrot.Person]
READER_1_1_1> RR_4049 SQL Query issued to database : (Thu Feb 18 22:21:21 2016)
READER_1_1_1> RR_4050 First row returned from database to reader : (Thu Feb 18 22:21:21 2016)
READER_1_1_1> BLKR_16019 Read [6] rows, read [0] error rows for source table [Person] instance name [PERSON]
READER_1_1_1> BLKR_16008 Reader run completed.
TRANSF_1_1_1> DBG_21216 Finished transformations for Source Qualifier [SQ_PERSON]. Total errors [0]
WRITER_1_*_1> WRT_8167 Start loading table [PERSON] at: Thu Feb 18 22:21:21 2016
CMN_1761 Timestamp Event: [Fri Feb 19 08:01:22 2016]
REP_12014 An error occurred while accessing the repository
CMN_1761 Timestamp Event: [Fri Feb 19 08:01:23 2016]
REP_12400 Repository Error (Connection to the Repository Service [infa_training] is broken.)
CMN_1761 Timestamp Event: [Fri Feb 19 08:01:23 2016]
REP_12400 Repository Error ([REP_55101] Connection to the Repository Service [infa_training] is broken.)
CMN_1761 Timestamp Event: [Fri Feb 19 08:01:23 2016]
REP_12400 Repository Error ([REP_55114] Reconnecting to the Repository Service [infa_training]. The resilience time is 180 seconds.)
CMN_1761 Timestamp Event: [Fri Feb 19 08:01:50 2016]
REP_12400 Repository Error ([REP_51490] Communication with client application on host [169.254.164.2] and port [6013] has failed because of network errors. [System Error (errno = 10054): Unknown error].)
CMN_1761 Timestamp Event: [Fri Feb 19 10:00:14 2016]
REP_12400 Repository Error ([REP_55112] Unable to connect to the Repository Service [infa_training] since the resilience time is up.)
CMN_1761 Timestamp Event: [Fri Feb 19 10:00:14 2016]
REP_12400 Repository Error (Failed to connect to repository service [infa_training].)
CMN_1761 Timestamp Event: [Fri Feb 19 10:00:14 2016]
REP_12014 An error occurred while accessing the repository
CMN_1761 Timestamp Event: [Fri Feb 19 10:00:14 2016]
REP_12400 Repository Error (Failed to connect to repository service [infa_training].)
CMN_1761 Timestamp Event: [Fri Feb 19 10:00:14 2016]
REP_12400 Repository Error ([REP_55102] Failed to connect to repository service [infa_training].)
CMN_1761 Timestamp Event: [Fri Feb 19 10:00:15 2016]
PETL_24074 Failed to send updates to the master service process. Session run
`will be terminated.`
</pre></code>
Hope you guys can shed light on this problem.
The issue definitely appears to be with the database. According to your log, the session hung for 10 hours and then seems to have lost its connection to the repository database as well. You should try changing the target connection to a flat file and/or any other database you have access to in order to test the session itself. Also, if you don't have the ability to do it yourself, you should ask a DBA to look at the session as it is running to see why the oracle connection is waiting/hung up.
I'm using EAServer 5.5 on Windows7 and the server is running with JDK 1.5
Now I want to UpGrade JDK1.5 to 1.8. Can you please some one help me.
I am getting the following error.
DynamicLibrary::lookup: af_dll_lookup (libjjdk12.dll, new_JagComponent) failed (libjdispatch) (Y:\calm\conn\itg\jagsrv\generic\dispatch\DynamicLibrary.cc#80)
000095 Tue Jul 21 12:50:32 2015 E [018286] CTS_JagComponent::load: failed to load component model library (libjdispatch) (Y:\calm\conn\itg\jagsrv\generic\dispatch\CTS_JagComponent.cc#841)
000096 Tue Jul 21 12:50:32 2015 E [018918] CTS_Component::load: failed for component 'Jaguar/Repository' (libjdispatch) (Y:\calm\conn\itg\jagsrv\generic\dispatch\CTS_Component.cc#1993)
000097 Tue Jul 21 12:50:32 2015 A [099999] SystemException: OBJECT_NOT_EXIST (CosNaming/NamingContext/resolve - #0.0.0.0) (libjdispatch) (Y:\calm\conn\itg\jagsrv\generic\dispatch\CTS_Object.cc#3995)
000098 Tue Jul 21 12:50:32 2015 E [018532] Exception 'CORBA::OBJECT_NOT_EXIST' in Session::create for component 'Jaguar/Repository' (libjdispatch) (Y:\calm\conn\itg\jagsrv\generic\dispatch\Session.cc#1029)
000099 Tue Jul 21 12:50:32 2015 A [099999] SystemException: OBJECT_NOT_EXIST (Session/create - #0.0.0.0) (libjdispatch) (Y:\calm\conn\itg\jagsrv\generic\dispatch\CTS_Object.cc#3995)
000100 Tue Jul 21 12:50:32 2015 A [099999] new_JagObjectRef: Bad URL - Jaguar/Repository (libjdispatch.iiop) (Y:\calm\conn\itg\jagsrv\generic\cc\JagORB.c#1074)
000101 Tue Jul 21 12:50:32 2015 E [018480] SEVERE ERROR - failed to access Jaguar Repository (libjdispatch.repository) (Y:\calm\conn\itg\jagsrv\generic\dispatch\Repository.cc#114)
000102 Tue Jul 21 12:50:32 2015 E [018488] Warning: failed to lookup properties for Package'CosNaming'(CORBA::INV_OBJREF) (libjdispatch.repository) (Y:\calm\conn\itg\jagsrv\generic\dispatch\Repository.cc#187)
000103 Tue Jul 21 12:50:32 2015 E [018477] Missing value for Component 'CosNaming/NamingContext' property 'com.sybase.jaguar.component.type' (sybase.eas.global) (Y:\calm\conn\itg\jagsrv\generic\dispatch\Properties.cc#151)
000104 Tue Jul 21 12:50:32 2015 E [018918] CTS_Component::load: failed for component 'CosNaming/NamingContext' (libjdispatch) (Y:\calm\conn\itg\jagsrv\generic\dispatch\CTS_Component.cc#1993)
000105 Tue Jul 21 12:50:32 2015 A [099999] SystemException: OBJECT_NOT_EXIST (CosNaming/NamingContext/resolve - #0.0.0.0) (libjdispatch) (Y:\calm\conn\itg\jagsrv\generic\dispatch\CTS_Object.cc#3995)
000106 Tue Jul 21 12:50:32 2015 E [018532] Exception 'CORBA::OBJECT_NOT_EXIST' in Session::create for component 'Jaguar/JavaInit' (libjdispatch) (Y:\calm\conn\itg\jagsrv\generic\dispatch\Session.cc#1029)
000107 Tue Jul 21 12:50:32 2015 A [099999] SystemException: OBJECT_NOT_EXIST (Session/create - #0.0.0.0) (libjdispatch) (Y:\calm\conn\itg\jagsrv\generic\dispatch\CTS_Object.cc#3995)
000108 Tue Jul 21 12:50:32 2015 A [099999] new_JagObjectRef: Bad URL - Jaguar/JavaInit (libjdispatch.iiop) (Y:\calm\conn\itg\jagsrv\generic\cc\JagORB.c#1074)
000109 Tue Jul 21 12:50:32 2015 F [018506] SEVERE ERROR - failed to access Jaguar/JavaInit (libjdispatch) (Y:\calm\conn\itg\jagsrv\generic\dispatch\Server.cc#418)
I don't think this is possible or recommended.
OP was asking for upgrading Java (inside) used by EAServer (app server like JBoss, but for PowerBuilder+Java). Most of the Java classes inside EAServer were compiled to Java 1.2 and support only up to Java 1.5. I recently tried to upgrade my EAS 5.5 to JDK 1.6. This caused above issues you mentioned.
Several things are at play here:
Deprecated Java classes, methods, models.
JDBC interface itself is different now. For Oracle, I had to use OJBC6 and that breaks with older databases.
In the end, decided to simply upgrade JDK to 1.5.0_22, max build for 1.5 (Sybase's own limit was 1.5.0_03).
That said, if you still want to try, you will have to update a few batch files (I am assuming you are on windows) in \bin.
You may have to install/copy the JDK inside Sybase\Shared
folder, so you can customize, if needed.
You will need to add new JDK entries into setenv.bat and
serverstart.bat. Basically, current batches are agnostic about the
new JDK versions you are introducing to the EAServer.
You may have to update user_setenv.bat to customize JDBC/classpaths.
You may also have to generate batch file for Jaguar Manager and
change Java directory used to launch it.
It didn't work for me. But, if you are able to make it to work, can you please post back with your suggestions here?
Sorry for the late reply. Been busy with a project. Are you still having the problem? That essentially says the service did not start. Did you look at the Jaguar.log?
I suggest, you start it using the batch file first -
\EAServer\bin\serverstart.bat -jdk18
I hope you have added jdk18 options in the batch files. And watch the below logs:
Jaguarout.log, Jaguar_performance.log (if found), Jaguar.log
Once you get it to work, then you can use Serverstart with -install option to start as a service.
I just want to reiterate, that even if you get it to start, you may have issues with connection caches (particularly JDBC) and other interfaces as the specifications changed a lot since Java 1.4. If you are getting issues there, you will have to update the OJDBC driver etc. Good luck!