Servlet mapping specifies an unknown servlet name when use spring4gwt library - spring

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

Related

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

How to Change url localhost spring?

I´m using spring mvc, I have got a project (Apliconta2Web) and your url is //Apliconta2Web/, but if i copy this project and change your name by (Apliconta3WebPrimefaces) when i push button run as i want url //Apliconta3WebPrimefaces/ but always i have got //Apliconta2Web/.
I have changed servlet-name. and add server the name is Apliconta3WebPrimefaces(Apliconta2Web)
How i can change it? Very thank. sorry by my english. i´m learning.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:web="http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
<display-name>Aplicacion Web Apliconta3WebPrimefaces</display-name>
<servlet>
<servlet-name>apliconta3webPrimeFaces</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-mapping>
<servlet-name>apliconta3webPrimefaces</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
</web-app>

Error Parsing /index.xhtml: not supported setting property http://xml.org/sax/properties/lexical-handler

I am trying to build a project using JSF, JPA, Spring, but I am not able to succeed. I am using JBoss as my server. It shows no error, but shows 404 error. Interesting thing is that when I use Tomcat, then the console is clear, but on loading page it shows,
Error Parsing /index.xhtml: not supported setting property http://xml.org/sax/properties/lexical-handler
Here's the complete stack trace
javax.faces.view.facelets.FaceletException: Error Parsing /index.xhtml: not supported setting property http://xml.org/sax/properties/lexical-handler
at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:425)
at com.sun.faces.facelets.compiler.SAXCompiler.doMetadataCompile(SAXCompiler.java:408)
at com.sun.faces.facelets.compiler.Compiler.metadataCompile(Compiler.java:130)
at com.sun.faces.facelets.impl.DefaultFaceletFactory.createMetadataFacelet(DefaultFaceletFactory.java:327)
at com.sun.faces.facelets.impl.DefaultFaceletFactory.access$200(DefaultFaceletFactory.java:93)
at com.sun.faces.facelets.impl.DefaultFaceletFactory$2.newInstance(DefaultFaceletFactory.java:166)
at com.sun.faces.facelets.impl.DefaultFaceletFactory$2.newInstance(DefaultFaceletFactory.java:164)
at com.sun.faces.facelets.impl.DefaultFaceletCache$2.newInstance(DefaultFaceletCache.java:94)
at com.sun.faces.facelets.impl.DefaultFaceletCache$2.newInstance(DefaultFaceletCache.java:89)
at com.sun.faces.util.ExpiringConcurrentCache$1.call(ExpiringConcurrentCache.java:99)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.sun.faces.util.ExpiringConcurrentCache.get(ExpiringConcurrentCache.java:114)
at com.sun.faces.facelets.impl.DefaultFaceletCache.getViewMetadataFacelet(DefaultFaceletCache.java:143)
at com.sun.faces.facelets.impl.DefaultFaceletCache.getViewMetadataFacelet(DefaultFaceletCache.java:62)
at com.sun.faces.facelets.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:260)
at com.sun.faces.facelets.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:209)
at com.sun.faces.application.view.ViewMetadataImpl.createMetadataView(ViewMetadataImpl.java:114)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:233)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
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: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_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Jsf_Spring_Jpa</display-name>
<!-- Welcome Page -->
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<!-- 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>/faces/*</url-pattern>
</servlet-mapping>
<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>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<!-- Spring Context Configuration' s Path definition -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value> /WEB-INF/applicationContext.xml</param-value>
</context-param>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<!-- Project Stage Level -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<!-- 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>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
</web-app>
How is this caused and how can I solve it?
This error comes from pull-parser which is an optional dependency of dom4j. You might be inadvertently getting pull-parser on your classpath even though it's optional for dom4j. Try explicitly excluding it and using your JDK's built-in parser instead (e.g. com.sun.org.apache.xerces.internal.parsers.SAXParser) which it should do by default then.
This question is 6 years old, so the following cannot have been the problem, but: in my Gradle project upgrading from Gradle 5.4 to Gradle 6.5 suddenly resulted in pull-parser being on the classpath because of a dependency on dom4j even though, as mentioned, the dependency of dom4j on pull-parser is optional and previously that wasn't happening. I've reported this to the Gradle project: https://github.com/gradle/gradle/issues/13656.
I get rid of the error by adding following dependency (in Gradle syntax):
implementation 'pull-parser:pull-parser:2.1.10'

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"/>

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

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.

Resources