iFogSim icon indicating copy to clipboard operation
iFogSim copied to clipboard

Errors when testing DCNS

Open sharlec opened this issue 3 years ago • 24 comments

Hi, I am trying to make the ifogsim and ifogsim2 running. They both have the same error messages as:

Starting DCNS... Exception in thread "main" java.lang.Error: Unresolved compilation problems: The constructor AppModule(int, String, String, int, double, int, long, long, String, CloudletScheduler, Map<Pair<String,String>,SelectivityModel>) refers to the missing type Pair Pair cannot be resolved to a type

at ifogsim_1/org.fog.application.Application.addAppModule(Application.java:65)
at ifogsim_1/org.fog.test.perfeval.DCNSFog.createApplication(DCNSFog.java:233)
at ifogsim_1/org.fog.test.perfeval.DCNSFog.main(DCNSFog.java:68)

I am using JDK13.0.2.

sharlec avatar May 03 '22 22:05 sharlec

Hi, AppModule class uses the Pair implementation available in "org.apache.commons.math3.util.Pair". So please make sure to add all the the external libraries in the "JARs" Folder (https://github.com/Cloudslab/iFogSim/tree/main/jars) to your project when running. Hope this helps.

Samodhap avatar May 04 '22 00:05 Samodhap

Hi,

Thanks for mentioning the libraries. I just double checked my external libraries and I realized that I forget to unzip the common_math.jar.

However, after unzip the jars and have the same library setting as tutorial https://www.youtube.com/watch?v=uqg7TcOQS5Q,

I get a new error showing as: The archive: /ifogsim_1/jars/commons-math3-3.5-javadoc.jar which is referenced by the classpath, does not exist.

What is the commons-math3-3.5-javadoc.jar? it is not in the tutorial but in a folder.

sharlec avatar May 04 '22 01:05 sharlec

I also noticed that some test cases work, but some do not.

In the test.perfeval folder, if I run DCNSFog.java or TranslationService then the previous errors show up; if i run microserviceAppSample2.java, TwoApps.java or VRGameFog.java then they work as expected.

sharlec avatar May 04 '22 02:05 sharlec

Hi, i guess your class path refers to a different jar. https://github.com/Cloudslab/iFogSim/tree/main/jars/commons-math3-3.5 The jar inside this folder is the one it should be referring to.

Samodhap avatar May 04 '22 03:05 Samodhap

thanks for quick response. I just double check my files and I am sure the class path refer to the file in the mentioned folder.

sharlec avatar May 04 '22 03:05 sharlec

Hi, To assist further with this, would it be possible to post screenshots of your class path libraries either from run configurations or the project structure ?

Samodhap avatar May 04 '22 03:05 Samodhap

image

sharlec avatar May 04 '22 03:05 sharlec

Please try removing commons-math3-3.5-javadoc.jar in your classpath and running again 166620104-0022f72c-7ec3-46ca-a416-1a42ed26fcf7 .

Samodhap avatar May 04 '22 03:05 Samodhap

That is the extra jre in the folder and once remove it, the error message is gone.

However, the DCNS file is still not working. I tested all other samples in the test.perfeval folder, all other files either work or missing input files(reasonable), but DCNS give me the error message:

Error: Could not find or load main class org.fog.test.perfeval.DCNSFog Caused by: java.lang.ClassNotFoundException: org.fog.test.perfeval.DCNSFog

This should not happen as the main function starts in line 52

sharlec avatar May 04 '22 03:05 sharlec

Doing a clean build might help solve it.

Samodhap avatar May 04 '22 04:05 Samodhap

I just clean build, did not work; I also remove all files and re-downloaded them from Github again, with proper JRE configurations. The error is still there.

sharlec avatar May 04 '22 04:05 sharlec

Sorry to hear that. Please try following all the instructions in the Readme. The software has been tested and should work properly. (https://github.com/Cloudslab/iFogSim/blob/main/README.md)

Samodhap avatar May 04 '22 12:05 Samodhap

Thanks for the assistance. I did follow the readme instructions, and the ifogsim seems working well just other than the DCSNs file. I guess I may ignore some details in the configuration. I will keep trying. Thank you!

sharlec avatar May 04 '22 18:05 sharlec

follow steps here - it worked for me https://stackoverflow.com/questions/49520858/error-occurred-during-initialization-of-boot-layer-findexception-module-not-fou

Inzark avatar Dec 07 '23 00:12 Inzark

i have these problem too but i can't solved them Screenshot 2024-01-11 at 5 14 49 PM

paghikia avatar Jan 11 '24 18:01 paghikia