Jhipster / Oracle connectivity steps ? dev database? - oracle

I tried many ways to generate Jhipster app with oracle as DEV_DATABASE_TYPE.
still not succeed and i can't find the steps to follow.
Tested with Jhipster 11g2 and 12c2, non of it worked.
Steps i followed :
Generate and app using JDL fil : app.jdl
application {
config {
applicationType monolith,
baseName jhipsterSampleApplication,
packageName io.company.crud,
authenticationType jwt,
databaseType sql,
prodDatabaseType oracle,
devDatabaseType oracle,
buildTool maven,
searchEngine false,
testFrameworks [gatling, protractor],
clientFramework angularX,
clientTheme Litera,
clientThemeVariant Light,
enableTranslation true,
nativeLanguage en,
languages [ en, fr ]
}
entities *
}
Then i update these files : application-dev.yml and pom.xml
spring:
profiles: dev
datasource:
driverClassName: oracle.jdbc.OracleDriver
dataSourceClassName: oracle.jdbc.pool.OracleDataSource
url: jdbc:oracle:thin:#localhost:1521:orcl
username: rest_test
password: rest_test
jpa:
database-platform: org.hibernate.dialect.Oracle10gDialect
database: ORACLE
openInView: false
show_sql: true
generate-ddl: false
hibernate:
ddl-auto: none
naming-strategy: org.hibernate.cfg.EJB3NamingStrategy
properties:
hibernate.cache.use_second_level_cache: true
hibernate.cache.use_query_cache: false
hibernate.generate_statistics: false
hibernate.cache.region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
I tried to delete this line from app.jdl :
prodDatabaseType oracle,
and i got an error saying : Only 'h2Memory', 'h2Disk', 'mysql' are allowed as devDatabaseType
Does anyone have a clear process to follow, in order to generate an app with Oracle DB ?
Thank you

This question was resolved here : stackoverflow.com/questions/60640151/jhipster-and-oracle-11gr2 thank you all

Related

In memory Derby Db, not loading initial scripts

using spring boot + with Derby depedency, and with below configuration. dont see scripts getting loaded
datasource:
url: jdbc:derby:memory:testdb;create=true
driverClassName: org.apache.derby.jdbc.EmbeddedDriver
username: app
#password:
generate-unique-name: false
continue-on-error: false
#schema: sql/initial-schema.sql
initialization-mode: always
data: sql/initial-data.sql
#schema: classpath:initial-schema.sql
#data: classpath:initial-data.sql
jpa:
defer-datasource-initialization: true
database-platform: org.hibernate.dialect.DerbyTenSevenDialect
generate-ddl: true
database: default
show-sql: true
hibernate:
naming:
strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
ddl-auto: **update**

jHipster H2 console not working

I am working on monolithic application in which there are some custom entities . When I access the H2 Console via Administration tab . It causes the app to restart when I click the connect button . I am not able to understand why this is happening . Can anyone help me to figure it out .
In logs :
DEBUG 971 --- [ Thread-51] com.mydomain.mytable1 : close successful.
DEBUG 971 --- [ Thread-51] com.mydomain.mytable2 : close successful.
DEBUG 971 --- [ Thread-51] com.mydomain.mytable3 : close successful.
.
.
This is causing an issue to access the database via console although , there is no issue while accessing API . Executing queries also result in localhost refused to connect . I am new to jHipster and H2.
Configuration :
spring:
profiles:
active: dev
include: swagger
devtools:
restart:
enabled: true
livereload:
enabled: false # we use gulp + BrowserSync for livereload
jackson:
serialization.indent_output: true
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:h2:file:./target/h2db/db/mydatabase;DB_CLOSE_DELAY=-1
username: frothers
password:
h2:
console:
enabled: false
jpa:
database-platform: io.github.jhipster.domain.util.FixedH2Dialect
database: H2
show-sql: true
properties:
hibernate.id.new_generator_mappings: true
hibernate.cache.use_second_level_cache: true
hibernate.cache.use_query_cache: false
hibernate.generate_statistics: true
hibernate.cache.region.factory_class: io.github.jhipster.config.jcache.NoDefaultJCacheRegionFactory
Why disabling the h2 console if you want to access it?
h2:
console:
enabled: false
Just turn enabled to true.

H2 Database Run Script First before Creating the Schema

I am trying to use the in-memory database H2 for some testing, In my case I am trying to Create the Schema and load the Schema with some data.
The problem that I am having is when I run a test it tries to run the script first without creating the schema and I get the errror table does not exists.
application-test.yml file
spring:
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:test;MODE=MySQL;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS sample\;runscript from '~/LoadData.sql'
jpa:
hibernate:
ddl-auto: create-drop
properties:
hibernate:
default_schema: sample
application.yml
server:
port: 0
spring:
application:
name: services
devtools:
livereload:
enabled: false
jpa:
show-sql: true
properties:
hibernate:
dialect: org.hibernate.dialect.MySQLDialect
default_schema: ${APP_DATASOURCE_SCHEMA}
temp:
use_jdbc_metadata_defaults: false
hibernate:
naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
jackson:
serialization:
indent-output: true
logging:
level:
com.application: DEBUG
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8761/eureka/
instance:
leaseRenewalIntervalInSeconds: 3
leaseExpirationDurationInSeconds: 4
sample:
application:
portrange:
min: 8090
max: 8099
sendemail: false
ldap:
contextSource:
url: ${LDAP_URL}
base: ${LDAP_BASE}
userDn: ${LDAP_USER_DN}
password: ${LDAP_PASSWORD}

