You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Knuplesch, Juergen" <Ju...@icongmbh.de> on 2011/11/09 15:49:52 UTC

fork, JUnit and Linux

Hello,

 

when I run a <junit> task with

fork="yes"

under LINUX the test does not even start:

 

[junit] Exception in thread "main" java.lang.NoClassDefFoundError: 

    [junit] Caused by: java.lang.ClassNotFoundException: 

    [junit]    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

    [junit]    at java.security.AccessController.doPrivileged(Native Method)

    [junit]    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

    [junit]    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

    [junit]    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

    [junit]    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

    [junit] Could not find the main class: .  Program will exit.

    [junit] Test fest.basic.DOPELoginTest FAILED (crashed)

    [junit] Exception in thread "main" java.lang.NoClassDefFoundError: 

    [junit] Caused by: java.lang.ClassNotFoundException: 

    [junit]    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

    [junit]    at java.security.AccessController.doPrivileged(Native Method)

    [junit]    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

    [junit]    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

    [junit]    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

    [junit]    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

    [junit] Could not find the main class: .  Program will exit.

    [junit] Test fest.basic.DOPEUserSettingsTest FAILED (crashed)

 

 

The same code is running fine, when I use Windows.

When I set fork="no" it works also with LINUX.

What do I need to set up, to use <junit> and fork="yes" with Linux?

 

Jürgen

-- 

Jürgen Knuplesch                    www.icongmbh.de <http://www.icongmbh.de/> 

icon Systemhaus GmbH                Tel. +49 711 806098-275

Sophienstraße 40                    juergen.knuplesch@icongmbh.de

D-70178 Stuttgart                   Fax. +49 711 806098-299

 

Geschäftsführer: Uwe Seltmann

HRB Stuttgart 17655

USt-IdNr.: DE 811944121 

 

 


AW: fork, JUnit and Linux

Posted by "Knuplesch, Juergen" <Ju...@icongmbh.de>.
Hello,

I just use a workaround (not to fork):

I made fork a configurable property.
Under Linux I set the property to false or no.

Then the tests are correctly executed.
But I would be happy to find the real solution.
At least I'm not alone anymore...

Jürgen


-----Ursprüngliche Nachricht-----
Von: roject [mailto:roject.luo@allianz.com.au] 
Gesendet: Freitag, 9. Dezember 2011 01:46
An: user@ant.apache.org
Betreff: Re: fork, JUnit and Linux

HI, i am having the same problem with running ant junit in linux. Do you
solve the problem?

--
View this message in context: http://ant.1045680.n5.nabble.com/fork-JUnit-and-Linux-tp4977907p5060443.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: fork, JUnit and Linux

Posted by roject <ro...@allianz.com.au>.
HI, i am having the same problem with running ant junit in linux. Do you
solve the problem?

--
View this message in context: http://ant.1045680.n5.nabble.com/fork-JUnit-and-Linux-tp4977907p5060443.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: fork, JUnit and Linux

Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-11-14, Knuplesch, Juergen wrote:

> I use OpenSuse 11.4 32 Bit
> I use Java 1.6.0.17, JDK from Sun
> Before that I tried 1.6.022 and OpenJDK.

And you are sure this is what Ant uses?

> The problem I have is when I use the fork attribute.

> Do I have to tell Linux to take the old classpath along. How?
> With windows it works the way I use it.

On Linux it does for me as well.

If you run Ant in verbose mode it will tell you the command line it uses
to run the foreked Java process.  Anything strange in there?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


AW: fork, JUnit and Linux

Posted by "Knuplesch, Juergen" <Ju...@icongmbh.de>.
I use OpenSuse 11.4 32 Bit
I use Java 1.6.0.17, JDK from Sun
Before that I tried 1.6.022 and OpenJDK.

The problem I have is when I use the fork attribute.

Do I have to tell Linux to take the old classpath along. How?
With windows it works the way I use it.

In the moment I do not use fork anymore and everything is working.
But I would like to use fork but I do not see where the problem is and how to solve it.


-----Ursprüngliche Nachricht-----
Von: Stefan Bodewig [mailto:bodewig@apache.org] 
Gesendet: Freitag, 11. November 2011 15:58
An: user@ant.apache.org
Betreff: Re: fork, JUnit and Linux

On 2011-11-09, Knuplesch, Juergen wrote:

> when I run a <junit> task with

> fork="yes"

> under LINUX the test does not even start:

LINUX is a pretty broad term here.  Which version of java are you using?
I use Ant on Linux using OpenJDK or Sun's Java without any problems.
If this is gcj then you may have quite a bit of work to do to make thigs
run correctly.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: fork, JUnit and Linux

Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-11-09, Knuplesch, Juergen wrote:

> when I run a <junit> task with

> fork="yes"

> under LINUX the test does not even start:

LINUX is a pretty broad term here.  Which version of java are you using?
I use Ant on Linux using OpenJDK or Sun's Java without any problems.
If this is gcj then you may have quite a bit of work to do to make thigs
run correctly.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org