Why am I getting WebXml is not initialized yet? - jsf-2

I´ve a Maven Web Application with JSF2, Primefaces, Spring, and Hibernate.
So I recently migrated my web application from Glassfish 3 to Weblogic 12c.
When it run on Glassfish it worked fine but after migrating my application after some problems with the aspect libraries I managed to deploy it. But after running my application I found a bug. When my xhtml runs and loads data from my managed bean constructor it gets the data and renders it as expected, but if I fire an ajax event it gets the expected data but it doesn´t render the data and I get the next exception:
<11/01/2014 07:56:27 PM CST> <Error> <javax.enterprise.resource.webcontainer.jsf.application> <BEA-000000> <Error Rendering View[/pages/dashboard.xhtml]
java.lang.IllegalStateException: WebXml is not initialized yet. Please use #init(ServletContext) method to manually initialize it.
at org.omnifaces.config.WebXml.checkInitialized(WebXml.java:313)
at org.omnifaces.config.WebXml.getFormLoginPage(WebXml.java:294)
at org.omnifaces.context.OmniPartialViewContext$OmniPartialResponseWriter.startDocument(OmniPartialViewContext.java:253)
at org.primefaces.context.PrimePartialResponseWriter.startDocument(PrimePartialResponseWriter.java:134)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:287)
Truncated. see log file for complete stacktrace
>
<11/01/2014 07:56:27 PM CST> <Error> <HTTP> <BEA-101020> <[ServletContext#11936366[app:geotrack1-1.0-SNAPSHOT module:geotrack1-1.0-SNAPSHOT.war path:null spec-version:3.0]] Servlet failed with an Exception
java.lang.IllegalStateException: WebXml is not initialized yet. Please use #init(ServletContext) method to manually initialize it.
at org.omnifaces.config.WebXml.checkInitialized(WebXml.java:313)
at org.omnifaces.config.WebXml.getFormLoginPage(WebXml.java:294)
at org.omnifaces.context.OmniPartialViewContext$OmniPartialResponseWriter.startDocument(OmniPartialViewContext.java:253)
at org.primefaces.context.PrimePartialResponseWriter.startDocument(PrimePartialResponseWriter.java:134)
at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:201)
Truncated. see log file for complete stacktrace
>
<11/01/2014 07:56:27 PM CST> <Notice> <Diagnostics> <BEA-320068> <Watch "UncheckedException" in module "Module-FMWDFW" with severity "Notice" on server "AdminServer" has triggered at 11/01/2014 07:56:27 PM CST. Notification details:
WatchRuleType: Log
WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'WL-101020') OR (MSGID = 'WL-101017') OR (MSGID = 'WL-000802') OR (MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
WatchData: DATE = 11/01/2014 07:56:27 PM CST SERVER = AdminServer MESSAGE = [ServletContext#11936366[app:geotrack1-1.0-SNAPSHOT module:geotrack1-1.0-SNAPSHOT.war path:null spec-version:3.0]] Servlet failed with an Exception
Does anyone knows what´s happening??
Here is my web.xml
<?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">
<!-- Spring Context Configuration' s Path definition -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContext.xml
</param-value>
</context-param>
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<!-- The Bootstrap listener to start up and shut down Spring's root WebApplicationContext. It is registered to Servlet Container -->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<!-- JSF Servlet is defined to container -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Mapping with servlet and url for the http requests. -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<!-- Configuracion de Quartz -->
<listener>
<listener-class>org.quartz.ee.servlet.QuartzInitializerListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>
15
</session-timeout>
</session-config>
</web-app>
In my weblogic.xml I´ve:
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" 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 http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
<jsp-descriptor>
<keepgenerated>true</keepgenerated>
<debug>true</debug>
</jsp-descriptor>
<context-root>/geotrack1</context-root>
</weblogic-web-app>
I hope someone knows what´s happening.
Thanks in advace.

It's already reported as issue 273 at 29 october 2013 and fixed for 1.7, which has just been released:
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>1.7</version>
</dependency>

To fix it I change in my pom from omnifaces 1.6.3 to ominifaces 1.5

Related

application Migrating to weblogic 12.1.3.0 from 10.3.3.0 -unable to render JSF expressions

I am in the process of migrating Struts 2+Jsf 2.x web application from WEB -LOGIC 10.3.3.0 to 12.1.3.0.
I am encountering an error while accessing the pages ,as per my understanding if a JSF tag encounters with a value which is reading from the properties file it is encountering the Issue.And in the same pages I am able to read the struts messages.
I have created a POC with the same jars which my application is using to check the JSF is rendering properly or not.the POC is working fine.
and I placed the POC created page in to my application and tried to access again the same error encounterd.
when I comment the Struts filter in My application ,newly created pages worked fine.
I have tried to upgrade the Struts2jsf plugin.jar to newer versions .
I have removed the jsf-api,jsf -impl,JSTL from the APPINF\LIB.
changed the faces-config xsd to 2.0
but no luck..
Below is the error stack :
java.lang.stackOverflowError.
at java.util.HasMap$treeNode.GetTreeNode(HashMap.java:1873)
at java.util.HasMap.getNode(HashMap.java:573)
at java.util.HashMap.get(HashMap.java:556)
at ognl.ognlRuntime.getParameterTypes(ognlRuntime.java)
at ognl.ognlRuntime.findParameterTypes(ognlRuntime.java)
at ognl.OgnlRuntime.getGetMethod(ognlRuntime.java)
at ognl.ognlRuntime.hasGetMethod(ognlRuntime.java)
....
at org.apache.struts2.jsf.strutsVariableResolver.resolvervariable(StrutsVaraibaleResolver :78)
at com.sun.faces.el.variabelResolverImpl.resolvervariabel(VariableResolverImpl.java:80))
at org.apache.struts2.jsf.strutsVariableResolver.resolvervariable(StrutsVaraibaleResolver :78)
at com.sun.faces.el.variabelResolverImpl.resolvervariabel(VariableResolverImpl.java:80))
at org.apache.struts2.jsf.strutsVariableResolver.resolvervariable(StrutsVaraibaleResolver :78)
at com.sun.faces.el.variabelResolverImpl.resolvervariabel(VariableResolverImpl.java:80))
at org.apache.struts2.jsf.strutsVariableResolver.resolvervariable(StrutsVaraibaleResolver :78)
at com.sun.faces.el.variabelResolverImpl.resolvervariabel(VariableResolverImpl.java:80))
java.lang.ClassCastException:java.lang.StackOverflowerror cannot be cast to java.lang.Excetption
java.lang.ClassCastException:java.lang.StackOverflowerror cannot be cast to java.lang.Excetption
at jsp_servlet._error._jspService(_error.java)
at weblogic.servlet.jsp.Jspbase.service(JsPBase.java)
**
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app
version="2.5"
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_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-Value>classpath:/applicationContext-resources.xml
classpath:/applicationContext-dao.xml
classpath:/applicationContext-service.xml
/WEB-INF/applicationContext.xml
/WEB-INF/applicationContext-Struts.xml
/WEB-INF/Secuirty.xml
</param-Value>
</context-param>
<context-param>
<param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLE</param-name>
<param-value>false</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<servlet>
<servlet-name>faces</servlet-name/>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class/>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>JSPSupportServlet</servlet-name>
<servlet-class>org.apache.struts2.views.JspSupportServlet</servlet-class>
</servlet>
<filter>
<filter-name>struts-prepare</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
</filter>
<filter>
<filter-name>struts</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>
</filter>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphone.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter>
<display-name>richfaces</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh </filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD </dispatcher>
<dispatcher>INCLUDE </dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>struts </filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>richfaces</filter-name>
<url-pattern>*.html</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>sitemesh </filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
faces-config.xml :
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
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-facesconfig_1_2.xsd"
version="1.2"
<application>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<resource-bundle>
<base-name>message</base-name>
<var>msg</var>
</resource-bundle>
</application>
I have added additionally to the faces config below handler which worked me to display the login page
<view-handler>org.ajax4jsf.application.AjaxViewHandler</view-handler>
while navigating to any page above error encountering.
Below are the list of jars presented :
activation-1.1.jar
antlr-2.7.6.jar
aopaliance-1.0.jar
asm3.3.jar
aspectjrt-1.6.6.jar
aspectjweaver-1.6.6.jar
axiom-api-1.2.5.jar
cglib-2.2.jar
commons-beanutils-1.7.0.jar
commons-Codec-1.5.jar
Commons-collections-3.2.jar
commons-digester-1.8.jar
commons-el.jar
commons-fileupload-1.2.1.jar
commons-io-1.4.jar
commons-lang-2.4.jar
commong-logging-1.1.1.jar
commons-pool-1.2.jar
commons-vfs-1.0.jar
compass-2.1.3.jar
jsf-facelets 1.1.15B1.jar
richfaces-impl 3.3.jar
richfaces-ui 3.3Final.jar
standard.jar
jstl.jar
jsf-api2.0.2.jar
jsf-impl 2.0.2.jar
log4j-1.2.13 jar
ognl2.7.3.jar
sitemesh-2.4.2.jar
richfaces-api-3.3.3.Final.jar
richfaces-imple-jsf2-3.3.3.Final.jar
richfaces-ui-3.3.3.Final.jar
slf4j-api.jar
slf4j-log4j12.jar
hibernate-core.jar
hibernate-search.jar
hibernate-commons-annotations.jar
hibernate-annotations.jar
standard1.1.2.jar
struts2-corre-2.1.8.jar
struts2-jsf-plugin-2.1.8.1
wsdl4j-1.6.2.jar
xml-apis-1.0.b2.jar
xml-resolver-1.2.jar
xmlbeans-2.4.0.jar
xmlSchema-core 2.0.jar
xwork-core2.1.6.jar
etc...
eg code causing the errors :
hello.jsp
<%# taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%# taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<head>
<title>JSF Example</title>
<head>
<body>
<h2>JSF Example - </h2>
<h:form>
<h:inputText value="#{msg.testmessage}"></h:inputText>
</h:form>
<body>
</html>
I am struggling a lot what went wrong.and the application is running fine in wls 10.3.3.0.
appreciated your help.
Regards,
Ganesh Karanam

