'Getting an exception "Failed to start service jboss.module.service" for spring portlets

Thanks for your time

the version we are using liferay 6 - jboss 7 and here is the error exception getting when trying to avoid the lib folder consisting spring jars inside every spring mvc3 portlet war . Because the same set of spring dependency jars were added to all the portlets and deploying all the time, it actually increases the load . To get rid of this , created a folder inside modules [structure goes like this jboss/modules/com/spring/main/--jar files--] and added all the common libraries.

this is the module.xml

<module xmlns="urn:jboss:module:1.0" name="com.spring">
  <resources>
    <resource-root path="org.springframework.aop-3.1.1.RELEASE.jar"/> 
    <resource-root path="org.springframework.asm-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.aspects-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.beans-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.context-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.context.support-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.core-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.expression-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.instrument-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.instrument.tomcat-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.jdbc-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.jms-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.orm-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.oxm-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.test-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.transaction-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.web-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.web.portlet-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.web.servlet-3.1.1.RELEASE.jar"/>
    <resource-root path="org.springframework.web.struts-3.1.1.RELEASE.jar"/>
    <resource-root path="standard.jar"/>
    <resource-root path="util-java.jar"/>
    <resource-root path="util-taglib.jar"/>
    <resource-root path="util-bridges.jar"/>
    <resource-root path="commons-logging.jar"/>
    <resource-root path="ext-oneprm-liferay-portal-ext-util-bridges.jar"/>
    <resource-root path="ext-oneprm-liferay-portal-ext-util-java.jar"/>
    <resource-root path="ext-oneprm-liferay-portal-ext-util-taglib.jar"/>

  </resources>

</module> 

and the jboss-deployement-structure.xml inside the portlet

<?xml version="1.0"?>

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
    <deployment>
        <dependencies>
            <module name="com.liferay.portal"></module>
            <module name="org.jboss.modules"></module>
        </dependencies>
    </deployment>
</jboss-deployment-structure> 

This is the error we are getting now .. did i still missing anything to mention inside the portlet ? can anyone help me please ... thanks in advance !!

20:38:41,812 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 1) Deployment of "sample-spring-template-portlet.war" was rolled back with failure message {"Failed services" => {"jboss.module.service.\"deployment.sample-spring-template-portlet.war\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.sample-spring-template-portlet.war\".main: Failed to load module: deployment.sample-spring-template-portlet.war:main"}}
20:38:42,140 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Stopped deployment sample-spring-template-portlet.war in 323ms
20:38:42,140 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 2) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.module.service.\"deployment.sample-spring-template-portlet.war\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.sample-spring-template-portlet.war\".main: Failed to load module: deployment.sample-spring-template-portlet.war:main"}}}}
20:51:35,192 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner) 20:51:35,192 INFO  [AutoDeployDir:167] Processing sample-spring-template-portlet-6.1.0.1.war
20:51:35,192 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner) 20:51:35,192 INFO  [PortletAutoDeployListener:71] Copying portlets for C:\apps\Liferay\JBOSS\Liferay-6.1.0\deploy\sample-spring-template-portlet-6.1.0.1.war
20:51:35,567 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Expanding: C:\apps\Liferay\JBOSS\Liferay-6.1.0\deploy\sample-spring-template-portlet-6.1.0.1.war into C:\DOCUME~1\SESA23~1\LOCALS~1\Temp\20120507205135567
20:51:36,302 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 1 file to C:\DOCUME~1\SESA23~1\LOCALS~1\Temp\20120507205135567\WEB-INF
20:51:36,958 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 1 file to C:\DOCUME~1\SESA23~1\LOCALS~1\Temp\20120507205135567\WEB-INF\classes
20:51:36,958 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 1 file to C:\DOCUME~1\SESA23~1\LOCALS~1\Temp\20120507205135567\WEB-INF\classes
20:51:37,552 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 1 file to C:\DOCUME~1\SESA23~1\LOCALS~1\Temp\20120507205135567\WEB-INF\jsp
20:51:38,223 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 16 files to C:\apps\Liferay\JBOSS\Liferay-6.1.0\jboss-7.0.2\standalone\deployments\sample-spring-template-portlet.war
20:51:38,411 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 1 file to C:\apps\Liferay\JBOSS\Liferay-6.1.0\jboss-7.0.2\standalone\deployments\sample-spring-template-portlet.war
20:51:38,427 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Deleting directory C:\DOCUME~1\SESA23~1\LOCALS~1\Temp\20120507205135567
20:51:38,489 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner) 20:51:38,489 INFO  [PortletAutoDeployListener:81] Portlets for C:\apps\Liferay\JBOSS\Liferay-6.1.0\deploy\sample-spring-template-portlet-6.1.0.1.war copied successfully. Deployment will start in a few seconds.
20:51:38,630 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "sample-spring-template-portlet.war"
20:51:39,192 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) added javax.persistence.api dependency to sample-spring-template-portlet.war
20:51:39,677 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."sample-spring-template-portlet.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."sample-spring-template-portlet.war".INSTALL: Failed to process phase INSTALL of deployment "sample-spring-template-portlet.war"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0_03]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0_03]
        at java.lang.Thread.run(Thread.java:722) [:1.7.0_03]