Cannot Connect Spring Boot Application to IBM Informix Database

I cannot connect my spring boot application to IBM Informix database. I have added the informix data source in application.yml file.
I am using spring 4.
I get the following error.
no writeable property 'url' in class com.informix.jdbcx.IfxXADataSource
spring.profiles.active: db_dummy
spring.mvc.view:
prefix: /WEB-INF/jsp/
suffix: .jsp
spring.messages.basename: static/resources/messages/pjMessageResource, static/resources/messages/pymacMessageResource, static/resources/messages/messageResource, static/resources/messages/base
spring.datasource:
url: jdbc:informix-sqli://x.x.x.x:9093/testdb:informixserver=myserver;
driverClassName: com.informix.jdbc.IfxDriver
username: informix
password: sss
xa:
dataSourceClassName: com.informix.jdbcx.IfxXADataSource
#----------------------------------------------------------
security.basic.enabled: false
spring.jackson.serialization.INDENT_OUTPUT: true
server.error.whitelabel.enabled: false
management:
context-path: /_mep
security.enabled: false
#security.role: SUPERUSER
multipart.maxFileSize: 10Mb
spring:
jpa:
openInView: true
show-sql: false
properties:
hibernate:
connection.charSet: UTF-8
format_sql: true
use_sql_comments: true
jdbc:
batch_size: 30
fetch_size: 100
jadira:
usertype:
autoRegisterUserTypes: true
javaZone: jvm
databaseZone: jvm
---
#----------------------------------------------------------------
# development
#----------------------------------------------------------------
spring.profiles: development
secondary.datasource:
url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
driverClassName: org.h2.Driver
username: sa
password:
xa:
dataSourceClassName: org.h2.jdbcx.JdbcDataSource
#----------------------------------------------------------
---
#----------------------------------------------------------------
# staging or production
#----------------------------------------------------------------
spring.profiles: staging,production
spring.jpa.database_platform: org.hibernate.dialect.InformixDialect
---
#----------------------------------------------------------------
# psql
#----------------------------------------------------------------
spring.profiles: informix
spring.datasource:
url: jdbc:informix-sqli://x.x.x.x:9093/aaa:informixserver=test;
driverClassName: com.informix.jdbc.IfxDriver
username: informix
password:
xa:
dataSourceClassName: com.informix.jdbcx.IfxXADataSource
---
#----------------------------------------------------------------
# h2
#----------------------------------------------------------------
spring.profiles: h2
spring.datasource:
url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
driverClassName: org.h2.Driver
username: sa
password:
xa:
dataSourceClassName: org.h2.jdbcx.JdbcDataSource
have you included the jars named 1)ifxjdbc & 2)ifxjdbcx jars.
in pom add Informix with releated versionID as dependencies.
<dependency>
<groupId>com.ibm.informix</groupId>
<artifactId>jdbc</artifactId>
<version>{versionID}</version>
</dependency>

JHipster test: NoCacheRegionFactoryAvailableException when second level cache is disabled

When I use jhipster generate an app, I disabled the second level cache. However, when I run either "gradle test" or "run as junit test" to test the app, it is failed because the "NoCacheRegionFactoryAvailableException". I have checked the application.yml in directory "src/test/resources/config", and be sure that the second cache is disabled. I do not know why the app is still looking for second-cache. Is there any clue how this happen? or how to disable second level cache completely?
Except the test failure, everything else works well, the app can run successfully.
application.yml in src/test/resources/config
spring:
application:
name: EMS
datasource:
url: jdbc:h2:mem:EMS;DB_CLOSE_DELAY=-1
name:
username:
password:
jpa:
database-platform: com.espion.ems.domain.util.FixedH2Dialect
database: H2
open-in-view: false
show_sql: true
hibernate:
ddl-auto: none
naming-strategy: org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy
properties:
hibernate.cache.use_second_level_cache: false
hibernate.cache.use_query_cache: false
hibernate.generate_statistics: true
hibernate.hbm2ddl.auto: validate
data:
elasticsearch:
cluster-name:
cluster-nodes:
properties:
path:
logs: target/elasticsearch/log
data: target/elasticsearch/data
mail:
host: localhost
mvc:
favicon:
enabled: false
thymeleaf:
mode: XHTML
liquibase:
contexts: test
security:
basic:
enabled: false
server:
port: 10344
address: localhost
jhipster:
async:
corePoolSize: 2
maxPoolSize: 50
queueCapacity: 10000
security:
rememberMe:
# security key (this key should be unique for your application, and kept secret)
key: jhfasdhflasdhfasdkfhasdjkf
metrics: # DropWizard Metrics configuration, used by MetricsConfiguration
jmx.enabled: true
swagger:
title: EMS API
description: EMS API documentation
version: 0.0.1
termsOfServiceUrl:
contactName:
contactUrl:
contactEmail:
license:
licenseUrl:
enabled: false
Move src/test/resources/config/application.yml to src/test/resources directory.
You can find that solution from https://github.com/jhipster/generator-jhipster/issues/3730

Resources