FacesServlet not working in web fragment

I have two web applications (web-module1.war & web-module2.war) and I want to use a web fragment (web-core.jar) for common servlet declaration like FacesServlet.
When I declare FacesServlet in web.xml no problem, but when I move this declaration to web-fragment.xml I get this error :
java.lang.IllegalStateException: No Factories configured for this Application.
This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
A typical config looks like this;
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
I don't have this problem with other servlet/filter declaration !
The web-fragment.xml is in web-core.jar's META-INF folder as well as the faces-config.xml.
The web-core.jar is declared as a maven dependency (I can find it in the WEB-INF/lib).
This is web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" metadata-complete="false"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.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_3_0.xsd">
<absolute-ordering>
<name>core_web_fragment</name>
</absolute-ordering>
</web-app>
And web-fragment.xml :
<?xml version="1.0" encoding="UTF-8"?>
<web-fragment metadata-complete="true" version="3.0"
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-fragment_3_0.xsd">
<name>core_web_fragment</name>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-*.xml</param-value>
</context-param>
<!-- /Spring Config -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>inscription.xhtml</welcome-file>
</welcome-file-list>
</web-fragment>
I'm using Tomcat7
If you are using Apache Myfaces JSF implementation this is a known bug
So u should change it ( use MOJARRA for example)

