I am trying to deploy an CDI App to a WebSphere Server! When I deploy the war without the deployment descriptor, everything works fine.
But when I try to deploy the Application with a web.xml deployment descriptor, no Injection will work …
Unfortunately I have to use a dep. desc., because I need to add a Servlet filter to my Application…
My deployment descriptor looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app
id="LohnzettelOnline" version="2.4"
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">
<servlet>
<servlet-name>LohnzettelOnline</servlet-name>
<servlet-class>at.sozvers.pva.lohnzettelonline.ui.Servlet</servlet-class>
<init-param>
<description>Vaadin UI provider to use.</description>
<param-name>UIProvider</param-name>
<param-value>com.vaadin.cdi.CDIUIProvider</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>LohnzettelOnline</servlet-name>
<url-pattern>/lohnzettelonline/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>LohnzettelOnline</servlet-name>
<url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>
<filter>
<filter-name>LoginFilter</filter-name>
<filter-class>ui.util.LoginFilter</filter-class>
<init-param>
<param-name>dropurl.0</param-name>
<param-value>/VAADIN/</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>LoginFilter</filter-name>
<url-pattern>/lohnzettelonline/*</url-pattern>
</filter-mapping>
</web-app>
Where I have to mention, that my Servlet class is extending the VaadinCDIServlet and has some ServletConfiguration:
@VaadinServletConfiguration(ui = MainUI.class, closeIdleSessions = false, productionMode = false)
public class Servlet extends VaadinCDIServlet {
@Override
protected VaadinServletService createServletService(DeploymentConfiguration deploymentConfiguration) throws ServiceException {
LogManager.getLogger().debug("Vaadin Servlet initialized.");
return super.createServletService(deploymentConfiguration);
}