Eclipse使用 junit测试, 报 “The builder launch configuration could not be found” 错误
解决方法如下:
- Package Explorer 视图下选中项目名
- 右键项目名,然后选择Properties 或者 在Eclipse 工具栏中选择 Project -> Properties
- 弹出的 Properties 对话框中,点击 Builders
- 将没有勾选,缺失的 builder 移除掉
- 点击 OK 按钮
DONE!
Eclipse使用 junit测试, 报 “The builder launch configuration could not be found” 错误
解决方法如下:
DONE!
启动eclipse选择workspace后, 启动失败,提示查看.log文件。
可以试验下面的方法
1. 可以试下这个方法:workspace\.metadata\.plugins\org.eclipse.core.resources\目录下有一个.snap文件,把它删除掉,顺利的话,eclipse就可以用该workspace启动了,启动后,把所有project给clean一下
2. 首先进入workspace的.metadata/.plugins/org.eclipse.core.resources/.projects文件夹中,你会发现一些项目的文件;
然后估计一下哪个项目出错(一般情况下是eclipse异常关闭时正在使用的项目),进入项目对应的文件;再后找到里面有个叫.SNAP的文件,把它删除掉。最后重新启动eclipse,问题应该会解决
Good Luck!
介绍下在eclipse中使用pydev插件进行远程调试,供参考。
先看下官网的资料,后面有测试总结:
In PyDev you can debug a remote program (a file that is not launched from within Eclipse).
The steps to debug an external program are:
Let’s see a simple ‘step-by-step’ example on how this works:
1. Start the remote debugger server: To start the remote debugger server, you have to click the green button pointed by ‘1’ in the image below. After doing that, it will show a message in the console (indicated by ‘2’) to confirm that the server is listening for incoming connections.
Note: Those buttons should be present at the debug perspective and they can be enabled in other perspectives through Window > Customize perspective > Command groups availability > PyDev debug.
Image: Remote Debugger Server
2. Go to the debug perspective: This is needed because it has no actual ‘signal’ that it reached a breakpoint when doing remote debugging. So, if you already have it open, just cycle to it with Ctrl+F8. Otherwise, go to the menu: window > Open Perspective > Other > Debug.
Note that there should appear a process named ‘Debug Server’ in the debug view (see ‘1’ in the image below).
Image: Debug perspective
3. Make sure pydevd.py is in your pythonpath: This file is included in the org.python.pydev plugin. So, you’ll have to add it to the pythonpath. It’s exact location will depend upon the eclipse location and the plugin version, being something like:
eclipse/plugins/org.python.pydev_x.x.x/pysrc/pydevd.py
(so, the container folder must be in your pythonpath). If you choose to execute it from another machine, you need to copy all the files within that folder to the target machine in order to be able to debug it (if the target machine does not have the same paths as the client machine, the file pydevd_file_utils.py must be edited to properly translate the paths from one machine to the other – see comments on that file).
4. Call pydevd.settrace(): Now that the pydevd.py module is already on your pythonpath, you can use the template provided: ‘pydevd’ to make the call: import pydevd;pydevd.settrace(). When that call is reached, it will automatically suspend the execution and show the debugger.
Image: pydevd.settrace called
NOTE 1: the settrace() function can have an optional parameter to specify the host where the remote debugger is listening. E.g.:pydevd.settrace(‘10.0.0.1’)
NOTE 2: the settrace() function can have optional parameters to specify that all the messages printed to stdout or stderr should be passed to the server to show. E.g.: pydevd.settrace(stdoutToServer=True, stderrToServer=True)
NOTE 3: You can have the running program in one machine and PyDev on another machine, but if the paths are not exactly the same, some adjustments have to be done in the target machine:
Aside from passing the files in eclipse/plugins/org.python.pydev_x.x.x/pysrc to your target machine, the file pydevd_file_utils.py must be edited to make the path translations from the client machine to the server machine and vice-versa. See the comments on that file for detailed instructions on setting the path translations.
我在看完上面的资料后还是很疑惑,感觉没说清楚。 经过使用测试后总结下经验,使用中大家需注意以下四个问题:
1. eclipse端是debug服务端 , 即端口的监听端, 也就是说远端要调试的python代码文件是作为客户端连接eclipse端的端口(如:默认端口 5678), 切记!!我在这里吃了大亏。
2. 在eclipse插件plugins目录查找到pydevd.py文件后,将文件所在的整个个文件夹copy到需要调试的机器的python文件的site-packages目录下,并保证可以访问到pydevd.py(我使用了在site-packages目录下建立pysrc.pth文件指定路径方式),可参考文章最后的url。
3. 如果远程调试,一般python代码的路径在eclipse端与远程机器上的路径是不一样的,一定记住修改pydevd_file_utils.py中的PATHS_FROM_ECLIPSE_TO_PYTHON值,修改具体值可以看下文件中关于这个变量的注释,而且注释中还有举例说明。
4. 在需要调试的代码中使用下面代码:
import pydevd
pydevd.settrace(‘eclipse端服务器地址‘, port=端口5678, stdoutToServer=True, stderrToServer=True)
官网参考: http://www.pydev.org/manual_adv_remote_debugger.html
其它参考:http://blog.csdn.net/tantexian/article/details/47003385
当选择完workspace之后,eclipse开始加载启动,在这个阶段经常出现闪退出的情况,这主要有两个原因:
原因一、eclipse.ini的配置问题:
可能配置的内存太小,或者系统本身内存不够了,比如我的就配置成这样:
-Xms128m -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=512m -Dorg.eclipse.swt.browser.DefaultType=mozilla
具体配置方法和参数说明网上很多,不再赘述。
原因二、之前错误的关闭,workspace的问题:
这个问题比较棘手,因为很难找到问题出再哪,可能之前的操作有误,可能某个插件BUG,等等。
最狠的解决方法是删除workspace/.metadata/目录,也就是把这个workspace从eclipse的记忆中删除,缺点是要重新加载每一个项目…
网上很流行的一个方法是:
$ rm YOUR_PROJECT_DIR/.metadata/.plugins/org.eclipse.core.resources/.snap
但是我没成功。
我用的这个方法成功了:
0, 进入workspace/.metadata/.plugins/目录 1. Rename org.eclipse.core.resources to org.eclipse.core.resources_old. 2. Start eclipse 3. Close eclipse 4. Delete org.eclipse.core.resources 5. Rename org.eclipse.core.resources_old back to org.eclipse.core.resources 6. Star eclipse
这个方法相对完美,不用重新加载任何项目,推荐!
转自:http://www.cnblogs.com/coding-way/archive/2012/10/17/2727481.html
Then look at two topics related to incoming references:
Using the following OQL statement, we have identified total 7 entries (see Figure above) as our objects of interest:
SELECT * FROM java.lang.String WHERE toString().startsWith(“http://xmlns.oracle.com/apps/fnd/applcore/log/service/types”)
After expanding the first entry, it shows two outgoing references:
Outgoing References show the actual contents of the instances, helping to find out their purpose. In our Stringinstance, it holds two references. The memory overhead of this String instance is shown in two values: [3]
To get incoming references of the first entry, choose List Objects with Incoming References from the context menu.
Now a tree structure is displayed, showing all instances with all incoming references (note the different icon highlighted in red). These references have kept the object alive and prevented it from being garbage collected.
Similarly, from the context menu, you can display immediate dominators of the first entry (see Figure below). AnObject X is said to dominate an Object Y if every path from the GC Root to Y must pass through X. So, immediate dominators is a very effective way to find out who is keeping a set of objects alive. For example, the immediate dominators of our first entry (note that we have used “java.*|com.sun..*” as our filter) is:
From context menu, you can also show “Path to GC Roots” of the first entry (see Figure below). Path to GC Rootsshows the path to GC roots which should be found for a given object. As you can expect, its immediate dominatorsmust also be on this path. Note that, when you display Path to GC Roots, you can specify which fields of certain classes to be ignored when finding paths. For example, we have specified that paths through Weak or Soft Referencereferents to be excluded.
Now we know
is keeping our String instance alive. Instead of viewing Path to GC Roots, it is easier to see it the other way around. So, we have chosen to display the outgoing references of WebServiceEndpoint instance (see Figure below). As you can see, our String instance is displayed as the leaf node of the tree structure.
eclipse中调试 python代码时出现错误提示:“SyntaxError: Non-ASCII character ‘xe6’ in file…”, 解决方法如下:
在.py文件的最上面添加下面一行:
搞定!
A:
1.在eclipse的run configurations中创建一个maven build,选择好Maven工程,在Goals一栏中输入jetty:run。然后进入“jre”Tab,在vm arguments一栏中输入-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
2.打开debug configuration,创建一个remote java application,在host中输入服务器地址,一般就本机localhost。在port一栏中输入上面配置中端口号8000。这样,当服务器启动后,就可以进行远程debug了。这种debug方式的好外是可以在debug依赖的jar包,并在上面设置断点。(前提是你已经获得了jar包的源代码)
B:
如果是Tomcat,只需要在tomcat/bin/的catalina.bat文件的开头加入下面的设置即可:
SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
然后在eclipse新建一个remote debug,端口填入8000即可。
//Dao测试类继承自上面的基类,并添加了个测试方法findByEmail。
就这么简单,但是要注意要加载相应的包,Spring-test.jar, apache的commons-下的包最好都加上。(项目中你基本都能用上)