tags:

views:

65

answers:

1

In Liferay ext build-parent.xml there is a target build-webxml that executes java. Unfortunately this target does not complete for some reason.

I debugged the code and main method finishes. But still the echo directly after the java is not executed. It just hangs in the end

When I Ctrl+c then it prints out

 [java] Java Result: 1
 [echo] web.xml files merged

If I add spawn="true" then it finishes but I would not like this. Any ideas what could cause this and how can I make it finish?

Apache Ant version 1.8.1 and JVM build 1.5.0_17-b04

The target is as follows:

<target name="build-webxml">
    <java
        classname="com.liferay.portal.tools.WebXMLBuilder"
        classpathref="project.classpath"
        fork="true"
        newenvironment="true" spawn="false" resultproperty="web.xml.build.success"
    >
        <jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
        <!--  -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -->
        <arg value="tmp/WEB-INF/web.xml.original" />
        <arg value="docroot/WEB-INF/web.xml" />
        <arg value="tmp/WEB-INF/web.xml" />
    </java>
    <echo message="web.xml files merged"/>
</target>

I found that I'm having the same issue as described here: http://www.liferay.com/community/forums/-/message_boards/message/4931689

And still I have no solution

A: 

Suggests that the java class com.liferay.portal.tools.WebXMLBuilder is multi-threaded and one of these threads is still running in the background.

spawn="true" works because the ANT jvm doesn't not wait for the child process to complete. Similarily CTRL-C works because you're sending a signal to kill the process.

Mark O'Connor
It is not multithreaded. You can see the source here:http://docs.liferay.com/portal/5.2/javadocs/portal-impl/com/liferay/portal/tools/WebXMLBuilder.java.htmlIt reads and writes some files on disk. Can this be an issue?
Priit
Might be. I tried tracing the code back, but can't see what implementation of the FileUtil class you're using. See http://docs.liferay.com/portal/5.1/javadocs/portal-kernel/com/liferay/portal/kernel/util/FileUtil.java.htmlCan you reproduce the problem when running the code stand-alone without ANT?
Mark O'Connor