I modified the jboss-web.xml files to the following :

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Service Reference 4.2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd";>

<jboss-web>
        <loader-repository>
                com.xxxx.xxxx.crs.maintenance:loader=xxxx-maintenance-web.war
        
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
        </loader-repository>
</jboss-web>

But now I get a Linkage Error when starting JBoss :

Caused by: java.lang.LinkageError: loader constraint violation: when
resolving overridden method
"com.xxxx.yyyy.service.maintenance.internal.FlightScheduleServiceImpl$$EnhancerByCGLIB$$f599cbe3.saveFlightSchedule(Lcom/xxxx/yyyy/maintenance/core/dto/FlightScheduleDTO;)V"
the class loader (instance of
org/jboss/web/tomcat/service/WebAppClassLoader) of the current class,
com/xxxx/yyyy/service/maintenance/internal/FlightScheduleServiceImpl$$EnhancerByCGLIB$$f599cbe3,
and its superclass loader (instance of
org/jboss/mx/loading/UnifiedClassLoader3), have different Class objects for
the type com/xxxx/yyyy/maintenance/core/dto/FlightScheduleDTO used in the
signature
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
        at java.lang.Class.getDeclaredMethod(Class.java:1935)
        ....


Yohan Liyanage wrote:
> 
> Hi,
> 
> I am trying to deploy a EAR file which contains two WAR files, each of
> which uses Struts 2 into JBoss, but it fails due to a class loading
> problem. The exception I get is as follows:
> 
> 10:52:46,698 ERROR [[/xxxx-reservation-web]] Exception starting filter
> struts2
> Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory -
> bean -
> jar:file:/opt/jboss/jboss-4.2.3.GA/server/default/tmp/deploy/tmp44322xxxx-crs.ear-contents/xxxx-reservation-web-0.0.1-SNAPSHOT-exp.war/WEB-INF/lib/struts2-core-2.0.14.jar!/struts-default.xml:30:72
>       at
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:208)
>       at
> org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
>       at
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)
>       at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
>       at
> org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
>       at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
>       at
> org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:205)
>       at
> org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
>         ......
> 
> Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the
> name xwork has already been loaded by bean -
> jar:file:/opt/jboss/jboss-4.2.3.GA/server/default/tmp/deploy/tmp44322xxxx-crs.ear-contents/xxxx-maintenance-web-0.0.1-SNAPSHOT-exp.war/WEB-INF/lib/struts2-core-2.0.14.jar!/struts-default.xml:30:72
> - bean -
> jar:file:/opt/jboss/jboss-4.2.3.GA/server/default/tmp/deploy/tmp44322xxxx-crs.ear-contents/xxxx-reservation-web-0.0.1-SNAPSHOT-exp.war/WEB-INF/lib/struts2-core-2.0.14.jar!/struts-default.xml:30:72
>       at
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:193)
>       ... 145 more
> 
> In each WAR file's WEB-INF/lib folder, the struts2 jar files are present.
> I have used JBoss loader repositories at EAR level and WAR level to scope
> the class loading. But still, it seems  that one WAR file can see the
> libraries in other WAR file's lib folder.
> 
> The JBoss class loading configurations are as follows :
> 
> jboss-app.xml (in EAR) :
> 
>      <jboss-app>
>            <loader-repository>
>                    com.xxxx.xxxx.crs:loader=xxxx-crs.ear
>                    <loader-repository-config>java2ParentDelegation=false
>                    </loader-repository-config>
>            </loader-repository>
>      </jboss-app>
> 
> jboss-web.xml (in each WAR, with different repository ids)
> <jboss-web>
>       <class-loading java2ClassLoadingCompliance="false">
>               <loader-repository>
>                       
> com.xxxx.xxxx.crs.maintenance:loader=xxxx-maintenance-web.war
>               
> <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
>               </loader-repository>
>       </class-loading>
> </jboss-web>
> 
> My environment is as follows :
> 
> JBoss AS 4.2.3 GA
> Struts 2.0.14 (and related libraries)
> 
> Any assistance in resolving this issue would be much appreciated.
> 
> Thanks in advance.
> 
> Regards,
> Yohan.
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-multiple-wars-in-single-ear%2C-under-JBoss-tp25710696p25710849.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to