开发者社区> 问答> 正文

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

展开
收起
爱吃鱼的程序员 2020-06-23 00:48:00 669 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    项目创建Dao对象时编译报错
    @Autowired
    privateRealNameAppleDaorealNameAppleDao;

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

    2020-06-23 00:48:18
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
蚂蚁金服高级开发工程师萧恺:IDEA 插件开发入门教程 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载