AMLSim icon indicating copy to clipboard operation
AMLSim copied to clipboard

Building AMLSim project shows Compilation Errors

Open sunilnagaraja opened this issue 5 years ago • 4 comments

Steps: Generated paysim.jar using steps mentioned here : https://github.com/IBM/AMLSim/wiki/Quick-Introduddction-to-AMLSim#dependencies. Attached file https://ibm.box.com/s/o9agh0uqm439a77d1guhzg6ws339vlag ( paySim.jar)

Also i imported maven project from https://github.com/EdgarLopezPhD/PaySim and generated jar, Attached file https://ibm.box.com/s/o9agh0uqm439a77d1guhzg6ws339vlag ( PaySim-Snaphsot.jar)

with both times, i get this compilation errors building AMLSim.sh

Attached logs : https://zenhub.ibm.com/app/files/293714/adb983cc-7917-4f23-8df6-24616d11c67f/download

sunilnagaraja avatar Jul 10 '19 08:07 sunilnagaraja

I am sorry to make trouble for you about compilations. I could not download the logs you attached (the zenhub page says "file not found"), but I found some dependencies and links are missing at this wiki page, and then I add them. Would you download additional jar files for these links and try it again?

hkanezashi avatar Jul 10 '19 23:07 hkanezashi

Now I add the paysim.jar we currently use to jars directory.

hkanezashi avatar Jul 11 '19 08:07 hkanezashi

Hi @hkanezashi , Thanks for your reply.

I copied paysim.jar from https://github.com/IBM/AMLSim/blob/master/jars/paysim.jar . Here's my jar directory

[root@testgraph1 jars]# ll /root/AMLSim-master/jars
total 63428
drwxr-xr-x 3 root root      307 Jul  9 03:43 commons-math3-3.6.1
-rw-r--r-- 1 root root 18577952 Mar 21  2016 commons-math3-3.6.1-bin.tar.gz
-rw-r--r-- 1 root root  2213560 Jul  9 08:10 commons-math3-3.6.1.jar
-rw-r--r-- 1 root root  2975563 Jul  9 08:11 commons-math3-3.6.1-tests.jar
-rw-r--r-- 1 root root    12008 Jul  9 08:11 commons-math3-3.6.1-tools.jar
-rw-r--r-- 1 root root   438826 Jul  9 00:16 dsiutils-2.4.2.jar
-rw-r--r-- 1 root root 18707271 Jul  9 00:16 fastutil-8.1.0.jar
-rw-r--r-- 1 root root    69344 Jul  9 00:16 jsap-2.1.jar
drwxr-xr-x 7 root root      123 Aug 18  2014 mason
-rw-r--r-- 1 root root 19887544 Jun 19  2015 mason18.zip
-rw-r--r-- 1 root root  1004838 Jun 23 01:57 mysql-connector-java-5.1.46.jar
-rw-r--r-- 1 root root    74796 Jul 15 06:32 paysim.jar
-rw-r--r-- 1 root root      735 Jun  3 19:29 README.md
-rw-r--r-- 1 root root    41203 Jul  9 00:16 slf4j-api-1.7.25.jar
-rw-r--r-- 1 root root   394345 Jul  9 06:19 sux4j-4.2.0.jar
-rw-r--r-- 1 root root   379254 Jul  9 06:25 webgraph-3.6.1.jar

Now executing below command again shows same error

[root@testgraph1 AMLSim-master]# sh scripts/build_AMLSim.sh
src/amlsim/Account.java:8: error: package sim.engine does not exist
import sim.engine.SimState;
                 ^
src/amlsim/Account.java:9: error: package sim.engine does not exist
import sim.engine.Steppable;
                 ^
src/amlsim/Account.java:12: error: cannot access Steppable
public class Account extends Client implements Steppable {
       ^
  class file for sim.engine.Steppable not found
src/amlsim/Account.java:174: error: cannot find symbol
        public void step(SimState state) {
                         ^
  symbol:   class SimState
  location: class Account
src/amlsim/Account.java:183: error: cannot find symbol
        public void handleAction(SimState state) {
                                 ^
  symbol:   class SimState
  location: class Account
src/amlsim/AMLSim.java:17: error: cannot access SimState
public class AMLSim extends ParameterizedPaySim {
       ^
  class file for sim.engine.SimState not found
src/amlsim/FraudAccount.java:24: error: cannot find symbol
        public void handleAction(SimState state){
                                 ^
  symbol:   class SimState
  location: class FraudAccount
src/amlsim/Account.java:48: error: cannot find symbol
        this.id = "-";
        ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:49: error: cannot find symbol
                this.model = null;
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:61: error: cannot find symbol
                this.id = id;
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:62: error: cannot find symbol
                this.startStep = start;
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:63: error: cannot find symbol
                this.endStep = end;
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:64: error: cannot find symbol
                this.extraAttributes = attrs;
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:67: error: cannot find symbol
                        case AbstractTransactionModel.SINGLE: this.model = new SingleTransactionModel(); break;
                                                              ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:68: error: cannot find symbol
                        case AbstractTransactionModel.FANOUT: this.model = new FanOutTransactionModel(); break;
                                                              ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:69: error: cannot find symbol
                        case AbstractTransactionModel.FANIN: this.model = new FanInTransactionModel(); break;
                                                             ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:70: error: cannot find symbol
                        case AbstractTransactionModel.MUTUAL: this.model = new MutualTransactionModel(); break;
                                                              ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:71: error: cannot find symbol
                        case AbstractTransactionModel.FORWARD: this.model = new ForwardTransactionModel(); break;
                                                               ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:72: error: cannot find symbol
                        case AbstractTransactionModel.PERIODICAL: this.model = new PeriodicalTransactionModel(); break;
                                                                  ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:73: error: cannot find symbol
                        default: System.err.println("Unknown model ID: " + modelID); this.model = new EmptyModel(); break;
                                                                                     ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:75: error: cannot find symbol
                this.model.setAccount(this);
                                      ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:75: error: package this does not exist
                this.model.setAccount(this);
                    ^
src/amlsim/Account.java:76: error: package this does not exist
                this.model.setParameters(init_balance, start, end);
                    ^
src/amlsim/Account.java:78: error: cannot find symbol
                this.cashInModel = new CashInModel();
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:79: error: cannot find symbol
                this.cashInModel.setAccount(this);
                                            ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:79: error: package this does not exist
                this.cashInModel.setAccount(this);
                    ^
src/amlsim/Account.java:80: error: package this does not exist
                this.cashInModel.setParameters(init_balance, start, end);
                    ^
src/amlsim/Account.java:82: error: cannot find symbol
                this.cashOutModel = new CashOutModel();
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:83: error: cannot find symbol
                this.cashOutModel.setAccount(this);
                                             ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:83: error: package this does not exist
                this.cashOutModel.setAccount(this);
                    ^
src/amlsim/Account.java:84: error: package this does not exist
                this.cashOutModel.setParameters(init_balance, start, end);
                    ^
src/amlsim/Account.java:90: error: cannot find symbol
            this.startStep = AbstractTransactionModel.generateStartStep();
            ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:95: error: package this does not exist
        return this.extraAttributes.get(name);
                   ^
src/amlsim/Account.java:99: error: cannot find symbol
                return this.startStep;
                       ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:102: error: cannot find symbol
                return this.endStep;
                       ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:106: error: cannot find symbol
                this.caseSubject = flag;
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:110: error: cannot find symbol
                return this.caseSubject;
                       ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:114: error: cannot find symbol
                this.branch = branch;
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:118: error: cannot find symbol
                return this.branch;
                       ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:123: error: cannot find symbol
                dest.origs.put(this.id, this);
                               ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:123: error: cannot find symbol
                dest.origs.put(this.id, this);
                                        ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:127: error: package this does not exist
                this.tx_types.put(dest.id, ttype);
                    ^
src/amlsim/Account.java:135: error: package this does not exist
                if(this.tx_types.containsKey(destID)){
                       ^
src/amlsim/Account.java:137: error: package this does not exist
                }else if(!this.tx_types.isEmpty()){
                              ^
src/amlsim/Account.java:138: error: package this does not exist
                        List<String> values = new ArrayList<>(this.tx_types.values());
                                                                  ^
src/amlsim/Account.java:150: error: package this does not exist
                return new ArrayList<>(this.origs.values());
                                           ^
src/amlsim/Account.java:158: error: package this does not exist
                return new ArrayList<>(this.dests.values());
                                           ^
src/amlsim/Account.java:166: error: package this does not exist
                this.alerts.add(ag);
                    ^
src/amlsim/Account.java:173: error: method does not override or implement a method from a supertype
        @Override
        ^
src/amlsim/Account.java:176: error: cannot find symbol
                if(currentStep < this.startStep || this.endStep < currentStep){
                                 ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:176: error: cannot find symbol
                if(currentStep < this.startStep || this.endStep < currentStep){
                                                   ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:187: error: cannot find symbol
                        ag.registerTransactions(step, this);
                                                      ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:190: error: package this does not exist
                this.model.sendTransaction(step);
                    ^
src/amlsim/Account.java:200: error: cannot find symbol
                long step = amlsim.schedule.getSteps();
                                  ^
  symbol:   variable schedule
  location: variable amlsim of type AMLSim
src/amlsim/Account.java:201: error: package this does not exist
                this.cashInModel.sendTransaction(step);
                    ^
src/amlsim/Account.java:202: error: package this does not exist
                this.cashOutModel.sendTransaction(step);
                    ^
src/amlsim/Account.java:219: error: cannot find symbol
                this.id = c.getID();
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:220: error: cannot find symbol
                this.setBalance(c.getBalance());
                                 ^
  symbol:   method getBalance()
  location: variable c of type Account
src/amlsim/Account.java:220: error: cannot find symbol
                this.setBalance(c.getBalance());
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:221: error: cannot find symbol
                this.setCurrency(c.getCurrency());
                                  ^
  symbol:   method getCurrency()
  location: variable c of type Account
src/amlsim/Account.java:221: error: cannot find symbol
                this.setCurrency(c.getCurrency());
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:222: error: cannot find symbol
                this.setName(c.getName());
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:223: error: cannot find symbol
                this.setNumDeposits(c.getNumDeposits());
                                     ^
  symbol:   method getNumDeposits()
  location: variable c of type Account
src/amlsim/Account.java:223: error: cannot find symbol
                this.setNumDeposits(c.getNumDeposits());
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:224: error: cannot find symbol
                this.setNumTransfers(c.getNumTransfers());
                                      ^
  symbol:   method getNumTransfers()
  location: variable c of type Account
src/amlsim/Account.java:224: error: cannot find symbol
                this.setNumTransfers(c.getNumTransfers());
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:225: error: cannot find symbol
                this.setNumWithdraws(c.getNumWithdraws());
                                      ^
  symbol:   method getNumWithdraws()
  location: variable c of type Account
src/amlsim/Account.java:225: error: cannot find symbol
                this.setNumWithdraws(c.getNumWithdraws());
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:226: error: cannot find symbol
                this.origs = c.origs;
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:227: error: cannot find symbol
                this.dests = c.dests;
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:232: error: cannot find symbol
        return this.id;
               ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:240: error: cannot find symbol
        return this.id;
               ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:248: error: cannot find symbol
                return "C" + this.id;
                             ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:256: error: cannot find symbol
                this.probList = probList;
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:264: error: cannot find symbol
                this.paramFile = paramFile;
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Account.java:272: error: cannot find symbol
                this.stepHandler = stepHandler;
                ^
  symbol:   variable this
  location: class Account
src/amlsim/Alert.java:53: error: incompatible types: AMLSim cannot be converted to PaySim
        return amlsim;
               ^
src/amlsim/AMLSim.java:50: error: cannot find symbol
                super.setTagName("1");
                ^
  symbol:   variable super
  location: class AMLSim
src/amlsim/AMLSim.java:64: error: cannot find symbol
                                        super.setPropertiesFile(filePath);
                                        ^
  symbol:   variable super
  location: class AMLSim
src/amlsim/AMLSim.java:68: error: cannot find symbol
                                        this.setNrOfSteps(NUM_OF_STEPS);
                                        ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:95: error: package this does not exist
                int index = this.idMap.get(id);
                                ^
src/amlsim/AMLSim.java:96: error: cannot find symbol
                return (Account) this.getClients().get(index);
                                 ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:104: error: cannot find symbol
                        loadAccountFile(this.accountFile);
                                        ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:106: error: cannot find symbol
                        System.err.println("Cannot load account file: " + this.accountFile);
                                                                          ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:113: error: cannot find symbol
                        loadTransactionFile(this.transactionFile);
                                            ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:115: error: cannot find symbol
                        System.err.println("Cannot load transaction file: " + this.transactionFile);
                                                                              ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:122: error: cannot find symbol
                        loadAlertFile(this.alertFile);
                                      ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:124: error: cannot find symbol
                        System.err.println("Cannot load fraud file: " + this.alertFile);
                                                                        ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:129: error: cannot find symbol
                super.initSimulation();
                ^
  symbol:   variable super
  location: class AMLSim
src/amlsim/AMLSim.java:133: error: cannot find symbol
                super.loadParametersFromFile();
                ^
  symbol:   variable super
  location: class AMLSim
src/amlsim/AMLSim.java:134: error: cannot find symbol
        Properties prop = this.getParamters();
                          ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:161: error: cannot find symbol
                this.numBranches = Integer.parseInt(this.getParamters().getProperty("numBranches"));
                ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:161: error: cannot find symbol
                this.numBranches = Integer.parseInt(this.getParamters().getProperty("numBranches"));
                                                    ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:162: error: cannot find symbol
                if(this.numBranches <= 0){
                   ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:165: error: cannot find symbol
                for(int i=0; i<this.numBranches; i++) {
                               ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:166: error: package this does not exist
                        this.branches.add(new Branch(i));
                            ^
src/amlsim/AMLSim.java:169: error: cannot find symbol
                this.accountFile = this.getParamters().getProperty("accountFile");
                ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:169: error: cannot find symbol
                this.accountFile = this.getParamters().getProperty("accountFile");
                                   ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:170: error: cannot find symbol
                this.transactionFile = this.getParamters().getProperty("transactionFile");
                ^
  symbol:   variable this
  location: class AMLSim
src/amlsim/AMLSim.java:170: error: cannot find symbol
                this.transactionFile = this.getParamters().getProperty("transactionFile");
                                       ^
  symbol:   variable this
  location: class AMLSim
100 errors

Can you help me to fix this issue please? Thanks

sunilnagaraja avatar Jul 15 '19 14:07 sunilnagaraja

Dear @sunilnagaraja, thank you for sharing your logs. According to the file list in jars directory and the error logs, the reason is that mason.18.jar is not located just under the jars directory (maybe under jars/mason directory, but our compilation script cannot find). Would you move this jar file to just under the jars directory and try it again? Thank you for your time.

hkanezashi avatar Jul 16 '19 09:07 hkanezashi