Tuesday, August 28, 2007

Migrate WASD 5.1 Application to RSA 7.0/WAS 6.1

Get the application source from Harvest repository. Disconnect Harvest connection.

Create a new web project and ear project in RSA on a new folder. Import source code from the old folder. Compile passed.

Deploy to the embedded WAS 6.1. Run.

Find the tld path problem. Old web.xml sets tlds under WEB_INF/, now application looks tlds under WEB_INF/tlds. Edit web.xml and fix it. WAS 6.1 automatically republishes the app and restart the app.

Get this exception.
[8/28/07 10:49:14:485 EDT] 00000036 WebApp E Exception caught while initializing context
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator' defined in ServletContext resource [/WEB-INF/declarativeServices.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator]; constructor threw exception; nested exception is java.lang.NoSuchMethodError: org/objectweb/asm/ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator]; constructor threw exception; nested exception is java.lang.NoSuchMethodError: org/objectweb/asm/ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
java.lang.NoSuchMethodError: org/objectweb/asm/ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
Search Google. Find talks on incompatibility of asm, cglib, spring and hibernate. We are using
  • spring-1.2.6
  • hibernate-3.1.2
  • asm-1.5.3
  • cglib-2.1_3
Try to obtain the ear file from production system and deploy to WAS 6.1.

Encounter the same exception.

Several combinations tried. Finally this one worked.

Download spring-framework-1.2.9-with-dependencies.zip and extract the cglib-nodep-2.1_3.jar and replace the original cglib-2.1_3.jar. Redeploy the application in workspace to WAS 6.1 and restart server.

It is possibly both spring framework and hibernate depend on cglib, and further on asm, but they require different asm. cglib-nodep actually packages a revised asm, spring will have no need of a separate asm and let hiberate uses the asm exclusively. Hibernate may actually not need any cglib, but no time for this research yet.

2 comments:

Anonymous said...

That solved the problem. Thanks for the same!

Anonymous said...

Can anyone recommend the best Patch Management tool for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: N-able N-central desktop management
? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!