I have some problem in testing example about migration cited in AFME Programmers' Guide in a Virtual SunSpot.
After created a jar file, using the command jar-app, that contains application code (generated following instructions contained in AFME Programmers'guide) + classes contained in afme3_3.jar, migration3_3.jar, radiomig3_3.jar, radiogram3_3.jar, I tried to depoly it in a virtual sun spot, but an error occurred during deploying phase.
The error is:
Java Runtime Environment version: 1.6.0_07
[translating suite C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicat
ionTemplate_1.0.00 …]
IO error while loading: class javax.microedition.lcdui.List
javax.microedition.io.ConnectionNotFoundException: javax/microeditio
n/lcdui/List.class
at com.sun.squawk.io.j2me.classpath.Protocol.openInputStream(Pro
tocol.java:162)
at com.sun.squawk.translator.ci.ClassFileLoader.load(ClassFileLo
ader.java:139)
at com.sun.squawk.translator.Translator$1.run(Translator.java:66
5)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer
.java:125)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.ja
va:159)
at com.sun.squawk.translator.Translator.load(Translator.java:663
)
at com.sun.squawk.translator.Translator.load(Translator.java:357
)
at com.sun.squawk.translator.Translator.computeClosure(Translato
r.java:682)
at com.sun.squawk.translator.Translator.close(Translator.java:42
9)
at com.sun.squawk.Romizer.translate(Romizer.java:711)
at com.sun.squawk.Romizer.access$000(Romizer.java:44)
at com.sun.squawk.Romizer$1.run(Romizer.java:373)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer
.java:127)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.ja
va:177)
at com.sun.squawk.Romizer.run(Romizer.java:371)
at com.sun.squawk.Romizer.main(Romizer.java:331)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
NoClassDefFoundError: javax.microedition.lcdui.List
at com.sun.squawk.romizer.EmbeddedSquawkClassLoader.runMain(Embe
ddedSquawkClassLoader.java:49)
at com.sun.spot.solarium.spotworld.participants.EmulatedSunSPOT.
doSuite(EmulatedSunSPOT.java:769)
at com.sun.spot.solarium.spotworld.participants.EmulatedSunSPOT.
doDeploy(EmulatedSunSPOT.java:867)
[translating suite C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicat
ionTemplate_1.0.00 …]
at com.sun.spot.solarium.spotworld.participants.EmulatedSunSPOT$
5.run(EmulatedSunSPOT.java:501)
at com.sun.spot.solarium.spotworld.common.UICommand.runWrapper(U
ICommand.java:173)
at com.sun.spot.solarium.spotworld.participants.CommandQueue$1.r
un(CommandQueue.java:46)
NoClassDefFoundError: com.agentfactory.cldc.GUIFactory
[translating suite C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicat
ionTemplate_1.0.00 …]
Romizer processed 122 classes and generated these files:
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.sym
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.suite
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.suite.metadata
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.suite.api
How can I do to resolve this problem?
I hope that problem is clear; If isn't clear please tell me
If you want, I can post application code or send it with a mail
thanks in advance!!!!
lucignolo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using afme_nointer3_3.jar, rather than afme3_3.jar, I create a new application jar file but, unfortunately, during the deploying phase in a virtual sun spot of this application, the same exception is thrown:
Java Runtime Environment version: 1.6.0_07
[translating suite C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicat
ionTemplate_1.0.00 …]
IO error while loading: class javax.microedition.lcdui.List
javax.microedition.io.ConnectionNotFoundException: javax/microeditio
n/lcdui/List.class
at com.sun.squawk.io.j2me.classpath.Protocol.openInputStream(Pro
tocol.java:162)
at com.sun.squawk.translator.ci.ClassFileLoader.load(ClassFileLo
ader.java:139)
at com.sun.squawk.translator.Translator$1.run(Translator.java:66
5)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer
.java:125)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.ja
va:159)
at com.sun.squawk.translator.Translator.load(Translator.java:663
)
at com.sun.squawk.translator.Translator.load(Translator.java:357
)
at com.sun.squawk.translator.Translator.computeClosure(Translato
r.java:682)
at com.sun.squawk.translator.Translator.close(Translator.java:42
9)
at com.sun.squawk.Romizer.translate(Romizer.java:711)
at com.sun.squawk.Romizer.access$000(Romizer.java:44)
at com.sun.squawk.Romizer$1.run(Romizer.java:373)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer
.java:127)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.ja
va:177)
at com.sun.squawk.Romizer.run(Romizer.java:371)
at com.sun.squawk.Romizer.main(Romizer.java:331)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
NoClassDefFoundError: javax.microedition.lcdui.List
[translating suite C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicat
ionTemplate_1.0.00 …]
at com.sun.squawk.romizer.EmbeddedSquawkClassLoader.runMain(Embe
ddedSquawkClassLoader.java:49)
at com.sun.spot.solarium.spotworld.participants.EmulatedSunSPOT.
doSuite(EmulatedSunSPOT.java:769)
at com.sun.spot.solarium.spotworld.participants.EmulatedSunSPOT.
doDeploy(EmulatedSunSPOT.java:867)
at com.sun.spot.solarium.spotworld.participants.EmulatedSunSPOT$
5.run(EmulatedSunSPOT.java:501)
at com.sun.spot.solarium.spotworld.common.UICommand.runWrapper(U
ICommand.java:173)
at com.sun.spot.solarium.spotworld.participants.CommandQueue$1.r
un(CommandQueue.java:46)
NoClassDefFoundError: com.agentfactory.cldc.GUIFactory
[translating suite C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicat
ionTemplate_1.0.00 …]
Romizer processed 122 classes and generated these files:
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.sym
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.suite
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.suite.metadata
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.suite.api
I think that problem is class javax.microedition.lcdui.List; I haven't an implementation of this class in my PC and, for this reason, an exception is thrown. Where can I find an implementation for this class for VIRTUAL SUNSPOT?
I hope in your answer
thanks a lot!!!
lucignolo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you should not be getting that error if you are using afme_nointer3_3.jar. Make sure that the other jar file has been removed from the classpath. The Sun SPOT does not support the lcdui package so you will not be able to use an implementation for the virtual spot. Make sure that you are using the Deploylet and DeployAgentPlatform templates for generating the Java files. Additionally, take a look at the other thread int the forum related to preverifying AFME for the sun spot.
Conor
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unfortunatelly, I have the same exception (ClassNotFoundException javax.microedition etc..etc…) during deployment of migration example cited in AFME programmers’ guide in a virtual sun spot (page 46 I think).
In this post I will try to explain my problem in a "better form", hoping that you can detect problems.
First of all, I realized the preverifying of jar archive afme_nointer3_3.jar, migration3_3.jar, radiogram3_3.jar, radiomig3_3.jar, using the command preverify.exe, contained in the directory C:\sunspot\sdk4.0\sdk\bin\. The instruction used for preverifying is:
Where C:\AFME_dapreverificare is folder that contains file jar nointer3_3.jar, migration3_3.jar, radiogram3_3.jar, radiomig3_3.jar. The preverified jars will be included in a directory output collocated in C:\sunspot\sdk4.0\sdk\bin.
Later I created the application, simply making a copy-paste from tutorial (the example in tutorial is exactly for virtual sunspot). I “compiled” file .af using classes in jar archive comp3_3.jar. In particular, I created two project Migration_Sender (that contains SpotIreland.af & SpotSparrow.sh & compiled classes) and Migration_Receiver (that contains SpotAfrica.af & SpotSparrow.sh & compiled classes). The preverified jars are all collocated in the in the same project folder that contains file build.xml and in file build.properties is inserted string:
Later, I started solarium, created a new virtual spot, clicked with left button for opening a menu and then selected Deploy MIDlet bundle, choosing file build.xml from folder Migration_Receiver. After few seconds….exception
I don’t know where the problem is….It seems correct; In the variable CLASSPATH there is only string C:\AFME\comp3_3.jar, useful for creating MIDlet.
If you want I can post the code.
Please help me, thank you. I already tested other examples (HelloWorld, Comunication) and all is ok.
Best regards
lucignolo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I’m sorry but I think that I don’t understand what you said. My system variable CLASSPATH's value is only C:\AFME\comp3_3.jar not C:\AFME\migration3_3.jar. Indeed, removing from property utility.jars migration3_3.jar (property contained in file build.properties). I have this error in deploying phase:
Error building jar file: suite\TestMigration_1.0.0.jar
Compile failed; see the compiler error output for details.
No to.jar.file specified.
Using "suite\TestMigration_1.0.0.jar"
C:\test_AFME\Migration_Receiver\src\spotmi\LEDTogFact.java:4: cannot find symbol
symbol : class ActuatorFactory
location: package com.agentfactory.cldc
import com.agentfactory.cldc.ActuatorFactory;
^
C:\test_AFME\Migration_Receiver\src\spotmig\LEDTogFact.java:7: cannot find symbol
symbol: class ActuatorFactory
public class LEDTogFact implements ActuatorFactory{
These classes required during compiling phase are all contained in jar archive migration3_3.jar. If I remove migration3_3.jar from utility.jars property, I can’t compile code of example application.
I hope tht is clear
Thanks a lot, connor, for your help.
Best regards.
lucignolo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After removing class GUIFactory from migration3_3.jar, I'm finally able to
deploy successfully in a virtual sunspot first Migration_Sender
application and then Migration_Receiver application! Can I remove class
GUIFactory from migration3_3.jar archive without having problems?
Later tested migration's functioning using two virtual sunspot under
soalrium. So I created two virtual sunspot the first for Migration_Sender
application and the second for Migration_Receiver application, and tried to deploy
apllications to virtual sunspot. Unfortunately,during second deploying to second
virtual sunspot an OutOfMemory exception is thrown. I think that isn't an
AFME problem, do you think this?
I hope in your answer
best regards
lucignolo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes, you can remove the GUIFactory without any problems. That class was intended for mobile phone applications. I will upload a version that does not include that class at a later date.
I think there is a bug in Solarium. When you test the application (have two platforms running) and then you want to retest, you need to restart the emulator.
best regards,
Conor
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Regarding problem using solarium, I would be more clear…..After opening solarium, as I told previously, I created two virtual SunSpot, with address 7f00.0001.0000.1001 and 7f00.0001.0000.1002. After deploying, in SunSPOT 7f00.0001.0000.1001, Migration_Receiver application, I tried to deploy Migration_Sender application in 7f00.0001.0000.1002 but…..an OutOfMemoryException occurred. So, for this reason, I’m not able to do any test for this application using two virtual SunSPOTs in solarium. Is not a “retest probelm”. The problem is, when I create two SunSPOT in solarium and try to deploy Migration_Server and Migration_Recevier in these two SunSPOT, an exception occurs. Is this problem caused by solarium’s bug?
Thanks a lot, connor!!!
lucignolo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using information contained in thread that you suggest me, I finally succeed to create two virtual sunspot (with address respectively 7f00.0001.0000.1001 and 7f00.0001.0000.1002) and to deploy respectively Migration_Sender and Migration_Receiver application; unfortunately there are some problem when I tried to run these application in virtual sunspot. In fact, when I try to run Migration_Receiver in virtual sunspot 7f00.0001.0000.1002 a new exception is thrown:
java.net.SocketException: error setting options
at java.net.PlainDatagramSocketImpl.join
(Native Method)
at java.net.PlainDatagramSocketImpl.join
(PlainDatagramSocketImpl.java:172)
at java.net.MulticastSocket.joinGroup(Mu
lticastSocket.java:276)
at com.sun.squawk.io.j2se.multicastsocke
t.Protocol.open(Unknown Source)
at javax.microedition.io.Connector.openP
rim(Connector.java:310)
at javax.microedition.io.Connector.open(
Connector.java:236)
at com.sun.squawk.vm.GenericConnectionCh
annel.execute(GenericConnectionChannel.java:181)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:365)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:174)
java.net.SocketException: error setting option
s
at java.net.PlainDatagramSocketImpl.join
(Native Method)
at java.net.PlainDatagramSocketImpl.join
(PlainDatagramSocketImpl.java:172)
at java.net.MulticastSocket.joinGroup(Mu
lticastSocket.java:276)
at com.sun.squawk.io.j2se.multicastsocke
t.Protocol.open(Unknown Source)
at javax.microedition.io.Connector.openP
rim(Connector.java:310)
at javax.microedition.io.Connector.open(
Connector.java:236)
at com.sun.squawk.vm.GenericConnectionCh
annel.execute(GenericConnectionChannel.java:181)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:365)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:174)
radio server created: 46
radio server running
and then application started (I think so, because a virtual sunspot’s led became to blink). Later I tried to run Migration_Receiver in virtual sunspot 7f00.0001.0000.1001, but a new exception was thrown:
radio server running
java.net.SocketException: error setting options
at java.net.PlainDatagramSocketImpl.join
(Native Method)
at java.net.PlainDatagramSocketImpl.join
(PlainDatagramSocketImpl.java:172)
at java.net.MulticastSocket.joinGroup(Mu
lticastSocket.java:276)
at com.sun.squawk.io.j2se.multicastsocke
t.Protocol.open(Unknown Source)
at javax.microedition.io.Connector.openP
rim(Connector.java:310)
at javax.microedition.io.Connector.open(
Connector.java:236)
at com.sun.squawk.vm.GenericConnectionCh
annel.execute(GenericConnectionChannel.java:181)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:365)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:174)
java.net.SocketException: error setting option
s
at java.net.PlainDatagramSocketImpl.join
(Native Method)
at java.net.PlainDatagramSocketImpl.join
(PlainDatagramSocketImpl.java:172)
at java.net.MulticastSocket.joinGroup(Mu
lticastSocket.java:276)
at com.sun.squawk.io.j2se.multicastsocke
t.Protocol.open(Unknown Source)
at javax.microedition.io.Connector.openP
rim(Connector.java:310)
at javax.microedition.io.Connector.open(
Connector.java:236)
at com.sun.squawk.vm.GenericConnectionCh
annel.execute(GenericConnectionChannel.java:181)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:365)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:174)
radio server created: 45
radio server running
Uncaught exception in Thread.run():
on thread AODVSender
com.sun.spot.peripheral.SpotFatalException: Go
t IOException while sending over SocketMac null
at java.lang.Throwable.<init>(bci=16)
at java.lang.Throwable.<init>(bci=5)
at java.lang.Exception.<init>(bci=6)
at java.lang.RuntimeException.<init>(bci=6
)
at com.sun.spot.peripheral.SpotFatalExcept
ion.<init>(44)
at com.sun.spot.peripheral.radio.SocketMAC
.mcpsDataRequest(bci=119)
at com.sun.spot.peripheral.radio.RadioPack
etDispatcher.sendBroadcast(119)
at com.sun.spot.peripheral.radio.RadioPack
etDispatcher.sendPacket(142)
in virtual method #33 of com.sun.spot.peri
pheral.radio.LowPan(bci=142)
at com.sun.spot.peripheral.radio.LowPan.se
ndBroadcast(617)
at com.sun.spot.peripheral.radio.LowPan.se
ndBroadcast(572)
in virtual method #23 of com.sun.spot.peri
pheral.radio.mhrp.aodv.Sender(bci=45)
at com.sun.spot.peripheral.radio.mhrp.aodv
.Sender.run(147)
in virtual method #47 of com.sun.squawk.VM
Thread(bci=38)
in static method #3 of com.sun.squawk.VM(b
ci=6)
com.sun.spot.peripheral.NoRouteException: No r
oute found
at java.lang.Throwable.<init>(bci=16)
at java.lang.Throwable.<init>(bci=5)
at java.lang.Exception.<init>(bci=6)
at java.io.IOException.<init>(bci=6)
at com.sun.spot.peripheral.NoRouteExceptio
n.<init>(35)
in virtual method #35 of com.sun.spot.peri
pheral.radio.LowPan(bci=186)
in virtual method #28 of com.sun.spot.peri
pheral.radio.LowPan(bci=90)
at com.sun.spot.peripheral.radio.LowPan.se
nd(434)
at com.sun.spot.peripheral.radio.Radiogram
ProtocolManager.send(99)
at com.sun.spot.peripheral.radio.proxy.Sen
dRadioPacketCommand.execute(46)
at com.sun.spot.peripheral.radio.proxy.Rad
ioRequestEnvelope.execute(34)
in virtual method #13 of com.sun.spot.inte
risolate.WorkerThread(bci=7)
at com.sun.spot.interisolate.WorkerThread.
run(55)
at java.lang.Thread.run(bci=17)
in virtual method #47 of com.sun.squawk.VM
Thread(bci=38)
in static method #3 of com.sun.squawk.VM(b
ci=6)
And later, as you can see in stacktrace, also a NoRouteException was thrown…..but address inserted in file SpotIreland.af was 7f00.0001.0000.1002!!!!
I think that this exception are generated by solarium’s bugs. Do you think this? Do you know how I can resolve this problem for proving this application under solarium?
I hope that problem is clear…….
Thanks a lot, connor, for helping that you are giving me
Best regard
lucignolo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think this is a Solarium problem rather than an AFME problem. I would check the Solarium forums. Please post the solution here if you find it. Additionally, bear in mind that if you are doing a number of tests you need to restart solarium after each test as I think the applications running on the Virtual SPOTs are not properly terminated by Solarium.
C
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This could potentially be related to whitespace in one of the Solarium configuratrion files. I think I had to change a configuration file when I started using it, but I'm not sure if it was related to this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Deploying applications Migration_Sender and Migration_Receiver on REAL SunSPOT, I have got these errors:
Compiling 7 source files to /Users/Ciccio/Documents/workspace/Migration_Receiver/build
/Users/Ciccio/Documents/workspace/Migration_Receiver/src/spotmig/SpotAfricaAgentPlatform.java:14: package javax.microedition.lcdui does not exist
import javax.microedition.lcdui.Display;
^
/Users/Ciccio/Documents/workspace/Migration_Receiver/src/spotmig/SpotAfricaAgentPlatform.java:15: package javax.microedition.lcdui does not exist
import javax.microedition.lcdui.Displayable;
^
/Users/Ciccio/Documents/workspace/Migration_Receiver/src/spotmig/SpotAfricaAgentPlatform.java:43: cannot find symbol
symbol : class GUIFactory
location: package com.agentfactory.cldc
import com.agentfactory.cldc.GUIFactory;
^
/Users/Ciccio/Documents/workspace/Migration_Receiver/src/spotmig/SpotAfricaAgentPlatform.java:361: cannot find symbol
symbol : class GUIFactory
location: class spotmig.SpotAfricaAgentPlatform
if (o instanceof GUIFactory) {
^
/Users/Ciccio/Documents/workspace/Migration_Receiver/src/spotmig/SpotAfricaAgentPlatform.java:363: cannot find symbol
symbol : class GUIFactory
location: class spotmig.SpotAfricaAgentPlatform
Module module = ((GUIFactory) o).createGUI(name, let, null);
^
5 errors
and similar errors I have got deploying Migration_Sender application in a real SunSPOT too. Obviously, in these cases, I use DeployMigPlatform.template instead of EmuMigPlatform.template.
Can I remove every reference to classes FactoryGUI, javax.microedition.lcdui.Display and finally javax.microedition.lcdui.Displayable from SpotIrelandAgentPlatform and SpotAfricaAgentPlatform code without any problem?
Thanks a lot, connor
best regards
lucignolo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, you can delete the references from the Java code itself without any problem, but I would suggest that you delete them from the template file and save it as a different file name. That way, the change will be there for all applications and you will not have to change the Java code when you recompile. You can do this by extracting the files from the compiler Jar (comp3_3.jar) and then rearchiving them. You will then have to change the file name you reference in the agent platform script.
Alternatively, for this application, the EmuMigPlatform should still work for a real SunSPOT. I thought I included the relevant template file without the references in the latest release, but obviously not. I will upload it later in comp3_4.jar.
hope this helps,
Conor
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have successfully run the "Sun SPOT Wireless Communication" example and "HelloWorld" example in Virtual SunSpot and real Sunspot devices.But I have a problem in testing example "Agent Migration with Sun SPOTs" cited in AFME Programmers' Guide in a Virtual SunSpot.
After created related files, i compiled AFME files, then compiled and preverified java files, and then created a jar file, then I tried to depoly it in a virtual sun spot, but an error occurred during deploying phase.
VerifyError: com.agentfactory.radio.RadioMigManager
com.sun.squawk.translator.VerifyError: while translating com.agentfactory.cldc.logic.FOS com.agentfactory.radio.RadioMigManager.processAction(com.agentfactory.cldc.AgentName,int,com.agentfactory.cldc.logic.FOS)@8 (RadioMigManager.java:140):
missing stack map entry for address. Check that class file has been preverified for Java ME: com/agentfactory/radio/RadioMigManager.class
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
NoClassDefFoundError: com.agentfactory.radio.RadioMigManager$1
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
com.sun.squawk.translator.VerifyError: while translating com.agentfactory.radio.RadioServerTask com.agentfactory.radio.RadioServerTask.<init>(java.lang.String,com.agentfactory.cldc.scheduler.Scheduler,com.agentfactory.cldc.migration.MigrationPlatform)@14 (RadioServerTask.java:53):
missing stack map entry for address. Check that class file has been preverified for Java ME: com/agentfactory/radio/RadioServerTask.class
VerifyError: com.agentfactory.radio.RadioServerTask
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
com.sun.squawk.translator.VerifyError: while translating void com.agentfactory.radio.RadiostreamTask.run()@0 (RadiostreamTask.java:59):
VerifyError: com.agentfactory.radio.RadiostreamTask
missing stack map entry for address. Check that class file has been preverified for Java ME: com/agentfactory/radio/RadiostreamTask.class
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
NoClassDefFoundError: spotmig.SpotAfricaAgentPlatform
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
NoClassDefFoundError: spotmig.SpotAfricalet
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
NoClassDefFoundError: spotmig.SpotIrelandAgentPlatform
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
NoClassDefFoundError: spotmig.SpotIrelandlet
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
Romizer processed 115 classes and generated these files:
C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00.sym
C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00.suite
C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00.suite.metadata
C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00.suite.api
I think the preverification phase didn't work. Would you please help me.
Best regards.
Hakan Cam.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You should try using a build script similar to the ones in the sun spot examples that are downloaded with the sun spot sdk. In order for it to locate the required afme files, you will need to set the utility.jars property in the build.properties configuration file.
Best regards,
Conor
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am planning to develop an application about agent migration. In this application an agent in the first sunspot collects the environmental data, i.e., temperature, light, battery level, etc. when the data collection ends, a new agent will be created and this agent will migrate to the second sunspot and displays the collected data. I am wondering if it is possible or not? Would you please tell me how i manage to develop? Thanks in advance.
Best regards,
Hakan.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi guys,
I have some problem in testing example about migration cited in AFME Programmers' Guide in a Virtual SunSpot.
After created a jar file, using the command jar-app, that contains application code (generated following instructions contained in AFME Programmers'guide) + classes contained in afme3_3.jar, migration3_3.jar, radiomig3_3.jar, radiogram3_3.jar, I tried to depoly it in a virtual sun spot, but an error occurred during deploying phase.
The error is:
Java Runtime Environment version: 1.6.0_07
[translating suite C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicat
ionTemplate_1.0.00 …]
IO error while loading: class javax.microedition.lcdui.List
javax.microedition.io.ConnectionNotFoundException: javax/microeditio
n/lcdui/List.class
at com.sun.squawk.io.j2me.classpath.Protocol.openInputStream(Pro
tocol.java:162)
at com.sun.squawk.translator.ci.ClassFileLoader.load(ClassFileLo
ader.java:139)
at com.sun.squawk.translator.Translator$1.run(Translator.java:66
5)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer
.java:125)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.ja
va:159)
at com.sun.squawk.translator.Translator.load(Translator.java:663
)
at com.sun.squawk.translator.Translator.load(Translator.java:357
)
at com.sun.squawk.translator.Translator.computeClosure(Translato
r.java:682)
at com.sun.squawk.translator.Translator.close(Translator.java:42
9)
at com.sun.squawk.Romizer.translate(Romizer.java:711)
at com.sun.squawk.Romizer.access$000(Romizer.java:44)
at com.sun.squawk.Romizer$1.run(Romizer.java:373)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer
.java:127)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.ja
va:177)
at com.sun.squawk.Romizer.run(Romizer.java:371)
at com.sun.squawk.Romizer.main(Romizer.java:331)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
NoClassDefFoundError: javax.microedition.lcdui.List
at com.sun.squawk.romizer.EmbeddedSquawkClassLoader.runMain(Embe
ddedSquawkClassLoader.java:49)
at com.sun.spot.solarium.spotworld.participants.EmulatedSunSPOT.
doSuite(EmulatedSunSPOT.java:769)
at com.sun.spot.solarium.spotworld.participants.EmulatedSunSPOT.
doDeploy(EmulatedSunSPOT.java:867)
[translating suite C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicat
ionTemplate_1.0.00 …]
at com.sun.spot.solarium.spotworld.participants.EmulatedSunSPOT$
5.run(EmulatedSunSPOT.java:501)
at com.sun.spot.solarium.spotworld.common.UICommand.runWrapper(U
ICommand.java:173)
at com.sun.spot.solarium.spotworld.participants.CommandQueue$1.r
un(CommandQueue.java:46)
NoClassDefFoundError: com.agentfactory.cldc.GUIFactory
[translating suite C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicat
ionTemplate_1.0.00 …]
Romizer processed 122 classes and generated these files:
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.sym
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.suite
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.suite.metadata
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.suite.api
How can I do to resolve this problem?
I hope that problem is clear; If isn't clear please tell me
If you want, I can post application code or send it with a mail
thanks in advance!!!!
lucignolo
Hey Lucignolo,
You need to use the afme_nointer3_3.jar Jar file rather than afme3_3.jar.
C
ok, I will try using this jar file.
thanks a lot!!!!
lucignolo
Hi conormuldoon,
Using afme_nointer3_3.jar, rather than afme3_3.jar, I create a new application jar file but, unfortunately, during the deploying phase in a virtual sun spot of this application, the same exception is thrown:
Java Runtime Environment version: 1.6.0_07
[translating suite C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicat
ionTemplate_1.0.00 …]
IO error while loading: class javax.microedition.lcdui.List
javax.microedition.io.ConnectionNotFoundException: javax/microeditio
n/lcdui/List.class
at com.sun.squawk.io.j2me.classpath.Protocol.openInputStream(Pro
tocol.java:162)
at com.sun.squawk.translator.ci.ClassFileLoader.load(ClassFileLo
ader.java:139)
at com.sun.squawk.translator.Translator$1.run(Translator.java:66
5)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer
.java:125)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.ja
va:159)
at com.sun.squawk.translator.Translator.load(Translator.java:663
)
at com.sun.squawk.translator.Translator.load(Translator.java:357
)
at com.sun.squawk.translator.Translator.computeClosure(Translato
r.java:682)
at com.sun.squawk.translator.Translator.close(Translator.java:42
9)
at com.sun.squawk.Romizer.translate(Romizer.java:711)
at com.sun.squawk.Romizer.access$000(Romizer.java:44)
at com.sun.squawk.Romizer$1.run(Romizer.java:373)
at com.sun.squawk.util.ComputationTimer.execute(ComputationTimer
.java:127)
at com.sun.squawk.util.ComputationTimer.time(ComputationTimer.ja
va:177)
at com.sun.squawk.Romizer.run(Romizer.java:371)
at com.sun.squawk.Romizer.main(Romizer.java:331)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
NoClassDefFoundError: javax.microedition.lcdui.List
[translating suite C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicat
ionTemplate_1.0.00 …]
at com.sun.squawk.romizer.EmbeddedSquawkClassLoader.runMain(Embe
ddedSquawkClassLoader.java:49)
at com.sun.spot.solarium.spotworld.participants.EmulatedSunSPOT.
doSuite(EmulatedSunSPOT.java:769)
at com.sun.spot.solarium.spotworld.participants.EmulatedSunSPOT.
doDeploy(EmulatedSunSPOT.java:867)
at com.sun.spot.solarium.spotworld.participants.EmulatedSunSPOT$
5.run(EmulatedSunSPOT.java:501)
at com.sun.spot.solarium.spotworld.common.UICommand.runWrapper(U
ICommand.java:173)
at com.sun.spot.solarium.spotworld.participants.CommandQueue$1.r
un(CommandQueue.java:46)
NoClassDefFoundError: com.agentfactory.cldc.GUIFactory
[translating suite C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicat
ionTemplate_1.0.00 …]
Romizer processed 122 classes and generated these files:
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.sym
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.suite
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.suite.metadata
C:\DOCUME~1\Alessio\IMPOST~1\Temp\SunSpotApplicationTemplate_1.0.0
0.suite.api
I think that problem is class javax.microedition.lcdui.List; I haven't an implementation of this class in my PC and, for this reason, an exception is thrown. Where can I find an implementation for this class for VIRTUAL SUNSPOT?
I hope in your answer
thanks a lot!!!
lucignolo
hi,
you should not be getting that error if you are using afme_nointer3_3.jar. Make sure that the other jar file has been removed from the classpath. The Sun SPOT does not support the lcdui package so you will not be able to use an implementation for the virtual spot. Make sure that you are using the Deploylet and DeployAgentPlatform templates for generating the Java files. Additionally, take a look at the other thread int the forum related to preverifying AFME for the sun spot.
Conor
sorry, that should have been EmuAgentPlatfrom rather than DeployAgentPlatform if you are using the emulator
Probably, I think that I make a mistake during the preverifying phase;
In this phase I use the command preverify.exe found under the
bin directory of sdk4.0 (I use blue release). The script is:
*directory_sdk4.0*/bin/preverify -classpath <directory_sdk4.0>/lib/squawk_device.jar *directory afme_nointer3_3.jar, migration3_3.jar, radiomig3_3.jar, radiogram3_3.jar*
I hope that is clear
please help me, thank you
lucignolo
Connor,
Unfortunatelly, I have the same exception (ClassNotFoundException javax.microedition etc..etc…) during deployment of migration example cited in AFME programmers’ guide in a virtual sun spot (page 46 I think).
In this post I will try to explain my problem in a "better form", hoping that you can detect problems.
First of all, I realized the preverifying of jar archive afme_nointer3_3.jar, migration3_3.jar, radiogram3_3.jar, radiomig3_3.jar, using the command preverify.exe, contained in the directory C:\sunspot\sdk4.0\sdk\bin\. The instruction used for preverifying is:
C:\sunspot\sdk4.0\sdk\bin\>preverify.exe –classpath C:\sunspot\sdk4.0\sdk\lib\squawk_device.jar C:\AFME_dapreverificare
Where C:\AFME_dapreverificare is folder that contains file jar nointer3_3.jar, migration3_3.jar, radiogram3_3.jar, radiomig3_3.jar. The preverified jars will be included in a directory output collocated in C:\sunspot\sdk4.0\sdk\bin.
Later I created the application, simply making a copy-paste from tutorial (the example in tutorial is exactly for virtual sunspot). I “compiled” file .af using classes in jar archive comp3_3.jar. In particular, I created two project Migration_Sender (that contains SpotIreland.af & SpotSparrow.sh & compiled classes) and Migration_Receiver (that contains SpotAfrica.af & SpotSparrow.sh & compiled classes). The preverified jars are all collocated in the in the same project folder that contains file build.xml and in file build.properties is inserted string:
utility.jars=afme_nointer.jar;radiogram3_3.jar;migration3_3.jar;radiomig3_3.jar
Later, I started solarium, created a new virtual spot, clicked with left button for opening a menu and then selected Deploy MIDlet bundle, choosing file build.xml from folder Migration_Receiver. After few seconds….exception
I don’t know where the problem is….It seems correct; In the variable CLASSPATH there is only string C:\AFME\comp3_3.jar, useful for creating MIDlet.
If you want I can post the code.
Please help me, thank you. I already tested other examples (HelloWorld, Comunication) and all is ok.
Best regards
lucignolo
hi lucignolo,
Try removing migration3_3.jar from the classpath
C
Hi connor,
I’m sorry but I think that I don’t understand what you said. My system variable CLASSPATH's value is only C:\AFME\comp3_3.jar not C:\AFME\migration3_3.jar. Indeed, removing from property utility.jars migration3_3.jar (property contained in file build.properties). I have this error in deploying phase:
Error building jar file: suite\TestMigration_1.0.0.jar
Compile failed; see the compiler error output for details.
No to.jar.file specified.
Using "suite\TestMigration_1.0.0.jar"
C:\test_AFME\Migration_Receiver\src\spotmi\LEDTogFact.java:4: cannot find symbol
symbol : class ActuatorFactory
location: package com.agentfactory.cldc
import com.agentfactory.cldc.ActuatorFactory;
^
C:\test_AFME\Migration_Receiver\src\spotmig\LEDTogFact.java:7: cannot find symbol
symbol: class ActuatorFactory
public class LEDTogFact implements ActuatorFactory{
^
C:\test_AFME\Migration_Receiver\src\spotmig\SpotAfricaAgentPlatform.java:30:
package com.agentfactory.cldc.migration does not exist
import com.agentfactory.cldc.migration.MigrationPlatform;
^
C:\test_AFME\Migration_Receiver\src\spotmig\SpotAfricaAgentPlatform.java:32:
cannot find symbol
symbol : class ActuatorFactory
location: package com.agentfactory.cldc
import com.agentfactory.cldc.ActuatorFactory;
^
C:\test_AFME\Migration_Receiver\src\spotmig\SpotAfricaAgentPlatform.java:33: cannot find symbol
symbol : class PerceptorFactory
location: package com.agentfactory.cldc
import com.agentfactory.cldc.PerceptorFactory;
^
C:\test_AFME\Migration_Receiver\src\spotmig
\SpotAfricaAgentPlatform.java:37: cannot find symbol
symbol : class ModuleFactory
location: package com.agentfactory.cldc
import com.agentfactory.cldc.ModuleFactory;
^
C:\test_AFME\Migration_Receiver\src\spotmig\SpotAfricaAgentPlatform.java:46: cannot find symbol
symbol: class MigrationPlatform
public class SpotAfricaAgentPlatform implements
MigrationPlatform,Platform{
^
C:\test_AFME\Migration_Receiver\src\spotmig\TimingPerceptorFact.java:5: cannot find symbol
symbol : class PerceptorFactory
location: package com.agentfactory.cldc
import com.agentfactory.cldc.PerceptorFactory;
^
C:\test_AFME\Migration_Receiver\src\spotmig\TimingPerceptorFact.java:7: cannot find symbol
symbol: class PerceptorFactory
public class TimingPerceptorFact implements PerceptorFactory{
^
C:\test_AFME\Migration_Receiver\src\spotmig\SpotAfricaAgentPlatform.java:92: cannot access
com.agentfactory.cldc.migration.MigrationPlatform
class file for com.agentfactory.cldc.migration.MigrationPlatform not found
new com.agentfactory.radio.RadioMigManager(args,agentName,scheduler,this).register(services);
^
C:\test_AFME\Migration_Receiver\src\spotmig\SpotAfricaAgentPlatform.java:218: cannot find symbol
symbol : class PerceptorFactory
location: class spotmig.SpotAfricaAgentPlatform
PerceptorFactory percep = (PerceptorFactory) p.newInstance();
^
C:\test_AFME\Migration_Receiver\src\spotmig\SpotAfricaAgentPlatform.java:218: cannot find symbol
symbol : class PerceptorFactory
location: class spotmig.SpotAfricaAgentPlatform
PerceptorFactory percep = (PerceptorFactory) p.newInstance();
^
C:\test_AFME\Migration_Receiver\src\spotmig\SpotAfricaAgentPlatform.java:229: cannot find symbol
symbol : class ActuatorFactory
location: class spotmig.SpotAfricaAgentPlatform
ActuatorFactory actFact = (ActuatorFactory) a.newInstance();
^
C:\test_AFME\Migration_Receiver\src\spotmig\SpotAfricaAgentPlatform.java:229: cannot find symbol
symbol : class ActuatorFactory
location: class spotmig.SpotAfricaAgentPlatform
ActuatorFactory actFact = (ActuatorFactory) a.newInstance();
^
C:\test_AFME\Migration_Receiver\src\spotmig\SpotAfricaAgentPlatform.java:238: cannot find symbol
symbol : class ModuleFactory
location: class spotmig.SpotAfricaAgentPlatform
((ModuleFactory) a.newInstance()).createModule(name).register(modules);
^
15 errors
These classes required during compiling phase are all contained in jar archive migration3_3.jar. If I remove migration3_3.jar from utility.jars property, I can’t compile code of example application.
I hope tht is clear
Thanks a lot, connor, for your help.
Best regards.
lucignolo
Hi connor,
After removing class GUIFactory from migration3_3.jar, I'm finally able to
deploy successfully in a virtual sunspot first Migration_Sender
application and then Migration_Receiver application! Can I remove class
GUIFactory from migration3_3.jar archive without having problems?
Later tested migration's functioning using two virtual sunspot under
soalrium. So I created two virtual sunspot the first for Migration_Sender
application and the second for Migration_Receiver application, and tried to deploy
apllications to virtual sunspot. Unfortunately,during second deploying to second
virtual sunspot an OutOfMemory exception is thrown. I think that isn't an
AFME problem, do you think this?
I hope in your answer
best regards
lucignolo
hi lucignolo,
yes, you can remove the GUIFactory without any problems. That class was intended for mobile phone applications. I will upload a version that does not include that class at a later date.
I think there is a bug in Solarium. When you test the application (have two platforms running) and then you want to retest, you need to restart the emulator.
best regards,
Conor
Hi Connor,
Regarding problem using solarium, I would be more clear…..After opening solarium, as I told previously, I created two virtual SunSpot, with address 7f00.0001.0000.1001 and 7f00.0001.0000.1002. After deploying, in SunSPOT 7f00.0001.0000.1001, Migration_Receiver application, I tried to deploy Migration_Sender application in 7f00.0001.0000.1002 but…..an OutOfMemoryException occurred. So, for this reason, I’m not able to do any test for this application using two virtual SunSPOTs in solarium. Is not a “retest probelm”. The problem is, when I create two SunSPOT in solarium and try to deploy Migration_Server and Migration_Recevier in these two SunSPOT, an exception occurs. Is this problem caused by solarium’s bug?
Thanks a lot, connor!!!
lucignolo
hi,
take a look a look at the following thread for changing the memory allocation for the JVM running solarium: https://www.sunspotworld.com/forums/viewtopic.php?f=35&t=2147
best regards,
C
hi connor,
Using information contained in thread that you suggest me, I finally succeed to create two virtual sunspot (with address respectively 7f00.0001.0000.1001 and 7f00.0001.0000.1002) and to deploy respectively Migration_Sender and Migration_Receiver application; unfortunately there are some problem when I tried to run these application in virtual sunspot. In fact, when I try to run Migration_Receiver in virtual sunspot 7f00.0001.0000.1002 a new exception is thrown:
java.net.SocketException: error setting options
at java.net.PlainDatagramSocketImpl.join
(Native Method)
at java.net.PlainDatagramSocketImpl.join
(PlainDatagramSocketImpl.java:172)
at java.net.MulticastSocket.joinGroup(Mu
lticastSocket.java:276)
at com.sun.squawk.io.j2se.multicastsocke
t.Protocol.open(Unknown Source)
at javax.microedition.io.Connector.openP
rim(Connector.java:310)
at javax.microedition.io.Connector.open(
Connector.java:236)
at com.sun.squawk.vm.GenericConnectionCh
annel.execute(GenericConnectionChannel.java:181)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:365)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:174)
java.net.SocketException: error setting option
s
at java.net.PlainDatagramSocketImpl.join
(Native Method)
at java.net.PlainDatagramSocketImpl.join
(PlainDatagramSocketImpl.java:172)
at java.net.MulticastSocket.joinGroup(Mu
lticastSocket.java:276)
at com.sun.squawk.io.j2se.multicastsocke
t.Protocol.open(Unknown Source)
at javax.microedition.io.Connector.openP
rim(Connector.java:310)
at javax.microedition.io.Connector.open(
Connector.java:236)
at com.sun.squawk.vm.GenericConnectionCh
annel.execute(GenericConnectionChannel.java:181)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:365)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:174)
radio server created: 46
radio server running
and then application started (I think so, because a virtual sunspot’s led became to blink). Later I tried to run Migration_Receiver in virtual sunspot 7f00.0001.0000.1001, but a new exception was thrown:
radio server running
java.net.SocketException: error setting options
at java.net.PlainDatagramSocketImpl.join
(Native Method)
at java.net.PlainDatagramSocketImpl.join
(PlainDatagramSocketImpl.java:172)
at java.net.MulticastSocket.joinGroup(Mu
lticastSocket.java:276)
at com.sun.squawk.io.j2se.multicastsocke
t.Protocol.open(Unknown Source)
at javax.microedition.io.Connector.openP
rim(Connector.java:310)
at javax.microedition.io.Connector.open(
Connector.java:236)
at com.sun.squawk.vm.GenericConnectionCh
annel.execute(GenericConnectionChannel.java:181)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:365)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:174)
java.net.SocketException: error setting option
s
at java.net.PlainDatagramSocketImpl.join
(Native Method)
at java.net.PlainDatagramSocketImpl.join
(PlainDatagramSocketImpl.java:172)
at java.net.MulticastSocket.joinGroup(Mu
lticastSocket.java:276)
at com.sun.squawk.io.j2se.multicastsocke
t.Protocol.open(Unknown Source)
at javax.microedition.io.Connector.openP
rim(Connector.java:310)
at javax.microedition.io.Connector.open(
Connector.java:236)
at com.sun.squawk.vm.GenericConnectionCh
annel.execute(GenericConnectionChannel.java:181)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:365)
at com.sun.squawk.vm.ChannelIO.execute(C
hannelIO.java:174)
radio server created: 45
radio server running
Uncaught exception in Thread.run():
on thread AODVSender
com.sun.spot.peripheral.SpotFatalException: Go
t IOException while sending over SocketMac null
at java.lang.Throwable.<init>(bci=16)
at java.lang.Throwable.<init>(bci=5)
at java.lang.Exception.<init>(bci=6)
at java.lang.RuntimeException.<init>(bci=6
)
at com.sun.spot.peripheral.SpotFatalExcept
ion.<init>(44)
at com.sun.spot.peripheral.radio.SocketMAC
.mcpsDataRequest(bci=119)
at com.sun.spot.peripheral.radio.RadioPack
etDispatcher.sendBroadcast(119)
at com.sun.spot.peripheral.radio.RadioPack
etDispatcher.sendPacket(142)
in virtual method #33 of com.sun.spot.peri
pheral.radio.LowPan(bci=142)
at com.sun.spot.peripheral.radio.LowPan.se
ndBroadcast(617)
at com.sun.spot.peripheral.radio.LowPan.se
ndBroadcast(572)
in virtual method #23 of com.sun.spot.peri
pheral.radio.mhrp.aodv.Sender(bci=45)
at com.sun.spot.peripheral.radio.mhrp.aodv
.Sender.run(147)
in virtual method #47 of com.sun.squawk.VM
Thread(bci=38)
in static method #3 of com.sun.squawk.VM(b
ci=6)
com.sun.spot.peripheral.NoRouteException: No r
oute found
at java.lang.Throwable.<init>(bci=16)
at java.lang.Throwable.<init>(bci=5)
at java.lang.Exception.<init>(bci=6)
at java.io.IOException.<init>(bci=6)
at com.sun.spot.peripheral.NoRouteExceptio
n.<init>(35)
in virtual method #35 of com.sun.spot.peri
pheral.radio.LowPan(bci=186)
in virtual method #28 of com.sun.spot.peri
pheral.radio.LowPan(bci=90)
at com.sun.spot.peripheral.radio.LowPan.se
nd(434)
at com.sun.spot.peripheral.radio.Radiogram
ProtocolManager.send(99)
at com.sun.spot.peripheral.radio.proxy.Sen
dRadioPacketCommand.execute(46)
at com.sun.spot.peripheral.radio.proxy.Rad
ioRequestEnvelope.execute(34)
in virtual method #13 of com.sun.spot.inte
risolate.WorkerThread(bci=7)
at com.sun.spot.interisolate.WorkerThread.
run(55)
at java.lang.Thread.run(bci=17)
in virtual method #47 of com.sun.squawk.VM
Thread(bci=38)
in static method #3 of com.sun.squawk.VM(b
ci=6)
And later, as you can see in stacktrace, also a NoRouteException was thrown…..but address inserted in file SpotIreland.af was 7f00.0001.0000.1002!!!!
I think that this exception are generated by solarium’s bugs. Do you think this? Do you know how I can resolve this problem for proving this application under solarium?
I hope that problem is clear…….
Thanks a lot, connor, for helping that you are giving me
Best regard
lucignolo
hi,
I think this is a Solarium problem rather than an AFME problem. I would check the Solarium forums. Please post the solution here if you find it. Additionally, bear in mind that if you are doing a number of tests you need to restart solarium after each test as I think the applications running on the Virtual SPOTs are not properly terminated by Solarium.
C
This could potentially be related to whitespace in one of the Solarium configuratrion files. I think I had to change a configuration file when I started using it, but I'm not sure if it was related to this.
Hi connor,
Deploying applications Migration_Sender and Migration_Receiver on REAL SunSPOT, I have got these errors:
Compiling 7 source files to /Users/Ciccio/Documents/workspace/Migration_Receiver/build
/Users/Ciccio/Documents/workspace/Migration_Receiver/src/spotmig/SpotAfricaAgentPlatform.java:14: package javax.microedition.lcdui does not exist
import javax.microedition.lcdui.Display;
^
/Users/Ciccio/Documents/workspace/Migration_Receiver/src/spotmig/SpotAfricaAgentPlatform.java:15: package javax.microedition.lcdui does not exist
import javax.microedition.lcdui.Displayable;
^
/Users/Ciccio/Documents/workspace/Migration_Receiver/src/spotmig/SpotAfricaAgentPlatform.java:43: cannot find symbol
symbol : class GUIFactory
location: package com.agentfactory.cldc
import com.agentfactory.cldc.GUIFactory;
^
/Users/Ciccio/Documents/workspace/Migration_Receiver/src/spotmig/SpotAfricaAgentPlatform.java:361: cannot find symbol
symbol : class GUIFactory
location: class spotmig.SpotAfricaAgentPlatform
if (o instanceof GUIFactory) {
^
/Users/Ciccio/Documents/workspace/Migration_Receiver/src/spotmig/SpotAfricaAgentPlatform.java:363: cannot find symbol
symbol : class GUIFactory
location: class spotmig.SpotAfricaAgentPlatform
Module module = ((GUIFactory) o).createGUI(name, let, null);
^
5 errors
and similar errors I have got deploying Migration_Sender application in a real SunSPOT too. Obviously, in these cases, I use DeployMigPlatform.template instead of EmuMigPlatform.template.
Can I remove every reference to classes FactoryGUI, javax.microedition.lcdui.Display and finally javax.microedition.lcdui.Displayable from SpotIrelandAgentPlatform and SpotAfricaAgentPlatform code without any problem?
Thanks a lot, connor
best regards
lucignolo
Hi lucignolo,
Yes, you can delete the references from the Java code itself without any problem, but I would suggest that you delete them from the template file and save it as a different file name. That way, the change will be there for all applications and you will not have to change the Java code when you recompile. You can do this by extracting the files from the compiler Jar (comp3_3.jar) and then rearchiving them. You will then have to change the file name you reference in the agent platform script.
Alternatively, for this application, the EmuMigPlatform should still work for a real SunSPOT. I thought I included the relevant template file without the references in the latest release, but obviously not. I will upload it later in comp3_4.jar.
hope this helps,
Conor
Hi guys,
I have successfully run the "Sun SPOT Wireless Communication" example and "HelloWorld" example in Virtual SunSpot and real Sunspot devices.But I have a problem in testing example "Agent Migration with Sun SPOTs" cited in AFME Programmers' Guide in a Virtual SunSpot.
After created related files, i compiled AFME files, then compiled and preverified java files, and then created a jar file, then I tried to depoly it in a virtual sun spot, but an error occurred during deploying phase.
The error is listed below:
Java Runtime Environment version: 1.6.0_18
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
### Excluding compile: com.sun.squawk.Method::getParameterTypes
### Excluding compile: com.sun.squawk.SymbolParser::getSignatureTypeAt
VerifyError: com.agentfactory.radio.RadioMigManager
com.sun.squawk.translator.VerifyError: while translating com.agentfactory.cldc.logic.FOS com.agentfactory.radio.RadioMigManager.processAction(com.agentfactory.cldc.AgentName,int,com.agentfactory.cldc.logic.FOS)@8 (RadioMigManager.java:140):
missing stack map entry for address. Check that class file has been preverified for Java ME: com/agentfactory/radio/RadioMigManager.class
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
NoClassDefFoundError: com.agentfactory.radio.RadioMigManager$1
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
com.sun.squawk.translator.VerifyError: while translating com.agentfactory.radio.RadioServerTask com.agentfactory.radio.RadioServerTask.<init>(java.lang.String,com.agentfactory.cldc.scheduler.Scheduler,com.agentfactory.cldc.migration.MigrationPlatform)@14 (RadioServerTask.java:53):
missing stack map entry for address. Check that class file has been preverified for Java ME: com/agentfactory/radio/RadioServerTask.class
VerifyError: com.agentfactory.radio.RadioServerTask
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
com.sun.squawk.translator.VerifyError: while translating void com.agentfactory.radio.RadiostreamTask.run()@0 (RadiostreamTask.java:59):
VerifyError: com.agentfactory.radio.RadiostreamTask
missing stack map entry for address. Check that class file has been preverified for Java ME: com/agentfactory/radio/RadiostreamTask.class
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
NoClassDefFoundError: spotmig.SpotAfricaAgentPlatform
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
NoClassDefFoundError: spotmig.SpotAfricalet
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
NoClassDefFoundError: spotmig.SpotIrelandAgentPlatform
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
NoClassDefFoundError: spotmig.SpotIrelandlet
[translating suite C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00 …]
Romizer processed 115 classes and generated these files:
C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00.sym
C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00.suite
C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00.suite.metadata
C:\DOCUME~1\CAM\LOCALS~1\Temp\helloworld_spot_migration_1.00.suite.api
I think the preverification phase didn't work. Would you please help me.
Best regards.
Hakan Cam.
Hi Hakan,
You should try using a build script similar to the ones in the sun spot examples that are downloaded with the sun spot sdk. In order for it to locate the required afme files, you will need to set the utility.jars property in the build.properties configuration file.
Best regards,
Conor
Dear Mr.Conor Muldoon,
I would like to thank you for your help. I have successfully run the example about migration in Virtual SunSpot.
Best regards,
Hakan Cam
No worries Hakan,
Best regards,
Conor
Hi Mr.Conor Muldoon,
I am planning to develop an application about agent migration. In this application an agent in the first sunspot collects the environmental data, i.e., temperature, light, battery level, etc. when the data collection ends, a new agent will be created and this agent will migrate to the second sunspot and displays the collected data. I am wondering if it is possible or not? Would you please tell me how i manage to develop? Thanks in advance.
Best regards,
Hakan.
Please ignore this post. Because i have added a new topic.
Sincerely,
Hakan.