Webservlet suddenly stopped working - maven

I have got a Webservlet (Dynamic Web Module 3.1), it looks like this:
package de.timetoact.cce;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ibm.sbt.services.client.ClientServicesException;
import de.timetoact.cce.handler.ContentHandler;
import de.timetoact.cce.util.Connect;
import de.timetoact.cce.util.Util;
import de.timetoact.cce.util.Variables;
#WebServlet(urlPatterns = { "/main" }, loadOnStartup = 1)
public class InitServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
String actionn = request.getParameter("action").toLowerCase();
if (actionn.equals("delete")) {
System.out.println("It does work");
}
}
}
Web.xml:
<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">
<display-name>Archetype Created Web Application</display-name>
<servlet>
<description>The service servlet handles requests from the toolkit to access external resources.</description>
<display-name>Social Business Toolkit Service Servlet</display-name>
<servlet-name>ServiceServlet</servlet-name>
<servlet-class>com.ibm.sbt.service.core.servlet.ServiceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServiceServlet</servlet-name>
<url-pattern>/service/*</url-pattern>
</servlet-mapping>
<servlet>
<description>This servlet initializes the specified JavaScript library for use by the Social Business Toolkit.</description>
<display-name>Social Business Toolkit Library Servlet</display-name>
<servlet-name>LibraryServlet</servlet-name>
<servlet-class>com.ibm.sbt.jslibrary.servlet.LibraryServlet</servlet-class>
<init-param>
<param-name>toolkitExtUrl</param-name>
<param-value>%local_server%/sbtx</param-value>
</init-param>
<init-param>
<param-name>jsLibraryUrl</param-name>
<param-value>%local_server%/sbt/js/libs</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>LibraryServlet</servlet-name>
<url-pattern>/library/*</url-pattern>
</servlet-mapping>
<filter>
<description>This filter is responsible for creating the toolkit application and context objects for every servlet within this web application.</description>
<display-name>Social Business Toolkit Filter</display-name>
<filter-name>SBTFilter</filter-name>
<filter-class>com.ibm.sbt.util.SBTFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SBTFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Yesterday it worked perfectly, but today I get the message:
The requested resource is not available. /CCE/main
I cleaned the project and did update (Maven Update Project)
Nevertheless I got this context error, although I did not change anything.
What is wrong here?

This problem is caused by running two instances of your project in eclipse or tomcat. You can resolve this problem by restarting eclipse or tomcat.

Related

running spring mvc web app and jaxws soap web service in single tomcat instance having 1 web.xml file

I am making a zoho to quickbooks integration. In which I have created web application and soap service for quickbooks desktop to communicate with. My web app works fine with spring annotations but the autowired like annotations don't work. I want to know whether you can keep web.xml configuration like below
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" id="WebApp_ID" version="4.0">
<display-name>zohoquickbooks</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>2</session-timeout>
</session-config>
<servlet>
<servlet-name>zohoquickbooksdispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/zohoquickbooks-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>zohoquickbooksdispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<listener>
<listener-class>
com.sun.xml.ws.transport.http.servlet.WSServletContextListener
</listener-class>
</listener>
<servlet>
<servlet-name>qbservice</servlet-name>
<servlet-class>
com.sun.xml.ws.transport.http.servlet.WSServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>qbservice</servlet-name>
<url-pattern>/qbservice</url-pattern>
</servlet-mapping>
</web-app>
This configuration works. One problem is there for jaxws service in web.xml. The object of implementation class is initiated by jax-ws container and not by spring so autowiring other objects in that class does not work. You can get spring managed objects into non spring managed object by doing specified in this URL "https://dzone.com/articles/autowiring-spring-beans-into-classes-not-managed-by-spring". Otherwise this configuration works fine. You can run web app and soap service on same container on same port. Just the url path needs to be different.
It's easy with spring boot without any xml.
You can use dependency: cxf-spring-boot-starter-jaxws.
https://mvnrepository.com/artifact/org.apache.cxf/cxf-spring-boot-starter-jaxws
It will separate your spring services from jaxws services. By default it will expose jaxws service at url: http://localhost:8080/services
Details you can read here https://cxf.apache.org/docs/springboot.html.
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.xml.ws.Endpoint;
#Configuration
public class ApacheCxfConfig {
#Autowired
private Bus bus;
#Bean
public Endpoint endpoint() {
EndpointImpl endpoint = new EndpointImpl(bus, new NumberConversionSoapTypeImpl());
endpoint.publish("/hello");
return endpoint;
}
}
#WebService(name = "NumberConversionSoapType", targetNamespace = "http://www.dataaccess.com/webservicesserver/")
#XmlSeeAlso({
ObjectFactory.class
})
public interface NumberConversionSoapType {
/**
* Returns the word corresponding to the positive number passed as parameter. Limited to quadrillions.
*
* #param ubiNum
* #return
* returns java.lang.String
*/
#WebMethod(operationName = "NumberToWords")
#WebResult(name = "NumberToWordsResult", targetNamespace = "http://www.dataaccess.com/webservicesserver/")
#RequestWrapper(localName = "NumberToWords", targetNamespace = "http://www.dataaccess.com/webservicesserver/", className = "az.soap.NumberToWords")
#ResponseWrapper(localName = "NumberToWordsResponse", targetNamespace = "http://www.dataaccess.com/webservicesserver/", className = "az.soap.NumberToWordsResponse")
public String numberToWords(
#WebParam(name = "ubiNum", targetNamespace = "http://www.dataaccess.com/webservicesserver/")
BigInteger ubiNum);
}
#Service
#WebService(name = "NumberConversionSoapType", targetNamespace = "http://www.dataaccess.com/webservicesserver/")
public class NumberConversionSoapTypeImpl implements NumberConversionSoapType {
#Override
public String numberToWords(BigInteger ubiNum) {
System.out.println("numberToWords");
return null;
}
}

Auto Repository with Spring Data

I have a little problem in integrating spring with JSF.
I understood that either Spring and JSF have distinct containers. So I can't mix their annotations because registered beans will not be visible to each other.
However, I've read an article : Spring DAO is not injected in JSF managed bean where guy says that It's possible to annotate everything with spring annotations make visible these components to JSF.
I'm really confused with xml configuration because sometimes I read that I don't need it but in most cases I see people usually do this.
My question is what need to be configured if I have this source code and I want to make visible spring beans to JSF :
package pl.catarina.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import pl.catarina.domain.Patient;
import pl.catarina.repository.PatientRepository;
import javax.annotation.PostConstruct;
#Component
#Scope("request")
public class RegisterController {
#Autowired
private PatientRepository patientRepository;
private Patient patient;
#PostConstruct
public void init(){
patient = new Patient();
patient.setName("jan");
patient.setSurname("Way");
patient.setPhoneNumber("21421131");
patient.setEmail("asdpad#gmail.com");
patient.setPassword("pdsad223Sdsd");
}
public void save(){
patientRepository.save(patient);
}
}
REPOSITORY
package pl.catarina.repository;
import org.springframework.stereotype.Repository;
import pl.catarina.domain.Patient;
#Repository
public interface PatientRepository extends UserBaseRepository<Patient> {
Patient findByEmail(String email);
}
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">
<welcome-file-list>
<welcome-file>pages/home.xhtml</welcome-file>
</welcome-file-list>
<!--
FacesServlet is main servlet responsible to handle all request.
It acts as central controller.
This servlet initializes the JSF components before the JSP is displayed.
-->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<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>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</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>com.ocpsoft.pretty.DEVELOPMENT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>bootstrap</param-value>
</context-param>
</web-app>

Request is not mapped to the controller

When I go with the url..http://localhost:8080/springdemo/hello..it is showing 404 not found error..I have put my java file inside src/main/java as usual in Maven project. My controller code is as follows :-
package org.abhishek;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import java.lang.System;
#Controller
public class HelloWorldController {
#RequestMapping(value="/hello", method = RequestMethod.GET)
public ModelAndView helloWorld() {
System.out.println("hello**");
String message = "Hello World, Spring MVC # Javatpoint";
return new ModelAndView("hello", "message", message);
}
}
Web.xml file given below
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="java.sun.com/xml/ns/javaee"; xmlns:xsi="w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="java.sun.com/xml/ns/javaee java.sun.com/xml/ns/javaee/web-app_2_5.xsd">;
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
</web-app>
I put this line System.out.println() for debugging purpose and I found that this method is not executed with the above mentioned url...i.e. http://localhost:8080/springdemo/hello.Please answer..thanx in advance.
This is speculative, but you could have a mapping problem in your web.xml file, which would result in the Spring controller not even being hit (despite having a correct #RequestMapping annotation). Your web.xml file should have the following servlet mapping:
<servlet>
<servlet-name>springServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springServlet</servlet-name>
<url-pattern>/springdemo/*</url-pattern>
</servlet-mapping>
Now paste your URL into a web browser and see if you can hit it:
http://localhost:8080/springdemo/hello

Can not connect JAX-RS service to MVC template

I'm attempting to make use of JAX-RS' (Jersey) MVC pattern. Attempts to reach http://localhost:8080/myproject/foos/test result in an error that reads:
java.io.IOException: The template name, /view, could not be resolved to a fully qualified template name
http://localhost:8080/myproject/foos results in the same error.
What am I missing?
Resource:
package resources;
import com.sun.jersey.api.view.Viewable;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
#Path("foos")
public class FooResource {
#GET
#Produces(MediaType.TEXT_HTML)
public Viewable get() {
return new Viewable("/index", this);
}
#GET
#Path("{id}")
#Produces(MediaType.TEXT_HTML)
public Viewable get(#PathParam("id") String id) {
return new Viewable("/view", id);
}
}
Views:
WEB-INF / jsp / resources / FooResource
index.jsp
view.jsp
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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-app_3_0.xsd">
<filter>
<filter-name>jersey</filter-name>
<filter-class>com.sun.jersey.spi.container.servlet.ServletContainer</filter-class>
<init-param>
<param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name>
<param-value>/(resources|images|js|styles|(WEB-INF/jsp))/.*</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>jersey</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<description>Set the default, base template path to the WEB-INF folder.</description>
<param-name>com.sun.jersey.config.property.JSPTemplatesBasePath</param-name>
<param-value>/WEB-INF/jsp</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ServletAdaptor</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>
Made the following changes:
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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-app_3_0.xsd">
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>welcome.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>jersey</filter-name>
<filter-class>com.sun.jersey.spi.container.servlet.ServletContainer</filter-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>controllers</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name>
<param-value>/((WEB-INF/views))/.*</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.JSPTemplatesBasePath</param-name>
<param-value>/WEB-INF/views/</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.feature.Redirect</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.feature.FilterForwardOn404</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>jersey</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Resource:
#Path("foos")
public class FooResource {
#GET
#Produces(MediaType.TEXT_HTML)
public Viewable index() {
return new Viewable("/foos/index", this);
}
#GET
#Path("{id}")
#Produces(MediaType.TEXT_HTML)
public Viewable view(#PathParam("id") String id) {
return new Viewable("/foos/view", id);
}
}
Views:
\welcome.jsp
\WEB-INF\views\foos\
index.jsp
view.jsp
I had this same error running under Jetty 9. The application ran fine using mvn clean jetty:run but had this error when packaged as a war and deployed under Jetty. This is the fix in web.xml that worked for me:
<init-param>
<param-name>com.sun.jersey.config.property.JSPTemplatesBasePath</param-name>
- <param-value>/WEB-INF/views/</param-value>
+ <param-value>/WEB-INF/views</param-value>
</init-param>
Yep, that's it. So, hopefully this helps someone who stumbles across this. My config is basically the same as craig's, but had the extra slash.
From initial inspection I think you want to put index.jsp and view.jsp directly in WEB-INF/jsp.
The name should be a fully qualified name like /index.jsp or /index.html.

AspectJ Injection in Vaadin working only after I Generate the SerialVersionID

Hi I am using Spring 3 + Spring MVC (half of the site) + Vaadin + AspectJ + JPA2 + Spring Security
My problem is that Spring creates all my Repositories and I would like to share those with Vaadin using AspectJ injection with Spring Annotations, when vaadin is started (Admin part of the site)
I have managed to make it all working after a couple days, I can use the #Configurable Spring annotation in my Vaadin Controller so It can get auto injected with my Spring context repositories,
BTW I am using Compile-Time weaving with maven, codehaus plugins and AspectJ eclipse plugin so tomcat can get the necessary libs.
BUT...
It sometimes works sometimes doesn't...
I found that when I add serializable interface to my repos it works, but only If I ask to generate the serialId and then run the app (tomcat) right after it, if I make any changes and build it again, injection is gone.
My config and Classes...
part that I think matters of my applicationContext.xml
.
.
Other stuff
<context:spring-configured />
<context:component-scan base-package="br.com.gsc" />
<mvc:annotation-driven />
<tx:annotation-driven transaction-manager="transactionManager"/>
.
.
Other stuff
here is the Vaadin Servlet
package br.com.gsc.vaadin;
import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import br.com.gsc.model.tableMapping.Person;
import br.com.gsc.repository.objRepos.PersonRepository;
import com.vaadin.Application;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.Window;
#Configurable(preConstruction=true,autowire=Autowire.BY_TYPE)
public class VaadinOperatorServlet extends Application {
/**
*
*/
private static final long serialVersionUID = -1481084776783567319L;
#Autowired
private transient PersonRepository pRepo;
public void init() {
createWindow();
}
public void createWindow(){
Window window = new Window();
Panel p = new Panel();
Label l = new Label("Teste");
Label l2 = new Label("");
Label l3 = new Label("");
Person person = pRepo.findPersonByID("user");
l2 = new Label(person.getUsername());
p.addComponent(l);
p.addComponent(l2);
window.addComponent(p);
setMainWindow(window);
window.getContent().setSizeFull();
}
}
My Repo
package br.com.gsc.repository.objRepos;
import java.io.Serializable;
import java.util.List;
import org.springframework.stereotype.Repository;
import br.com.gsc.model.tableMapping.Person;
import br.com.gsc.repository.AbsRepository;
import br.com.gsc.repository.objInterfaces.IPersonRepository;
#Repository
public class PersonRepository extends AbsRepository<Person> implements IPersonRepository,Serializable{
/**
*
*/
private static final long serialVersionUID = -8520715359024018210L;
#Override
public void addPerson(Person t) {
add(t);
}
Lot's of other stuff....
}
Web.xml with the servlet routings and other stuff.
<?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>GSC</display-name>
<welcome-file-list>
<welcome-file>/intern.html</welcome-file>
</welcome-file-list>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<!-- Vaadin production mode -->
<context-param>
<param-name>productionMode</param-name>
<param-value>false</param-value>
</context-param>
<!-- SERVLETS -->
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>vaadinServlet</servlet-name>
<servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>br.com.gsc.vaadin.VaadinOperatorServlet</param-value>
</init-param>
<init-param>
<description>Application widgetset</description>
<param-name>widgetset</param-name>
<param-value>br.com.gsc.vaadin.widgetset.GscWidgetset</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- SERVLET MAPPINGS -->
<servlet-mapping>
<servlet-name>vaadinServlet</servlet-name>
<url-pattern>/admin/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>vaadinServlet</servlet-name>
<url-pattern>/oper/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>vaadinServlet</servlet-name>
<url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<!-- Filter OpenSession -->
<filter>
<filter-name>openEntityManager</filter-name>
<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>openEntityManager</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Filter OpenSession -->
<!-- Filter Security -->
<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>
<!-- Filter Security -->
<!-- Filter HTTP Methods -->
<filter>
<filter-name>httpMethodFilter</filter-name>
<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>httpMethodFilter</filter-name>
<servlet-name>spring</servlet-name>
</filter-mapping>
<!-- Filter HTTP Methods -->
</web-app>
Sounds like a problem we had, where we had correctly configured maven to compile-time weave our #Configurable's, but Eclipse did not do this automatically.
This is a feature of the m2eclipse plugin in eclipse that's lacking I think.
Because you correctly define the spring-aspects jar in the aspects path in the pom file, but eclipse doesn't know to do this as well.
So we had to manually add the AOP facet to your project that contains #Configurables, and then configure it to add the spring-aspects.jar as the aspects path.
Then when eclipse compiles, the aspects are woven, and when you run your tomcat from Eclipse, your tomcat will use woven classes, instead of non-woven classes.
Well I could not fix it by any means...
I finally used Spring roo to build a maven web app and pasted all my codes and configs there, because I knew Roo worked out of the box with Aspects.
It's now working... but I have no clue why my last project had that issue with DI outside Spring Context.

Resources