IDEMPIERE-633 AdempiereActivator.packIn() causes NullPointerException

This commit is contained in:
Carlos Ruiz 2013-03-03 13:48:54 -05:00
parent 893530a9b9
commit 5776804b4a
1 changed files with 3 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import org.adempiere.base.IDictionaryService;
import org.adempiere.base.Service; import org.adempiere.base.Service;
import org.compiere.model.Query; import org.compiere.model.Query;
import org.compiere.model.X_AD_Package_Imp; import org.compiere.model.X_AD_Package_Imp;
import org.compiere.util.AdempiereSystemError;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Trx; import org.compiere.util.Trx;
import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleActivator;
@ -97,6 +98,8 @@ public class AdempiereActivator implements BundleActivator {
IDictionaryService service = Service.locator().locate(IDictionaryService.class).getService(); IDictionaryService service = Service.locator().locate(IDictionaryService.class).getService();
FileOutputStream zipstream = null; FileOutputStream zipstream = null;
try { try {
if (service == null)
throw new AdempiereSystemError("Could not find/load OSGi service for packin");
// copy the resource to a temporary file to process it with 2pack // copy the resource to a temporary file to process it with 2pack
InputStream stream = context.getBundle().getEntry("/META-INF/2Pack.zip").openStream(); InputStream stream = context.getBundle().getEntry("/META-INF/2Pack.zip").openStream();
File zipfile = File.createTempFile(getName(), ".zip"); File zipfile = File.createTempFile(getName(), ".zip");