开发者

WAS 6.1 - Deploying Multiple WARs in one EAR

So from what I read this should be pretty simple to execute.. I've followed a similar setup as seen here in creating my application.xml file.

<application>
   <display-name>test</display-name>

   <module>
      <web>
         <web-uri>foo.war</web-uri>
         <context-root>foo</context-root>
      </web>
   </module>

   <module>
      <web>
         <web-uri>bar.war</web-uri>
         <context-root>bar</context-root>
      </web>
   </module>

</application>

I've tested both of these apps separately inside this JVM and they have worked fine... however when placed together I am getting a struts 2 error (both apps have been created utilizing the struts 2 framework), and I am unsure what is missing. The error is as follows

[Servlet Error]-[Filter [struts2]: could not be initialized]: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - wsjar:file:<my filepath>/WEB-INF/lib/struts2-core-2.0.14.jar!/struts-default.xml:30:72 

Any thoug开发者_Python百科hts?


*Edit So I've been reading this error can be caused when you have conflicting struts2 jars in the WEB-INF/lib directory (or they are loaded in two places). Though I thought this couldnt be an issue since these jars are in different WARs.


The simplest way may be changing classloader policy: from console applications->enterprise applications->your app->WAR class loader policy->Class loader for each WAR file in application. But try to assure that there is only one set of given jars in ears' WEB-INF/lib dir. You can use shared libs also. But if the problem is caused by shared libs you can change class loader order applications->enterprise applications->your app->class loader order->Classes loaded with local class loader first (parent last).


If you suspect it is the conflict, turn on verbose classloading to see what is being loaded. Ensure that you have multiple classloaders (which is the default).

Looking at the verbose classloading should tell you where the required classes are being loaded from by the WAS run time.

HTH

Manglu

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