2015-08-10 3 views
0

Я пытаюсь протестировать свое приложение с весенним тестом, но после множества попыток конфигурации я прошу помощи!Испытание весеннего блока java-config maven Не удалось загрузить ApplicationContext

мои конфигурационные файлы:

AppConfig:

@Configuration 
@Profile(value="profile1") 
@ComponentScan(basePackages={"br.uem.gestaoresiduos"}, 
    [email protected](type=FilterType.REGEX, pattern={"br.uem.gestaoresiduos.web.*"})) 
@PropertySource(value = { "classpath:application.properties" }) 
@EnableScheduling 
@EnableAspectJAutoProxy 
@EnableCaching 
public class AppConfig{ 
    @Autowired 
    private Environment env; 

    @Bean 
    public static PropertySourcesPlaceholderConfigurer placeHolderConfigurer() 
    { 
     return new PropertySourcesPlaceholderConfigurer(); 
    } 

    @Bean 
    public JavaMailSenderImpl javaMailSenderImpl() { 
     JavaMailSenderImpl mailSenderImpl = new JavaMailSenderImpl(); 
     mailSenderImpl.setHost(env.getProperty("smtp.host")); 
     mailSenderImpl.setPort(env.getProperty("smtp.port", Integer.class)); 
     mailSenderImpl.setProtocol(env.getProperty("smtp.protocol")); 
     mailSenderImpl.setUsername(env.getProperty("smtp.username")); 
     mailSenderImpl.setPassword(env.getProperty("smtp.password")); 

     Properties javaMailProps = new Properties(); 
     javaMailProps.put("mail.smtp.auth", true); 
     javaMailProps.put("mail.smtp.starttls.enable", true); 

     mailSenderImpl.setJavaMailProperties(javaMailProps); 

     return mailSenderImpl; 
    } 

    @Bean 
    public CacheManager cacheManager() 
    { 
     return new ConcurrentMapCacheManager(); 
    } 
} 

PersistenceConfig.java

@Configuration 
@EnableTransactionManagement 
    @EnableJpaRepositories(basePackages="br.uem.gestaoresiduos.repositories") 
@PropertySource(value = { "classpath:application.properties" }) 
public class PersistenceConfig 
{ 
@Autowired 
private Environment env; 

@Value("${init-db:false}") 
private String initDatabase; 

@Bean 
public PlatformTransactionManager transactionManager() 
{ 
    EntityManagerFactory factory = entityManagerFactory().getObject(); 
    return new JpaTransactionManager(factory); 
} 

@Bean 
public LocalContainerEntityManagerFactoryBean entityManagerFactory() 
{ 
    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean(); 

    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); 
    vendorAdapter.setGenerateDdl(Boolean.TRUE); 
    vendorAdapter.setShowSql(Boolean.TRUE); 

    factory.setDataSource(dataSource()); 
    factory.setJpaVendorAdapter(vendorAdapter); 
    factory.setPackagesToScan("br.uem.gestaoresiduos.entities"); 

    Properties jpaProperties = new Properties(); 
    jpaProperties.put("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); 
    factory.setJpaProperties(jpaProperties); 

    factory.afterPropertiesSet(); 
    factory.setLoadTimeWeaver(new InstrumentationLoadTimeWeaver()); 
    return factory; 
} 

@Bean 
public HibernateExceptionTranslator hibernateExceptionTranslator() 
{ 
    return new HibernateExceptionTranslator(); 
} 

@Bean 
public DataSource dataSource() 
{ 
    BasicDataSource dataSource = new BasicDataSource(); 
    dataSource.setDriverClassName(env.getProperty("jdbc.driverClassName")); 
    dataSource.setUrl(env.getProperty("jdbc.url")); 
    dataSource.setUsername(env.getProperty("jdbc.username")); 
    dataSource.setPassword(env.getProperty("jdbc.password")); 
    return dataSource; 
} 

@Bean 
public DataSourceInitializer dataSourceInitializer(DataSource dataSource) 
{ 
    DataSourceInitializer dataSourceInitializer = new DataSourceInitializer(); 
    dataSourceInitializer.setDataSource(dataSource); 
    ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator(); 
    databasePopulator.addScript(new ClassPathResource("db.sql")); 
    dataSourceInitializer.setDatabasePopulator(databasePopulator); 
    dataSourceInitializer.setEnabled(Boolean.parseBoolean(initDatabase)); 
    return dataSourceInitializer; 
} 

}

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<groupId>br.uem</groupId> 
<artifactId>tcc-gestao-residuos</artifactId> 
<version>0.0.1-SNAPSHOT</version> 
<packaging>war</packaging> 

