What libraries does eclipse need in build path for Hibernate? - java

I'm learning Hibernate and am following an online tutorial on integrating it with Eclipse. I have installed the JBoss plugin with Hibernate into Eclipse Luna 4.4. and verified I have Hibernate available. The next step is to configure the build path for my new Java project and include the "necessary" Hibernate libraries...no information given on how to do that. How does one go about identifying the required jar files? I see several folders under my eclipse plugins directory that contain jboss or hibernate in the folder name, and underneath these folders do exist jar files, but I would think that there must be an easier way than plodding through all these directories and adding any jar file that looks like it's related to Hibernate or JBoss. Thanks.

Related

How to use Hibernate 5.2 with JPA 2 in Netbeans 8

I am using Windows 10 and Netbeans 8.2. I am able to use JPA 2 with Hibenate 4.3.x. Actually Netbeans 8.2 comes with Hibernate 4.3.x. Now i want to use Hibernate 5.2.x. I have downloaded Hibernate 5.2.12 as zip file from this link http://hibernate.org/orm/releases/5.2/. Then i have imported it into Netbeans. But i am getting the error :
javax.persistence.PersistenceException: No Persistence provider for EntityManager.
I know it is easy to use with maven.
Finally i have got the solution.
If the zip folder unzipped and all the jars inside the required folder imported, it will not work. One of the following errors or both may shown :
No Persistence provider for EntityManager named
Hibernate 5.2.2: No Persistence provider for EntityManager
To solve the above problems have to do the following task :
This line have to add in the persistence.xml file :
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
And have to download classmate-0.8.0.jar, and have to add it in the class path. This jar can be downloaded from Here
Then have to download the hibernate-entitymanager-5.0.12.Final.jar file and Have to add it in the class path. The jar can be downloaded from Here
In the Netbeans there is a default library called Hibernate 4.3.x(JPA 2.1).If you want to change this library, you have to find the installation folder of Neatbeans and the folder where hibernate has kept.
In windows it may found in :
C:\Program Files\NetBeans 8.2\java\modules\ext\hibernate4
For Linux it may be found in :
/usr/local/netbeans-8.2/java/modules/ext/hibernate4/
Then paste the jars from required folder (It will be found in downloaded Hibernate folder) and other jars mentioned above. You may find some jars duplicate. Then you may notice that some jars of hibernate almost with the same name but difference in version. Then delete the jars which has older version name.
one of your dependency file is Zip file . Extract it and the add the Jar instead

Unable to locate Spring framework's 4.0.6 jar files?

I'm completely new in Spring and followed this tutorial http://tutorialspoint.com/spring
and this video too http://www.youtube.com/watch?v=ZwMwfGNrRtE
And according to this i downloaded spring-framework-4.0.6.RELEASE-dist.zip from here
I did extracted those zip files,
Now i'm unable to locate jars files into folder, But www.tutorialspoint.com/spring says It contains this pic.
But into my folder(which i downloaded spring framework), I can't locate these library please help!!
I did search all jar files in that folder but i could find only this pic
and not being able to find these jar files:
antlr-runtime-3.0.1
org.springframework.aop-3.1.0.M2
org.springframework.asm-3.1.0.M2
org.springframework.aspects-3.1.0.M2
org.springframework.beans-3.1.0.M2
org.springframework.context.support-3.1.0.M2
org.springframework.context-3.1.0.M2
org.springframework.core-3.1.0.M2
org.springframework.expression-3.1.0.M2
commons-logging-1.1.1
Well surprisingly, the dist for release 4.0.6 does not contain the jars for 3.1.0.M2 ! More seriously, under lib dir on related zip file, you will find all the jars for spring 4.0.6.
But you must have a minimal knowledge on your build environment be it maven, eclipse, Netbeans + ant, Netbeans + maven, ...
And do not forget the documentation for spring that explains what external jars are required for some operations. Notably commons-logging-1.1.1 even if the manual explains how to use other loggin utilities.
You may want to consider using Maven, as opposed to manually downloading jar files and referring to them explicitly.
With Maven, you'd declare a dependency on the spring framework (including specific version) and you'd have all of the dependencies downloaded to a local repository, including transitory dependencies (you'd only need to specify the framework itself, for example, although in your case you'd probably need to include security and/or mvc.)

