cancel
Showing results for 
Search instead for 
Did you mean: 

Hybris 18.08 - MySQL db error for B2C installation

Former Member
0 Kudos

Hybris 18.08

I'm trying Hybris B2C Installation with MySQL 5.7.25 as db, but no luck so far. Getting db related error. It works fine with default HSQL.

local.properties

 db.url=jdbc:mysql://localhost/dbnew?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC  
 db.driver=com.mysql.cj.jdbc.Driver 
 db.username=hybris
 db.password=hybris
   mysql.allow.fractional.seconds=true
 # other *mandatory* settings
 db.customsessionsql=SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
 mysql.optional.tabledefs=CHARSET=utf8 COLLATE=utf8_bin
 mysql.tabletype=InnoDB

User 'Hybris' got full privileges.

Tried,

1) Installing receipe - /installer/ ./install.sh -r b2c_acc_plus

2) ant modulegen -Dinput.module=accelerator -Dinput.name=training4 -Dinput.package=com.hybris.training4 -Dinput.template=develop

3) removed unnecessary extensions and added the below extensions,

training4fulfilmentprocess

training4cockpits

training4core

training4facades

training4test

training4initialdata

training4storefront

4) 'ant clean all' was success

5) But 'ant intialize' fails with error,

... [java] ERROR [ImpExWorker<9/16>] [Registry] line 16 at main script: cannot activate tenant <> since its database connection is currently lost

... [java] ERROR [ImpExWorker<9/16>] [ConnectionImpl] error resetting isolation level [java] de.hybris.platform.jdbcwrapper.interceptor.recover.RecoveryInProgressException: Recovery in progress. Please try again later. [java] at de.hybris.platform.jdbcwrapper.interceptor.recover.SQLRecoverableExceptionHandler.get(SQLRecoverableExceptionHandler.java:67) ~[coreserver.jar:?] [java] at de.hybris.platform.jdbcwrapper.interceptor.JDBCInterceptor.get(JDBCInterceptor.java:69) ~[coreserver.jar:?] [java] at de.hybris.platform.jdbcwrapper.interceptor.ConnectionWithJDBCInterceptor.getTransactionIsolation(ConnectionWithJDBCInterceptor.java:147) ~[coreserver.jar:?]

... [java] WARN [main] (00000006-ImpEx-Import) [SQLErrorCodesFactory] Error while extracting database name - falling back to empty error codes [java] org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is de.hybris.platform.jdbcwrapper.interceptor.recover.RecoveryInProgressException: Recovery in progress. Please try again later. [java] at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:338) ~[spring-jdbc-4.3.17.RELEASE.jar:4.3.17.RELEASE] [java] at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:365) ~[spring-jdbc-4.3.17.RELEASE.jar:4.3.17.RELEASE] [java] at org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:212) [spring-jdbc-4.3.17.RELEASE.jar:4.3.17.RELEASE] [java] at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:134) [spring-jdbc-4.3.17.RELEASE.jar:4.3.17.RELEASE]

... [java] at de.hybris.bootstrap.loader.Loader.main(Loader.java:118) [ybootstrap.jar:?] [java] Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is de.hybris.platform.jdbcwrapper.interceptor.recover.RecoveryInProgressException: Recovery in progress. Please try again later. [java] at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) ~[spring-jdbc-4.3.17.RELEASE.jar:4.3.17.RELEASE] [java] at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:325) ~[spring-jdbc-4.3.17.RELEASE.jar:4.3.17.RELEASE] [java] ... 67 more [java] Caused by: de.hybris.platform.jdbcwrapper.interceptor.recover.RecoveryInProgressException: Recovery in progress. Please try again later.

... [java] ERROR [main] [FlexibleSearch] Flexible search error occured... [java] ERROR [main] [CommerceServicesSystemSetup] Importing [/commerceservices/import/constraints.impex]... FAILED [java] de.hybris.platform.servicelayer.exceptions.ModelSavingException: [de.hybris.platform.servicelayer.interceptor.impl.UniqueAttributesInterceptor@4d54d507]: unexpected validator error: SQL search error - Recovery in progress. Please try again later. query = 'null', values = [PropertyValue:8796093088345, 00000003, 8796100591698, 8796100165714, 8796100427858, 8796099870802, 8796100722770, 8796099608658, 8796100034642, 8796100526162, 8796099936338, 8796099969106, 8796100198482, 8796100362322, 8796100329554, 8796099641426, 8796099739730, 8796100100178, 8796100132946, 8796100558930, 8796100395090, 8796099674194, 8796099706962, 8796099805266, 8796099838034, 8796093513810, PropertyValue:8796093088345, 00000003, 8796100296786] [java] at de.hybris.platform.servicelayer.internal.model.impl.wrapper.ModelWrapper.invokeValidateInterceptors(ModelWrapper.java:315) ~[coreserver.jar:?] [java] at de.hybris.platform.servicelayer.internal.model.impl.wrapper.ModelWrapper.validate(ModelWrapper.java:239) ~[coreserver.jar:?]

... [java] INFO [main] [TypeLocalization] 8 threads will be used to localize type system. [java] ERROR [main] [AbstractAntPerformable] Error occurred while perfort task [java] java.lang.IllegalStateException: Given master data source DataSourceImpl<> seemed to be invalid (cannot connnect = true ), (pool closed = false) [java] at de.hybris.platform.core.system.impl.DefaultInitLockDao.assertDataSourceValid(DefaultInitLockDao.java:91) ~[coreserver.jar:?] [java] at de.hybris.platform.core.system.impl.DefaultInitLockDao.getInitializedMasterDataSource(DefaultInitLockDao.java:80) ~[coreserver.jar:?] [java] at de.hybris.platform.core.system.impl.DefaultInitLockDao.readLockInfo(DefaultInitLockDao.java:112) ~[coreserver.jar:?]

