Hello all,

I am researching the possibility of using the Java 2 Micro Edition platform 
in a web-enabled device.  Specifically, I am investigating whether the 
Catalina servlet container can be configured using the c virtual machine 
(under CDC-foundation profile) instead of relying upon a full-fledged jdk to 
to the job.  I am running Linux.

The following are steps I've taken to find a solution:

- changed name 'cvm' to 'java'
- changed PATH varialbe to execute cvm when 'java' command is typed
- changed JAVA_HOME to the directory above the bin where cvm (java) resides
- altered catalina.sh -classpath references to -Djava.class.path= and added 
$CATALINA_HOME/server/lib/catalina.jar to the classpath
- added (in catalina.sh) -Xbootclasspath=$JAVA_HOME/lib/foundation.jar

I did all of this under the "embedded" section of catalina.sh.  When I run 
the script: "bin/catalina.sh embedded" many error are thrown due to the 
limited package set found in foundation.jar.  (ie. 
java.lang.NoClassDefFoundError: javax.servlet.ServletException).  So I began 
added all of the packages catalina called for, but this only took me so far.


Below is the applicable section of catalina.sh that I altered and my current 
error output.  (I realize I placed many non-j2me compliant jars in the 
classpath, I'm only doing everything I can think of to make catalina happy 
to get cvm to run!):

-----------
catalina.sh
-----------
elif [ "$1" = "embedded" ] ; then

  shift

exec "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
      -showversion -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" 
-Djava.class.path=$CATALINA_HOME/server/lib/catalina.jar:/home/brice/java/javaWebServices/server/lib/commons-digester.jar:/usr/java/j2sdk1.4.0/lib/javax.servlet.jar:/usr/java/jdk1.3.1/jre/lib/rt.jar
 
-Xbootclasspath=$JAVA_HOME/lib/foundation.jar \
      -Dcatalina.base="$CATALINA_BASE" \
      -Dcatalina.home="$CATALINA_HOME" \
      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
       org.apache.catalina.startup.Embedded

--------------------
command line (error)
--------------------
[root@dhcp-15-180-33-173 jakarta-tomcat-4.0.4]# bin/catalina.sh embedded
Using CATALINA_BASE:   /usr/local/jakarta-tomcat-4.0.4
Using CATALINA_HOME:   /usr/local/jakarta-tomcat-4.0.4
Using CATALINA_TMPDIR: /usr/local/jakarta-tomcat-4.0.4/temp
Using JAVA_HOME:       
/home/brice/java/j2me/foundation/cdcfoundation/build/linux
GC[SS]: Initialized semi-space gen for generational GC
        Size of *each* semispace in bytes=1048576
        Limits of generation = [0x401bc200,0x403bc200)
        First semispace      = [0x401bc200,0x402bc200)
        Second semispace     = [0x402bc200,0x403bc200)
GC[MC]: Initialized mark-compact gen for generational GC
        Size of the space in bytes=3145728
        Limits of generation = [0x403bc200,0x406bc200)
GC[generational]: Auxiliary data structures
        heapBaseMemoryArea=[0x401bc008,0x406bc208)
        cardTable=[0x8345e90,0x8348690)
        objectHeaderTable=[0x8348698,0x834ae98)
        summaryTable=[0x834aea0,0x8354ea0)
java version "J2ME Foundation 1.0"
Java(TM) 2, Micro Edition (build 1.0fcs-ar)
CVM (build 1.0fcs-ar, native threads)
security properties not found. using defaults.
Starting embedded server
Creating engine
Creating host 'localhost' with appBase 
'/usr/local/jakarta-tomcat-4.0.4/webapps'
Creating context '' with docBase 
'/usr/local/jakarta-tomcat-4.0.4/webapps/ROOT'
can't open ../lib/tzmappings
java.lang.NoSuchMethodError: java.lang.String: method getBytes(II[BI)V not 
found
        at 
org.apache.catalina.util.RequestUtil.URLDecode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;(RequestUtil.java:376)
...


Has anyone ever tried to run tomcat on a j2me implementation?  If anyone has 
any clues, pointers, advise, online docs, etc it would be much appreciate.  
Thanks.

-Brice Roncace



_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to