idea 项目 创建Dao对象时编译报错

@Autowired
private RealNameAppleDao realNameAppleDao;

加上这两句话编译就报错
package com.newlife.service.impl;

import com.newlife.dao.RealNameAppleDao;
import com.newlife.model.RealNameApple;
import com.newlife.service.RealNameAppleService;
import org.apache.tomcat.util.http.fileupload.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import java.io.*;
import java.util.List;

/**

  • Created by Administrator on 2016/7/25 0025. */ @Service @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class RealNameAppleServiceImpl implements RealNameAppleService { // @Autowired // private RealNameAppleDao realNameAppleDao; // 不注释这两行程序跑步起来 疑惑

// @Override
public String addModel(RealNameApple realNameApple,MultipartFile file1,MultipartFile file2) {}
}

    报错信息:Caused by: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1696)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
... 33 more

[2016-07-26 10:55:49,558] Artifact Gradle : newlife:NewLife : newlife.war: Error during artifact deployment. See server log for details.
26-Jul-2016 10:55:50.630 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory D:\xiangmu\gongju\apache-tomcat-8.0.36\webapps\manager
26-Jul-2016 10:55:50.702 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory D:\xiangmu\gongju\apache-tomcat-8.0.36\webapps\manager has finished in 71 ms

1个回答

项目 创建Dao对象时编译报错
@Autowired
private RealNameAppleDao realNameAppleDao;

加上这两句话编译就报错
package com.newlife.service.impl;
import com.newlife.dao.RealNameAppleDao;
import com.newlife.model.RealNameApple;
import com.newlife.service.RealNameAppleService;
import org.apache.tomcat.util.http.fileupload.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipar

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