Problems with POST when using the builtin HTTPServer on OS 1.12

"Joel Rowley" <[email protected]> Tue, 25 May 2004 10:50:26 -0400
Newsgroups gmane.comp.hardware.microcontrollers.tini
Message-ID <200405251044337.SM03688@jrowl611>
Hey List,

I take back what I said about it working under Slush.  When I use their
batch file to compile it to a .tini it works, but when I use my build.xml
using Tiniant, it doesn't work.  This is what my build.xml looks like:

----------------------------------------------------------------------------
---------------
<?xml version="1.0"?>

<project name="PostExample" default="main function" basedir=".">

  <!-- Load user-settable properties -->
  <property file="build.properties"/>

  <!-- Set fixed and derived properties -->
  <property name="pure.build.dir" value="classes"/>
  <property name="tini.build.dir" value="classes.tini"/>
  <property name="tini.db" value="${tini.dir}/bin/tini.db"/>
  <property name="tini.jar" value="${tini.dir}/bin/tini.jar"/>
  <property name="tiniclasses.jar" value="${tini.dir}/bin/tiniclasses.jar"/>
  <property name="tini.output.file" value="./bin/PostExample.tbin"/>
  <property name="tini.flash" value="yes"/>
  <property name="tini.targetaddress" value="0x470100"/>
  <property name="owapi_dep.txt" value="${tini.dir}/bin/owapi_dep.txt"/>
  <property name="modules.jar" value="${tini.dir}/bin/modules.jar"/>
  <property name="tini.onewire.jar"
value="${tini.dir}/bin/owapi_dependencies_TINI.jar"/>
  <property name="ths.url"
value="http://www.smartsc.com/tini/TiniHttpServer"/>
  <property name="javac.deprecation" value="false"/>
  <property name="javac.optimize" value="false"/>
  <property name="javac.nowarn" value="false"/>
  <property name="javac.debug" value="false"/>
  <property name="tini.debug" value="true"/>
  <property name="deploy.script" value="${basedir}/deploy.bat"/>
  <property name="run.script" value="run.bat"/>
  <property name="null.output" value="nul"/>
  
  <target name="writeVariables">
    <echo message="tini.dir is set to = ${tini.dir}"/>
    <echo message="servlet.jar is set to = ${servlet.jar}"/>
    <echo message="tini.host is set to = ${tini.host}"/>
    <echo message="tini.user is set to = ${tini.user}"/>
    <echo message="tini.pass is set to = ${tini.pass}"/>
    <echo message="src.files is set to = ${src.files}"/>
    <echo message="src.dirs is set to = ${src.dirs}"/>
    <echo message="dependency.classpath is set to =
${dependency.classpath}"/>
    <echo message="dependency.files is set to = ${dependency.files}"/>
    <echo message="dependency.groups is set to = ${dependency.groups}"/>
    <echo message="pure.onewire.jar is set to = ${pure.onewire.jar}"/>
    <echo message="spi.tsilk.jar is set to = ${spi.tsilk.jar}"/>
    <echo message="JavaKit commandline Args = ${javakit.commandline.args}"/>
  </target>

  <target name="init">
    <available property="jdk.ok"
      classname="java.lang.StrictMath"
    />
    <available property="jsdk23.error"
      classpath="${servlet.jar}"
      classname="javax.servlet.Filter"
    />
    <available property="tiniant.ok"
      classname="net.geeba.ant.Tini"
    />
    <available property="tiniant.error"
      classname="net.geeba.ant.Dependency"
    />
    <available property="tini.ok"
      classpath="${tiniclasses.jar}"
      classname="com.dalsemi.system.TINIOS"
    />
    <available property="setup.done"
      file="${tini.build.dir}/javax/servlet/Servlet.class"
    />
    <available property="deploy.script" value="${basedir}\deploy.bat"
file="C:\"/>
    <available property="run.script" value="run.bat" file="C:\"/>
    <available property="null.output" value="nul" file="C:\"/>
  </target>

  <target name="check jdk" unless="jdk.ok" depends="init">
    <fail
      message="${line.separator}You *must* use JDK 1.3 (or later) to build
TiniHttpServer."
    />
  </target>

  <target name="check jsdk" if="jsdk23.error">
    <fail
      message="${line.separator}Your servlet.jar is from JSDK 2.3.  You
