一直显示import """cannot be resolved

报错:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'fabricService' defined in ServletContext resource [/WEB-INF/classes/spring/applicationContext-servic
e.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [textile.ssm.service.impl.FabricServiceImpl]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
The import com.ruanjian cannot be resolved
name cannot be resolved to a variable。
我import 全部都删除了为什么还会跳出这个错误?

3个回答

/WEB-INF/classes/spring/applicationContext-service.xml 这里面定义了一个bean fabricService有问题,问题后面不是提示了吗,Could not instantiate bean class [textile.ssm.service.impl.FabricServiceImpl]: Constructor threw exception 不能够初始化,构造函数抛出异常,后边是说Unresolved compilation problems:The import com.ruanjian cannot be resolved name cannot be resolved to a variable。这个名字不能当一个变量处理之类的,你还是仔细查查代码吧

sinat_34890672
sinat_34890672 就算全部改完了还是提示这个问题
大约 3 年之前 回复

the import cannot be resolved
在家用的是jdk1.7 到单位后把项目导入后,出现

the import xxxxx  cannot be resolved
原来是myeclipse使用默认的jdk 1.6 所以出错
更改如下

然后 把jdk改一下就可以了......
答案就在这里:the import cannot be resolved
----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?

idea 的话,就是部署有问题。删掉部署包。再部署就好了

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
The import org.eclipse cannot be resolved
[code=Java]rnimport org.eclipse.jface.action.StatusLineManager;rnimport org.eclipse.jface.action.ToolBarManager;rnimport org.eclipse.jface.window.ApplicationWindow;rnimport org.eclipse.swt.SWT;rnimport org.eclipse.swt.events.SelectionAdapter;rnimport org.eclipse.swt.events.SelectionEvent;rnimport org.eclipse.swt.graphics.Point;rnimport org.eclipse.swt.widgets.Button;rnimport org.eclipse.swt.widgets.Composite;rn[/code]rnrn错误提示:rnThe import org.eclipse cannot be resolvedrnrn我只是装了jdk和eclipse ide for j2ee developersrn我是不是缺了什么没装好啊,所以会有那个错误?
The import cannot be resolved 问题
rn//rnimport java.io.*;rnimport javax.bluetooth.*;rnimport javax.microedition.io.*;rnrnpublic class ConnHandler extends Thread rn private Server owner = null;rn public ConnHandler (Server owner)rn super();rn this.owner = owner;rn rn//rn//rnimport java.awt.*;rnimport javax.swing.*;rnrnpublic class Server extends JFrame rn public Server () rn super();rn ......rn ......rn ConnHandler handler = new ConnHandler(this);rn handler.start();rn rn//rnrn 以上两个类ConnHandler, Server之间有关联,所以打算放在同一个工程的同一个包里rnrn 但是,当我建立的工程是普通的Java 工程的时候,ConnHandler中的import 语句就提rn示错误:import javax.bluetooth.*;rn import javax.microedition.io.*;rn 这两句提示The import cannot be resolvedrn此时Server中无错误。rnrn 而当我建立的工程是J2ME MIDlet Suite,也就是 J2ME MIDlet 工程时,情况就反过来rn了:Server中的import语句有错:import java.awt.*;rn import javax.swing.*;rn 这两句提示The import cannot be resolvedrn此时ConnHandler中无错误。rnrn 不知道该怎么办啊..rn
The import java.util cannot be resolved
刚用MyEclipse6.5+Tomcat6.0做我的课程设计,但刚写2句话就有错误。rn我安的是JDK6.0,在C盘。写一般的java程序没有问题、rn[code=HTML]rn<%@page contentType="text/html;charset=gbk" %>rn<%@page language="java" import="java.util.*" %>rn[/code]rn提示说“The import java.util cannot be resolved”rn我在网上查找说可能是build path中没有设置好。rn[img=http://hi.csdn.net/attachment/201101/3/6202528_1294061531WD8A.jpg][/img]rn[img=http://hi.csdn.net/attachment/201101/3/6202528_1294061527hevV.jpg][/img]
The import javax.bluetooth cannot be resolved
import javax.bluetooth.BluetoothStateException;rnimport javax.bluetooth.DiscoveryAgent;rnimport javax.bluetooth.LocalDevice;rnimport javax.bluetooth.UUID;rnrn都有错误,rnrnUUID,LocalDevice都cannot be resolved to a typernrn我应该加入哪个jar包?rnrn我在网上搜了好长时间,但是都不知道javax.bluetooth.* 下的东西都在哪个jar包中。。。rnrn我该在google 或 baidu 中怎么搜索?
The import net cannot be resolved
rnimport java.io.BufferedInputStream;rnimport java.io.File;rnimport java.io.FileInputStream;rnimport java.io.FileNotFoundException;rn[color=#FF6600]import net.mindview.util.Print[/color].*;rnpublic class ReadLineDemo rn static void main(String[] args) rn File file=new File("text.txt");rn tryrn FileInputStream input=new FileInputStream(file);rn catch(FileNotFoundException e)rn rn rn rnrn在reference中已经引入net.mindview.util.Print包rn但是提示包为引入
The import org.javia cannot be resolved
import org.javia.arity.Symbols;rnimport org.javia.arity.SyntaxException;rnimport org.javia.arity.Util;rnrnrn三个均提示The import org.javia cannot be resolvedrnrn请问如何解决?
The import com.jauker cannot be resolved
import com.jauker.widget.BadgeView; rn这一行怎么显示 The import com.jauker cannot be resolved.
The import info cannot be resolved
在工程里面rnrnimport info.monitorenter.cpdetector.io.ASCIIDetector;rnimport info.monitorenter.cpdetector.io.CodepageDetectorProxy;rnimport info.monitorenter.cpdetector.io.JChardetFacade;rnimport info.monitorenter.cpdetector.io.ParsingDetector;rnimport info.monitorenter.cpdetector.io.UnicodeDetector;rnrn提示:The import info cannot be resolvedrn该怎么解决呢?是不是要引入jar文件啊?rn
The import java.util.Arrays cannot be resolved
package com.xx;rnimport java.util.Arrays;rnrnpublic class Score2 rn public static void main(String[] args)rn int[] scores = new int[10];rn for(int score: scores)rn System.out.printf("%2d",score);rn rn rn System.out.println();rn System.out.println("--------------------");rn Arrays.fill(scores, 60);rn for(int score: scores)rn System.out.printf("%3d",score);rn rn rn rn rnrnrn
The import org.apache.commons cannot be resolved
我用的是eclipse和tomcat,导入:commons-fileupload-1.1.1.jar,和commons-io-1.2.jar两个包后,还是出现上面的问题即:The import org.apache.commons cannot be resolved,求解!
The import javax.jnlp cannot be resolved
import javax.jnlp.*;rnRT,用的Eclipse不知何解,求解!
The import cn cannot be resolved
今天刚刚换了eclipse,新建工程后, rn把一些类文件拷贝到工程目录下, (.java的)rn调用的时候 就提示 rnThe import cn cannot be resolvedrnrn在网上查了一下,也没有弄明白,第一次接触 eclipse,大家帮我看看,指点一下 ,谢谢了。
The import org.springframework.stereotype cannot be resolved
Spring Web flow中的一个例子jsf-booking
The import org.jdom cannot be resolved
myeclipse刚导入一个项目就出现这样的问题!请教下
import 时 cannot be resolved
[img=http://my.csdn.net/my/album/detail/1156757][/img][img=http://my.csdn.net/my/album/detail/1156756][/img]
spring 显示the import "org.aspectj" cannot resolved
spring tool suite新建菜单中有Aspectj projectn但是import org.aspectj.lang.annotation.*;会显示the import org.aspectj cannot resolved**
struts1中的错误:The import org.apache.struts cannot be resolved
我使用struts1和hibernate做一个小的测试,在myeclipse中增加了struts1.2和hibernate的特性rn可是,添加好特性之后,在我继承的action类中,会import org.apache.struts.action.ActionForward;rn系统在这一句上提示错误:rnrnThe import org.apache.struts cannot be resolvedrnrn我看了我的bulid path中包含的jar,其中指定了strust的jar,我到他指定的目录下面看了一下,那些jar包的确都在,可系统就是提示找不到那些jar,这是为何?rn请高手指教
the import java.sql cannot be resolved怎么解决
代码如下rnrn<%@ page language="java" contentType="text/html; charset=gb2312"rn pageEncoding="gb2312"%>rn<%@ page import="java.sql.*"%> //此处红XX提示the import java.sql cannot be resolved rnrn<%// 禁止浏览器缓冲保留数据rn response.setHeader("Cache-Control","no-store");rn response.setHeader("Pragma","no-cache");rn response.setDateHeader("Expores",0);rn%>rnrnrnrnrnrnrnrnrn rn 社团首页rn rn rnrnrnrnrnrn <%@include file="head.html"%>rn rn rn rn 公告栏rn 社团最近活动rn 赞助商rn rn rn rn rn rn rn rn rn <%String sql = "select Gcontent,Gtime from notice";rn ResultSet rs = DBconn.executeQuery(sql);rn %>rn rn rn rn rn rn <%while(rs.next())%>rn <%=rs.getString("Gcontent") %>rn rn <%=rs.getDate("Gtime")%> rn rn rn rn <%%>rn rn rn rn rn rn rn rn rn <% sql="select Hno,Htopic,Htime from event order by Htime DESC"; // DB is SAMSrn ResultSet events=DBconn.executeQuery(sql);rn int sum=1;rn String bgcolor = "#ddccdd";rn while(events.next() && sum++<10) rn if(sum%2==0) bgcolor = "#FFFFFF";rn else bgcolor = "#FFFFFF";rn %> rn >rn rn <%=events.getString(2)%>rn <%=events.getDate(3)%>rn <%%>rn rn rn rn rn rn rn rn rn rn rn rn rn 用户名:rn rnrn 密 码: rn rn rn rn rn rn rnrn rn rn rn rn 友情链接rn 社团简介rn 优秀会员rn rn rn rn 友情链接rn 友情链接rn 友情链接rn 友情链接rn rn rn 笛箫口琴协会直属与社团联合会,以丰富大学生课余rn 文化生活而成立的社团机构, 该协会成立于2002年,经过三年的发展,会员rn 现以达到450多人,成为我校具有极强实力及生命力的协会之一。协会现设有rn 组织部、宣传部、外联部、会员部、笛箫部及口琴部,各部协调发展为协会的rn 进一步发展起了很好的作用。 rn  协会宗旨:笛箫口琴协会以培训会员的笛、箫、口琴rn 的基本演奏技能为主, 并开展多种文艺活动。在社团联合会及其他社团的帮助与rn 合作中,协会常联合其他社团一起组织大型的文艺活动,在学生中引起了很大的rn 反响。 rn rn rnrnrn rn rn <%@include file="tail.html"%>rnrnrn
The import javax.media cannot be resolved 请问如何解决?
我已经下载安装了JMFrn用户环境变量CLASSPATH如下rn.;.;d:\PROGRA~1\java\JMF21~1.1E\lib\sound.jar;d:\PROGRA~1\java\JMF21~1.1E\lib\jmf.jar;d:\PROGRA~1\java\JMF21~1.1E\lib;rnrn系统环境变量PATH如下rn%SystemRoot%\system32;d:\PROGRA~1\java\JMF21~1.1E\bin;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Common Files\Thunder Network\KanKan\Codecsrnrn但是我在Eclipse 里面使用import javax.media.*;仍然被划了红色下划波浪线rnThe import javax.media cannot be resolvedrnrn我按照网络上找到的JMF安装方法以及环境变量检查都通过了,也重启机器了rn怎么还是这样啊,求救!!!
此问题The import org.springframework.stereotype cannot be resolved如何解决
Spring Web Flow 中的一个例子jsf-booking中的ReferenceData.java中的import org.springframework.stereotype.Service;出现错误提示为The import org.springframework.stereotype cannot be resolved,请问如何解决!
the import javax.servlet cannot be resolved是什么问题啊。
我刚接触JAVA,rn很多都不懂,望指点。
导入工程的“The import android cannot be resolved”错误解决方法
导入工程的“The import android cannot be resolved”错误解决方法
求助解决办法,eclipse报错“The import org.apache.commons.math cannot be resolved”
在eclipse中发布项目时,eclipse报错显示“The import org.apache.commons.math cannot be resolved”,通过添加Commons.jar包,编译后问题依然存在。现在很疑惑,不知道怎么去解决了,想向前辈们咨询一下。
eclipse 配合 weblogic The import cannot be resolved 的问题
请问各位大侠,我使用eclipse 和 weblogic 开发jsp,自建pb类后eclipse 放在src下,使用<% import%> 或者rn在编写是没有报错,但是运行时出现The import pb cannot be resolved 和 pb cannot be resolved to a type的错误,若是不导入类则没有问题,请问应该在哪里如何配置?谢谢rn
在线等 The import javax.microedition.pim cannot be resolved
见标题:The import javax.microedition.pim cannot be resolvedrn rn 哪里有 javax.microedition.pim可选包下载?rnrn 在线等 解决问题立马结账!不够再加啊!
The import org.codehaus.xfire.security cannot be resolved如何解决
The import org.codehaus.xfire.security cannot be resolved如何解决
导入maven项目出现 The import com.sun.jna cannot be resolved
用项目clean后还是没有解决包括maven updatern有没有大神碰到过这种情况?求解
The import org.springframework.orm cannot be resolved?这是怎么回事??
程序里老出现:The import org.springframework.orm cannot be resolvedrn然后这里都有错误:rnpublic class AaaaDAO extends HibernateDaoSupport =============这里的HibernateDaoSupportrn private static final Log log = LogFactory.getLog(AaaaDAO.class);rnrn // property constantsrnrn protected void initDao() rn // do nothingrn rnrn public void save(Aaaa transientInstance) rn log.debug("saving Aaaa instance");rn try rn getHibernateTemplate().save(transientInstance); =======这里getHibernateTemplatern log.debug("save successful");rn catch (RuntimeException re) rn log.error("save failed", re);rn throw re;rn rn rnrn我用的是hibernate3.jar这个包,错误的意思好像是org.springframework.orm 识别不了,怎么解决???rn
错误:The import android provider.ContactsContract cannot be resolved
The import android provider.ContactsContract cannot be resolvedrnrn请问这个错误是怎么回事?rn我按《Android应用开发揭秘》一书学习,例3.2的源码出现这个错误,是什么原因?请高手指点~~
import 映射文件的时候提示 cannot be resolved
我用的myeclipse + struts + hibernate,我已经生成了映射文件了代码如下:rnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rnrn但是我在类中一使用 import com.xiebing.hibernate.Vipdata; 就提示The import com.xiebing.hibernate.Vipdata cannot be resolved 请各位指教,这个问题缠了我好几天,我刚学,身边没人可以问。
cannot be resolved
[img=http://my.csdn.net/my/album/detail/1156757][/img][img=http://my.csdn.net/my/album/detail/1156756][/img]
the import com.borland.dx.can not be resolved
the import com.borland.dx.can not be resolvedrn需要那个包啊
the import can not be resolved
<%@ page language="java" contentType="text/html;charset=GB2312"%>rn[u]<%@ page import="asset.test.QueryBean" %>[/u]rn[u][/u]rn rn高手帮看下,我是个初学者本来是照着书写这段代码连数据库的,结果调用BEAN出问题了,我是把BEAN生成了class文件放到了项目WEB-INF,CLASS目录下的asset/test,然后就提示这个错误````rn帮小弟弟看看,小弟在此感激不禁啊```
XmlPullParser cannot be resolved
XmlPullParser cannot be resolved 这样一个错误提示。。要怎么样在J2ME中importXmlPullParser呢。。急!!rn谢谢
InputStream cannot be resolved
  最近在做一个Struts2+spring+hibernate的文件上传,单元测试没有问题,不过,这个存入数据库的Blob对象是通过new关键字创造一个文件对象,然后创建一个输入流fin,再用Hiberante.createBlob(fin)生成的.但是,我想从JSP页面的文件域里面取得一个文件对象,然后再创建Blob,部分代码如下:rnrnpublic Integer uploadImage(Integer userId,List title,List photos) throws BlogException rn List files = photos ;//从页面上来的文件对象列表rn int length = files.size();rn List titles = title;//文件标题列表rn Integer pId = null;rn for(int i = 0 ; i < length ; i++)rn try rn                  /**从列表中取出一个文件对象,用来创建一个输入流(就在这个地方出现了"                      InputStream cannot be resolved"问题,这是断点调试时的结果)最后在rn                  JSP异常页面打印出的异常信息是:"java.lang.ClassCastException:                        java.lang.String "**/rnrn InputStream fin = new FileInputStream(files.get(i));rn Blob photoContext = Hibernate.createBlob(fin);rn rn Photo photo = new Photo();rn User user = userDao.get(userId);rn photo.setUser(user);rn photo.setTitle(titles.get(i));rn photo.setPhotocontext(photoContext);rn rn photoDao.save(photo);rn pId = photo.getPhotoId();rn catch (FileNotFoundException e) rn e.printStackTrace();rn throw new BlogException("上传文件没有找到,请检查操作是否合法!");rn catch (IOException e) rn e.printStackTrace();rn throw new BlogException("IO操作异常!");rn rn rn return pId;rn rn  敬请各位前辈指教!小弟不胜感激!!rn
R.array cannot be resolved
rn我在layout下新建了.xml文件,内容如下rnrnrnrn 1rn 2rn 3rnrnrnrn在主程序中添加了rnspl=(Spinner)findViewById(R.id.spl);rnArrayAdapter Ad=ArrayAdapter.createFromResource(this,R.array.num,android.R.layout.simple_spinner_item);rnAd.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);rnspl.setAdapter(Ad);rnrn但是其中R.array cannot be resolved,求解!!!
Android开发 eclipse ...cannot be resolved
Android 新人 rn[code=java]package com.example.ex03_01;rnrnimport android.app.Activity;rnimport android.os.Bundle;rnimport android.view.View;rnimport android.view.View.OnClickListener;rnimport android.widget.TextView;rnimport android.widget.EditText;rnimport android.widget.Button;rnrnpublic class MainActivity extends Activity rnprivate TextView txt;rnprivate EditText edit;rnprivate Button myButton;rn@Overridernprotected void onCreate(Bundle savedInstanceState) rnsuper.onCreate(savedInstanceState);rnsetContentView(R.layout.activity_main);rntxt= (TextView)findViewById(R.id.textView1);rnedit= (EditText)findViewById(R.id.editText1);rnmyButton= (Button)findViewById(R.id.button1);rnmyButton.setOnClickListener(new mClick());rnrnrnclass mClick implements OnClickListenerrnpublic void onClick(View v)rnString inputStr;rninputStr=edit.getText().toString();rntxt.setTxt(inputStr);rnrn[/code]rn报错: edit cannot be resolved ; txt cannot be resolved; rnwarning: The value of the field MainActivity.edit (txt) is not used.rnres中并没有相关报错。。网上没找着对应的原因和解决方法 应该不是版本问题rn![图片说明](https://img-ask.csdn.net/upload/201711/03/1509682753_765852.png)
JSONArray cannot be resolved
怎样解决?rnJSONArray.fromObject(listTree).toString();这一句有错误JSONArray cannot be resolvedrnlistTree 是一个ArrayList
sql cannot be resolved!郁闷
rn rn查询书籍信息 rn rn rn rn rn rn 请选择查询条件: rn rn ID rn name rn auther rn publisher rn time rn all rn rn 关键字 rn rn rn rn jsp的查询如下:rn<%@ page contentType="text/html;charset=gb2312"%> rn<%@ page import="java.sql.*"%> rn<%@ include file="conn1.jsp"%>rn <% String id=request.getParameter("ID");rn String name=request.getParameter("name");rn String auther=request.getParameter("auther");rn String publisher=request.getParameter("publisher");rn String time1=request.getParameter("time");rn String all=request.getParameter("all");rn String keyword=request.getParameter("keyword");rn String id1="id";rn String name1="name";rn String auther1="auther";rn String publisher1="publisher";rn String time11=" time1";rn String keyword1=" keyword";rn String all1="all";rn if (id1==id) String sql="select * from info where ID="+keyword; rn if(name1==name) String sql="select * from info where name="+keyword; rn if(auther1==auther) String sql="select * from info where auther="+keyword; rn if(publisher1==auther) String sql="select * from info where publisher="+keyword; rn if(time11==time1) String sql="select * from info where time="+keyword;rn if(all1==all) String sql="select * from info "; rn ResultSet rs=st.executeQuery(sql);rn out.println("数据库操作成功,查询结果如下:"); rn out.println(" ");rn out.println(" "+"ID"+" "+"name"+" "+"auther"+" "+"publisher"+" "+"time"+""); rn while(rs.next()) rn String col1 =rs.getString(1);rn String col2 =rs.getString(2);rn String col3 =rs.getString(3);rn String col4 =rs.getString(4);rn String col5 =rs.getString(5);rn out.println(" "+col1+" "+col2+" "+col3+" "+col4+" "+col5+""); rn rn out.println("");rn %> <%//这个是什么作用啊? 似乎很重要的语句rn%> rn <% rn rs.close(); rn st.close(); rn con.close(); rn %> rnrn rn rnrn 错误信息:rnAn error occurred at line: 5 in the jsp file: /result.jsprnGenerated servlet error:rnsql cannot be resolvedrnrn感觉程序写的冗余代码比较多,希望大侠指点修正阿,拜谢!
out cannot be resolved 怎么回事?
<%!rn int dd()rn rn for(int i=3;i>=0;i--)rn rn out.print(""+i+"");rn rn return 0;rn rn%>rnrnGenerated servlet error:rnout cannot be resolvedrn怎么回事?
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池