Red Hat Bugzilla – Bug 1062155
Missing javax.servlet.api dependency in org.jasig.cas.client module
Last modified: 2016-10-30 18:59:19 EDT
Description of problem: When trying to use the cas-client-core-3.2.1.jar of /modules/system/layers/gatein/org/jasig/cas/client/main/ in an application by defining dependency in the jboss-deployement-structure.xml file, a java.lang.ClassNotFoundException exception is thrown for the missing dependency of javax.servlet.http.HttpSessionListener in the cas-client-core-3.2.1.jar Directly having the client jar in the application's /WEB-INF/lib/ works fine since the web-subsystem wraps the javax.sevlet.api. Version-Release number of selected component (if applicable): - JBoss Portal Platform (6.1) - cas-client-core-3.2.1.jar Actual results: ======================================== 10:48:12,740 WARN [org.jboss.modules] (MSC service thread 1-8) Failed to define class org.jasig.cas.client.session.SingleSignOutHttpSessionListener in Module "org.jasig.cas.client:main" from local module loader @1e845c2 (finder: local module finder @3c0007 (roots: C:\Java\jboss-jpp-6.1.0\modules,C:\Java\jboss-jpp-6.1.0\modules\system\layers\gatein,C:\Java\jboss-jpp-6.1.0\modules\system\layers\base)): java.lang.LinkageError: Failed to link org/jasig/cas/client/session/SingleSignOutHttpSessionListener (Module "org.jasig.cas.client:main" from local module loader @1e845c2 (finder: local module finder @3c0007 (roots: C:\Java\jboss-jpp-6.1.0\modules,C:\Java\jboss-jpp-6.1.0\modules\system\layers\gatein,C:\Java\jboss-jpp-6.1.0\modules\system\layers\base))) ... ... Caused by: java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionListener at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_45] ... ... Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpSessionListener from [Module "org.jasig.cas.client:main" from local module loader @1e845c2 (finder: local module finder @3c0007 (roots: C:\Java\jboss-jpp-6.1.0\modules,C:\Java\jboss-jpp-6.1.0\modules\system\layers\gatein,C:\Java\jboss-jpp-6.1.0\modules\system\layers\base))] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.2.Final-redhat-1] ======================================== Expected results: It should be possible to re-use the /modules/system/layers/gatein/org/jasig/cas/client/main/cas-client-core-3.2.1.jar from the application using the jboss-deployment-structure.xml Additional info: As a workaround one has to include javax.servlet.api as a dependency in the module.xml of /modules/system/layers/gatein/org/jasig/cas/client/main OR Create a custom module for cas-client-core-3.2.1.jar and then include javax.servlet.api as a dependency in its module.xml.
It should be noted that using the newest cas-client-core (3.3.0) offers the added advantage of being able to use org.jasig.cas.client.jaas.Servlet3AuthenticationFilter (see https://issues.jasig.org/browse/CASC-174). This is necessary for authenticating with applications in a different security domain. In other words, reusing cas-client-core 3.2.1 doesn't make as much sense as would using 3.3.0 or higher.
https://github.com/gatein/gatein-portal/pull/846 was merged in upstream.
Reproduced with 6.1.0, fix verified with 6.2.0.ER2.