We are trying to upgrade our project through build.gradle dependencies :
spring-boot from version 1.5.7 to 2.3.3
Gradle from version Gradle-4.8-all to Gradle-6.4.1-all
We are getting the following error:
Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException:
Migration V3__Sequence_Table.sql failed
---------------------------------------
SQL State : 42001
Error Code : 42001
Message : Syntax error in SQL statement "DELIMITER[*]
The JDBC connection URL was mentioned as below earlier.
o.f.c.internal.database.DatabaseFactory : Database: jdbc:mysql://xxxxx:3306/mydb (MySQL 5.7)
This has been changed as below now,
o.f.c.internal.database.DatabaseFactory : Database: jdbc:h2:mem:testdb (H2 1.4)
Is this the cause of the above flyway migration error?
problem:
Run command for jar file is a problem for this project `
Dspring.config.location=run.properties
this commad execute only run.properties
solution:
Instead of the above run command, you should try this run command for the jar file
Dspring.config.additional-location=run.properties
I was try for my project and this was working well
Related
I have installed Hive and mysql successfully, i did the configuration for Hive as suggested in link. But i see an error as below:
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
..
..
Caused by: org.datanucleus.exceptions.NucleusException: Attempt to invoke the "BONECP" plugin to create a ConnectionPool gave an error : The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH. Please check your CLASSPATH specification, and the name of the driver.
so i added the mysql-connector-java.jar in lib of Hive. Now hive just hangs, i dont get the shell at all.
Kindly suggest how i can resolve it
You need to add mysql connector to the classpath in the hive. It is looking for that connector in your classpath and its not able to find it. Download mysql connector and put it to the following path
/usr/lib/hive/apache-hive-0.13.0-bin/lib
I'm trying to configure NHibernate to use a MySql database.
I use the following code:
_sessionFactory = Fluently.Configure().Database(
MySQLConfiguration.Standard.ConnectionString(
cs => cs.Server("localhost").Database("Schedule").Username("root").Password("root"))
).Mappings(m => m.FluentMappings.AddFromAssemblyOf<NHibernateHelper>()).BuildSessionFactory();
and I have the following exception :
how to solve?
MySql ADO.NET driver dll is not in the directory of your program and also not installed. copy MySql.Data.dll into you program dir.
I am getting this problem after running any program in netbeans7.2
my java path are as follows
C:\Program Files\Java\jdk1.6.0_23\bin
my netbeans install in C:\Program Files\NetBeans 7.2 Beta
The following error occurred while executing this line:
jar:file:/C:/Program%20Files/NetBeans%207.2%20Beta/java/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Problem: failed to create task or type componentdef
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
I am getting the below error when i am trying to connect to my database.
Exception in thread "main" java.lang.NoClassDefFoundError: java.util.concurrent.ConcurrentHashMap
at com.mysql.jdbc.NonRegisteringDriver.<clinit>(NonRegisteringDriver.java:83)
at java.lang.Class.initializeClass(libgcj.so.7rh)
at java.lang.Class.initializeClass(libgcj.so.7rh)
at java.lang.Class.forName(libgcj.so.7rh)
at java.lang.Class.forName(libgcj.so.7rh)
at test.main(test.java:14)
Information :
Platform : RHEL 5
Java : jdk1.6.0_45
jdbc connector : mysql-connector-java-5.1.26-bin.jar
Sever: Tomcat 6
I have placed the jdbc connector inside usr/share/java/ Directory.
and my program to test the connection is placed in the root folder.
I have set the CLASSPATH to point to the connector using EXPORT command.
and I am using javac filename.java command to compile & java filename to run it.
A JDBC driver doesn't need to be installed or configured. You download the jar, add it to the runtime classpath of your application, and you're done:
java -cp someJar.jar:someDirectory:theMySQLJdbcDriver.jar com.foo.bar.Main
I have installed the old version of mysql connector which was compatible with RHEL5
and now its working fine.
Thanks !!
I'm having the hardest time getting Eclipse to connect and reverse engineer from a MySQL5 database. I can see Eclipse connecting to my MySQL database and can even see the tables through the "Data Source Explorer" view but when I try it after creating Hibernate Console and Configuration files, I get the error:
org.hibernate.console.HibernateConsoleRuntimeException:
Problems while loading database
driverclass (com.mysql.jdbc.Driver)
Problems while loading database
driverclass (com.mysql.jdbc.Driver)
java.lang.ClassNotFoundException:com.mysql.jdbc.Driver
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
From my simple java project, I start by creating a Hibernate Configuration File (cfg.xml).
Name of file: hibernate.cfg.xml
Session Factory name: org.hibernate.SessionFactory
Database Dialect: org.hibernate.dialect.MySQL5Dialect
Driver Class: com.mysql.jdbc.Driver
Connection Url: jdbc:mysql://localhost:3306/<myDatabaseName>
Default Schema: <myDatabaseName>
Username: correct username
Password: correct password
I also have selected the option to "Create a console Configuration"
At this point, I can see the new configuration listed in my "Hibernate Configuration" perspective/workbench pane. If I try to expand it, I get the earlier listed error.
I don't understand why I can see the database through the 'Data Source Explorer" and even though I'm using the DB connection profile listed in there as part of my configuration, I still get this error.
I also tried to create a new database profile using a manual mysql connector jar (mysql-connector-java-5.1.13-bin.jar) and same end result.
Versions of what I have:
Eclipse version: 3.6.0 aka Helios, Build 20100617 - 1415
MySQL: 5.1.34
Hibernate Tools (from JBoss): HibernateTools-3.3.1.v201006011046R-H111-GA
(placed into Eclipse's 'dropins' folder)
What am I doing wrong in my hibernate configuration setup?
Help!
Your Hibernate Console Configuration doesn't have the MySQL JDBC driver on its classpath, hence the java.lang.ClassNotFoundException:com.mysql.jdbc.Driver. From the reference guide of the Hibernate Tools:
3.4. Creating a Hibernate Console Configuration
...
alt text http://docs.jboss.org/tools/2.1.0.Beta1/hibernatetools/html_single/images/plugins/plugins_3.png
...
Classpath: The classpath for loading POJO and JDBC drivers; only needed if
the default classpath of the Project
does not contain the required classes.
Do not add Hibernate core libraries or
dependencies, they are already
included. If you get ClassNotFound
errors then check this list for
possible missing or redundant
directories/jars.
Include default classpath from project: When enabled the project
classpath will be appended to the
classpath specified above
Does the "associated project" have the MySQL JDBC driver declared as library? If not, then you must add it (either as a project library or in the above tab).