Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ant junitreport always going to wrong

 
li lianghong
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my build.xml file flow as:

[junitreport] Processing D:\eclipse4.2\workspace\ant_junit\build\test\report\TESTS-TestSuites.xml to D:\eclipse4.2\workspace\ant_junit\build\test\report\html\junit-noframes.html
[junitreport] Loading stylesheet jar:file:/D:/SSHAndTools/jar/ant/apache-ant-1.8.4/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-noframes.xsl
[junitreport] : Error! 非 static Java 函数 'replace' 的第一个参数不是有效的对象引用。
[junitreport] : Error! 无法将数据类型 'void' 转换为 'reference'。
[junitreport] : Fatal Error! 无法编译样式表
[junitreport] Failed to process D:\eclipse4.2\workspace\ant_junit\build\test\report\TESTS-TestSuites.xml

i don't know idea.........
 
li lianghong
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and my environment :
os-window7
jdk-1.7
junit4.10
ant1.8.4
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, because the error messages are not in English, it is going to be extremely difficult to help you resolve this...
 
Paul Clapham
Sheriff
Pie
Posts: 20713
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Chinese in this one:

[junitreport] : Fatal Error! 无法编译样式表


means, according to Google Translate, "Can not compile style sheets". However we shouldn't have to do the work of translating into English, that's the responsibility of the original poster.
 
li lianghong
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am so sorry about that! the error message as follow:


 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds to me like the junitreport classes are picking up a stray JAR file somewhere. Try running ant with the -v option to see if it gives you more information. If that doesn't work, try setting ANT_OPTS to "-verbose:class" and run Ant again. This option causes the JVM to list each class loaded and the JAR it came from, that will let you know if you are picking up a stray JAR file. (P.S. I hope you don't have CLASSPATH set.)
 
li lianghong
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Johnson wrote:This sounds to me like the junitreport classes are picking up a stray JAR file somewhere. Try running ant with the -v option to see if it gives you more information. If that doesn't work, try setting ANT_OPTS to "-verbose:class" and run Ant again. This option causes the JVM to list each class loaded and the JAR it came from, that will let you know if you are picking up a stray JAR file. (P.S. I hope you don't have CLASSPATH set.)


when i use the option -v the error messages follow as :

but i still can't resolve it!
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about my -verbose:class suggestion?
 
li lianghong
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Johnson wrote:What about my -verbose:class suggestion?


i can use the option -verbose and the result is the same as -v,
but i don't know how to specify -verbose:class ! and where can i set the option?
thank you!
 
li lianghong
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i run command ant -v at the command line ,it works!
but when i back to eclipse ,the error is still there, maybe something wrong with my configuration,
but nobody met the error?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I wrote in my earlier post, set ANT_OPTS to -verbose:class. After you do that, run ant again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic