can't running project when add springsecurity.taglib.xml - spring

i've problem when implement spring security and jsf 2.0, exactly when add springsecurity.taglib.xml in web.xml
server : glassfish server 3
springframework 3.0.2
jsf 2.0
library :
org.springframework.faces.sources 3
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>HelloWorldExampleWithSpring3MVCInEclipse</display-name>
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/springsecurity.taglib.xml</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/app-config.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/app-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>faces/index.jsp</welcome-file>
</welcome-file-list>
springsecurity.taglib.xml
<?xml version="1.0"?>
<!DOCTYPE facelet-taglib PUBLIC
"-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
"http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
<namespace>http://www.springframework.org/security/tags</namespace>
<tag>
<tag-name>authorize</tag-name>
<handler-class>org.springframework.faces.security.FaceletsAuthorizeTagHandler</handler-class>
</tag>
<function>
<function-name>areAllGranted</function-name>
<function-class>org.springframework.faces.security.FaceletsAuthorizeTagUtils</function-class>
<function-signature>boolean areAllGranted(java.lang.String)</function-signature>
</function>
<function>
<function-name>areAnyGranted</function-name>
<function-class>org.springframework.faces.security.FaceletsAuthorizeTagUtils</function-class>
<function-signature>boolean areAnyGranted(java.lang.String)</function-signature>
</function>
<function>
<function-name>areNotGranted</function-name>
<function-class>org.springframework.faces.security.FaceletsAuthorizeTagUtils</function-class>
<function-signature>boolean areNotGranted(java.lang.String)</function-signature>
</function>
<function>
<function-name>isAllowed</function-name>
<function-class>org.springframework.faces.security.FaceletsAuthorizeTagUtils</function-class>
<function-signature>boolean isAllowed(java.lang.String, java.lang.String) </function-signature>
</function>
</facelet-taglib>
this is error message
In-place deployment at D:\Project\Secret Project\Hobic Project EE\Yeah\build\web
deploy?path=D:\Project\Secret Project\Hobic Project EE\Yeah\build\web&name=Yeah&force=true failed on GlassFish Server 3
D:\Project\Secret Project\Hobic Project EE\Yeah\nbproject\build-impl.xml:760: The module has not been deployed.
BUILD FAILED (total time: 1 minute 29 seconds)
server error message
SEVERE: Exception while loading the app
SEVERE: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException:
Source Document: jar:file:/D:/Project/Secret%20Project/Hobic%20Project%20EE/Zest/build/web/WEB- INF/lib/org.springframework.faces-2.0.4.RELEASE.jar!/META-INF/faces-config.xml
Cause: Class 'org.springframework.faces.webflow.FlowActionListener' is missing a runtime dependency: java.lang.NoClassDefFoundError: org/springframework/webflow/execution/RequestContext
your suggest right [java.lang.NoClassDefFoundError: org/springframework/webflow/execution/RequestContext], and i got new error now :(
SEVERE: Exception while loading the app
SEVERE: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [security.xml]
Offending resource: ServletContext resource [/WEB-INF/app-config.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security]
Offending resource: ServletContext resource [/WEB-INF/security.xml]
*solution [Offending resource: ServletContext resource [/WEB-INF/security.xml]] *
![.jar needed][1]
can you give suggest for my problem ?
thx agung

I don't use Netbeans, so I don't know its ins and outs, but this error message seems to indicate that some error/exception has been occurred beforehand. Is there really not anything more into the build log?
Anyway, not sure if that solves the problem and is related to the concrete problem, but one thing which caught my eye is that your <facelet-taglib> is declared conform Facelets 1.x while you're using JSF 2.x which has Facelets 2.x bundled. Netbeans might have fallen over that.
Fix the root declaration of .taglib.xml file as follows:
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
version="2.0"
>
<!-- Config here. -->
</facelet-taglib>
Further, Glassfish is a Servlet 3.0 compatible container, but your web.xml root declaration complies Servlet 2.5. This should technically also not immediately cause a problem, but you'll miss Servlet 3.0 / EL 2.2 advantages this way.
I'd fix the root declaration of the web.xml as well:
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0"
>
<!-- Config here. -->
</web-app>
Update as per your update the root cause of your concrete problem seems to be the following:
java.lang.NoClassDefFoundError: org/springframework/webflow/execution/RequestContext
The NoClassDefFoundError means that the in the message mentioned class is missing in the classpath, while it is (indirectly) required by other classes in your application. The solution would be to add the class (or in this particular case, the JAR file with the class) to the classpath. The mentioned class is part of Spring WebFlow. You need to download it and include it in the classpath (the buildpath as the IDE calls it) the same way as you did for the core Spring framework and Spring Security.
Update 2 as per your second update, a new problem appeared after fixing the first:
Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security] Offending resource: ServletContext resource [/WEB-INF/security.xml]
I'm no Spring guy so I can't answer that from top of head, but Google suggests that this problem is caused by a missing Spring Security Config JAR file.

Related

Invalid <url-pattern> in servlet mapping when set it to empty string

To have a home-page servlet which will generate home page's content, I kept url-pattern empty in the servlet-mapping, which AFAIK maps to the context root, say like mysite.com/ or http://{host}:{port}/mysite/
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name>My site</display-name>
<servlet>
<servlet-name>controller</servlet-name>
<servlet-class>com.mysite.control.MainController</servlet-class>
<!-- Load this servlet at server startup time -->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>controller</servlet-name>
<url-pattern></url-pattern>
</servlet-mapping>
The above is the complete web.xml (except root element web-app).
But Tomcat 7.0.26 gives following error during startup due to which the war is not getting deployed.
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mysite]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)
...
Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> in servlet mapping
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3208)
...
Note 1: This is not a spring project, it is pure servlet 3.0 project and just has web.xml configuration at the moment.
Note 2: The class com.mysite.control.MainController does exist.
How can I fix this? I know welcome-file is an option to mimic home page but that is not optimal and I would prefer to fix this instead. Is this tomcat 7.0.26 bug or some other issue?
This is a bug of Tomcat and have been fixed since 7.0.28.
Please refer to this page. So you should update Tomcat.

Getting errors when starting tomcat

My project is a dynamic web project,not maven project.
It gets errors when startting tomcat:
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/springmvc]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 6 more
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2499)
at java.lang.Class.getDeclaredFields(Class.java:1811)
at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:270)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:139)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)
at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:415)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:892)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5412)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more
I think it's caused by web.xml,codes below:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name>Archetype Created Web Application</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>file:WebContent/WEB-INF/spring-mybatis.xml</param-value>
</context-param>
<!-- Spring MVC servlet -->
<servlet>
<servlet-name>SpringMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>file:WebContent/WEB-INF/spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>SpringMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<async-supported>true</async-supported>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
I have googled before,most of them dont configure context-param and servlet,but I have configured them.And I have added jar files in lib.
This is my file structure:
-WEB-INF
--spring-mvc.xml
--spring-mybatis.xml
--web.xml
Are there someting wrongs with the contextConfigLocation?I also tried /WEB-INF/spring-mybatis.xml,but it not worked.
Recommended Options
Use Maven/Gradle project to build your project in your IDE and let them to take care of your dependencies.
When you are using spring framework it is always recommended to use Bill of Materials to avoid ClassNotFound exception.
Spring-boot is very popular, if you wish you can choose that option too to avoid XML configurations.
I think you are mission some jar to be added please make sure that you have below jars added... According to spring-webmvc 3.1.2 need following jar: I have given the same answer earlier so refer the below jar
aopalliance-1.0.jar
commons-logging-1.1.1.jar
spring-webmvc-3.1.2.RELEASE.jar
spring-asm-3.1.2.RELEASE.jar
spring-beans-3.1.2.RELEASE.jar
spring-core-3.1.2.RELEASE.jar
spring-context-3.1.2.RELEASE.jar
spring-aop-3.1.2.RELEASE.jar
spring-expression-3.1.2.RELEASE.jar
spring-context-support-3.1.2.RELEASE.jar
spring-web-3.1.2.RELEASE.jar

Servlet mapping specifies an unknown servlet name when use spring4gwt library

