liquibase.exception.DatabaseException: Syntax error in SQL statement " CREATE EXTENSION[*] UUID-OSSP; - spring-boot

Im using postgres with liquibase on cloud and h2db on my local machine. When i write sql queries for generating uuid, i get the error during build:
liquibase.exception.DatabaseException: Syntax error in SQL statement " CREATE EXTENSION[*] UUID-OSSP;
So i removed ossp extension and used gen_random_uuid() instead. And i get the below eror:
Caused by: liquibase.exception.LiquibaseException:
liquibase.exception.MigrationFailedException: Migration failed for change set db/scripts/123_Somescripts.sql::raw::includeAll:
Reason: liquibase.exception.DatabaseException: Syntax error in SQL statement "
I start getting this error during build when i include H2 DB dependency. Otherwise the build works fine.
BUT, even if build works fine, i get the error:
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
Process finished with exit code 0
I configured postgres db in appication-local.yml, and activated local profile but build still fails.

Related

Liquibase in a Spring Application doesn't fail on unknown change type

We’ve recently ran into an issue where we had a typo in a Liquibase change type and nothing caught this issue. We used the addNonNullConstraint change type, which does not exist, instead of addNotNullConstraint.
The issue here is that we're using YAML format for the changeset file, which doesn't have any validation. With the XML format, we would at least get an error in the editor.
Executing the Liquibase CLI validate command finds the faulty change set:
➜ git: ✗ liquibase validate
Starting Liquibase at 13:46:47 (version 4.17.0 #4922 built at 2022-10-05 14:56+0000)
Liquibase Version: 4.17.0
Liquibase Community 4.17.0 by Liquibase
Unexpected error running Liquibase: Error parsing db/changelog.yaml
- Caused by: Error parsing /db/changes/0019_mark-column-non-null.yaml
- Caused by: Error parsing /db/changes/0019_mark-column-non-null.yaml: Unknown change type 'addNonNullConstraint'. Check for spelling or capitalization errors and missing extensions such as liquibase-commercial.
For more information, please use the --log-level flag
But when starting up the Spring Boot app, there’s no hint that something went wrong with one of the new changesets that need to be applied:
INFO Liquibase.database : Set default schema name to public
INFO liquibase.lockservice : Successfully acquired change log lock
INFO liquibase.changelog : Reading from public.databasechangelog
Running Changeset: /db/changes/0019_mark-column-non-null.yaml::Mark column as non-null::Dev
INFO liquibase.changelog : ChangeSet /db/changes/0019_mark-column-non-null.yaml::Mark column as non-null::Dev ran successfully in 0ms
Ideally, the Spring Boot app would validate the change sets before applying them, and fail if the change type is unknown. But I could not find out how to run the Liquibase validate command in the context of the Spring integration.

OBIEE12c configuration failed with oracle database 19c

My OBIEE12c configuration failed after proceed 12%.
OBIEE version: 12.2.1.4
Oracle Database version: 19c
Stack Trace:
Variable in stdconfigactionhandler : BI Configuration
progress in calculate progress6
progress in calculate progress6
java.lang.IllegalStateException: Action:BI_Configuration failed with error:Configure BI Failed with Execution of [/u01/app/middleware/bi_home/oracle_common/common/bin/wlst.sh, /u01/app/middleware/bi_home/bi/modules/oracle.bi.configassistant/essbase.py, /u01/app/middleware/bi_home, /u01/app/middleware/bi_home/user_projects/domains/bi12c, weblogic, Expanded, EDWIPRDAPP1, 9502, 9503, ORACLE, oracle.jdbc.OracleDriver, jdbc:oracle:thin:#//EDWIPRDDB-scan:1521/edwprddb, DEVBI, jdbc:oracle:thin:#//EDWIPRDDB-scan:1521/edwprddb, ] failed with exit value 1
at oracle.as.install.engine.modules.configuration.client.ConfigAction.fail(ConfigAction.java:281)
at oracle.bi.install.config.actions.BIConfigAction.doExecute(BIConfigAction.java:137)
at oracle.as.install.engine.modules.configuration.client.ConfigAction.execute(ConfigAction.java:405)
at oracle.as.install.engine.modules.configuration.action.TaskPerformer.run(TaskPerformer.java:88)
at oracle.as.install.engine.modules.configuration.action.TaskPerformer.startConfigAction(TaskPerformer.java:108)
at oracle.as.install.engine.modules.configuration.action.ActionRequest.perform(ActionRequest.java:15)
at oracle.as.install.engine.modules.configuration.action.RequestQueue.performSequentialExecution(RequestQueue.java:284)
at oracle.as.install.engine.modules.configuration.action.RequestQueue.perform(RequestQueue.java:260)
at oracle.as.install.engine.modules.configuration.standard.StandardConfigActionManager.start(StandardConfigActionManager.java:185)
at oracle.as.install.engine.modules.configuration.boot.ConfigurationExtension.kickstart(ConfigurationExtension.java:82)
at oracle.as.install.engine.modules.configuration.ConfigurationModule.run(ConfigurationModule.java:87)
at java.lang.Thread.run(Thread.java:820)
In Config Module Finish Event...
The following workaround can fix the issue
Step 1: First following command in the current session
export JAVA_OPTIONS="-Doracle.jdbc.fanEnabled=false ${JAVA_OPTIONS} ${JAVA_PROPERTIES}"
export JAVA_OPTIONS
export CONFIG_JVM_ARGS=-Doracle.jdbc.fanEnabled=false
Step 2: Remove or rename the following file
$Oracle_home/oracle_common/lib/ons.jar
Ste3. Re-run the configuration assistant
$Oracle_Home/bi/bin/config.sh or config.cmd

TestContainer Oracle

according to https://www.testcontainers.org/modules/databases/jdbc/#database-containers-launched-via-jdbc-url-scheme , i'm trying to create an Oracle Container with Quarkus using jdbc url scheme.
After provided a valid docker image ("store/oracle/database-instantclient:12.2.0.1") and set this properties:
"%test":
quarkus:
datasource:
jdbc:
driver: org.testcontainers.jdbc.ContainerDatabaseDriver
url: jdbc:tc:oracle:///databasename
db-kind: other
i get this error:
Container is started (JDBC URL: jdbc:oracle:thin:system/oracle#localhost:32827:xe)
2020-11-09 17:33:06,719 INFO [🐳 .2.0.1]] (Agroal_13889837441) Container store/oracle/database-instantclient:12.2.0.1 started in PT4M7.8483772S
2020-11-09 17:33:06,738 WARN [io.agr.pool] (Agroal_13889837441) Datasource '<default>': Could not create new connection
2020-11-09 17:33:06,805 ERROR [io.qua.application] (main) Failed to start application (with profile test): org.flywaydb.core.internal.exception.FlywaySqlException:
Unable to obtain connection from database: Could not create new connection
--------------------------------------------------------------------------
SQL State : null
Error Code : 0
Message : Could not create new connection
at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:65)
at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:80)
at org.flywaydb.core.Flyway.execute(Flyway.java:453)
at org.flywaydb.core.Flyway.migrate(Flyway.java:158)
Can someone help me?
If I remember correctly, Flyway community editions (that ships with Quarkus) does not have support for Oracle. You need to use the Enterprise edition.
You need to replace the Quarkus Flyway dependency. Just exclude the one included and add the enterprise one (either in Maven or Gradle).

