-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad Error Message When Saving Document #8
Comments
I agree, we need to fix this to give a better error message. This makes it sound like there was something wrong with the input document. |
Any update on this? |
It's on our TODO list, we'll take a look. |
Any update? |
We're working on a new release now, we'll fix as part of that. |
Hi Any update on this. I too facing same error |
@kumarAppsCode this will be fixed in the upcoming release we're working on now. But this issue is only about having a more descriptive error message... are you just asking about that, or are you trying to actually resolve the error? If you're trying to resolve the error, please make sure you have the right version of the JDBC jar. Which database service are you trying to connect to, is it autonomous 19c or 21c or an on premise database? For 19c autonomous or on premise, upgrading to ojdbc8.jar version 19.7 should resolve the error. For 21c autonomous, upgrading to ojdbc8.jar version 21.1 should resolve the error. |
Hi, |
@kumarAppsCode right, for autonomous, please make sure you have an ojdbc8.jar (i.e. JDBC jar), version 19.7 or higher, as I mentioned above. Then the error will go away (of course, please make sure you don't still have an older JDBC jar on the classpath when your run your SODA program). If you get either SODA 1.1.7.1 (the very latest) or 1.1.4 (the previous) releases of SODA from Maven Central, they'll automatically pull such a jar as a dependency (specifically, SODA 1.1.7.1 will pull a 21.1 ojdbc8.jar, and SODA 1.1.4 will put a 19.7 ojdbc8.jar). If either one is OK for you, you might as well go with SODA 1.1.7.1 and 21.1 ojdbc8.jar, because that's needed to work with 21c autonomous. So it's future proof.
Hope this helps, please let us know if you have further questions. |
Thanks. Let me try and update you |
@morgiyan , I got the same error, I can able to connect with the database and I can able to print a list of the collection while trying to insert one JSON document getting below error [Ensure the content of the input document is valid JSON] Exception in thread "main" oracle. soda.OracleException: Error occurred during conversion of the input document's JSON content to binary. Ensure the content of the input document is valid JSON. Note: If I try to insert null content. it was working fine. |
@morgiyan , I am referring to SODA for Java blog step If try to change all the latest jar files and run the application got the below error. I am using cloud wallet in the window system and it doesn't have "host:port:sid" , my url will be Attached My Sources. Kindly check and provide your suggestion. Note: Only attached sources jar. I can able to see all collection name from the schema and I can able to insert null content remaining process getting errors. If new jar version modifying. it getting errors. SODA for PLSQL working fine. I need to try JAVA Thank you |
@kumarAppsCode right, updating the jars was necessary, but now it can't establish a JDBC connection to autonomous for some reason. Yes, the URL looks correct, the host/port would come from the tnsnames.ora, which is in the TNS_ADMIN directory in the URL. Somehow it's not processing that TNS_ADMIN directory correctly. So with your previous ojdbc8.jar it's working, but if you upgrade the jar to 19.7 or 21.1, then it starts giving this error you posted? java.sql.SQLRecoverableException: IO Error: Invalid connection string format, a valid format is: "host:port:sid" For the set of JDBC jars you're using, could you please tell me the output of (this will tell me the versions of these jars): java -jar ojdbc8.jar Let me also check with JDBC folks on connecting to autonomous from windows (I am personally not an expert on that, since it's orthogonal to SODA) and get back to you shortly... it might be next week, because it's the weekend now and folks might be off. But in the meantime, please let me know the output of java -jar commands above. |
@kumarAppsCode and apologies for the inconvenience! We'll get this figured out asap. |
@morgiyan, Noted. Thanks for the update. Please refer the below jar version java -jar ojdbc8.jar ***** JCE UNLIMITED STRENGTH IS INSTALLED **** java -jar osdt_core.jar java -jar osdt_cert.jar java -jar oraclepki.jar I have attached the source code with the java jar for your reference. |
@kumarAppsCode Thanks for posting the info. I see that you don't have the right JDBC jar versions still... you have jdbc 18.3, which won't work for using SODA on Autonomous. Please use 19.7 or 21.1. Best to use 21.1, because that'll also work with Autonomous 21c, as well as Autonomous 19c. These links point to a zipped tar of all the jars, in addition to ojdbc8.jar, that you need for connecting to Autonomous - specifically osdt_core.jar, osdt_cert.jar, and oraclepki.jar. Please make sure to download the jars from either one of these two links (21.1 is preferrable), and don't use your old 18.3/18.1 jars (make sure they are not on the classpath!) Also, instead of escaped backslashes in the wallet path of the URL, please use forward slash, even for Windows (so instead of \ use /). And please don't use spaces in directory names used in the wallet path (e.g. don't use DB JAVA, or New Learn). You can put it in any directory, but with no spaces used in the path. For example, you can put all the wallet files in D:/Projects/NewLearn/SODA/DBJava/Wallet_DB202106021234. So instead of: String url="jdbc:oracle:thin:@db202106021234_tp?TNS_ADMIN=D:\Projects\New Learn\SODA\DB JAVA\Wallet_DB202106021234"; You'll have something like this: String url="jdbc:oracle:thin:@db202106021234_tp?TNS_ADMIN=D:/Projects/NewLearn/SODA/DBJAVA/Wallet_DB202106021234"; You can just create D:/Projects/NewLearn/SODA/DBJAVA/Wallet_DB202106021234 and copy all the files from your original wallet directory (i.e. the one with spaces in the path) there. |
Thanks for the update. Let me try and update you |
When trying to create a new document collection and save a new document with the 19.3 JDBC drivers, I received the following exception when calling
insertAndGet
:This error message is misleading as the document was indeed valid JSON. The fix was to update to the latest 19.6 JDBC drivers, but this error message should have been more clear as to what the issue was.
The text was updated successfully, but these errors were encountered: