@echo off :: ################################################################################# :: # Abstract: This script overcomes a bug in the autogenerated build.cmd # :: # created by Blazix 1.2.5 This error seems to be caused by # :: # Java 1.5+ not creating skeltons for RMI communication. # :: # Alternatives : Use the Java 1.4 SDK to avoid this problem. Of course this # :: # is not always possible thus this script. # :: # Usage : Use this script instead of the autogenerated build.cmd # :: # Platform : Windows/Dos # :: # Author: Ronan Barrett # :: # Date: 10/10/05 # :: ################################################################################# ::Set these variables to determine how the script parameters - TODO:Might want to make these command line parameters ::note the slash used below instead of a period in DOS for the package names. The slash must be forward slash set PACKAGE_DIR=ejb\demo4 set PACKAGE_NAME=ejb.demo4 set EJB_NAME=Demo4 set BLAZIX_HOME=c:\blazix ::*****************Don't edit anything below this point***************************** set TEMP_DIR=ejbtemp set CLASSPATH=%CLASSPATH%;%BLAZIX_HOME%\blazix.jar;. ::cd emulated pwd on UNIX by printing the current working directory ::%command% runs the command but allows us to store the results in a variable, akin to running in a UNIX subshell ::store the current directory and append a trailing slash set home_dir=%cd%\ echo Compile the Home, the Bean and the Interface...... javac -cp %CLASSPATH% -d %home_dir% %home_dir%%EJB_NAME%Home.java %home_dir%%EJB_NAME%.java %home_dir%%EJB_NAME%Bean.java echo Roll up all the complied files to a jar...... jar -cvf %EJB_NAME%.jar -C %home_dir% META-INF/ejb-jar.xml %PACKAGE_DIR%/%EJB_NAME%Home.class %PACKAGE_DIR%/%EJB_NAME%.class %PACKAGE_DIR%/%EJB_NAME%Bean.class echo Create a temporary directory %TEMP_DIR%...... mkdir %TEMP_DIR% ::perform the Blazix specific EJB work - This causes an error which we ignore echo ************** Ignore errors *************** java -cp %CLASSPATH% desisoft.ejbtools.EjbCompiler -keepgenerated %EJB_NAME%.jar %EJB_NAME%Ejb.jar echo ************** Stop ignoring *************** echo Compile the source files just created by desisoft.ejbtools.EjbCompiler...... cd %TEMP_DIR% javac -cp %CLASSPATH%;.;../%EJB_NAME%.jar *.java echo Clean up and move the compiled EjbCompiler files so we can generate some Skeletons...... mkdir %PACKAGE_DIR% move *.class %PACKAGE_DIR% echo Java 1.5 doesn't by default create Skeletons so we force RMIC todo it for us...... rmic -v1.1 -classpath %CLASSPATH%;.;../%EJB_NAME%.jar %PACKAGE_NAME%.%EJB_NAME%HomeCtx rmic -v1.1 -classpath %CLASSPATH%;.;../%EJB_NAME%.jar %PACKAGE_NAME%.%EJB_NAME%BeanCtx echo Group all the compiled classes together and prepare to archive...... cd %PACKAGE_DIR% move *.class %home_dir%%PACKAGE_DIR% cd %home_dir% echo Roll up all the required plumming into a jar file...... jar cf %EJB_NAME%Ejb.jar %PACKAGE_DIR%/*.class META-INF/* echo Move the new EJB jar into the Blazix ejb directory...... move /Y %EJB_NAME%Ejb.jar %BLAZIX_HOME%/ejbdir/ ::tidy up rmdir /S /Q %TEMP_DIR%