Caused by: java.lang.RuntimeException: Failed to load class org.springframework.web.servlet.ViewRendererServlet
        at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:141)
        at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:122)
        at org.jboss.as.ee.component.LazyValue.get(LazyValue.java:40)
        at org.jboss.as.ee.component.EEApplicationDescription.getClassConfiguration(EEApplicationDescription.java:183)
        at org.jboss.as.ee.component.ComponentDescription.createConfiguration(ComponentDescription.java:153)
        at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:70)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
        ... 5 more
Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.ViewRendererServlet from [Module "deployment.sample-spring-template-portlet.war:main" from Service Module Loader]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
        at java.lang.Class.forName0(Native Method) [:1.7.0_03]
        at java.lang.Class.forName(Class.java:264) [:1.7.0_03]
        at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:139)
        ... 11 more

20:51:39,958 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 1) Deployment of "sample-spring-template-portlet.war" was rolled back with failure message {"Failed services" => {"jboss.deployment.unit.\"sample-spring-template-portlet.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"sample-spring-template-portlet.war\".INSTALL: Failed to process phase INSTALL of deployment \"sample-spring-template-portlet.war\""},"Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.sample-spring-template-portlet.sample-spring-template-portlet.ValidatorFactory missing [ jboss.naming.context.java.module.sample-spring-template-portlet.sample-spring-template-portlet ]","jboss.naming.context.java.module.sample-spring-template-portlet.sample-spring-template-portlet.Validator missing [ jboss.naming.context.java.module.sample-spring-template-portlet.sample-spring-template-portlet ]"]}
20:51:40,349 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment sample-spring-template-portlet.war in 398ms
20:51:40,364 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 2) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.deployment.unit.\"sample-spring-template-portlet.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"sample-spring-template-portlet.war\".INSTALL: Failed to process phase INSTALL of deployment \"sample-spring-template-portlet.war\""},"Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.sample-spring-template-portlet.sample-spring-template-portlet.ValidatorFactory missing [ jboss.naming.context.java.module.sample-spring-template-portlet.sample-spring-template-portlet ]","jboss.naming.context.java.module.sample-spring-template-portlet.sample-spring-template-portlet.Validator missing [ jboss.naming.context.java.module.sample-spring-template-portlet.sample-spring-template-portlet ]"]}}}


Solution 1:[1]

Your jboss-deployment-structure.xml I don't think is correct. Try remove the two modules you have and adding one for com.spring.

<?xml version="1.0"?>

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
    <deployment>
        <dependencies>
            <module name="com.spring"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure> 

Solution 2:[2]

Remove these two module Names

<module name="com.liferay.portal"></module>
<module name="org.jboss.modules"></module>

... and replace as

<module name="com.spring"/>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 James R. Perkins
Solution 2 Matt