*must* use JSDK 2.2."
    />
  </target>

  <target name="check tiniant" unless="tiniant.ok">
    <fail
      message="${line.separator}TiniAnt was not found on your classpath."
    />
  </target>

  <target name="check tiniant version" if="tiniant.error">
    <fail
      message="${line.separator}A very old version of TiniAnt was detected.
You must use TiniAnt 1.2.0 (or later) to build TiniHttpServer."
    />
  </target>

  <target name="check tini" unless="tini.ok">
    <fail
      message="${line.separator}TINI classes not found in
${tiniclasses.jar}."
    />
  </target>

  <target name="check tools" depends="init, check jdk, check jsdk, check
tiniant, check tiniant version, check tini">
    <!-- Add tini task -->
    <taskdef name="tini" classname="net.geeba.ant.Tini"/>
  </target>

  <!-- General setup -->
  <target name="setup" unless="setup.done" depends="init">
    <mkdir dir="${tini.build.dir}"/>
  </target>

  <target name="tini" depends="check tools,setup"
    description="Builds Slush for TINI platform"
    >
    <javac
      srcdir="src:${src.dirs}"
      destdir="${tini.build.dir}"
 
classpath="${tini.onewire.jar}:${tini.build.dir}:${dependency.classpath}:${s
pi.tsilk.jar}:${modules.jar}"
      bootclasspath="${tiniclasses.jar}"
      includes="${src.files}"
      target="1.1"
      deprecation="${javac.deprecation}"
      optimize="${javac.optimize}"
      nowarn="${javac.nowarn}"
      debug="${javac.debug}"
    />
    <tini
      outputfile="${tini.output.file}"
      flash="${tini.flash}"
      targetaddress="${tini.targetaddress}"
      database="${tini.db}"
      dependencyfiles="${owapi_dep.txt},${dependency.files}"
      depends="${dependency.groups}"
 
dependpath="${tini.onewire.jar}:${dependency.classpath}:${modules.jar}"
      classpath="${tini.jar}"
      force="yes"
      verbose="${tini.debug}"
      >
      <convert dir="${tini.build.dir}"/>
    </tini>
  </target>

  <target name="deploy" depends="tini"
    description="Deploys Hvac files to TINI (default target)"
    >
    <chmod file="${deploy.script}" perm="ugo+rx"/>
    <exec dir="${basedir}" executable="${deploy.script}"
output="${null.output}">
      <arg value="${tini.host}"/>
      <arg value="${tini.user}"/>
      <arg value="${tini.pass}"/>
    </exec>
  </target>
  
  <echo message="JavaKit commandline Args = ${javakit.commandline.args}"/>
  <target name="javakit"
    description="Runs JavaKit"
    >
    <chmod file="${javakit.script}" perm="ugo+rx"/>
    <exec dir="${tini.dir}/bin" executable="${javakit.script}"
output="${null.output}">
      <arg value="${javakit.commandline.args}"/>
    </exec>
  </target>

  <target name="clean"
    description="Deletes all class files created by the build process"
    >
    <delete dir="${tini.build.dir}"/>
  </target>
  
  <target name="main function" depends="writeVariables,check
tools,setup,tini"
  	description="This function runs all of the basic necessary
functions"
  	>
  </target>

</project>
----------------------------------------------------------------------------
---------------

This is what my build.properties file looks like:

----------------------------------------------------------------------------
---------------
################
#
# Set "tini.dir" to your TINI installation directory.
#
# NOTE: Be sure to use forward slashes (as shown) even on Windows!

tini.dir=D:/TINI/SDK/tini1.12

################
#
# Set "servlet.jar" to the absolute name of the servlet.jar file from JSDK
2.2.
#
# NOTE: Be sure to use forward slashes (as shown) even on Windows!

servlet.jar=C:/j2sdk1.4.2_04/lib/servlet.jar

################
#
# Set "tini.host" to your TINI's hostname or IP address.

tini.host=192.168.2.4

################
#
# Set "tini.user" to a valid username for your TINI.

tini.user=root

################
#
# Set "tini.pass" to the password for the user specified as tini.user.

tini.pass=tini

################
#
# Set "src.files" to the file names of all the source files
# needed by your servlets (including the servlets themselves).
# This must be a comma separated list.  Note that you can use
# a backslash ('\') as a line continuation character to continue
# this onto multiple lines for improved readability.  If you add
# lines to the end of the existing lines, don't forget to add a
# backslash to the end of the formerly last line.
#
# NOTE: File names MUST BE *relative to* AND *below* either the
#       "src" subdirectory or one of the directories specified
#       in the src.dirs property below.
#
# NOTE: Be sure to use forward slashes in paths even on Windows!
#
# NOTE: Separate entries with commas (',').

