JES with (J2ME)CDC and Foundation on Linux/x86

I'm trying to run JES with (J2ME) CDC and Foundation on Linux/x86 platform.

I used jdk1.3 to extract JES and updated "runjes" to use "CVM". After running "runjes", JES printed at command prompt this output as described in the documentation

Java Embedded Server 2.0

Copyright 1998, 1999 and 2000 Sun Microsystems, Inc. All rights reserved.

Use is subject to license terms.

Type 'h[elp]' for a list of commands.

>

but when I try to start services by typing

>start log, servlet, http, tcatjspcruntime, httpauth, httpusers, jesmp

I'm getting this error

- trace begin --

java.lang.NoSuchMethodError: java.lang.String: method <init>([BIII)V not found

at com.sun.jes.impl.jar.Attributes.read(Lcom/sun/jes/impl/jar/Manifest$F

astInputStream;[B)V(Attributes.java:276)

at com.sun.jes.impl.jar.Manifest.read(Ljava/io/InputStream;)V(Manifest.j

ava:100)

at com.sun.jes.impl.jar.Manifest.<init>(Ljava/io/InputStream;)V(Manifest

.java:52)

at com.sun.jes.impl.framework.BundleImpl.storeBundle(Ljava/io/InputStrea

m;Ljava/lang/String;Ljava/util/Hashtable;)V(BundleImpl.java:859)

at com.sun.jes.impl.framework.BundleImpl.createCachedBundle(Ljava/lang/S

tring;Ljava/io/InputStream;)V(BundleImpl.java:755)

at com.sun.jes.impl.framework.BundleImpl.<init>(Ljava/lang/String;Ljava/

io/InputStream;Lcom/sun/jes/impl/framework/Framework;J)V(BundleImpl.java:103)

at com.sun.jes.impl.framework.Framework.installBundle(Ljava/lang/String;

Ljava/io/InputStream;J)Lorg/osgi/framework/Bundle;(Framework.java:233)

at com.sun.jes.impl.framework.Framework.installBundle(Ljava/lang/String;

Ljava/io/InputStream;)Lorg/osgi/framework/Bundle;(Framework.java:205)

at com.sun.jes.impl.framework.Main.getBundle(Ljava/lang/String;)Lorg/osg

i/framework/Bundle;(Main.java:627)

at com.sun.jes.impl.framework.Main.startBundles([Ljava/lang/String;)V(Ma

in.java:590)

at com.sun.jes.impl.framework.Main.dispatch(Ljava/lang/String;)Z(Main.ja

va:341)

at com.sun.jes.impl.framework.Main.run(Ljava/io/BufferedReader;Z)V(Main.

java:274)

at com.sun.jes.impl.framework.Main.runInteractive()V(Main.java:228)

at com.sun.jes.impl.framework.Main.main([Ljava/lang/String;)V(Main.java:

79)

> start servlet

java.lang.NoSuchMethodError: java.lang.String: method <init>([BIII)V not found

at com.sun.jes.impl.jar.Attributes.read(Lcom/sun/jes/impl/jar/Manifest$F

astInputStream;[B)V(Attributes.java:276)

at com.sun.jes.impl.jar.Manifest.read(Ljava/io/InputStream;)V(Manifest.j

ava:100)

at com.sun.jes.impl.jar.Manifest.<init>(Ljava/io/InputStream;)V(Manifest

.java:52)

at com.sun.jes.impl.framework.BundleImpl.storeBundle(Ljava/io/InputStrea

m;Ljava/lang/String;Ljava/util/Hashtable;)V(BundleImpl.java:859)

at com.sun.jes.impl.framework.BundleImpl.createCachedBundle(Ljava/lang/S

tring;Ljava/io/InputStream;)V(BundleImpl.java:755)

at com.sun.jes.impl.framework.BundleImpl.<init>(Ljava/lang/String;Ljava/

io/InputStream;Lcom/sun/jes/impl/framework/Framework;J)V(BundleImpl.java:103)

at com.sun.jes.impl.framework.Framework.installBundle(Ljava/lang/String;

Ljava/io/InputStream;J)Lorg/osgi/framework/Bundle;(Framework.java:233)

at com.sun.jes.impl.framework.Framework.installBundle(Ljava/lang/String;

Ljava/io/InputStream;)Lorg/osgi/framework/Bundle;(Framework.java:205)

at com.sun.jes.impl.framework.Main.getBundle(Ljava/lang/String;)Lorg/osg

i/framework/Bundle;(Main.java:627)

at com.sun.jes.impl.framework.Main.startBundles([Ljava/lang/String;)V(Ma

in.java:590)

at com.sun.jes.impl.framework.Main.dispatch(Ljava/lang/String;)Z(Main.ja

va:341)

at com.sun.jes.impl.framework.Main.run(Ljava/io/BufferedReader;Z)V(Main.

java:274)

at com.sun.jes.impl.framework.Main.runInteractive()V(Main.java:228)

at com.sun.jes.impl.framework.Main.main([Ljava/lang/String;)V(Main.java:

error trace end

any clue, can anybody help me, Sun documentation says that JES works with J2ME foundation.

Am I doing some thing wrong.

many thanks in advance

raj

[4378 byte] By [kalipatnapu] at [2007-9-26 2:50:51]
# 1
This is not an answer to your question. How did you "extracted" JES and how did you "updated" the runjes command?
qlheng at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 2

> This is not an answer to your question. How did you

> "extracted" JES and how did you "updated" the runjes

> command?

When I said I extracted JES, I meant I installed the

JES frame work. The installation procedure for JES framework is clearly explained in this READ ME doc.

http://www.sun.com/software/embeddedserver/techinfo/README20-solaris.html

"runjes" is a shell script ( on unix systems ) for windows its runjes.bat a batch file.

My environment is Linux. I set JES_JAVA_HOME to cvm Home and updated this part of the "rujes" script

###old script begin###

if [ -r $JES_JAVA_HOME/bin/pjava ] ; then

# jdk1.2 can find classes.zip itself; pjava cannot.

javaCmd=$JES_JAVA_HOME/bin/pjava

sysClasspath=$JES_JAVA_HOME/lib/classes.zip:

else

javaCmd=$JES_JAVA_HOME/bin/java

sysClasspath=

fi

###old script end###

and changed it to

###new script begin###

if [ -r $JES_JAVA_HOME/bin/cvm ] ; then

# cvm needs the foundation jar in Xbootclasspath

javaCmd="$JES_JAVA_HOME/bin/cvm -Xbootclasspath=$JES_JAVA_HOME/lib/foundation.jar"

sysClasspath=

elif [ -r $JES_JAVA_HOME/bin/pjava ] ; then

# jdk1.2 can find classes.zip itself; pjava cannot.

javaCmd=$JES_JAVA_HOME/bin/pjava

sysClasspath=$JES_JAVA_HOME/lib/classes.zip:

else

javaCmd=$JES_JAVA_HOME/bin/java

sysClasspath=

fi

###new script end###

hope this answers ur question

regards,

Raj

kalipatnapu at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 3
Hello Can any body from Sun asnwer me please.. Its urgent..thanks in advanceRaj
kalipatnapu at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 4

Take a look at this:

--

10ACTIVEuseradm

11ACTIVEdevicem

12ACTIVErmboot

13ACTIVEtelnet

14ACTIVEkitman

15ACTIVEpmp

16ACTIVElicense

fw>$info.jvm

JVM System Properties :

JVM vendor: Sun Microsystems Inc.

JVM version: J2ME Foundation 1.0

JVM vednor URL : http://java.sun.com/

fw>$info.mem

Used Memory : 1541076

Total Memory : 4194304

Free Memory : 2653228

fw>$

-

For more information look at http://www.prosyst.com/.

v.pavlov at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 5
Hi v.pavlov I dont understand your reply. Could you please explain clearly.thanks,Raj
kalipatnapu at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 6

JES is OSGi framework but not the only one. The previous message was cut&paste from ProSyst's mBedded Server console which is also an OSGi gateway.

And that cut&paste shows that it is really running with CVM ocupying only 1.5M RAM (Actually with Java 1.1.7 it is at about 800K and with other JVM like IBMs J9, Jeode, Jbed it uses even less memory.)

v.pavlov at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 7
Thank you for your reply, Raj. Have you solved your problem?
qlheng at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 8
Unfortunately JES 2.0 implementation uses several String constructors that have been deprecated. They are removed from CDC/Foundation profile.JES 2.1 has fixed this problem.- Kirk
kirkc at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 9
Thanks for the tip. By saying 2.1, do you mean JES2.0 with the patch or Sun has released a new edition?
qlheng at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 10
It's a new release which implements the OSGi spec R2,not the patch one.- Kirk
kirkc at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 11

I actually searched sun's site. The only product available for download is JES2.0 and Patch-01. Can you tell me where I can get JES2.1? And, can you tell me exactly how to use JES on CVM? I've tried to combine them together in order to use on my graduation project for one month, no luck yet.

qlheng at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 12

I have Jes2.0 running on CDC+ Foundation Classes vm

on linux 2.2.19 kernel, on a home-brewed embedded distro.

the runjes script is massive overkill and I coulnd't get it to work

either. I put together m own startup script which looks like this:

(cvm is in /bin and foundation.jar is in /lib, you might want to fix

this:

#!/bin/sh

JES_DIR=<path to your jes installation>

export JES_DIR

# Set the directory of the jescache to somewhere non-volatile

JESCACHE=/jescache

export JESCACHE

#

/bin/cvm -Xbootclasspath=/lib/foundation.jar -Djava.class.path= \\

$JES_DIR/lib/framework.jar -Dcom.sun.jes.framework.cache.dir= \\

$JESCACHE -Dcom.sun.jes.framework.bundles.baseurl= \\

file:/$JES_DIR/bundles com.sun.jes.imple.framework.Main

#

This will start the framework , then you needto start whatever

bundles you want to run.

Pete

youngpk at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 13

If you try to preload foundation classes in CVM binary it will require less space on the disk and you can make your distro smaller.

Actually today we've managed to put Linux+CVM+ProSyst mBedded Server on a single floppy

It works great and it's quite fast after the floppy boots.

In that floppy are also included http bundles, serving some static html pages with flash animation, telnet - for remote access, and pmp - to connect with our GUI Administrator.

v.pavlov at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 14

Excellent. Do you use LRP or something else?

I was thinking at one time that it might be possible to preload the

JES2.0 framework classes into the CVM binary as well. I was

going to try this but bit rot has set in and it appears that I can

no longer compile cvm (same box, same compiler!) Weird.

youngpk at 2007-6-29 10:37:44 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 15

Preloading jes into CVM binary really saves some space but then, once you decide to place a newer JES version you should recompile your CVM again.

That's why we preloaded foundation classes only and framework was outside in a .jar archive.

About the Linux we used - it's not LPR but our work.

The kernel is much stripped 2.2.14 from RedHat 6.2 distribution. We also use latest busybox (from the CVS) for some shell utilities, ifconfig and route commands.

Unfortunately this wasn't enough so we had to format or diskette 1743K (yes, this is possible in linux - /dev/fd0u1743). But this is really enough. Once the server is started and core bundles are installed you can install some other bundles using http.

;)

v.pavlov at 2007-7-1 2:49:14 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 16

Hi there,

Was this problem ever resolved? Unfortunately, I seem to be running into the same problem. I've trolled through all of the responses and I couldn't find an answer to the original question. There was mention of a JES 2.1 - but that doesn't seem to be available yet. If anyone has any suggestions it would greatly be appreciated.

Thanks in advance! :)

Regards,

Jeff

java.jeff at 2007-7-1 2:49:14 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 17

Hi,

i have problem in running of OSGi bundles in JES framework.i have installed JES2.0 version.

i am even unable run the runjes.bat file .so,i started the framework from the lib folder(included the same in classpath).Installed the given bundles in the framework.i am working with examples in docs/tutorial folder .......... club,greeting1 ,greeting2,greeting3.....

The service ,GreetingService(interface) is not being registered. Could you plz guide me.

thanks & regards,

tony

tony_shalli at 2007-7-1 2:49:15 > top of Java-index,Java Mobility Forums,Consumer and Commerce...