[Anthill-pro] StackOverflowException in job
Garg, Mudit
Mudit.Garg at newsint.co.uk
Thu Dec 4 11:40:14 CST 2008
Hi Varban,
Thnaks for the response, I removed the replaceAll call but it still
fails.
Following is the revised version:
${bsh:
import com.urbancode.anthill3.domain.project.*;
import com.urbancode.anthill3.domain.project.envprops.*;
import com.urbancode.anthill3.domain.servergroup.*;
import com.urbancode.anthill3.runtime.scripting.helpers.*;
import com.urbancode.anthill3.domain.environmentgroup.*;
StringBuffer buffer= new StringBuffer("");
Project project=ProjectLookup.getCurrent();
EnvironmentGroup envGroup= project.getEnvironmentGroup();
ServerGroup[]
serverGroupArray=ServerGroupFactory.getInstance().restoreAllForEnvironme
ntGroup(envGroup);
for (int j = 0; j < serverGroupArray.length; j++) {
ProjectEnvironmentProperty[] propArray =
ProjectEnvironmentPropertyFactory.getInstance().restoreAllForProjectAndS
erverGroup(project,serverGroupArray[j]);
String result = "";
for (int i = 0; i < propArray.length; i++)
result += propArray[i].getName() + "=" +
propArray[i].getValue()+ "\n";
buffer.append("echo '").append(result).append("' >
").append(serverGroupArray[j].getName()).append(".properties").append("\
n");
\}
return buffer.toString();
}
Regards,
Mudit Garg
-----Original Message-----
From: Varban [mailto:vvv at urbancode.com]
Sent: 04 December 2008 16:42
To: AnthillPro user and support list.
Subject: Re: [Anthill-pro] StackOverflowException in job
Mudit,
did you try removing the replaceAll("\"","\\\"") part? Do you have any
properties that contain "?
Regards,
Varban
Garg, Mudit wrote:
> Hi All,
>
>
>
> I'd a job to generate all properties defined for the various
> environments set for a project. It was working till yersteday, but now
> it is failing with a stackOverflowError:
>
> 2008-12-04 15:48:21,728 ERROR job/600/3 -
>
> java.lang.StackOverflowError
>
> at java.util.regex.Pattern$Loop.match(Pattern.java:4685)
>
> at java.util.regex.Pattern$GroupTail.match(Pattern.java:4637)
>
> at java.util.regex.Pattern$BitClass.match(Pattern.java:2876)
>
> at java.util.regex.Pattern$Branch.match(Pattern.java:4538)
>
>
>
>
>
> Here is my beanshell script:
>
> ${bsh:
>
> import com.urbancode.anthill3.domain.project.*;
>
> import com.urbancode.anthill3.domain.project.envprops.*;
>
> import com.urbancode.anthill3.domain.servergroup.*;
>
> import com.urbancode.anthill3.runtime.scripting.helpers.*;
>
> import com.urbancode.anthill3.domain.environmentgroup.*;
>
>
>
> StringBuffer buffer= new StringBuffer("");
>
> Project project=ProjectLookup.getCurrent();
>
> EnvironmentGroup envGroup= project.getEnvironmentGroup();
>
> ServerGroup[]
>
serverGroupArray=ServerGroupFactory.getInstance().restoreAllForEnvironme
ntGroup(envGroup);
>
> for (int j = 0; j < serverGroupArray.length; j++) {
>
> ProjectEnvironmentProperty[] propArray =
>
ProjectEnvironmentPropertyFactory.getInstance().restoreAllForProjectAndS
erverGroup(project,serverGroupArray[j]);
>
>
> String result = "";
>
> for (int i = 0; i < propArray.length; i++)
>
> result += propArray[i].getName() + "=" +
> propArray[i].getValue().replaceAll("\"","\\\"") + "\n";
>
> buffer.append("\n echo \"").append(result).append("\" >
> ").append(serverGroupArray[j].getName()).append(".properties");
>
>
>
> \}
>
> return buffer.toString();
>
> }
>
>
>
>
>
>
>
> If I remove every for loop in the code, the job succeeds but I cannot
> see what may be in error here.
>
> Has anybody faced this issue before?
>
>
>
> Regards,
> *Mudit Garg*
>
>
> *"Please consider the environment before printing this e-mail" *
>
> The Newspaper Marketing Agency: Opening Up Newspapers:
>
> www.nmauk.co.uk <http://www.nmauk.co.uk/>
>
> This e-mail and all attachments are confidential and may be
privileged.
> If you have received this e-mail in error, notify the sender
> immediately. Do not use, disseminate, store or copy it in any way.
> Statements or opinions in this e-mail or any attachment are those of
the
> author and are not necessarily agreed or authorised by News
> International (NI). NI Group may monitor emails sent or received for
> operational or business reasons as permitted by law. NI Group accepts
no
> liability for viruses introduced by this e-mail or attachments. You
> should employ virus checking software. News International Limited, 1
> Virginia St, London E98 1XY, is the holding company for the News
> International group and is registered in England No 81701
>
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> Anthill-pro mailing list
> Anthill-pro at lists.urbancode.com
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
_______________________________________________
Anthill-pro mailing list
Anthill-pro at lists.urbancode.com
http://lists.urbancode.com/mailman/listinfo/anthill-pro
"Please consider the environment before printing this e-mail"
The Newspaper Marketing Agency: Opening Up Newspapers:
www.nmauk.co.uk
This e-mail and all attachments are confidential and may be privileged. If you have received this e-mail in error, notify the sender immediately. Do not use, disseminate, store or copy it in any way. Statements or opinions in this e-mail or any attachment are those of the author and are not necessarily agreed or authorised by News International (NI). NI Group may monitor emails sent or received for operational or business reasons as permitted by law. NI Group accepts no liability for viruses introduced by this e-mail or attachments. You should employ virus checking software. News International Limited, 1 Virginia St, London E98 1XY, is the holding company for the News International group and is registered in England No 81701
More information about the Anthill-pro
mailing list