SEVERE Error in deploying WAR in Tomcat .ContainerBase addChildInternal error - java

I am not able to deploy my application war file in Tomcat Server version 7.0.54. Here is the error log.
WEB.XML
<context-param>
<param-name>branding</param-name>
<param-value>default</param-value>
</context-param>
<context-param>
<param-name>brandingTitle</param-name>
<param-value>Webchat: Fastpath</param-value>
</context-param>
<!-- Uncomment to specify your own logging
<context-param>
<param-name>logging</param-name>
<param-value>file://c:/log_file.log</param-value>
</context-param>
-->
<!-- Uncomment to specify your own location for the settings file
<context-param>
<param-name>settings</param-name>
<param-value>file://c:/my_settings.xml</param-value>
</context-param>
-->
<filter>
<filter-name>SetupFilter</filter-name>
<filter-class>org.jivesoftware.webchat.SetupFilter</filter-class>
<init-param>
<param-name>errorPage</param-name>
<param-value>fatal.jsp</param-value>
</init-param>
</filter>
<filter>
<filter-name>CharacterEncoder</filter-name>
<filter-class>org.jivesoftware.webchat.SetCharacterEncodingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SetupFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>CharacterEncoder</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Servlets -->
<servlet>
<servlet-name>FastpathServlet</servlet-name>
<servlet-class>org.jivesoftware.webchat.FastpathServlet</servlet-class>
<!-- Uncomment to have console debugger enabled
<init-param>
<param-name>smackDebugger</param-name>
<param-value>org.jivesoftware.smackx.debugger.ConsoleDebugger</param-value>
</init-param>
-->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>ImageServlet</servlet-name>
<servlet-class>org.jivesoftware.webchat.servlets.ImageServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>DynamicImageServlet</servlet-name>
<servlet-class>org.jivesoftware.webchat.servlets.DynamicImageServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SoundServlet</servlet-name>
<servlet-class>org.jivesoftware.webchat.sounds.SoundServlet</servlet-class>
</servlet>
<!-- Adding Direct Web Remoting Servlet -->
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<display-name>DWR Servlet</display-name>
<description>Direct Web Remoter Servlet</description>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>crossDomainSessionSecurity</param-name>
<param-value>false</param-value>
</init-param>
<!--
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
<description>Do we startup in debug/test mode?</description>
</init-param>
-->
<load-on-startup>-1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<!-- Servlet mappings -->
<servlet-mapping>
<servlet-name>FastpathServlet</servlet-name>
<url-pattern>/live/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ImageServlet</servlet-name>
<url-pattern>/getimage</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>DynamicImageServlet</servlet-name>
<url-pattern>/dynoimages/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SoundServlet</servlet-name>
<url-pattern>/sounds/*</url-pattern>
</servlet-mapping>
<!-- Session config -->
<session-config>
<session-timeout>1</session-timeout>
</session-config>
<mime-mapping>
<extension>jnlp</extension>
<mime-type>application/x-java-jnlp-file</mime-type>
</mime-mapping>
<!-- Welcome file list -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
Please help me get rid of this error!
Thanks
I am using JDK version 1.7. I have seen various solutions, but none have worked so far. It's frustrating.

Resolved the Issue . It seems I had duplicate smack Jars which i had overlooked .
Silly on my part .:/

Related

Spring 5 upgrade issue ResourceServlet

I'm moving from spring 4 to spring 5 (no spring boot yet) and after finally resolving dependency hell (at least I think so) I have problem with deploying app to tomcat with such stacktrace
Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.ResourceServlet
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
... 18 more
I know that ResourceServlet is replaced with ResourceHttpRequestHandler but I cannot find place where I use in some way this ResourceServlet. Any idea how can I get rid of this is welcome.
Here is my web.xml for starters:
<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_1.xsd"
version="3.1">
<distributable />
<display-name>app</display-name>
<context-param>
<param-name>log4jExposeWebAppRoot</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/application-context.xml WEB-INF/application-security.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<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>
<!-- javamelody - web app monitoring tool -->
<filter>
<filter-name>javamelody</filter-name>
<filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
<async-supported>true</async-supported>
</filter>
<filter-mapping>
<filter-name>javamelody</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ASYNC</dispatcher>
</filter-mapping>
<listener>
<listener-class>net.bull.javamelody.SessionListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcherservlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/application-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcherservlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>cxf</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>jolokia-agent</servlet-name>
<servlet-class>org.jolokia.http.AgentServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jolokia-agent</servlet-name>
<url-pattern>/jolokia/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>TrackerServlet</servlet-name>
<servlet-class>log4jwebtracker.servlet.TrackerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TrackerServlet</servlet-name>
<url-pattern>/tracker/*</url-pattern>
</servlet-mapping>

Jersey + GZIP encoding

First of all, I've seem a couple of examples that ilustrate how to use GZIP compression with Jersey.
Although, I saw none that attends the system requirement that I'm developing because I´m using Jersey 1.6 and the Jersey changes drastically from 1.9 to 2.0. Allied of that, all complete examples that I saw are in Jersey 2.0.
Searching for a complete example under 1.9 or less, I found that configuration that was to be places at web.xml file.
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
</init-param>
I think that I have to do something more to allow the GZIP compression.
Note: I have also a welcome file configured.
EDIT: this is my complete 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"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>app</display-name>
<servlet>
<servlet-name>app-servlet</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.app.controllers</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>app-servlet</servlet-name>
<url-pattern>/service/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>hotel-application.html</welcome-file>
</welcome-file-list>
<!-- BEGIN Spring Security Config -->
<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>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/login/*</url-pattern>
</servlet-mapping>
<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>
<!-- END Spring Security Config -->
How do you test your servlet? You have to have Accept-Encoding:gzip in the header. If you test your web services in a browser, the chances are the browser unzips everything and shows it to you. Try this: curl -H Accept-Encoding:gzip -i -u user:pass http://your/web/service

MyFaces app doesn't work on Weblogic 12c

I've got an application which is working perfectly fine on Weblogic 11. But when trying to run it on weblogic 12c, I get this exception:
...
Caused by: 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>
at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:286)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:206)
...
I've got this listener in my web.xml. I've gone through the first two pages on google search on this topic, but didn't find any solution.
I use:
Apache MyFaces 2.1.10
Servlet API 2.5
Spring 3.2.4
Requested: web.xml
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<!--
- ####################
- Spring configuration
- ####################
//-->
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<!--
- Declaration of the SPRING MVC dispatcher servlet.
//-->
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!--load-on-startup>1</load-on-startup-->
</servlet>
<servlet>
<servlet-name>pibEmailServlet</servlet-name>
<servlet-class>com.teamead.fwf.web.PibEmailServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>overviewForward</servlet-name>
<servlet-class>com.teamead.fwf.web.OverviewForwardServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>overviewForward</servlet-name>
<url-pattern>/showMenu/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>pibEmailServlet</servlet-name>
<url-pattern>/sendPibEmail</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>aipUpdateServlet</servlet-name>
<servlet-class>com.teamead.fwf.web.AipUpdateServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>aipUpdateServlet</servlet-name>
<url-pattern>/aip/update</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>aipUpdateServlet</servlet-name>
<url-pattern>/aip/reset</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>validationServlet</servlet-name>
<servlet-class>com.teamead.fwf.web.servlet.ValidationServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>validationServlet</servlet-name>
<url-pattern>/validationServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/pib.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/pib.pdf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/pib.xml</url-pattern>
</servlet-mapping>
<!--
- Specifies the context location for the root application context of this web app.
- The value mentioned here is the default of the ContextLoaderListener.
//-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/properties-config.xml
/WEB-INF/spring/menu/menu-config.xml
/WEB-INF/spring/captcha-service.xml
/WEB-INF/spring/custom-message-service.xml
/WEB-INF/spring/data-access.xml
/WEB-INF/spring/data-source.xml
/WEB-INF/spring/service-definition.xml
/WEB-INF/spring/domain-service.xml
/WEB-INF/spring/spring-security-config.xml
/WEB-INF/spring/cms-config.xml
/WEB-INF/spring/predefined-pib.xml
/WEB-INF/spring/fwf-services-manager.xml
</param-value>
</context-param>
<!-- Theme settings for FLAVOUR -->
<!--context-param>
<param-name>primefaces.THEME</param-name>
<param-value>#{siteService.siteTag}-THEME</param-value>
</context-param-->
<!--If this is not set, the XML comments in pages are rendered as components(i.e. in panelGrid)-->
<context-param>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<!--<listener>
<listener-class>com.bea.p13n.http.SessionMonitor</listener-class>
</listener>-->
<!--
- Listener, to allow Jetty serving MyFaces apps.
//-->
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
<!--
- Loads the specified root application context of this web app at startup,
- by default from "/WEB-INF/services.xml".
//-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--
- ##################################
- Tomahawk MyFaces JSF configuration
- ##################################
//-->
<context-param>
<param-name>org.apache.myfaces.JSF_JS_MODE</param-name>
<param-value>minimal-modern</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.VALIDATE_EMPTY_FIELDS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
<param-value>30</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.jspx</param-value>
</context-param>
<context-param>
<param-name>facelets.VIEW_MAPPINGS</param-name>
<param-value>/public/*;/restricted/*;/ajaxlogin/*;/mobile/*</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.CHECK_ID_PRODUCTION_MODE</param-name>
<param-value>false</param-value>
</context-param>
<!-- ONLY FOR WEBLOGIC DEPLOYMENT -->
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>2</param-value>
</context-param>
<context-param>
<param-name>primefaces.PRIVATE_CAPTCHA_KEY</param-name>
<param-value>6Ldx8eYSAAAAAI7A7Ln5GjOvQ88YD5HwwXV-KyUR</param-value>
</context-param>
<context-param>
<param-name>primefaces.PUBLIC_CAPTCHA_KEY</param-name>
<param-value>6Ldx8eYSAAAAAIyXv7tZAlOm5IGPYkIO1wLKHKMK</param-value>
</context-param>
<context-param>
<description>
This parameter tells MyFaces if javascript code should be allowed in the
rendered HTML output.
If javascript is allowed, command_link anchors will have javascript code
that submits the corresponding form.
If javascript is not allowed, the state saving info and nested parameters
will be added as url parameters.
Default: "true"
</description>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<description>
If true, rendered HTML code will be formatted, so that it is "human readable".
i.e. additional line separators and whitespace will be written, that do not
influence the HTML code.
Default: "true"
</description>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>
/WEB-INF/taglib/messages.taglib.xml;/WEB-INF/taglib/springsecurity.taglib.xml
</param-value>
</context-param>
<!-- if you want to disable the behaviour completely -->
<context-param>
<param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
<param-value>false</param-value>
</context-param>
<!-- if you are using myfaces + facelets don't forget to do this -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>false</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>
<servlet-name>Redirect Servlet</servlet-name>
<servlet-class>com.teamead.fwf.web.RedirectServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Redirect Servlet</servlet-name>
<url-pattern>/redirect</url-pattern>
</servlet-mapping>
<!--
- Faces Servlet Mapping.
//-->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<filter>
<filter-name>Character Encoding</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<!--
- Spring Security filter chain.
//-->
<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>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<!--
- The corresponding filter mapping
//-->
<filter-mapping>
<filter-name>Character Encoding</filter-name>
<url-pattern>*.faces</url-pattern>
</filter-mapping>
<!--
- Common data source.
//-->
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/CS_PU</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<!--
- Welcome Files.
//-->
<welcome-file-list>
<welcome-file>index.jspx</welcome-file>
</welcome-file-list>
</web-app>

How to have a servlet for a specific resource but use wicket for the rest of the web application

I'm trying to add Atmosphere support to a Wicket-1.5.X web application. (Currently upgrading to 6 isn't an option.)
I currently have the wicket filter configured to run on top of the Atmospheres MeteorServlet. I've created an sharedResource for Atmosphere to be used in my application.
I'm noticing that however with that configuration even pages(like my static login page) that don't use the shared resource still seem activate it.
I think the solution is to move the wicket filter from On top of the MeteorServlet to next to it. so that /App/MyResource will fire meteor but everything else with just get wicket.
How can I do that?
In Case it Matters:
Tomcat 6.0.29
Firefox 16.0.x
IE 9
UPDATE:
Here is what My web.xml currently looks like:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>CSC</display-name>
<!--
added for Spring Wicket Hibernate compatibility
From: http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/
-->
<context-param>
<!-- tells Spring to look in the Class Path for applicationContext.xml -->
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<!-- Starts Spring -->
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- prevent hibernate LazyLoadingException -->
<filter>
<filter-name>openSessionInView</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
<init-param>
<param-name>SessionFactoryBeanName</param-name>
<param-value>sessionFactory</param-value>
</init-param>
<init-param>
<param-name>applicationFactoryClassName</param-name>
<param-value>org.apache.wicket.SpringWebApplicationFactory</param-value>
</init-param>
<init-param>
<param-name>applicationBean</param-name>
<param-value>wicketApplication</param-value>
</init-param>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>
us.ak.state.revenue.cssd.Personnel.QuickStartApplication
</param-value>
</init-param>
<init-param>
<param-name>configuration</param-name>
<param-value>deployment</param-value>
</init-param>
<init-param>
<param-name>contextpath</param-name>
<param-value>CSC</param-value>
</init-param>
<init-param>
<param-name>fileEncoding</param-name>
<param-value>ISO-8859-1</param-value>
</init-param>
</filter>
<!--Atmosphere support, to remove the Ajax Updating Bug CSC-2 -->
<servlet>
<description>MeteorServlet</description>
<servlet-name>CSC</servlet-name>
<servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class>
<init-param>
<param-name>org.atmosphere.filter</param-name>
<param-value>org.apache.wicket.protocol.http.WicketFilter</param-value>
</init-param>
<!-- directory settings -->
<init-param>
<param-name>org.atmosphere.cpr.AtmosphereHandler.contextRoot</param-name>
<param-value>CSC</param-value>
</init-param>
<!-- Abilities -->
<init-param>
<param-name>org.atmosphere.useWebSocket</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.useNative</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.cpr.sessionSupport</param-name>
<param-value>true</param-value>
</init-param>
<!-- let Atmosphere handle keep alive,
make sure broadcast happens AFTER AJAX stuff -->
<init-param>
<param-name>
org.atmosphere.cpr.AtmosphereInterceptor
</param-name>
<param-value>
org.atmosphere.interceptor.AtmosphereResourceLifecycleInterceptor,
org.atmosphere.interceptor.BroadcastOnPostAtmosphereInterceptor
</param-value>
</init-param>
<!-- shouldn't this be defaultContentType? sets Content-Type header default -->
<init-param>
<param-name>org.atmosphere.cpr.defaultContextType</param-name>
<param-value>text/plain</param-value>
</init-param>
<init-param>
<param-name>filterMappingUrlPattern</param-name>
<param-value>/*</param-value>
</init-param>
<!-- minimize memory share broadcaster -->
<init-param>
<param-name>org.atmosphere.cpr.broadcaster.shareableThreadPool</param-name>
<param-value>true</param-value>
</init-param>
<!-- error recovery -->
<init-param>
<param-name>
org.atmosphere.cpr.recoverFromDestroyedBroadcaster
</param-name>
<param-value>true</param-value>
</init-param>
<!-- wicket filter settings -->
<init-param>
<param-name>applicationFactoryClassName</param-name>
<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
</init-param>
<init-param>
<param-name>applicationBean</param-name>
<param-value>wicketApplication</param-value>
</init-param>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>us.ak.state.revenue.cssd.QuickStartApplication</param-value>
</init-param>
<init-param>
<param-name>configuration</param-name>
<param-value>deployment</param-value>
</init-param>
<init-param>
<param-name>contextpath</param-name>
<param-value>CSC</param-value>
</init-param>
<init-param>
<param-name>fileEncoding</param-name>
<param-value>ISO-8859-1</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CSC</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<filter-mapping>
<filter-name>openSessionInView</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<mime-mapping>
<extension>ico</extension>
<mime-type>image/x-icon</mime-type>
</mime-mapping>
</web-app>
P.S.: Maybe a fellow wicket Dev knows, does 1.5 still work as a filter or a servlet?
Dunno about this specific case, but typically it's just a matter of adding a definition and mapping to web.xml before the framework (i.e. Wicket) mapping:
<servlet>
<servlet-name>myservlet</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>myservlet</servlet-name>
<url-pattern>/mystuff</url-pattern>
</servlet-mapping>

JSF doesn't interpreted in seam

Hy guys,
I installed jboss-seam on weblogic 10.3 (with many problem :( ) but now it's work, my application is deployed.
But now, I have a new problem, my JSF isn't interpreted and the JSF code appears in HTML.
Here is my 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" version="2.5">
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
<!-- RichFaces -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>glassX</param-value>
</context-param>
<!-- Suppress spurious stylesheets -->
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>disable</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
<param-value>disable</param-value>
</context-param>
<!-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -->
<context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
</servlet>
<!-- Facelets development mode (disable in production) -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>#debug#</param-value>
</context-param>
<!-- JSF -->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.seam</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>*.seam</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Seam Resource Servlet</servlet-name>
<url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/AuthenticatorAction/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>org.jboss.seam.example.booking.Authenticator</local>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/BookingListAction/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>org.jboss.seam.example.booking.BookingList</local>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/RegisterAction/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>org.jboss.seam.example.booking.Register</local>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/ChangePasswordAction/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>org.jboss.seam.example.booking.ChangePassword</local>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/HotelBookingAction/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>org.jboss.seam.example.booking.HotelBooking</local>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/HotelSearchingAction/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>org.jboss.seam.example.booking.HotelSearching</local>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/EjbSynchronizations/local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
</ejb-local-ref>
<session-config>
<session-timeout>10</session-timeout>
</session-config>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
</web-app>
My FacesServlet is load in startup but JSF doesn't work.
Someone can help me ?
Thanks.
If the XHTML page is not been parsed by the FacesServlet, then it simply means that the request URL did not match the url-pattern of the FacesServlet. You have set its url-pattern to *.seam So, to open the JSF page, you should not invoke it by http://example.com/page.xhtml, but by http://example.com/page.seam.
By the way, the javax.faces.DEFAULT_SUFFIX sets the actual file extension of template files where JSF should look for and parse. You've set it to .seam as well, but this should really be .xhtml.
I dont know if this will help, but here is our web.xml
<?xml version="1.0" ?>
<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_2_5.xsd"
version="2.5">
<!-- Ajax4jsf -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<!--
This config will enforce the container to compress all the richfaces
resources including images, stylesheets, javascript to be compressed
before sending to client. It will make significant reduced load time.
-->
<context-param>
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<!-- Seam -->
<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
<filter>
<filter-name>UTF8 Filter</filter-name>
<filter-class>foo.bar.filter.UTF8Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>UTF8 Filter</filter-name>
<url-pattern>*.seam</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Seam Resource Servlet</servlet-name>
<url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>
<!-- Facelets development mode (disable in production) -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<!-- JSF -->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.LIBRARIES</param-name>
<param-value>/WEB-INF/kf.taglib.xml</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>*.seam</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.csv</url-pattern>
</servlet-mapping>
<!-- Job executor servlet for jBPM Timers -->
<!-- TODO: Restrict access or better switch to ejb3 TimerService -->
<servlet>
<description>
This servlet has the purpose of executing pending jobs.
</description>
<servlet-name>JobExecutorServlet</servlet-name>
<servlet-class>org.jbpm.job.executor.JobExecutorServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>JobExecutorServlet</servlet-name>
<url-pattern>/jobs</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Document Store Servlet</servlet-name>
<servlet-class>org.jboss.seam.document.DocumentStoreServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Document Store Servlet</servlet-name>
<url-pattern>*.pdf</url-pattern>
</servlet-mapping>
<security-constraint>
<display-name>Restrict raw XHTML Documents</display-name>
<web-resource-collection>
<web-resource-name>XHTML</web-resource-name>
<url-pattern>*.xhtml</url-pattern>
</web-resource-collection>
<auth-constraint />
</security-constraint>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
I had this in my web.xml:
<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
And now, it's working.

Categories