Thursday, January 5, 2012

Spring Exceptions

1. Caused by: java.lang.NoSuchMethodError: net.sf.cglib.proxy.Enhancer.setInterceptDuringConstruction(Z)V
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:126)
at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEntityTuplizer.java:135)
at org.hibernate.tuple.entity.PojoEntityTuplizer.(PojoEntityTuplizer.java:55)

Solution: cglib-nodep-2.1_3.jar file in the classpath is causing the issue needed cglib.jar/cglib-full-2.0.1.jar file

2. java.lang.ClassCastException: org.aspectj.weaver.ResolvedType$Array cannot be cast to org.aspectj.weaver.ReferenceType

Solution: aspectjweaver.jar is used old version i.e 1.5.4 with spring 2.5.5 but for spring 3 we need aspectjweaver-1.6.6.jar
Link


3. Using <mvc:resources …/> in spring 3 causes all other views to stop working

Reason:

This happens because DispatcherServlet applies default configuration of handler mappings only when no custom handler mappings found in the context. Since adds its own handler mapping, defaults are broken, therefore other handler mappings should be decalred explicitly, either by or manually as beans.

Also note that declares only DefaultAnnotationHandlerMapping and doesn't declare other mappings such as BeanNameUrlHandlerMapping, though they are in defaults of DispatcherServlet. Declare them manually if you need them.

solution: <mvc:resources> requires <mvc:annotation-driven>

4. Caused by: javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [gnu.xml.dom.JAXPFactory@743399] does not support XML Schema. Are you running on Java 1.4 with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support.
Caused by: java.lang.IllegalArgumentException: http://java.sun.com/xml/jaxp/properties/schemaLanguage

Reason: Since the jar file gnujaxp.jar in the classpath

Solution: Jar file need for parsing is jaxp.jar file

5. Caused by: javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [org.apache.crimson.jaxp.DocumentBuilderFactoryImpl@1a1c887] does not support XML Schema. Are you running on Java 1.4 with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support.
Caused by: java.lang.IllegalArgumentException: No attributes are implemented

Reason: since the jar file crimson.jar in the classpath

Solution: Jar file need for parsing is jaxp.jar file

No comments:

Post a Comment