首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

eclipse断点调试 出现Source not found 的有关问题

2012-01-20 
eclipse断点调试 出现Source not found 的问题代码如下:我在执行到最后一句的时候,显示Sourcenotfound的问

eclipse断点调试 出现Source not found 的问题
代码如下:我在执行到最后一句的时候,显示Source   not   found   的问题,而在这个路径里面确实创建有   usergui.properties的文件。请大虾指点一下迷津。这个问题折磨我两天了,在线求教!

public   class   ConfigurationUtil   {

/**
  *   用于保存propertiesconfiguration对象,提供给其他的方法使用
  *   @see   org.apache.commons.configuration.PropertiesConfiguration
  */
private   PropertiesConfiguration   config   =   null;
/**
  *   用于保存配置文件的路径,方便其他方法使用
  */
private   String   FileName   =   null;

/**
  *   无参数构造函数,使用默认的参数值
  *
  */
public   ConfigurationUtil()
{
FileName   =   "usergui.properties ";
}

/**
  *   构造函数,带有配置文件路径,用于构建对象
  *   @param   fileName   配置文件的路径
  */
public   ConfigurationUtil(String   fileName)   {
super();
//   TODO   Auto-generated   constructor   stub
FileName   =   fileName;
}

/**
  *   将配置的数据保存到配置文件
  *   @param   cb   配置数据的封装体
  *   @see   PropertiesBean
  */
public   void   setConfiguration(PropertiesBean   cb)   {

try{
//remove   the   file   previously   saved   if   necessary
File   file   =   new   File( "./config ",FileName);
if(file.exists())
{
file.delete();
}
try
                {
                        file.createNewFile();
                        System.out.println( "文件初始化成功 ");
                }
                catch   (IOException   e)
                {
                        //   TODO   Auto-generated   catch   block
                        e.printStackTrace();
                }
                String   path   =   file.getAbsolutePath();
                config   =   new   PropertiesConfiguration(path);
                                  ...


[解决办法]
我只能提供一个参考,tomcat项目,在首选项中找到tomcat,里边就有source path,我遇到过找不到源的问题,勾上就好了。
[解决办法]
eclipse是依靠.class文件来做这些事情的,你看看是否该class文件存在。
再有就是打到jar包里的文件是没有源码的。
[解决办法]
另外你是不是自动编译的勾没打上没有编译啊???
[解决办法]
刚看清楚,原来不是不能debug,只是到config = new PropertiesConfiguration(path);这句的时候,因为没有PropertiesConfiguration的Source,无法跟踪。

这个应该不是问题,继续运行就好了。

热点排行