Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2008
    Posts
    3
    Rep Power
    0

    Default java.lang.StackoverflowError

    Hi,

    I created a Java class which runs perfectly fine when I run it in eclipse. However when I specify it as an ant task in my build.xml, it throws up java.lang.StackOverflow Error :confused:

    My class structure is :
    Java Code:
    public class X extends Task{
    
          public void sendMail(String server,string from,string to, string subject){
             /*
                   Procedure to implement sending a mail.
                   PS: This perfectly works when I build this java class separately and                       run
              */
    
    
            }  
    
           public void execute throws BuildException(){
                 sendMail(server,from,to,subject);     
      
           }
    
    }
    My build.xml ant target file goes like this:
    Java Code:
            <taskdef name="coverageMail"
                     classname="X" >
                     <classpath path = "${build.classpath}" />
             </taskdef>
    
              <target name="sendMail" >
                   <antcall target = "coverageMail />
               </target>
    Could anyone pl. help me out with this ?

  2. #2
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    7

    Default Stack overflowing

    Hello ravisankarvivek

    Normally when I get a stack overflow error, it means that some recursive method call can't be stored in a stack in the CPU's registers. (Someone, please correct me if I'm wrong) This can be because the method is calling itself infinitely many times. Maybe this will give you an idea or hint.

    Good luck. ;)
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    I hope so tim. It can be caused because of infinite recursion too. It can be happened according to the original code in this thread.

  4. #4
    Join Date
    Jun 2008
    Posts
    3
    Rep Power
    0

    Default

    Hey...thanks a lot.. It was a bug in my ant task [:(]...The ant targets kept calling recursively...Thank u once again for spending time on my bug..

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Fine, so you've solved this. Please mark the thread as solved now. It's really helpful to all other members here in our community.

  6. #6
    Join Date
    Jun 2008
    Posts
    3
    Rep Power
    0

    Default

    Cud you tell me how to do that ? I guess, u should put in the FAQ section also..

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. java.lang.StackOverflowError Exception
    By Marcus in forum Web Frameworks
    Replies: 4
    Last Post: 08-24-2012, 10:02 PM
  2. Replies: 3
    Last Post: 09-07-2009, 01:28 PM
  3. Replies: 2
    Last Post: 09-18-2008, 07:30 AM
  4. java.lang.StackOverFlowError exception
    By jayaj in forum NetBeans
    Replies: 1
    Last Post: 06-08-2008, 11:17 AM
  5. java.lang.StackOverflowError
    By eva in forum New To Java
    Replies: 3
    Last Post: 12-24-2007, 09:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •