aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes ant junitreport  always going to wrong Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ant junitreport  always going to wrong" Watch "ant junitreport  always going to wrong" New topic
Author

ant junitreport always going to wrong

li lianghong
Greenhorn

Joined: May 03, 2012
Posts: 11
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

Joined: May 03, 2012
Posts: 11
and my environment :
os-window7
jdk-1.7
junit4.10
ant1.8.4
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

Unfortunately, because the error messages are not in English, it is going to be extremely difficult to help you resolve this...


JBoss In Action
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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

Joined: May 03, 2012
Posts: 11
i am so sorry about that! the error message as follow:


Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

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

Joined: May 03, 2012
Posts: 11
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

Joined: May 14, 2008
Posts: 5827
    
    7

What about my -verbose:class suggestion?
li lianghong
Greenhorn

Joined: May 03, 2012
Posts: 11
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

Joined: May 03, 2012
Posts: 11
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

Joined: May 14, 2008
Posts: 5827
    
    7

As I wrote in my earlier post, set ANT_OPTS to -verbose:class. After you do that, run ant again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ant junitreport always going to wrong