I'm trying to integrate GWT and Spring using the library spring4gwt-0.0.1.jar, but get the following error:
Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name springGwtRemoteServiceServlet
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3275)
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3254)
at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1430)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1344)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more
My web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>TelephoneBook</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/application-config.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>springGwtRemoteServiceServlet</servlet-name>
<servlet-class>org.spring4gwt.server.SpringGwtRemoteServiceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>>springGwtRemoteServiceServlet</servlet-name>
<url-pattern>/TelephoneBook/springGwtServices/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>TelephoneBook.html</welcome-file>
</welcome-file-list>
</web-app>
What's the matter? Thanks in advance!
Here <servlet-name>>springGwtRemoteServiceServlet</servlet-name> you have an >to much. Is it a copy pase error? (after beginning servlet-name tag

Apache CXF and Spring but no WSDL (recursive links)

I have written a small sample web service, using Apache CXF (CXFServlet) and Spring (ContextLoaderListener) I have registered the CXFServlet to listen on the / url. And I am declaring my beans in beans.xml.
When I start the web service with tomcat and go to the service url, then I can see the web service definition (e.g. methods, endpoint, wsdl link). But the problem is that when I click on the wsdl link, then I do not get the WSDL file, but instead I am recursively forwarded back to the same page, but each time the name of the web service address is appended:
localhost:8080/Test/accountEndpoint
localhost:8080/Test/accountEndpointaccountEndpoint
localhost:8080/Test/accountEndpointaccountEndpointaccountEndpoint
The service is a "code-first" service which a #WebService annotated java interface and a implementation class.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>Test</display-name>
<servlet>
<servlet-name>cxf</servlet-name>
<display-name>cxf</display-name>
<description>Apache CXF Endpoint</description>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/beans.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
</web-app>
beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<bean id="account" class=".....AccountImpl" />
<jaxws:endpoint id="accountEndpoint" implementor="#account"
address="accountEndpoint" />
</beans>
As I understand it, CXF should automatically generate the WSDL file and provide it to me, when I click on the link, so I do not understand why that is not happening.
Specify the address this way, with a leading slash:
<jaxws:endpoint id="accountEndpoint" implementor="#account"
address="/accountEndpoint" />
Sorry, making a change, the above is not correct:
You are right, I am able to replicate the behavior with mapping CXFServlet to the "default" servlet path mapping of /, the fix that I could get to work for myself is to map it to /* instead:
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>

Jboss6.1 ClassNotFound in WEB/lib for listener

I use jboss6.1. When I try to deploy a web app, it say class not found when try to load spring.
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
the error is
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationListener
I put the spring in WEB/lib. Is that wrong? Or should be something else?
Thanks for the kind replies. What confuses me is I put the spring jars in my webapp's WEB/lib folder. Isn't that enough?
Following are the web.xml and the jars. ( I put all I grabbed in the dist folder of spring3.1)
But I wonder maybe is because I use jboss and there's something special in it? I google some post class loader but don't understand.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="CMDB_WS_HOST" version="3.0">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>99999999</session-timeout>
</session-config>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/beans.xml</param-value>
</context-param>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>com.inspur.cmdb.system.StartupListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
spring jars in web/lib
org.springframework.aop-3.1.0.M2.jar
org.springframework.asm-3.1.0.M2.jar
org.springframework.aspects-3.1.0.M2.jar
org.springframework.beans-3.1.0.M2.jar
org.springframework.context.support-3.1.0.M2.jar
org.springframework.context-3.1.0.M2.jar
org.springframework.core-3.1.0.M2.jar
org.springframework.expression-3.1.0.M2.jar
org.springframework.instrument.tomcat-3.1.0.M2.jar
org.springframework.instrument-3.1.0.M2.jar
org.springframework.jdbc-3.1.0.M2.jar
org.springframework.jms-3.1.0.M2.jar
org.springframework.orm-3.1.0.M2.jar
org.springframework.oxm-3.1.0.M2.jar
org.springframework.test-3.1.0.M2.jar
org.springframework.transaction-3.1.0.M2.jar
org.springframework.web.portlet-3.1.0.M2.jar
org.springframework.web.servlet-3.1.0.M2.jar
org.springframework.web.struts-3.1.0.M2.jar
org.springframework.web-3.1.0.M2.jar
Make sure your server classpath has included the Spring jar library. In Spring 3 its, spring-web.jar
check whether you have these jars in WEB/lib
commons-logging-1.1.1.jar
jstl-1.2.jar
spring-asm-3.0.3.RELEASE.jar
spring-beans-3.0.3.RELEASE.jar
spring-context-3.0.3.RELEASE.jar
spring-core-3.0.3.RELEASE.jar
spring-expression-3.0.3.RELEASE.jar
spring-web-3.0.3.RELEASE.jar
spring-webmvc-3.0.3.RELEASE.jar
It is ok with JBoss 7.It is classloading effect.
Config : /WEB-INF/jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC
"-//JBoss//DTD Web Application 4.2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
myapp:loader=anyUniqueName
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
</jboss-web>
Otherwise
I reference here.
I have not tried with JBoss 6 yet. But, I hope, the following configuration will be helpful for JBoss 6.
NOTE:
On JBoss 6.0, to avoid the container loading the classes before the application actually starts, one needs to add a WEB-INF/jboss-scanning.xml file to the application archive - with the following content:
Config : /WEB-INF/jboss-scanning.xml
<scanning xmlns="urn:jboss:scanning:1.0"/>

Resources