<properties> 
    <java.version>1.8</java.version> 
    <junit.version>4.11</junit.version> 
    <slf4j.version>1.7.5</slf4j.version> 
    <logback.version>1.0.13</logback.version> 
    <spring.version>4.2.0.RELEASE</spring.version> 
    <spring-data-jpa.version>1.8.2.RELEASE</spring-data-jpa.version> 
    <spring-security.version>3.2.0.RELEASE</spring-security.version> 
    <hibernate.version>5.0.0.CR4</hibernate.version> 
    <aspectj.version>1.7.2</aspectj.version> 
    <mysql.version>5.1.26</mysql.version> 
    <jackson-json.version>2.3.1</jackson-json.version> 
    <commons-dbcp.version>1.2.2</commons-dbcp.version> 
    <commons-lang3.version>3.1</commons-lang3.version> 
    <my.tomcat.path>/root/workspace/tcc-gestao-residuos/target/tomcat</my.tomcat.path> 
</properties> 

<build> 
    <finalName>${project.artifactId}</finalName> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.1</version> 
      <configuration> 
       <source>${java.version}</source> 
       <target>${java.version}</target> 
       <webXml>\src\main\webapp\WEB-INF\web.xml</webXml> 
      </configuration> 
     </plugin> 

     <plugin> 
      <groupId>org.apache.tomcat.maven</groupId> 
      <artifactId>tomcat7-maven-plugin</artifactId> 
      <version>2.2</version> 
      <configuration> 
       <port>8080</port> 
       <contextReloadable>true</contextReloadable> 
       <outputDirectory>${my.tomcat.path}</outputDirectory> 
      </configuration> 

     </plugin> 
    </plugins> 
</build> 

