Archive

Archive for March, 2011

WAS 7 and Struts 2, Oracle, Hibernate

March 3, 2011 Leave a comment

Last month, i began to develope JEE application using Struts2 framework, Spring plugins, Hibernate , oracle and Websphere Application sever v.7.  Actually, it is not new development, just migration from DB2 and Apache tomcat environment to Oracle and WAS environment.

This application, let’s called X application, is initially developed under Windows Server , JEE 5, Apache tomcat and IBM DB2 database System. It has been running at a government company as known as BUMN for a year and run smoothly.

When the migration is began, i switch the DB2 system to oracle and the Application server to WAS, without major changes on sources of application, but Connection configuration only. Then, i build and deploy it to development server (IBM P Series and AIX 6 environment).

First error i found is this :

at java.lang.Class.getDeclaredFieldsImpl(Native Method)
 at java.lang.Class.getDeclaredFields(Class.java:543)
 at com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:89)
 at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:71)
 at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:67)
 at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:150)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
 at java.util.concurrent.FutureTask.run(FutureTask.java:149)
 at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:76)
 at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:116)
 at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.<init>(ContainerImpl.java:348)
 at com.opensymphony.xwork2.inject.ContainerImpl$5.create(ContainerImpl.java:305)
 at com.opensymphony.xwork2.inject.ContainerImpl$5.create(ContainerImpl.java:301)
 at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:150)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
 at java.util.concurrent.FutureTask.run(FutureTask.java:149)
 at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:76)
 at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:116)
 at com.opensymphony.xwork2.inject.ContainerImpl.getConstructor(ContainerImpl.java:594)
 at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:491)
 at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)
 at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
 at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)
 at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
 at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
 at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
 at com.opensymphony.xwork2.inject.ContainerImpl$ParameterInjector.inject(ContainerImpl.java:462)
 at com.opensymphony.xwork2.inject.ContainerImpl.getParameters(ContainerImpl.java:477)
 at com.opensymphony.xwork2.inject.ContainerImpl.access$000(ContainerImpl.java:34)
 at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:293)
 at com.opensymphony.xwork2.inject.ContainerImpl$2.call(ContainerImpl.java:104)
 at com.opensymphony.xwork2.inject.ContainerImpl$2.call(ContainerImpl.java:101)
 at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
 at com.opensymphony.xwork2.inject.ContainerImpl.injectStatics(ContainerImpl.java:101)
 at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:493)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:184)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
 at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
 at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
 at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:140)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:509)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:423)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:282)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:340)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:812)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:917)
 at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:924)
 at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:651)
 at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
 at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
 at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
 at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
 at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
 at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
 at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
 at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
 at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
 at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
 at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
 at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
 at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
 at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
 at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
 at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
Caused by: java.lang.ClassNotFoundException: org.apache.velocity.app.VelocityEngine
 at java.net.URLClassLoader.findClass(URLClassLoader.java:419)
 at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:150)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
 at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:90)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
 at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)
 at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)
 at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:466)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
 at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:466)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
 ... 66 more

the stack trace indicate there is missing class related to velocity engine. I don’t know why this happened, because currently on the application i don’t use velocity implementation at all.

to resolve this error, i add velocity and velocity tools library to build path and rebuild the application, but it doesn’t work, the server still throw the same error. I explore the installation folder of WAS and found library folder contains ext folder inside, i assume this folder is for external library needed by the server to run the installed application. I copy the library to this folder, and restart the server, and finally the application is up and running.

the library i added to the WAS is attached below :

 

 

 

 

 

Categories: Programming Tags: , , ,