Spring Web app Migrate an on-premises database to the cloud

Before we do app update, just make sure that DBA already mirgrate all data from Physical DB server to Cloud(table, scheme, index...),

and we can use client tool like sqldeveloper to test the connection and check db data.

Step 1: update your datasource URL, User name and password from on-premise db to Oracle cloud like:

datasource.username
datasource.password
datasource.url
Step 2: verify your work is able to work or not, my web is runing in win server, and JRE is jdk 8, update update, it's not working, and show some error like:
"Cannot create PoolableConnectionFactory (IO Error: IO Error Could not generate DH keypair, Authentication lapse 0 ms.)"
"java.security.InvalidAlgorithmParameterException: Prime size must be multiple of 64, and can only range from 512 to 2048 (inclusive)"
 
Step 3: if only update setting is working, ignore all below steps, download 2 external jar from internet and put it to JRE ext path:

bcprov-ext-jdk15on-1.54.jar and bcprov-jdk15on-1.54.jar copy it JRE env path, eg: below UAT path:
C:\Program Files\Java\jre1.8.0_341\lib\ext

update C:\Program Files\Java\jre1.8.0_341\lib\security below file
java.security, update provider

security.provider.1=sun.security.provider.Sun
#security.provider.2=sun.security.rsa.SunRsaSign
security.provider.2=org.bouncycastle.jce.provider.BouncyCastleProvider
security.provider.3=sun.security.ec.SunEC
security.provider.4=com.sun.net.ssl.internal.ssl.Provider
security.provider.5=com.sun.crypto.provider.SunJCE
security.provider.6=sun.security.jgss.SunProvider
security.provider.7=com.sun.security.sasl.Provider
security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI
security.provider.9=sun.security.smartcardio.SunPCSC
#security.provider.10=sun.security.mscapi.SunMSCAPI
security.provider.10=org.bouncycastle.jce.provider.BouncyCastleProvider

Step 4: after update this, when run web app, still not work, rebuild my embedded tomcat, try to update (

C:\Program Files\Java\jre1.8.0_101\l
ib\security\cacerts) files before, but not work, this is to import the server cert to the ca trust list

Add to running VM option
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

after all, it's working fine with OCI.

 

posted @ 2022-09-26 16:16  renren0113  阅读(34)  评论(0)    收藏  举报