@echo on @REM -- Usage -- @if not "%1"=="-help" goto begin @echo Usage: build [-ms] @echo where "-ms" builds under Microsoft SDK for Java @echo. @echo The EJBean will be saved in jolt_ejb_bankapp.jar @echo You must run the setEnv script before using this script. @goto end :begin @echo. @echo ========= Start of building Jolt EJBean example ========= @echo. @setlocal set JAVA=java set JAVAC=javac if "%1"=="-ms" set JAVA=jview if "%1"=="-ms" set JAVAC=jvc set EJB_DIRECTORY=examples\jolt\ejb\bankapp set JAR=jolt_ejb_bankapp.jar set TEMP=..\..\..\temp set EJB_TEMP=%TEMP%\%EJB_DIRECTORY% set EJB_CLIENT_CLASSES=%CLIENT_CLASSES%\%EJB_DIRECTORY% set CLASSPATH=%CLASSPATH%;%TEMP% @REM Step 1: create directories if not exist %TEMP%\nul mkdir %TEMP% if not exist %EJB_CLIENT_CLASSES%\nul mkdir %EJB_CLIENT_CLASSES% @REM Step 2: Compile Java classes %JAVAC% -d %TEMP% bankapp\*.java @if errorlevel 1 goto error @REM Step 3: Copy classes to the clientclasses directory xcopy %EJB_TEMP% %EJB_CLIENT_CLASSES% /i @if errorlevel 1 goto error @REM Step 4: Delete the Client code from the temp directory @REM and the Bean code from client directory del /q %EJB_TEMP%\*Client*.class del /q %EJB_CLIENT_CLASSES%\*Bean*.class @REM Step 5: Create a .ser file from the deployment descriptor %JAVA% weblogic.ejb.utils.DDCreator -d %EJB_TEMP% -outputfile DD.ser bankapp\DeploymentDescriptor.txt @if errorlevel 1 goto error @REM Step 6: Run ejbc on the DD.ser file, creating generated files %JAVA% weblogic.ejbc -d %TEMP% %EJB_TEMP%\DD.ser @if errorlevel 1 goto error pushd %TEMP% @REM Step 7: Jar the EJBean using the manifest file jar cmf ..\%EJB_DIRECTORY%\manifest ..\myserver\%JAR% %EJB_DIRECTORY% @if errorlevel 1 goto error @REM Step 8: Remove the temp directory popd rmdir /s /q %TEMP% @if errorlevel 1 goto error @echo. @echo The EJBean has been saved in @echo. @echo %WL_HOME%\myserver\%JAR% @echo. @if "%1"=="-ms" goto msnote @echo To deploy the EJBean, either use the hot deploy feature of @echo the WebLogic Console to deploy the EJBean or add to the @echo "weblogic.ejb.deploy" property in the "weblogic.properties" @echo file an entry to deploy the .jar. @echo. @goto clientnote :msnote @if not "%1"=="-ms" goto clientnote @echo Running under the Microsoft SDK for Java, deploy the EJBean @echo by adding to the "weblogic.ejb.deploy" property in the @echo "weblogic.properties" file an entry to deploy the .jar. @echo. @echo You'll also need to add the path to the .jar to the CLASSPATH @echo for your Server. @echo. :clientnote @echo To run the client, follow the instructions in the @echo documentation for the example. @goto finish :error @REM return to starting directory popd @echo. @echo An error has occurred. Error level: %errorlevel% @echo. @echo You should delete any generated files and directories @echo (such as temp) before running the script again. :finish @echo. @echo ========= End of building Jolt EJBean example ========= @echo. :end @endlocal