Environment setting up troubleshoot.

Intellij Part

1.
FAILURE: Could not determine which tasks to execute.

* What went wrong:
Task 'ûx' not found in root project 'xxxx'.

* Try:
Run gradlew tasks to get a list of available tasks.

BUILD FAILED

Total time: 44.695 secs
Collecting build statistics.. RESPONSE:OK

Solution: encounter this issue when execute gradlew build -x check, but gradlew clean build and gradle build is executed successfully. update development tools solve this issue.
Sometimes above solution is not work, you can try to change the character encoding for scm. for perforce: Selected the workspace you wanted to change, then Connection -> Choose Character Encoding -> Unicode(UTF-16) -> OK, then force update the related files/tools like buildtools to your workspace.

2. encounter below error while debugging:
Error running xxServiceTests:
Classpath/Commandline is too long. In order to reduce its length classpath file can be used. Would you like to enable classpath file mode for all run configuration of your projects?
Enable link

Solution: click Enable link solved the question.
  this is same with: Set:  dynamic.classpath from false to  true            (in XML: <pathtotrunk>/trunk.iws)

3. Encounter below issue when run integration tests:
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157)
... ...
at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [com/xxx/www/api/api-test.system.spring.xml]; nested exception is java.io.FileNotFoundException: class path resource [com/xxx/www/api/api-test.system.spring.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
... ...
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148)
... 39 more
Caused by: java.io.FileNotFoundException: class path resource [com/xxx/www/api/api-test.system.spring.xml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:158)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
... 50 more
Solution: Build -> Rebuild project in Intellij.

4.encounter below issue when run unit tests:

java.lang.NullPointerException
at com.xxx.www.domain.services.thirdpartypackage.xxxServiceTests.priceAsExpected(xxxServiceTests.java:76)
at com.xxx.www.domain.services.thirdpartypackage.xxxServiceTests.testGroupResponse(xxxServiceTests.java:88)
... ...
at java.lang.reflect.Method.invoke(Method.java:597)at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)
Solution: not found yet.

5. How to clear the IntelliJ project index?
IntelliJ indexing takes a long time, and the index file could be broken sometime, when you found your index is broken, you can just clear the IntelliJ project index like below:

File | Invalidate Caches, restart. Or manually delete the following folders:
Linux/Windows: USER_HOME/.IntelliJIdeaXX/system
Mac: ~/Library/Caches/IntelliJIDEAXX
(where XX is your IDEA version).
From: http://stackoverflow.com/questions/1727922/how-to-clear-the-intellij-project-index

MyEclipse

1. MyEclipse 8.5 Unable to update index for central|http://repo1.maven.org/maven2:

我使用的是Myeclipse 8.5,今天启动时遇到了这个问题,在网上也找了许久,解决办法如下:
1、 Window(窗口)-->Preferences (首选项)-->Myeclipse Enterprise Workbench--> Maven4Myeclipse-->在右侧窗口中勾选“Enable Maven4MyEclipse features”复选框,单击“确定”按钮。如果已经勾选进行下一步。
2、Window(窗口)-->Preferences (首选项)-->Myeclipse Enterprise Workbench-->Maven4Myeclipseà-> Maven-->

在右侧窗口中去掉“Offline”和“Download Artifact Sources”复选框前面的勾-->单击确定按钮-->重新启动MyEclipse

OK。就是这样。。。只有先进行了第一步,才会有第二步中的Maven选项,切记。

posted @ 2013-07-03 10:25  莫笑旧人  阅读(749)  评论(0编辑  收藏  举报