搭建maven项目中遇见的问题

搭建maven项目中遇见的问题

问题:“Dynamic Web Module 3.0 requires Java 1.6 or newer.”

问题原因:jdk的版本不对

解决方式:在pom.xml中build标签中加入

<plugins>  
    <plugin>  
        <groupId>org.apache.maven.plugins</groupId>  
        <artifactId>maven-compiler-plugin</artifactId>  
        <version>2.3.2</version>  
        <configuration>  
            <source>1.6</source>  
            <target>1.6</target>  
        </configuration>  
    </plugin>  
</plugins>  

问题:Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

问题:Tomcat启动报错 Document base ……does not exist or is not a readable directory

原因:tmp0\conf\server.xml 中Context节点配置了很多已经移除的项目
解决方法:
1. 删除无用的 tmp0\conf\server.xml 中的 Context 节点;
2. 删除 tmp0\work\Catalina\localhost 下的所有文件夹;

问题:
Error creating bean with name ‘org.springframework.context.annotation.internalAsyncAnnotationProcessor’。。。。
@EnableAsync annotation metadata was not injected

问题原因:在applicationContext.xml中 配置包扫描器时, 使用了*, 想扫描所有的包; 而这种方式有可能扫描到spring自带的包, 造成错。

<context:component-scan base-package="*"/>

解决办法:改为

<context:component-scan base-package="service.*,dao.*,action.*"/>

问题:新建的maven项目中没有src/main/java等文件夹

解决:在项目上右键选择properties,然后点击java build path,在Librarys下,编辑JRE System Library,选择workspace default jre就可以了。

问题:Unsatisfied dependency expressed through field

解决:可能是因为有多个,autowired不知道该注入那一个

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值