... [java] Exception in thread "main" java.lang.reflect.InvocationTargetException [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java] at java.lang.reflect.Method.invoke(Method.java:498) [java] at de.hybris.bootstrap.loader.Loader.execute(Loader.java:142) [java] at de.hybris.bootstrap.loader.Loader.main(Loader.java:118) [java] Caused by: Sourced file: inline evaluation of: ``try
{ de.hybris.ant.taskdefs.AntPerformable p = new de.hybris.a . . . '' : Method Invocation p.doPerform : at Line: 4 : in file: inline evaluation of: ``try
{ de.hybris.ant.taskdefs.AntPerformable p = new de.hybris.a . . . '' : p .doPerform ( ) [java] [java] Target exception: java.lang.IllegalStateException: Given master data source DataSourceImpl<> seemed to be invalid (cannot connnect = true ), (pool closed = false) [java] [java] at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:97) [java] at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102) [java] at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47) [java] at bsh.BSHBlock.evalBlock(BSHBlock.java:130) [java] at bsh.BSHBlock.eval(BSHBlock.java:80) [java] at bsh.BSHBlock.eval(BSHBlock.java:46) [java] at bsh.BSHTryStatement.eval(BSHTryStatement.java:86) [java] at bsh.Interpreter.eval(Interpreter.java:645) [java] at bsh.Interpreter.eval(Interpreter.java:739) [java] at bsh.Interpreter.eval(Interpreter.java:728) [java] at de.hybris.platform.util.ClientExecuter.execute(ClientExecuter.java:49) [java] ... 6 more [java] shutting down hybris registry..

0 Kudos

Does it work properly if you remove the db.customsessionsql property from local.properties?

Former Member
0 Kudos

I didn't try that so far, please see my other comment.

0 Kudos

Yep, I would first try with the 5.x version of the connector, as I pointed in my other comment. Cheers.

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member620692
Active Contributor

The following database configuration has worked for me and hopefully, it should work for you too:

 db.driver=com.mysql.jdbc.Driver
 db.username=hybris
 db.password=hybris
 #Database name is dbnew
 db.url=jdbc:mysql://localhost/dbnew
 db.customsessionsql=SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
 mysql.optional.tabledefs=CHARSET=utf8 COLLATE=utf8_bin
 mysql.tabletype=InnoDB
 mysql.allow.fractional.seconds=true
 db.tableprefix=
 #Added the following to solve connection lost problem
 db.pool.maxActive=10000

As per the Hybris documentation, your database driver should be mysql-connector-java-5.x-bin.jar. However, I used mysql-connector-java-8.0.13.jar with the configuration mentioned above and it worked perfectly.

Please change the database name, username and password, and try this tested configuration without changing/adding anything else. Please note that when I tried adding some parameters (e.g. one or more of useConfigs=maxPerformance, nullCatalogMeansCurrent=true, characterEncoding=utf8) in the value for db.url, it failed with one or the other error(s) and I could not dig deeper in lack of time.

If it still doesn't work, please try after downgrading the database driver (to mysql-connector-java-5.x-bin.jar).

You can follow https://blogs.sap.com/2017/12/15/mysql-database-connection-to-hybris/ in order to set up your database.

Former Member
0 Kudos

'dbnew' is the second schema I created for this task, for whatever reason I couldn't use this. I deleted this and kept only the first schema 'db1' and could use this with no issues. The connector I used is, mysql-connector-java-8.0.12 .

100541809267
Explorer
0 Kudos

Hi SyAu,
I got similar issue while using the mysql-connector-java-8.0.12 version with MySQL 5.7. I remember changing the connector to 5.1 worked for me at that time. Can you also check at your end if the same works for you too?
- Thanks.

Former Member
0 Kudos

Sure. I will check and advise.

Former Member
0 Kudos

I even tried with creating a new instance, installed receipe again, ant modulegen, commented out yacclerator related extensions, added the ones for the new extensions and again no luck.

former_member620692
Active Contributor
0 Kudos

Any update on this, please? If this answer worked for you, you can click the Accept link below the answer to make it more referenceable.

Former Member
0 Kudos

I followed the link you provided, still no luck. If I have only one connection and db, hybris connects, probably my mysql installation could have been corrupted in my mac. Anyway, my team decided to use mssql on docker. Thanks for your time.

former_member620692
Active Contributor
0 Kudos

You are most welcome.

0 Kudos

Hi,

I running MySQL on MacOS. While running to ant initialize command, I got this error too.

Given master data source DataSourceImpl<<master/master>> seemed to be invalid (cannot connnect = true ), (pool closed = false)

Please be sure that MySQL is not stopped. It solved my problem with starting again.

former_member560975
Participant
0 Kudos

Are you running MySQL on MacOS?

Former Member
0 Kudos

Yes (macOS High Sierra)

0 Kudos

Also, I note that you are using com.mysql.cj.jdbc.Driver which if I am not wrong is "Connector/J 8.0". I have had really bad experiences when trying to connect this driver to 5.x releases of the server.

My fix always was getting the JDBC driver back to a release that matches that of the server.