Expression Language (EL) not working in Embedded Glassfish 4.0

I have this code in a .xhtml file:
<h:inputText id="userName" value="#{userEntity.userName}"
title="${bundle['signup.createuser.username']}"
maxlength="#{jsfConst.userNameMaxFieldSize}">
</h:inputText>
But the maxlength property is never set when deploying the war file in Embedded Glassfish 4.0. I deploy the very same war file to Glassfish 4.0 installation and it works fine.
I a using this Glassfish dependency in my POM:
<dependency>
<groupId>org.glassfish.main.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-glassfish-embedded-3.1</artifactId>
<version>1.0.0.CR3</version>
<scope>test</scope>
</dependency>
And this is the jsfConst.java file:
#ManagedBean
#Singleton
#ConcurrencyManagement(ConcurrencyManagementType.BEAN)
public class JsfConst {
public int getEmailFieldSize() {
return Const.emailFieldSize;
}
public int getUserNameMaxFieldSize() {
return Const.userNameMaxFieldSize;
}
}
My question is, what am I missing with Embedded Glassfish that makes it fail to enable the EL?
UPDATE:
This is the web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" 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_1.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<error-page>
<exception-type>com.sun.faces.context.FacesFileNotFoundException</exception-type>
<location>/pagenotfound.jsp</location>
</error-page>
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/sessionexpired.jsp</location>
</error-page>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
</web-app>
In Arquillian, you need to declare all classes that comprise the WAR file to deploy and test. Just register JsfConst in the WAR using ShrinkWrap.create(WebArchive.class, "createUser.war").addClass(JsfConst.class)