Corda fails to startup if hibernate_sequence is already created in Postgres

My Spring and Corda nodes share the same Posgres database. When I start first Corda nodes and then Spring everything goes smoothly. But if I start everything together like 'docker-compose up' I see following exception. It seems that Corda doesn't like if Spring creates hibernate_sequence first.
I see this problem with Corda 4.0 but with Corda 3.3 everything worked fine.
Is there any way to avoid this not-expected behaviour?
> ! ATTENTION: This node is running in development mode! This is not safe for production deployment.
[ERROR] 14:50:53+0000 [main] liquibase.severe - master.changelog.json: migration/common.changelog-init.xml::1511451595465-1.3::R3.Corda: Change Set migration/common.changelog-init.xml::1511451595465-1.3::R3.Corda failed. Error: ERROR: relation "hibernate_sequence" already exists [Failed SQL: CREATE SEQUENCE public.hibernate_sequence MINVALUE 1]
[ERROR] 14:50:53+0000 [main] internal.NodeStartupLogging.invoke - Could not create the DataSource: Migration failed for change set migration/common.changelog-init.xml::1511451595465-1.3::R3.Corda:
Reason: liquibase.exception.DatabaseException: ERROR: relation "hibernate_sequence" already exists [Failed SQL: CREATE SEQUENCE public.hibernate_sequence MINVALUE 1]: Could not create the DataSource: Migration failed for change set migration/common.changelog-init.xml::1511451595465-1.3::R3.Corda:
Reason: liquibase.exception.DatabaseException: ERROR: relation "hibernate_sequence" already exists [Failed SQL: CREATE SEQUENCE public.hibernate_sequence MINVALUE 1] [errorCode=euq4co, moreInformationAt=https://errors.corda.net/OS/5.0-SNAPSHOT/euq4co]
This is a bug documented here: https://r3-cev.atlassian.net/browse/CORDA-2393.
Indeed sequenceExists precondition solved the issue. The fix is pushed to Corda master in 57d0040.

Trying to Connect Vertica DB with Weblogic 10.3

Working on Linux Redhat
I have two below jars
1>vertica-jdbc-5.1.1.jar
2>vertica-jdk5-6.1.1-0.jar
Steps that i followed:
1 copied the jars to $WL_HOME/server/lib
2 I set the path of the jars to Linux Path like below
export WL_HOME=/usr/local/WL_Server10.3/sever
PATH= ${WL_HOME}/lib:${PATH}
3 I modified ${WL_HOME}/common/bin/commEnv.sh
Added my jars entry like below
# set up WebLogic Server's class path
WEBLOGIC_CLASSPATH="${JAVA_HOME}/lib/tools.
jar${CLASSPATHSEP}${WL_HOME}/server/lib/weblogic_sp.
jar${CLASSPATHSEP}${WL_HOME}/server/lib/weblogic.
jar${CLASSPATHSEP}${FEATURES_DIR}/weblogic.server.modules_13.1.1.0.
jar${CLASSPATHSEP}${WL_HOME}/server/lib/webservices.
jar${CLASSPATHSEP}${ANT_HOME}/lib/ant-all.
jar${CLASSPATHSEP}${ANT_CONTRIB}/lib/ant-contrib.jar
${CLASSPATHSEP}${WL_HOME}/server/lib/vertica-jdbc-5.1.1.jar
${CLASSPATHSEP}${WL_HOME}/server/lib/vertica-jdk5-6.1.1-0.jar"
export WEBLOGIC_CLASSPATH
//I also tried the below steps googling,................. Optional Step
4> Modified ${WL_HOME}/server/lib/jdbcdrivers.xml
Added required parameter
i didnt get what to fill in the URLClassPathName value so i ignored it.
5>I restarted the Weblogic server and logged into the admin console
6> I added new JDBC Data Source
While Testing the Connection i am getting below Error:
Message icon - Error An error occurred during activation of changes, please see the log for details.
Message icon - Error weblogic.application.ModuleException:
Message icon - Error weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: [Vertica][JDBC](10100) Connection Refused: (11640) Required Connection Key(s): user; (11480) Optional Connection Key(s): autocommit, connsettings, directbatchinsert, logintimeout, loglevel, lognamespace, logpath, readonly, resultbuffersize, sessionlabel, ssl, threepartnaming, transactionisolation
It would be great if someone can help me with the steps to connect Vertica Database to the Weblogic 10.3
What connection settings are you providing in:
"6> Added new JDBC Data Source
7>Followed the steps"
The error says you're missing specificying a user:
[Vertica][JDBC](10100) Connection Refused:
(11640) Required Connection Key(s): user;
(11480) Optional Connection Key(s): autocommit, connsettings, directbatchinsert, logintimeout, loglevel, lognamespace, logpath, readonly, resultbuffersize, sessionlabel, ssl, threepartnaming, transactionisolation

Resources