ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johan Adelöw <Johan.Ade...@corustechnologies.com>
Subject RE: Exception in thread "main"
Date Thu, 04 Sep 2003 08:07:20 GMT
In that case, just send me the JDBCTask, I would have to recompile ant anyway
because we have some tasks of our own that we put into ant.jar. I think the
<sql> task is called about 50 times, which would be about 50M which i dont
think is that much. Im trying to get hold the tool OptimizeIt here to see
what acctualy happends, but right now the cd´s are at drift.

/Johan

-----Original Message-----
From: Antoine Levy-Lambert [mailto:antoine@antbuild.com]
Sent: den 3 september 2003 18:25
To: Ant Users List
Subject: Re: Exception in thread "main"


I have just had a look at the code of the sql task and of the JDBCTask that
the sql task is using internally.
There is a caching mechanism (to cache class loaders) in the JDBCTask, but
it is not used.
So you are right, it is well possible that new class loaders and driver
instances are generated each time you execute the sqltask.
I do not know if/when garbage collection will reclaim them.
To get an idea, how many times is the <sql/> task called in your build ?

If I patch ant1.6alpha to try to fix your problem, would you be able to test
with 1.6 to see if you are happy ?

Cheers,

Antoine


----- Original Message -----
From: "Johan Adelöw" <Johan.Adelow@corustechnologies.com>
To: "Ant Users List" <user@ant.apache.org>
Sent: Wednesday, September 03, 2003 11:53 AM
Subject: RE: Exception in thread "main"


Im running Ant version 1.5.3 on a Sun Solaris 5.8, but we have had this
problem on windows also.
Actually I found (after reading your mail) that we launched ant with the
<exec> inside the script at one occation, and that´s why the [exec] turnd up
in the log, but this was not the problem.
I still get the "Exception in thread main" but in another place.

We do use the sqltask to launch all the database stuff.
What I am afraid of is that ant is loading the database driver each time we
use the <sql> task.

...
     [java] File length: 158892

     [java] Connected to  jdbc:oracle:thin:@elvis:1521:DB
     [java] User          nisse
     [java] Driver        Oracle JDBC driver
     [java] DriverVersion 9.0.1.0.0
     [java] IsJDBCcompl   true

     [echo] Done installing corus broker!

start:
     [exec] /test/ninstall/3_1/install/corus31/CorusWeb/lws/bin/lwsctrl.sh
start: lws started
     [exec] /test/ninstall/3_1/install/corus31/CorusBroker/bin/brokctrl.sh
start: broker started
Exception in thread "main"




-----Original Message-----
From: Antoine Levy-Lambert [mailto:antoine@antbuild.com]
Sent: den 2 september 2003 15:44
To: Ant Users List
Subject: Re: Exception in thread "main"


Hi Johan,
can you tell against which version of ant and which OS are you using ?
also if you are basically running a SQL script, it might be worthwhile to
use the <sql/> task rather than <exec/>
Also your log files seem to indicate that you are doing the following :

- starting a script or a program with the <exec/> task,
- this script or program is using the ant API to run the <java/> task,
- the java task does database operations

If this makes sense, you might want to refactor your build to :
1) generate a sql batch file containing the SQL statements you want to
execute
    insert into foo (bar, doe) values ('mybar', 'mydoe');
    ...
2) using the <sql/> task, execute the batch

Just ideas, I do not know for sure how your build is structured or what are
your constraints.

Antoine Lévy-Lambert

----- Original Message -----
From: "Johan Adelöw" <Johan.Adelow@corustechnologies.com>
To: "Ant Users List (E-mail)" <ant-user@jakarta.apache.org>
Sent: Tuesday, September 02, 2003 1:52 PM
Subject: Exception in thread "main"


Hi
Im experiencing what I think is a memory problem. I have a large build
including several scripts that has quite alot database interaction.
At the end of the run I suddenly get an Exception in thread "main" and the
build fails.
If I manualy run the scripts one by one there is no problem.

I've set up the memory parameter (-Xmx512m) to 500mb in the antscript but it
does not help.

Has anyone encountered/solved this problem?


     [exec]      [echo] Loading log4j_1.1.3.jar
     [exec]      [java] File name:
/test/ninstall/3_1/install/corus31/corus/3_1_0/lib/providers/openjms/log4j_1
.
1.3.jar
     [exec]      [java] File length: 158892

     [exec]      [java] Connected to  jdbc:oracle:thin:@elvis:1521:DB
     [exec]      [java] User          nisse
     [exec]      [java] Driver        Oracle JDBC driver
     [exec]      [java] DriverVersion 9.0.1.0.0
     [exec]      [java] IsJDBCcompl   true

      [exec]      [echo] Done installing broker!
      [exec] Exception in thread "main"

BUILD FAILED
file:/test/ninstall/3_1/bin/testenv_install_corus.xml:51: exec returned: 1

Total time: 46 minutes 49 seconds
bash-2.03$

---------------------------------------------------------------------
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


---------------------------------------------------------------------
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


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


Mime
View raw message