<dependencies> 

    <!-- Logging dependencies --> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>jcl-over-slf4j</artifactId> 
     <version>${slf4j.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-api</artifactId> 
     <version>${slf4j.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-log4j12</artifactId> 
     <version>${slf4j.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>ch.qos.logback</groupId> 
     <artifactId>logback-classic</artifactId> 
     <version>${logback.version}</version> 
    </dependency> 

    <!-- Spring dependencies --> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context-support</artifactId> 
     <exclusions> 
      <exclusion> 
       <groupId>commons-logging</groupId> 
       <artifactId>commons-logging</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-webmvc</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-test</artifactId> 
    </dependency> 

    <!-- Spring Data JPA dependencies --> 

    <dependency> 
     <groupId>org.springframework.data</groupId> 
     <artifactId>spring-data-jpa</artifactId> 
     <version>${spring-data-jpa.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-entitymanager</artifactId> 
     <version>${hibernate.version}</version> 
    </dependency> 

    <!-- SpringSecurity dependencies --> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-core</artifactId> 
     <version>${spring-security.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-web</artifactId> 
     <version>${spring-security.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-config</artifactId> 
     <version>${spring-security.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security</groupId> 
     <artifactId>spring-security-taglibs</artifactId> 
     <version>${spring-security.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.aspectj</groupId> 
     <artifactId>aspectjweaver</artifactId> 
     <version>${aspectj.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.aspectj</groupId> 
     <artifactId>aspectjrt</artifactId> 
     <version>${aspectj.version}</version> 
    </dependency> 

    <!-- Testing dependencies --> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>${junit.version}</version> 
     <scope>test</scope> 
    </dependency> 

    <!-- DB dependencies --> 
    <dependency> 
     <groupId>mysql</groupId> 
     <artifactId>mysql-connector-java</artifactId> 
     <version>${mysql.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>commons-dbcp</groupId> 
     <artifactId>commons-dbcp</artifactId> 
     <version>${commons-dbcp.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>com.fasterxml.jackson.core</groupId> 
     <artifactId>jackson-databind</artifactId> 
     <version>${jackson-json.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>javax.mail</groupId> 
     <artifactId>mail</artifactId> 
     <version>1.4.3</version> 
    </dependency> 

    <!-- Web dependencies --> 
    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>javax.servlet-api</artifactId> 
     <version>3.0.1</version> 
    </dependency> 

    <dependency> 
     <groupId>taglibs</groupId> 
     <artifactId>standard</artifactId> 
     <version>1.1.2</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>jstl</groupId> 
     <artifactId>jstl</artifactId> 
     <version>1.2</version> 
     <scope>compile</scope> 
    </dependency> 
</dependencies> 

<dependencyManagement> 
    <dependencies> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-framework-bom</artifactId> 
      <version>${spring.version}</version> 
      <type>pom</type> 
      <scope>import</scope> 
     </dependency> 
    </dependencies> 
</dependencyManagement> 

User.java

@Entity 
@Table(name="users") 
public class User 
{ 
    @Id @GeneratedValue(strategy=GenerationType.AUTO) 
    private int id; 
    private String name; 
    @Column(nullable=false, unique=true) 
    private String email; 
    @Column(nullable=false) 
    private String password; 
    private Date dob; 

    @OneToMany(fetch=FetchType.EAGER, cascade=CascadeType.ALL) 
    @JoinColumn(name="user_id") 
    private Set<Role> roles = new HashSet<>(); 
    ... 
} 

UserRepository.java

public interface UserRepository extends JpaRepository<User, Serializable>{ 
} 

UserService.java

@Service 
@Transactional 
public class UserService 
{ 

@Autowired 
private UserRepository userRepository; 

public List<User> findAll() { 
    return userRepository.findAll(); 
} 

public User create(User user) { 
    return userRepository.save(user); 
} 

UserServiceTest.java

@RunWith(SpringJUnit4ClassRunner.class) 
@ContextConfiguration(loader=AnnotationConfigContextLoader.class) 
public class UserServiceTest { 

@Configuration 
static class ContextConfiguration { 

    @Bean 
    public UserService userService() { 
     UserService userService = new UserService(); 
     return userService; 
    } 
} 

@Autowired 
private UserService userService; 

private User user; 

@Before 
public void setUp() throws Exception { 
    user = new User(1, "victor", "[email protected]d.ad", "sfd", null); 
} 

@Test 
public void testCreate() { 
    User result = userService.create(user); 
    user = result; 
} 

}

Ошибка:

[email protected]:~/workspace/tcc-gestao-residuos# mvn tomcat7:run-war -DskipTests 
[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building TCC Gestão de Resíduos UEM 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.2:run-war (default-cli) @ tcc-gestao-residuos >>> 
[INFO] 
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ tcc-gestao-residuos --- 
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] Copying 1 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ tcc-gestao-residuos --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ tcc-gestao-residuos --- 
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] Copying 0 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ tcc-gestao-residuos --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ tcc-gestao-residuos --- 
[INFO] Tests are skipped. 
[INFO] 
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ tcc-gestao-residuos --- 
[INFO] Packaging webapp 
[INFO] Assembling webapp [tcc-gestao-residuos] in [/root/workspace/tcc-gestao-residuos/target/tcc-gestao-residuos] 
[INFO] Processing war project 
[INFO] Copying webapp resources [/root/workspace/tcc-gestao-residuos/src/main/webapp] 
[INFO] Webapp assembled in [319 msecs] 
[INFO] Building war: /root/workspace/tcc-gestao-residuos/target/tcc-gestao-residuos.war 
[INFO] WEB-INF/web.xml already added, skipping 
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.2:run-war (default-cli) @ tcc-gestao-residuos <<< 
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.2:run-war (default-cli) @ tcc-gestao-residuos --- 
[INFO] Running war on http://localhost:8080/tcc-gestao-residuos 
[INFO] Creating Tomcat server configuration at /root/workspace/tcc-gestao-residuos/target/tomcat 
[INFO] create webapp with contextPath: /tcc-gestao-residuos 
ago 10, 2015 5:47:37 PM org.apache.coyote.AbstractProtocol init 
INFORMAÇÕES: Initializing ProtocolHandler ["http-bio-8080"] 
ago 10, 2015 5:47:37 PM org.apache.catalina.core.StandardService startInternal 
INFORMAÇÕES: Starting service Tomcat 
ago 10, 2015 5:47:37 PM org.apache.catalina.core.StandardEngine startInternal 
INFORMAÇÕES: Starting Servlet Engine: Apache Tomcat/7.0.47 
ago 10, 2015 5:47:37 PM org.apache.catalina.loader.WebappClassLoader validateJarFile 
INFORMAÇÕES: validateJarFile(/root/workspace/tcc-gestao-residuos/target/tcc-gestao-residuos/WEB-INF/lib/javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 
ago 10, 2015 5:47:41 PM org.apache.catalina.startup.TaglibUriRule body 
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined 
ago 10, 2015 5:47:41 PM org.apache.catalina.startup.TaglibUriRule body 
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jstl/core is already defined 
ago 10, 2015 5:47:41 PM org.apache.catalina.startup.TaglibUriRule body 
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined 
ago 10, 2015 5:47:41 PM org.apache.catalina.startup.TaglibUriRule body 
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined 
ago 10, 2015 5:47:41 PM org.apache.catalina.startup.TaglibUriRule body 
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined 
ago 10, 2015 5:47:41 PM org.apache.catalina.startup.TaglibUriRule body 
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined 
ago 10, 2015 5:47:41 PM org.apache.catalina.startup.TaglibUriRule body 
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined 
ago 10, 2015 5:47:41 PM org.apache.catalina.startup.TaglibUriRule body 
INFORMAÇÕES: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined 
ago 10, 2015 5:47:41 PM org.apache.catalina.startup.TaglibUriRule body 
INFORMAÇÕES: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined 
ago 10, 2015 5:47:41 PM org.apache.catalina.startup.TaglibUriRule body 
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined 
ago 10, 2015 5:47:41 PM org.apache.catalina.startup.TaglibUriRule body 
INFORMAÇÕES: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined 
ago 10, 2015 5:47:41 PM org.apache.catalina.startup.TaglibUriRule body 
... 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor' 
17:47:42.297 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.event.internalEventListenerFactory' 
17:47:42.329 [localhost-startStop-1] DEBUG o.s.w.c.s.AnnotationConfigWebApplicationContext - Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [[email protected]16386e] 
17:47:42.331 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'lifecycleProcessor' 
17:47:42.335 [localhost-startStop-1] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.liveBeansView.mbeanDomain' in [servletConfigInitParams] 
17:47:42.336 [localhost-startStop-1] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.liveBeansView.mbeanDomain' in [servletContextInitParams] 
17:47:42.336 [localhost-startStop-1] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.liveBeansView.mbeanDomain' in [jndiProperties] 
17:47:42.336 [localhost-startStop-1] DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/env/spring.liveBeansView.mbeanDomain] 
17:47:42.336 [localhost-startStop-1] DEBUG o.s.jndi.JndiLocatorDelegate - Converted JNDI name [java:comp/env/spring.liveBeansView.mbeanDomain] not found - trying original name [spring.liveBeansView.mbeanDomain]. javax.naming.NameNotFoundException: Name [spring.liveBeansView.mbeanDomain] is not bound in this Context. Unable to find [spring.liveBeansView.mbeanDomain]. 
17:47:42.337 [localhost-startStop-1] DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [spring.liveBeansView.mbeanDomain] 
17:47:42.338 [localhost-startStop-1] DEBUG o.s.jndi.JndiPropertySource - JNDI lookup for name [spring.liveBeansView.mbeanDomain] threw NamingException with message: Name [spring.liveBeansView.mbeanDomain] is not bound in this Context. Unable to find [spring.liveBeansView.mbeanDomain].. Returning null. 
17:47:42.338 [localhost-startStop-1] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.liveBeansView.mbeanDomain' in [systemProperties] 
17:47:42.338 [localhost-startStop-1] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment] 
17:47:42.338 [localhost-startStop-1] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null] 
17:47:42.340 [localhost-startStop-1] DEBUG o.s.web.context.ContextLoader - Published root WebApplicationContext as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT] 
17:47:42.349 [localhost-startStop-1] INFO o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 377 ms 
17:47:42.371 [localhost-startStop-1] DEBUG o.s.o.j.s.OpenEntityManagerInViewFilter - Initializing filter 'openEntityManagerInViewFilter' 
17:47:42.374 [localhost-startStop-1] DEBUG o.s.o.j.s.OpenEntityManagerInViewFilter - Filter 'openEntityManagerInViewFilter' configured successfully 
17:47:42.376 [localhost-startStop-1] DEBUG o.s.web.filter.DelegatingFilterProxy - Initializing filter 'delegatingFilterProxy' 
ago 10, 2015 5:47:42 PM org.apache.catalina.core.StandardContext filterStart 
GRAVE: Exception starting filter delegatingFilterProxy 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:698) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1174) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:283) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:201) 
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1051) 
    at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:326) 
    at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:235) 
    at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:199) 
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281) 
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:111) 
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 

