Sorry if this becomes a double post. (I sent the first mail before
subscribing to the mailing list, so not sure if that's recieved properly)
I'm trying to run the sample test in weblogic 6.0 (after having it run
successfully on Tomcat). After Ant starts weblogic server, it just hangs
there, i.e. it doesn't run the tests. It almost looks like that the weblogic
server didn't start in a different VM, or even if it did, somehow it's
blocking the Ant task "runservertests".
Here's my Ant script:
====================
<!--
========================================================================
Run Weblogic 6.0 tests
========================================================================
-->
<target name="tests_weblogic_60" depends="prepare_tests_weblogic_60"
if="weblogic.home.60">
<!-- Start the servlet engine, wait for it to be started, run the
unit tests, stop the servlet engine, wait for it to be stopped.
The servlet engine is stopped if the tests fail for any reason
-->
<runservertests testURL="http://localhost:7001/test"
startTarget="start_weblogic_60"
stopTarget="stop_weblogic_60"
testTarget="tests"/>
</target>
<!--
========================================================================
Start Weblogic 6.0
========================================================================
-->
<target name="start_weblogic_60">
<!--wlrun classpath="${weblogic.classes}"
jvmargs="-hotspot -ms64m -mx64m"
domain="${weblogic.domain}"
home="${weblogic.home.60}"
password="${weblogic.password}"
beahome="${bea.home}"
policy="${weblogic.home.60}/lib/weblogic.policy}"/-->
<!--"%JAVA_HOME%\bin\java" -hotspot -ms64m -mx64m -classpath
%CLASSPATH% -Dweblogic.Domain=mydomain -Dweblogic.Name=myserver
"-Dbea.home=C:\bea"
"-Djava.security.policy==C:\bea\wlserver6.0/lib/weblogic.policy"
-Dweblogic.management.password=%WLS_PW% weblogic.Server-->
<java classname="weblogic.Server" fork="yes"
dir="${weblogic.home.60}">
<jvmarg value="-hotspot"/>
<jvmarg value="-ms64m"/>
<jvmarg value="-mx64m"/>
<jvmarg value="-Dweblogic.Domain=${weblogic.domain}"/>
<jvmarg value="-Dweblogic.Name=${weblogic.name}"/>
<jvmarg value="-Dbea.home=${bea.home}"/>
<jvmarg
value="-Djava.security.policy==${weblogic.home.60}/lib/weblogic.policy"/>
<jvmarg
value="-Dweblogic.management.password=${weblogic.password}"/>
<classpath>
<pathelement location="${java.home}/../lib/tools.jar"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${weblogic.home.60}/lib/weblogic.jar"/>
<pathelement
location="${weblogic.home.60}/lib/weblogic_sp.jar"/>
<pathelement location="c:/tomcat/xerces-1_3_1/xerces.jar"/>
<pathelement
location="c:/projects/junit3.7/commons-cactus-23-1.1/lib/commons-cactus.jar"
/>
</classpath>
</java>
<echo message="in start_weblogic_60 weblogic.home.60 =
${weblogic.home.60}"/>
</target>
<!--
========================================================================
Stop weblogic 6.0
========================================================================
-->
<target name="stop_weblogic_40">
<!--wlstop classpath="${weblogic.classes}"
user="${weblogic.username}"
url="${weblogic.admin.url}"
password="${weblogic.password}"
beahome="${bea.home}"/-->
<!--java weblogic.Admin -url host:port SHUTDOWN -username
adminname -password password-->
<java classname="weblogic.Admin" fork="yes"
dir="${weblogic.home.60}">
<arg value="-url localhost:7001"/>
<arg value="SHUTDOWN"/>
<arg value="-username ${weblogic.username}"/>
<arg value="-password ${weblogic.password}"/>
<classpath>
<pathelement location="${java.home}/../lib/tools.jar"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${weblogic.home.60}/lib/weblogic.jar"/>
<pathelement
location="${weblogic.home.60}/lib/weblogic_sp.jar"/>
</classpath>
</java>
</target>
<!--
========================================================================
Display a warning message if the needed servlet engine home
property
is not set
========================================================================
-->
<target name="check_tests_weblogic_60" depends="testwar"
unless="weblogic.home.60">
<echo message=""/>
<echo
message="*********************************************************"/>
<echo message="WARNING : The 'weblogic.home.60' property has not
been set."/>
<echo message=" No test will be run on that servlet
engine."/>
<echo
message="*********************************************************"/>
<echo message=""/>
</target>
<!--
========================================================================
Prepare directories and variables for running the tests
========================================================================
-->
<target name="prepare_tests_weblogic_60"
depends="check_tests_weblogic_60" if="weblogic.home.60">
<echo message="weblogic.home.60 = ${weblogic.home.60}"/>
<property name="out.weblogic60.dir"
value="${out.test.dir}/weblogic60"/>
<property name="conf.weblogic60.dir"
value="${conf.test.dir}/weblogic60"/>
<property name="out.weblogic60.full.dir"
value="${basedir}/${out.weblogic60.dir}"/>
<filter token="out.weblogic60.full.dir"
value="${out.weblogic60.full.dir}"/>
<!-- Create work and conf directories and copy configuration files
-->
<mkdir dir="${out.weblogic60.dir}/conf"/>
<mkdir dir="${out.weblogic60.dir}/work"/>
<mkdir dir="${out.weblogic60.dir}/webapps"/>
<!-- Delete some config file so that they will be copied every time
-->
<delete file="${out.weblogic60.dir}/conf/server.xml"/>
<!-- Remove the auto deployed webapp so that it is redeployed every
-->
<!-- time.
-->
<delete dir="${out.weblogic60.dir}/webapps/test"/>
<!-- Copy the default weblogic web.xml to our test conf/ directory.
-->
<!-- This is needed otherwise weblogic does not start.
-->
<copy file="${weblogic.home.60}/conf/web.xml"
tofile="${out.weblogic60.dir}/conf/web.xml"/>
<copy file="${conf.weblogic60.dir}/server.xml"
tofile="${out.weblogic60.dir}/conf/server.xml" filtering="on"/>
<!-- Copy the war file -->
<copy file="${out.test.dir}/test.war"
tofile="${weblogic.home.60}/config/mydomain/applications/test.war"/>
</target>
====================
And here's the output on screen until Ant gets stuck:
====================
C:\projects\VisualCafe\TestServlet\build>ant tests_weblogic_60
Buildfile: build.xml
init:
[echo] --------- MyServlet Test 1.1 ---------
[echo]
[echo] java.class.path =
c:\projects\junit3.7\junit.jar;C:\jdk1.3.1\lib\too
ls.jar;c:\projects\antroot\jakarta-ant-1.3\lib\parser.jar;c:\projects\antroo
t\ja
karta-ant-1.3\lib\jaxp.jar;c:\projects\antroot\jakarta-ant-1.3\lib\jakarta-a
nt-1
.3-optional.jar;c:\projects\antroot\jakarta-ant-1.3\lib\ant.jar;
[echo]
[echo] java.home = C:\jdk1.3.1\jre
[echo] user.home = C:\WINNT\Profiles\sgiri
[echo]
[echo] basedir = C:\projects\VisualCafe\TestServlet
[echo]
[echo] servlet.jar =
c:/tomcat/jakarta-servletapi-4.0-b5/lib/servlet.jar
[echo] cactus.jar = lib/commons-cactus.jar
[echo] junit.jar = lib/junit.jar
[echo] cactus.ant.jar = lib/commons-cactus-ant.jar
prepare:
prepare-compile:
compile:
testwar:
check_tests_weblogic_60:
prepare_tests_weblogic_60:
[echo] weblogic.home.60 = c:/bea/wlserver6.0
[delete] Deleting:
C:\projects\VisualCafe\TestServlet\out\test\weblogic60\con
f\server.xml
[copy] Could not find file C:\bea\wlserver6.0\conf\web.xml to copy.
[copy] Copying 1 file to
C:\projects\VisualCafe\TestServlet\out\test\weblogic60\conf
tests_weblogic_60:
start_weblogic_60:
[java] Starting WebLogic Server ....
[java] <Jul 9, 2001 11:10:01 AM PDT> <Notice> <Management> <Loading
configu
ration file .\config\mydomain\config.xml ...>
[java] <Jul 9, 2001 11:10:05 AM PDT> <Info> <Logging> <Only log
messages of
severity "Error" or worse will be displayed in this window. This can be
changed
at Admin Console> mydomain> Servers> myserver> Logging> Debugging> Stdout
sever
ity threshold>
[java] <Jul 9, 2001 11:10:24 AM PDT> <Notice> <WebLogicServer>
<WebLogic Se
rver started>
[java] <Jul 9, 2001 11:10:24 AM PDT> <Notice> <WebLogicServer>
<SSLListenTh
read listening on port 7002>
[java] <Jul 9, 2001 11:10:24 AM PDT> <Notice> <WebLogicServer>
<ListenThrea
d listening on port 7001>
====================
Has anybody else run into this? I'm running this on a WindowsNT 4.0
workstation (with SP 6). Thanks for any help/pointers.