Replacing jar when upgrade the hibernate from 3.6.5 to 4.3.5

Right now, My project framework is Hibernate 3.6.5 now want to upgrade it to the latest one Hibernate 4.3.5.
There are some dependencies in between the .jar files.
My question is :
What all are the .jar files need to be change/replace at the time of upgrade ?
Recently I have the following .jar files for the Hibernate 3.6.5.
Here is the recent required .jars for the Hibernate 4.3.5.
Which .jar files are need to be replace ?
Thanks.
Download the latest version of Hibernate from the following Site http://hibernate.org/.
After downloading unzip the Downloaded Zip file. Now you can see mainly three folders like documentation, lib, project.
Open lib folder, now you can see following folders envers, jpa, optional, osgi, required.
Add all jar files (under required folder) to the classpath and also add one more jar file (under jpa).
===============================================
Assume you are downloaded Hibernate Software following location.
Hibernate_HOME = /home/rangareddy/Hibernate/hibernate-release-4.2.7.Final
Jar files:
%Hibernate_HOME%/lib/required/antlr-2.7.7.jar
%Hibernate_HOME%/lib/required/dom4j-1.6.1.jar
%Hibernate_HOME%/lib/required/hibernate-commons-annotations-4.0.2.Final.jar
%Hibernate_HOME%/lib/required/hibernate-core-4.2.7.Final.jar
%Hibernate_HOME%/lib/required/hibernate-jpa-2.0-api-1.0.1.Final.jar
%Hibernate_HOME%/lib/required/javassist-3.18.1-GA.jar
%Hibernate_HOME%/lib/required/jboss-logging-3.1.0.GA.jar
%Hibernate_HOME%/lib/required/jboss-transaction-api_1.1_spec-1.0.1.Final.jar
%Hibernate_HOME%/lib/jpa/hibernate-entitymanager-4.2.7.Final.jar

Why can't I step through library code when debugging a web project in Netbeans?

I have a Spring MVC web application where the majority of the code I am interested in sits in two Maven projects - one being the war project and another being a jar project on which the war depends. They also share the same parent pom though that is probably irrelevant for this question.
When I try to debug my web project I can't step into any of the code from the jar. I've checked Windows->Debugging->Sources and the jar project's source directory is present there. Both projects are open. Does Netbeans 7.0 not support stepping through a web project's dependencies?
In your library manager screen, in your sources tab, have you provided the location of the source folder.http://wiki.netbeans.org/AttachSourceToLibrary.
When you are stepping in to class files ( that netbeans could not find source far), there usually is a prompt from Netbeans asking if you want to associate a src with this corresponding file. Either way, I have managed to step into dependent projects using Netbeans.

Generate Websphere 6.1 compatible EAR file using Maven

I've been looking around for some time and couldn't find a clear explanation for this.
We're using a Websphere server to run a Web application developed using Rational Software Architect 7. This application is composed of a war project and 4 jar projects. To make the final ear file there is a sixth project which contains the additional files needed by IBM to deploy it.
Currently we have to use RSA to genereate the ear file. I would like to use Maven to do that.
Apparently previous tries to use maven-ear plugin generated corrupted ears. It would appear thet they are missing the extra xml files needed by IBM.
I found a maven was-6 plugin, but it doesn't seem able to generate the file, only to install it on websphere. I couldn't find a clear description of what it does.
Does someone have any advice ? A link to some article ?
Thank you very much !
Use the maven-ear-plugin to generate your ear, but include the extra ibm specific config files as part of the earSourceDirectory property of that plugin.
The plugin will generate the generic application.xml file and the ibm specific file ibm-application-bnd.xmi and the contents of the ibmconfig directory can be rolled in by the plugin as well, just not generated.

Categories

Resources