Hi all,
You guys have been great in the past, so I hope that someone can help me out
here too!
 
I've gotten past my first round(s) of problems, thanks to you folks. What
I'm trying to do is have a user via the GUI input international info from
which we dynamically create beans, jar them up and hot deploy them in
Weblogic. I have set the file.encoding in both the client and Weblogic JVM's
to UTF8. My beans are correctly being written and compiled in UTF8 and class
files look right. 
 
However, when I call ejbjar as below (yeah, I know it has 5.1 DTD's) when
the ejbc creates it's java sources for the stubs, it generates ANSI encoded
files and then compiles the classes in the same encoding, which then gives
me some type of encoded output for the international characters. 
 
Does anyone know what kind of flag that I can pass to the ejbjar task to get
it to use UTF8? The Weblogic folks told me that ejbc inherits the
file.encoding from the JVM in which the server is started, but my experience
has been that this is not the case. I'm probably doing something wrong, but
for the life of me, I can't figure it out!
 
Thanks!!
 
_Paul
 
==================================================
 
Here is my code as it currently spits out the xml files in a PrintWriter
 
            FileOutputStream fos = new FileOutputStream(buildBeanFile);
            OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF8");
            PrintWriter ps = new PrintWriter(osw);
                ps.print("<?xml version=\"1.0\" encoding=\"UTF-8\"
?>\n<project name=\"" + ejbName + "\" default=\"build\" basedir=\""
                    + antWorkingDir + "\">\n");
            ps.print("<!--\t\t setProperties \t\t-->\n");
            ps.print("\t<property name=\"src.dir\" value=\"" + srcDirName +
"\"/>\n");
            ps.print("\t<property name=\"file.encoding\"
value=\"UTF8\"/>\n");
            ps.print("\t<property name=\"descriptor.dir\" value=\"" +
descriptorDirName
                    + "\"/>\n");
            ps.print("\t<property name=\"build.classes\" value=\"" +
antWorkingDir
                    + File.separator + "build\"/>\n");
            ps.print("\t<property name=\"deploymentjars.dir\" value=\"" +
destDir
                    + "\"/>\n");
            ps.print("\t<property name=\"classpath\"  value=\"" +
wellKnownClasspath
                    + ";" + wlClasspath + "\"/>\n");
            ps.print("\t<property name=\"jarname\" value=\"" + jarName +
"\"/>\n");
            ps.print("\t<property name=\"temp.dir\" value=\"" +
EjbGeneratorUtils.TEMP_DIR
                    + "\"/>\n");
            ps.print("\t<property name=\"tempfile\"
value=\"${temp.dir}/${jarname}"
                    + EjbGeneratorUtils.JAR_SUFFIX + "\"/>\n");
            ps.print("\n");
            ps.print("<!--\t\t Compile source codes \t\t-->\n");
            ps.print("\t<target name=\"PreBuild\">\n");
            ps.print("\t\t<tstamp/>\n");
            ps.print("\t\t<mkdir dir=\"build\"/>\n");
            ps.print("\t\t<javac srcdir=\"${src.dir}\" destdir=\"build\"
debug=\"on\" encoding=\"UTF8\" optimize=\"on\" >\n");
            ps.print("\t\t\t<classpath>\n");
            ps.print("\t\t\t\t<pathelement path=\"${classpath}\" />\n");
            ps.print("\t\t\t</classpath>\n");
            ps.print("\t\t</javac>\n");
            ps.print("\t</target>\n");
            ps.print("\n");
            ps.print("<!--\t\t Build deployable jar file \t\t-->\n");
            ps.print("\t<target name=\"build\" depends=\"PreBuild\">\n");
            ps.print("\t\t<ejbjar srcdir=\"build\"
descriptordir=\"${descriptor.dir}\" basejarname=\"${jarname}\"
classpath=\"${build.classes}\">\n");
            ps.print("\t\t\t<weblogic destdir=\"${temp.dir}\"
classpath=\"${classpath}\" keepgenerated=\"true\" />\n");
            ps.print("\t\t\t<include name=\"**/ejb-jar.xml\" />\n");
            ps.print("\t\t\t<exclude name=\"**/*weblogic*.xml\" />\n");
            // added local copies of DTD's to allow non-Internet connected
servers to build EJBs.
            ps.print("\t\t\t<dtd publicId=\"-//Sun Microsystems, Inc.//DTD
Enterprise JavaBeans 1.1//EN\" \n");
            ps.print("\t\t\t\t location=\"" + workingDir +
"/ejb-jar_1_1.dtd\"/>\n");
            ps.print("\t\t\t<dtd publicId=\"-//BEA Systems, Inc.//DTD
WebLogic 5.1.0 EJB//EN\"\n");
            ps.print("\t\t\t\t location=\"" + workingDir +
"/weblogic-ejb-jar.dtd\"/>\n");
            ps.print("\t\t\t<dtd publicId=\"-//BEA Systems, Inc.//DTD
WebLogic 5.1.0 EJB RDBMS Persistence//EN\"\n");
            ps.print("\t\t\t\t location=\"" + workingDir +
"/weblogic-rdbms-persistence.dtd\"/>\n");
            ps.print("\t\t</ejbjar>\n");
            ps.print("\t\t<delete dir=\"${build}\" />\n");
            ps.print("\t\t<copy file=\"${tempfile}\"
todir=\"${deploymentjars.dir}\" />\n");
         //   ps.print("\t\t<delete file=\"${tempfile}\"/>\n");
            ps.print("\t</target>\n");
            ps.print("\n");
            ps.print("</project>\n");
            ps.flush();
            ps.close();
            osw.close();
            fos.close();
            callAnt("build", buildBeanFile, logFile);

Reply via email to