src.files= \
        tbc/control/hvac/**/*.java
        


################
#
# Set "src.dirs" to the list of directories that contain your source
tree(s).
# It is not necessary to include the "src" subdirectory of the
TiniHttpServer
# distribution (it would be redundant).
#
# NOTE: Directory names can be absolute or be relative to the TiniHttpServer
#       directory (i.e. the directory that contains this file).
#
# NOTE: Be sure to use forward slashes even on Windows!
#
# NOTE: Separate entries with semicolons (';') or colons (':').

src.dirs=src

################
#
# Set "dependency.classpath" to the directories and/or JAR files
# that contain third-party classes required by your servlets.
#
# Note that servlet.jar and the 1-Wire classes are already
# included elsewhere so they need not be repeated here.
#
# NOTE: Be sure to use forward slashes (/) even on Windows!
#
# NOTE: Separate entries with semicolons (';') or colons (':').

dependency.classpath=D:/TINI/TSilk/TstikApi1.12.jar

################
#
# Set "dependency.files" to a list of dependency files.
# You do not need to specify the owapi_dep.txt file that comes with
# the TINI firmware.
#
# NOTE: Separate entries with commas (',').

dependency.files=D:/TINI/TSilk/SDK/tini_dep_systronix.txt,D:/Downloads/Progr
ams/eclipse/workspace/TBC_HVAC_OS1.12/ths_owapi_dep.txt

################
#
# Set "dependency.groups" to a comma-separated list of dependency groups
# you use. These dependency groups should be defined in the owapi_dep.txt
# file that comes with the TINI firmware OR one of the dependency files
# listed on in the extra.dependency.filess property above.  Fully qualified
# class names may be listed here as well, but creating and using a
# dependency group is preferable.
#
# The ths_owapi_dep.txt file defines the following dependency groups:
#
#   THS_ALL includes all 1-Wire container classes (and classes required
#           by the container classes).  This makes OneWireServlet
#           far more interesting, but also make TiniHttpServer.tini
#           rather large.  Only recommended for 1 MB TINIs.
#
#           NOTE: This does *NOT* include any additional 1-Wire utility
#           classes that not required by the 1-Wire container classes.
#
#   THS_MIN includes only the 1-Wire classes that are absolutely required
#           for the sample servlets.  It makes OneWireContainer less
#           interesting, but also makes TiniHttpServer.tini much smaller.
#           This is the default and is recommended for 512 KB TINIs.
#
#   If you omit OneWireServlet.java, FamilyCode10Servlet.java, and
#   FamilyCode10Servlet.java from servlet.src (see above), you may set
#   onewire.deps to nothing for an even smaller TiniHttpServer.tini file.
#
# NOTE: Separate entries with commas (',').

#dependency.groups=THS_MIN,I2C400
#dependency.groups=I2C400,SpiConfig,HTTPSERVER
#dependency.groups=MAILTO,FTPCLIENT,HTTPSERVER
dependency.groups=HTTPSERVER

################
#
# Set pure.onewire.jar to the absolute name of the OneWireAPI.jar file
# from the final release 0.01 of the 1-Wire API for Java.
#
# NOTE: Be sure to use forward slashes (as shown) even on Windows!

pure.onewire.jar=D:/TINI/SDK/OneWire/lib/OneWireAPI.jar

################
#
# Set the spi.tsilk.jar to the place where the TstikApi1*.**.jar is where
(*.**) is
# the version number of the Tstik API.
#
# NOTE: Be sure to use forward slashes (as shown) even on Windows

spi.tsilk.jar = D:/TINI/TSilk/TstikApi1.12.jar

################
#
# Set the path to where the javakit batch file is located
# This file is supposed to launch javakit automaticlly
#

javakit.script=D:/TINI/SDK/tini1.12/bin/javakit.bat

################
#
# Set commandline arguments to use when running javakit
#
# Example to open COM 1: 
#       -port COM1
#

javakit.commandline.args=-400 -flash 40
----------------------------------------------------------------------------
---------

If anyone could show me the error of my way, I'd appreciate it!

Thanks!
Joel Rowley

_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini