Skip to main content

Posts

Showing posts from 2015

Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:

Exception : org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeController': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type  [javax.persistence.EntityManagerFactory] is defined Solution : you are scanning wrong package for controller class change your package declaration.

Maven dependencies Nature is not working in Eclipse

If you have enable the maven nature enables via eclipse and still  All maven dependencies are not loading and its not showing up in the libraries then. Add this entry in your classpath file of project . Just after JRE entry in your classpath file. 1. Ctrl+Shift+R to open up resource . 2. search .classpath 3 .add entry after JRE. <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>

Exception java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter

Exception: Caused by: java. lang . NoClassDefFoundError : net/sf/cglib/proxy/CallbackFilter at org. springframework . beans . factory . support . CglibSubclassingInstantiationStrategy . instantiateWithMethodInjection (CglibSubclassingInstantiationStrategy. java : 71 ) at org. springframework . beans . factory . support . SimpleInstantiationStrategy . instantiate (SimpleInstantiationStrategy. java : 75 ) at org. springframework . beans . factory . support . AbstractAutowireCapableBeanFactory . instantiateBean (AbstractAutowireCapableBeanFactory. java : 948 ) ... 13 more Caused by: java. lang . ClassNotFoundException : net. sf . cglib . proxy . CallbackFilter at java. net . URLClassLoader $1. run (Unknown Source) at java. net . URLClassLoader $1. run (Unknown Source) at java. security . AccessController . doPrivileged (Native Method) at java. net . URLClassLoader . findClass (Unknown Source) at java. lang . ClassLoader . loadClass (Unknown Source) at sun. misc . Launch...

Exception at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass)

You might end up with this exception while doing your one to one ,or many to one relationship in hibernate. Exception: Exception in thread "main" java. lang . NullPointerException at org. hibernate . cfg . OneToOneSecondPass . doSecondPass (OneToOneSecondPass. java : 135 ) at org. hibernate . cfg . Configuration . secondPassCompile (Configuration. java : 1127 ) at org. hibernate . cfg . AnnotationConfiguration . secondPassCompile (AnnotationConfiguration. java : 296 ) at org. hibernate . cfg . Configuration . buildSessionFactory (Configuration. java : 1283 ) at com. javatpoint . Test . main (Test. java : 13 ) To fix correct this exception Check following : 1. Your one to one mapping bean is pointing to correct column. 2. You have configured both table correctly. Once you have correct these your exception will go away.

Maven - Pom.xml Issues.

Maven -- > pom.xml error resolution Problem 1. Could not calculate build plan: Plugin org.apache.maven.plugins:maven-jar-plugin:2.3.2 or one of its dependencies could not be resolved. Soultion :-  1 . Just go to the path  C: \Users \< username> \. m2 \repository \org \apache \maven \plugins 2.  Delete the plugin which is causing the issue . 3. In Eclipse clean and build your project again 4. choose Maven->Update Dependencies. Problem 2 : Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): The operation was cancelled. Solution :-  Rightclick on your project in eclipse and choose Maven->Update Dependencies Choose Force update of snapshot release.

How to hot deploy your code on Remote Debugging.

Make sure you have check this. 1) If you run your application in eclipse using the launch configuration Is your "Project" - "Build Automatically" flag enabled? If not, the code is not compiled and ignored at runtime. Follow these steps to debug in Remote debug mode. Go to :- yourProject  --> Debug as --> debug configuration... 1 .DoubleClick on Remote java application  2. Set port in the connect Tab. click OK and select the appropriate project you want to debug. Click Ok and  then click debug. Hot deploy has supported the code changes in the method implementation only. If you add a new class or a new method, restart is still required. You are done with the Hot Deploy of remote application.

SessionFactory creation failed.org.hibernate.MappingException: An AnnotationConfiguration

You might have encountered this exception while mapping your POJO classes to tables in hibernate. Exception: SessionFactory creation failed. org . hibernate . MappingException : An AnnotationConfiguration instance is required to use <mapping class= "com.javacodegeeks.enterprise.hibernate.Student" /> Exception in thread "main" java. lang . ExceptionInInitializerError at com. javacodegeeks . enterprise . hibernate . utils . HibernateUtil . buildSessionFactory (HibernateUtil. java : 17 ) at com. javacodegeeks . enterprise . hibernate . utils . HibernateUtil .<clinit>(HibernateUtil. java : 8 ) at com. javacodegeeks . enterprise . hibernate . Test . main (Test. java : 14 ) Caused by: org. hibernate . MappingException : An AnnotationConfiguration instance is required to use <mapping class= "com.javacodegeeks.enterprise.hibernate.Student" /> at org. hibernate . cfg . Configuration . parseMappingElement (Configuration. j...