diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/business/SampleLoader.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/business/SampleLoader.java index 0d42ea959f4ea264f13d06f7c02eff1372fb5c17..7f5d1c120577065efaf65599524377a482764564 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/business/SampleLoader.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/business/SampleLoader.java @@ -17,6 +17,7 @@ package ch.systemsx.cisd.openbis.plugin.phosphonetx.server.business; import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -77,10 +78,18 @@ public class SampleLoader implements ISampleLoader { SampleTypePE sampleTypePE = daoFactory.getSampleTypeDAO().tryFindSampleTypeByCode(sampleTypeCode); + if (sampleTypePE == null) + { + return Collections.emptySet(); + } final Long sampleTypeID = sampleTypePE.getId(); SpacePE space = daoFactory.getSpaceDAO().tryFindSpaceByCodeAndDatabaseInstance(spaceCode, daoFactory.getHomeDatabaseInstance()); + if (space == null) + { + return Collections.emptySet(); + } final Long spaceID = space.getId(); List<SampleSkeleton> sampleSkeletons = sampleLister.listSampleBy(new IValidator<SampleSkeleton>() diff --git a/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml b/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml index 54fa288d23536986b199967d09279e54de9451f5..be72e2788acb3e1934824a56ca525371282afb0a 100644 --- a/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml +++ b/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml @@ -11,7 +11,7 @@ <bean id="phosphonetx-db-configuration-context" class="ch.systemsx.cisd.dbmigration.DatabaseConfigurationContext"> - <property name="basicDatabaseName" value="phosphonetx" /> + <property name="basicDatabaseName" value="${phosphonetx.database.basic-name}" /> <property name="createFromScratch" value="${phosphonetx.database.create-from-scratch}" /> <property name="scriptSingleStepMode" value="${phosphonetx.database.script-single-step-mode}" /> <property name="sequenceNameMapper">