Can anyone suggest which version of Hibernate and MySQL connector I should be using to run a Hibernate application?
I am using MySQL 5.5 and Eclipse Mars
Usually you would use a build manager in order to simplify your project setup, like Maven. And if you do, you then would go to a Maven repository and check all available versions and you would choose the version you need, for example:
Maven MySQL connector repository
Hibernate Maven repository
If you do so, Maven will take care downloading all the necessary dependencies that you will specify in pom.xml
Even if you don't want to use Maven, you can check Maven repositories to verify all available versions, you would download them and try for yourself if those versions suit your desired setup and needs.
Related
I'm a macOS user and my editor is intelli j.
And I want to install Mysql connector "NET" but, I can't even install...
How can I use Mysql connector NET in intelli j???
(or should I use it in only VS code??)
The MySQL Connector/NET is for Microsoft C#/.NET, not for Java, so you cannot install MySQL Connector/NET and use it from IntelliJ. You need to use MySQL Connector/J, and you don't 'install' it. If you want to use it from within IntelliJ itself, you don't need to install anything, IntelliJ has it included (or will download it when needed).
If you want to use it from a program you write in IntelliJ, you will need to add a dependency to your pom.xml (Maven), or build.gradle (Gradle), or manually add a library to your project (if you're not using a build tool), see How to add external library in IntelliJ IDEA?.
How to exclude the org.json version in MULE 3.9.0 buildpath?
The version is json-20140107 I want to use the latest json version. I tried to exclude in mule-commons but it did not do any help.
The json-20140107.jar library is distributed with Mule 3.9.0. Because of how Mule implements classloading, at execution time classes loaded from that jar file will override a newer version in your application. You must not change the version provided because Mule was tested. Changing any provided library in the distribution can cause unexpected errors.
You could pack a new version of the library and try to use Fine Grain Classloader Control however that seems to be an Enterprise Edition feature not available in the community edition. If you have the Enterprise Edition it is highly recommended to use the last patch version (currently 3.9.4) instead of 3.9.0.
Another solution could be to migrate to Mule 4.x, which uses classloading isolation to avoid this kind of issues. You can use any version of libraries inside applications without conflicting with the provided libraries in the runtime. Again, using the last version available is the recommended way to go. Mule 3 applications are not compatible with Mule 4, so you will need to migrate existing applications.
I am using VS2013.5, I installed the MySql for visual studio that is in the MySql Site. When I compiled my project, this warning appeared which, in the process, disabled me to use the MySqlClient methods and functions:
Warning 1 The primary reference "MySql.Data, Version=8.0.12.0,
Culture=neutral, PublicKeyToken=c5687fc88969c44d,
processorArchitecture=MSIL" could not be resolved because it was built
against the ".NETFramework,Version=v4.5.2" framework. This is a higher
version than the currently targeted framework
".NETFramework,Version=v4.5".
how can I resolve this? Is there a way to download and install the older mysql version?
You have to use and install an older MySQL connector or a newer .NET version. That is a common problem. Try to install the Version 6.X. Then it could work. If you have downloaded the MySQL integration for the Visual-Studio you have to install an older version. Not all versions are compatible and some new version have bugs and you can't open some windows. I had the same problem.
So you have to try some versions and combinations to find the correct one.
Well, if you are using .NET Framework v4.5 or v4.5.2, you better use MySQL Connector version 6.9.8. It'll work, mine did.
.NET Framework v4.5.2 work against MySql.Data, Version=8.0.12.0. So you have to use lower version of connector that is compatible with your .NET
Uninstall current connector (8.0.12.0), then from your Project > Reference tab, remove MySql.Data that has a version of 8.0.12.0. Install 6.9.8, then from Reference > Add > Search and CHECK MySql.data 6.9.8.
I'm trying to install OpenGTS on Red Hat's Openshift cloud platform.
OpenGTS is a Java/Tomcat7/Mysql/Ant application, so I created a JbossEWS app on Openshift, installed the standard Mysql cartridge, and an Ant cartridge I found online.
Our application does not have to be scalable, so that's what I chose.
I add a call to Ant in Openshift's build hook.
So far it has been impossible to install the jdbc driver however:
As I'm using Ant, I deleted the pom.xml for Openshift's standard Maven.
Neither is there a standalone.xml in JbossEWS. (There is one for JbossEAP).
Java's ext/lib directories are not accessible on Openshift.
So I copied the jdbc driver jar in $OPENSHIFT_DATA_DIR,
but nevertheless, when started, JbossEWS complains it cannot find a suitable jdbc driver for Mysql.
Is it even possible to run OpenGTS on Openshift?
It is comment about above question so we are following this link.
Here is the link https://blog.openshift.com/jndi-tomcat-configuration-howto/
And also catalina.properties file
common.loader=${catalina.base}/lib,${catalina.base}/lib/.jar,${catalina.home}/lib,${catalina.home}/lib/.jar,${catalina.home}/../app-root/data/*.jar
I got the following situation.
I'm using Apache Felix as OSGi Service implementation and Apache Karaf as OSGi container.
There is a bundle in karaf which should save some data via hibernate into a database, but I always get a SQLException: No Suitable Driver found.
I deployed the mysql-connector-bundle to karaf.
The problem is, in my mind, that hibernate whether imports the mysql-driver-packages nor my classes which should be mapped.
But I don't know hot to fix this. I'm familar to eclipse rcp where the buddy-policy fixes such problems, is there any best practice for this problem for felix and karaf?
What version of hibernate do you use? Only since Hibernate 4, hibernate is aware of OSGi classloaders, and it still doesn't have complete OSGi support. See e.g. https://hibernate.onjira.com/browse/HHH-7527, which is planned for Hibernate 4.2.
We used Gemini JPA with eclipselink instead as JPA provider in OSGi.
In the karaf eco-system, there is Aries JPA, which is primarly used with OpenJPA. See Which JPA providers are supported by Apache Aries Managed JPA?
Hibernate can't access do data and classes from other bundles (at least in version 3.x; I don't know about version 4). It only works easily if all (methods using hibernate, pojos, mapping files, all libraries) is in the same bundle. It can't access resources in other bundles.
Please also see my answer in this thread.