ago 10, 2015 5:47:42 PM org.apache.catalina.core.StandardContext startInternal 
GRAVE: Error filterStart 
ago 10, 2015 5:47:42 PM org.apache.catalina.core.StandardContext startInternal 
GRAVE: Context [/tcc-gestao-residuos] startup failed due to previous errors 
ago 10, 2015 5:47:42 PM org.apache.catalina.core.ApplicationContext log 
INFORMAÇÕES: Closing Spring root WebApplicationContext 
17:47:42.393 [localhost-startStop-1] INFO o.s.w.c.s.AnnotationConfigWebApplicationContext - Closing Root WebApplicationContext: startup date [Mon Aug 10 17:47:41 BRT 2015]; root of context hierarchy 
17:47:42.394 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'lifecycleProcessor' 
17:47:42.394 [localhost-startStop-1] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in org.s[email protected]f8fe9ce: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor]; root of factory hierarchy 
ago 10, 2015 5:47:42 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc 
GRAVE: The web application [/tcc-gestao-residuos] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 
ago 10, 2015 5:47:42 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 
GRAVE: The web application [/tcc-gestao-residuos] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. 
ago 10, 2015 5:47:42 PM org.apache.coyote.AbstractProtocol start 
INFORMAÇÕES: Starting ProtocolHandler ["http-bio-8080"] 

...

кто-то может мне помочь ... это правильный конфиг? чего не хватает?!?! Я пробовал много решений, найденных здесь и на других сайтах, но все они не смогли

К сожалению бардак ... это мой первый пост

Большое спасибо

+0

Опубликовать всю трассировку стека, особенно ту часть, где она, вероятно, говорит вам, что отсутствует. – chrylis

+0

изменить - Вставить трассировку стека –

ответ

0

Я полагаю, что у вас есть web.xml файл ваш проект, который ссылается на springSecurityFilterChain фильтр с помощью Spring DelegatingFilterProxy

Вы должны либо удалить его из web.xml для модульных тестов, или добавить его в весеннем контексте тест

Смежные вопросы