Foren

LR 7.0 GA2 Incorrect value & JDBC Batch update Exceptions

Julian Pfeil, geändert vor 7 Jahren.

LR 7.0 GA2 Incorrect value & JDBC Batch update Exceptions

Junior Member Beiträge: 72 Beitrittsdatum: 01.03.16 Neueste Beiträge
Hello,

i just "installed" a clean Liferay-7.0GA2-Tomcat-Bundle on my Debian 8.5 system.
During startup, while watching catalina.out-log i get a ton of exceptions concerning JDBC Batch updates and incorrect values in columns.

E.g.
09:27:49,919 ERROR [localhost-startStop-1][JDBCExceptionReporter:234] Incorrect string value: '\xC2\x80\xC2\x99re...' for column 'description' at row 1
09:27:49,925 ERROR [localhost-startStop-1][com_liferay_marketplace_service:97] [com.liferay.marketplace.lpkg.deployer.LPKGDeployerRegistrar(23)] The activate method has thrown an exception 
com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
	at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:33)
	at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:175) [...]


The full catalina.out-file is attached.

I can't get my head around what i did wrong, so any clues about what i'm doing wrong would be nice.

Kind Regards
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: LR 7.0 GA2 Incorrect value & JDBC Batch update Exceptions

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Was that started with a "untouched" Tomcat bundled downloaded from sourceforge?

Did you configure your Debian OS to use JDK 8?
Julian Pfeil, geändert vor 7 Jahren.

RE: LR 7.0 GA2 Incorrect value & JDBC Batch update Exceptions

Junior Member Beiträge: 72 Beitrittsdatum: 01.03.16 Neueste Beiträge
As you can see at the top of my catalina.out i have installed the Oracle JDK 1.8.091.

I did download the bundle through the link on the liferay-homepage (i guess it resolves to sourceforge).
Then i did create a portal-ext.properties file with the following contents (as in my 6.2-Version of Liferay on another server):


   redirect.url.security.mode=ip
   redirect.url.domains.allowed=
   redirect.url.ips.allowed=
	#127.0.0.1,SERVER_IP
  users.screen.name.allow.numeric=true
  users.screen.name.validator=com.liferay.portal.security.auth.LiberalScreenNameValidator
  users.reminder.queries.enabled=false
  users.reminder.queries.custom.question.enabled=false
  layout.user.public.layouts.enabled=false
  layout.user.private.layouts.enabled=false
  layout.user.public.layouts.power.user.required=true

velocity.engine.restricted.classes=
velocity.engine.restricted.variables=
freemarker.engine.restricted.classes=
freemarker.engine.restricted.variables=


Then i did create com.liferay.portal.store.file.system.configuration.FileSystemStoreConfiguration.cfg in [Liferay Home]/osgi/configs as described at https://dev.liferay.com/discover/deployment/-/knowledge_base/7-0/upgrading-to-liferay-7 to set my document library rootDir.

Also i copied the JDBC-Driver into my Bundle and did create a new mysql database for liferay.

After that i did start the bundle and finished the installation steps. As ordered by the installation i did restart liferay and voila, the errors appear.
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: LR 7.0 GA2 Incorrect value & JDBC Batch update Exceptions

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
I see this error may show some problem with your MySQL:

Wed Jun 29 09:26:39 GMT 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.


Can you check your MySQL configuration? For Liferay 7, MySQL 5.6 (at least) is needed.
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: LR 7.0 GA2 Incorrect value & JDBC Batch update Exceptions

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
BTW remember some parameters are need when using MySQL in jdbc URL:

jdbc:mysql://localhost/liferay?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
Julian Pfeil, geändert vor 7 Jahren.

RE: LR 7.0 GA2 Incorrect value & JDBC Batch update Exceptions

Junior Member Beiträge: 72 Beitrittsdatum: 01.03.16 Neueste Beiträge
I think, that there is no problem with my connection string (which i adjusted in the setup), because the setup does create the tables.
But to make sure i don't got parameters wrong, here is my jdbc-string:
jdbc:mysql://localhost/liferay?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true


And even though there is this JDBC-Batch-Error-Thing i can still login and use liferay portal. (That's why i don't think the SSL-Warning is a problem, because - as it says - it defaults back to not use SSL. So it is still working but without SSL)

I just want the error gone before it goes in production, because it is an error and will most likely interfere sooner or later.
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: LR 7.0 GA2 Incorrect value & JDBC Batch update Exceptions

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Hi Julian,

I would try to use a "clean" (with default config) MySQL.

Then I would just use the default jdbc URL Liferay uses.

After that, if it works, I would add those JDBC params you're using, so we could narrow what actually caused the problem.
Julian Pfeil, geändert vor 7 Jahren.

RE: LR 7.0 GA2 Incorrect value & JDBC Batch update Exceptions

Junior Member Beiträge: 72 Beitrittsdatum: 01.03.16 Neueste Beiträge
Hey,
  • I did purge mysql and it's configuration files from my debian system.
  • I did use a clean liferay bundle (no custom configurations).
  • Copied mysql-connector-java-5.1.39-bin.jar JDBC MYSQL driver to tomcat_home/lib/ext
  • Then i did install MYSQL 5.6 without chaning any configuration
  • I did create a database called 'lportal' (like in the default connection string) and a user called 'lportal'
  • In the setup-wizard i did select MYSQL Driver and changed only the DB username and password to lportal and the password. I left the connection string untouched
  • After the wizard told me to restart the portal, i did.
  • The ssl/ecryption warnings did disappear (I guess it is because i had mysql 5.7 before and now have mysql 5.6 installed)
  • The JDBC batch update error still appears.


Attached you find the "new" catalina.out -logfile
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: LR 7.0 GA2 Incorrect value & JDBC Batch update Exceptions

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Can you attach or copy-paste your portal-ext.properties and setup-wizard.properties? (removing any sensible data).

Thanks.
thumbnail
Arun Das, geändert vor 7 Jahren.

RE: LR 7.0 GA2 Incorrect value & JDBC Batch update Exceptions (Antwort)

Regular Member Beiträge: 166 Beitrittsdatum: 23.07.12 Neueste Beiträge
Hi,
This erros is because of your database collation.Your default collation might be 'latin' not 'utf8'. Please use the following to create database
CREATE DATABASE lportal DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;



Arun