Deploy Grails 2.3.0 to Glassfish Server

I have an application build with Grails 2.3.0 and type command 'grails war' to generate a war file.
I type following command to deploy the application :
asadmin deploy APP_PATH/target/myapp.war
But I get the following error:
remote failure: Error occurred during deployment: Exception while deploying the app [myapp] : org.xml.sax.SAXParseException; lineNumber: 137; columnNumber: 15;
Deployment descriptor file WEB-INF/web.xml in archive [myapp]. cvc-complex-type.2.4.a: 從元素 'init-param' found invalid content。expect '{"http://java.sun.com/xml/ns/javaee":run-as, "http://java.sun.com/xml/ns/javaee":security-role-ref, "http://java.sun.com/xml/ns/javaee":multipart-config}'。. Please see server.log for more details.
I use Grails 2.3.0 and get the same error on both Glassfish 3.1.2.2 and Glassfish 4.
How can I fix this error ?
Any help would be appreciate.
-- Update
I use grails command "grails install-templates" to generate web.xml, and move web.xml to web-app/WEB-INF, but still got the same error message. Following is my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
metadata-complete="true"
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">
<display-name>/#grails.project.key#</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>#grails.project.key#</param-value>
</context-param>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter</filter-class>
</filter>
<filter>
<filter-name>charEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<init-param>
<param-name>targetBeanName</param-name>
<param-value>characterEncodingFilter</param-value>
</init-param>
<init-param>
<param-name>targetFilterLifecycle</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>charEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<listener>
<listener-class>org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener</listener-class>
</listener>
<!-- Grails dispatcher servlet -->
<servlet>
<servlet-name>grails</servlet-name>
<servlet-class>org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
<init-param>
<param-name>dispatchOptionsRequest</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<!-- The Groovy Server Pages servlet -->
<servlet>
<servlet-name>gsp</servlet-name>
<servlet-class>org.codehaus.groovy.grails.web.pages.GroovyPagesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>gsp</servlet-name>
<url-pattern>*.gsp</url-pattern>
</servlet-mapping>
<session-config>
<!-- 30 minutes -->
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<!--
The order of the welcome pages is important. JBoss deployment will
break if index.gsp is first in the list.
-->
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.gsp</welcome-file>
</welcome-file-list>
</web-app>

adding spring security on netbeans

I created my project on netbeans and checked spring mvc framework and hibernate.
This created a web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 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_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>redirect.jsp</welcome-file>
</welcome-file-list>
</web-app>
However, whenever I add
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
I'm able to deploy it on tomcat but not able to run it :(
I get this error:
FAIL - Deployed application at context path /project but context failed to start
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
Anyone has suggestions to fix it?

Resources