mozzash / maven-replacer-plugin

Automatically exported from code.google.com/p/maven-replacer-plugin
MIT License
0 stars 0 forks source link

StackOverflowError #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
  mvn -P env clean compile

What is the expected output? What do you see instead?
  StackOverFlowException in replacer plugin

What version of the product are you using?
1.5.2

Please provide any additional information below.

this is ipallowed-{env}.xml
<?xml version="1.0" encoding="UTF-8"?>
<access-control default="deny">
    <allow>127.0.0.1</allow>

    <allow>1.1.1.1</allow>
    <allow>1.1.1.2</allow>
    <allow>1.1.1.3</allow>
                 ....
    <allow>255.255.255.255</allow>
</access-control>

and this is a part of pom.xml.

            <plugin>
                <groupId>com.google.code.maven-replacer-plugin</groupId>
                <artifactId>replacer</artifactId>
                <version>1.5.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>replace</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <file>src/main/resources/${ipallow-file}</file>
                    <!-- <outputFile>${deploy-dir}/WEB-INF/nginex_ipallow.xml</outputFile> -->
                    <outputFile>src/main/resources/nginex_ipallow.xml</outputFile>
                    <tokenValueMap>src/main/resources/linematch-token-map.txt</tokenValueMap>
                </configuration>
            </plugin>

and this is linematch-token-map.txt

<\?.*\?>=
<access-control.*>=
<allow>=allow" "
"=
</allow>=;
<\!--.*=
<procedure (.|\s)*</procedure>=
</access-control>=deny all;

and this is error messages when replacer runned.

[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ xxx ---
[INFO] Compiling 117 source files to /home1/irteam/tmp/ttt/deploy/xxx/classes
[INFO]
[INFO] --- replacer:1.5.2:replace (default) @ xxx ---
[INFO] Replacement run on 0 file.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.086 s
[INFO] Finished at: 2014-03-19T13:18:11+09:00
[INFO] Final Memory: 16M/176M
[INFO] ------------------------------------------------------------------------
---------------------------------------------------
constituent[0]: 
file:/home1/irteam/tmp/ttt/apache-maven-3.2.1/lib/plexus-sec-dispatcher-1.3.jar
constituent[1]: 
file:/home1/irteam/tmp/ttt/apache-maven-3.2.1/lib/plexus-interpolation-1.19.jar
constituent[2]: 
file:/home1/irteam/tmp/ttt/apache-maven-3.2.1/lib/sisu-guice-3.1.3-no_aop.jar
constituent[3]: 
file:/home1/irteam/tmp/ttt/apache-maven-3.2.1/lib/plexus-utils-3.0.17.jar
constituent[4]: 
file:/home1/irteam/tmp/ttt/apache-maven-3.2.1/lib/org.eclipse.sisu.plexus-0.0.0.
M5.jar

.................

---------------------------------------------------
Exception in thread "main" java.lang.StackOverflowError
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
        at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
        at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
        at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
        at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
        at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
        at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
        at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
        at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
        at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
        at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
        at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
        at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
        at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)

It can be solved by increasing jvm stack option in maven environment variable 
like this.
  MAVEN_OPTS=-Xss1m mvn -P env compile ...

But, I can't use this option because some other issues. To solve this, I have to
change OS from 32bit to 64bit because 64bit jvm default's stack size bigger 
than 32bit. But that's not on list.:( I think some recursive codes would be 
replaced to iteration pattern.

Original issue reported on code.google.com by initproc@gmail.com on 19 Mar 2014 at 4:28

GoogleCodeExporter commented 9 years ago
Is there any recursive codes in the replacer plugin?
If then those codes can be changed to iterate codes?

Original comment by initproc@gmail.com on 19 Mar 2014 at 4:35

GoogleCodeExporter commented 9 years ago
I'd like to give jvm options when replacer plugin runs, and the jvm options 
could be descripted in pom.xml with replacer plugin tags.

Original comment by initproc@gmail.com on 19 Mar 2014 at 5:05

GoogleCodeExporter commented 9 years ago
There should be no recursive code in this plugin. This looks like its recursion 
internal to the jvm codebase for java.util.regex.Pattern.
There isnt much options here other than changing how your regular expression is 
set up, and/or using multiple executions of replacer plugin.

Original comment by baker.st...@gmail.com on 19 Mar 2014 at 11:39

GoogleCodeExporter commented 9 years ago
Closing - unable to resolve with the given information and looks like an issue 
specific to the chosen regex pattern.

Original comment by baker.st...@gmail.com on 30 Apr 2014 at 7:44