• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ant junitreport always going to wrong

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and my environment :
os-window7
jdk-1.7
junit4.10
ant1.8.4
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am so sorry about that! the error message as follow:


 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What about my -verbose:class suggestion?
 
li lianghong
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic