Java Code does work on Local Machine/Not on Docker Container

0
Hey Guys, I have following Custom Java Action. It becomes a Entity out from an Excel list an checks when there is a new Objekt and than create this. public class JA_CreateProjektEntitys extends CustomJavaAction<java.util.List<IMendixObject>> { private java.util.List<IMendixObject> __Parameter; private java.util.List<datamanager.proxies.ProjeckImportDummy> Parameter;   public JA_CreateProjektEntitys(IContext context, java.util.List<IMendixObject> Parameter) { super(context); this.__Parameter = Parameter; }   @java.lang.Override public java.util.List<IMendixObject> executeAction() throws Exception { this.Parameter = java.util.Optional.ofNullable(this.__Parameter) .orElse(java.util.Collections.emptyList()) .stream() .map(__ParameterElement -> datamanager.proxies.ProjeckImportDummy.initialize(getContext(), __ParameterElement)) .collect(java.util.stream.Collectors.toList());   // BEGIN USER CODE Projekt projekt = null; SPS sps = null; Station station = null; Roboter roboter = null;   ArrayList<ProjeckImportDummy> list = new ArrayList<>(this.Parameter); ArrayList<IMendixObject> projektList = new ArrayList<>();     for (int i = 0; i < list.size(); i++) { ProjeckImportDummy current = list.get(i); if (projekt == null || !projekt.getProjektname().equals(current.getProjektname())) { projekt = new Projekt(current.getContext()); projekt.setProjektname(this.context(), current.getProjektname()); projekt.commit(this.context()); projektList.add(projekt.getMendixObject()); sps = null; station = null; roboter = null; } if (sps == null || !sps.getSPSName().equals(current.getSPSName())) { sps = new SPS(current.getContext()); sps.setSPSName(this.context(), current.getSPSName()); sps.setSPS_Projekt(this.context(), projekt); sps.commit(this.context());   station = null; roboter = null; } if (station == null || !station.getStationsName().equals(current.getStationsname())) { station = new Station(current.getContext()); station.setStationsName(this.context(), current.getStationsname()); station.setStation_Projekt(this.context(), projekt); station.setStation_SPS(this.context(), sps); station.commit(this.context());   roboter = null; } if (roboter == null || !roboter.getRobotername().equals(current.getRobotername())) { roboter = new Roboter(current.getContext()); roboter.setRobotername(this.context(), current.getRobotername()); roboter.setRoboter_Projekt(this.context(), projekt); roboter.setRoboter_Station(this.context(), station); roboter.commit(this.context()); } } return projektList; // END USER CODE     It works fine on my local machine but when i run it on my Docker, there is a problem in my if statements. It does compair the names and create a Projekt for every entity… Anyone an idea?
asked
1 answers
0

Is it worth adding a check that your current object is not null before trying to access methods in it, and that any values those methods return are also not null? 

answered