Wednesday, July 29, 2015

The archive: xxx hibernate3-3.2.3.GA.jar which is referenced by the classpath, does not exist.

This is recent error came with running a maven project in the eclipse.
I just copied one of the mkyoung test projects on AOP declarative transaction and it gave me the error when trying to run the main method.

error
=================================================

The archive: C:/Users/xxxFolder/.m2/repository/hibernate/hibernate3/3.2.3.GA/hibernate3-3.2.3.GA.jar which is referenced by the classpath, does not exist.

=================================================

Initially pom.xml was refeerenced with

<dependency>
<groupId>hibernate</groupId>
<artifactId>hibernate3</artifactId>
<version>3.2.3.GA</version>
</dependency>


where as this could not found i changed to

                <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.3.ga</version>
</dependency>

And the above issue comes as i did not create dependency file and when i import the project to the eclipse , it still use old dependency file.

So it better to build the dependency file again.

Solution
----------

Just delete ".classpath"  file and ".project" file from the folder and create again by running commad

mvn clean eclipse:eclispe

This will create brand new  ".classpath"  file and ".project" file and issue will be sorted.

Reference project :
http://www.mkyong.com/spring/spring-aop-transaction-management-in-hibernate/


Thursday, July 23, 2015

Find java home set or not

This is to tell you how to find whether you have set the JAVA_HOME

just take the command prompt.

and execute the command

 echo "%JAVA_HOME%"

you will get the output as path for JAVA_HOME

"C:\Program Files\Java\jdk1.7.0_13"

so output in the command line will be as below

===================================================


C:\Users\aprasad> echo "%JAVA_HOME%"
"C:\Program Files\Java\jdk1.7.0_13"


===================================================