Index: FLyrVect.java
===================================================================
--- FLyrVect.java	(revision 41806)
+++ FLyrVect.java	(revision 41807)
@@ -419,104 +419,102 @@
 
     public void saveToState(PersistentState state) throws PersistenceException {
 
-        if (!this.isAvailable()) {
+        FeatureStore featureStore = null;
+
+        if ( !this.isAvailable() ) {
+            logger.info("The '" + this.getName() + "' layer is not available, it will persist not.");
             return;
         }
+        
+        try {
+            super.saveToState(state);
 
-        super.saveToState(state);
+            if ( getLegend() != null ) {
+                state.set("legend", getLegend());
+            }
 
-        if (getLegend() != null) {
-            state.set("legend", getLegend());
-        }
+            featureStore = getFeatureStore();
 
-        FeatureStore fst = null;
-        fst = getFeatureStore();
+            if ( featureStore != null ) {
+                state.set("featureStore", featureStore);
+            }
 
-        if (fst != null) {
-            state.set("featureStore", fst);
-        }
+            state.set("isLabeled", isLabeled);
 
-        state.set("isLabeled", isLabeled);
+            if ( strategy != null ) {
+                state.set("labelingStrategy", strategy);
+            }
 
-        if (strategy != null) {
-            state.set("labelingStrategy", strategy);
-        }
+            if ( getLinkProperties() != null ) {
+                state.set("linkProperties", getLinkProperties());
+            }
 
-        if (getLinkProperties() != null) {
-            state.set("linkProperties", getLinkProperties());
+            state.set("typeShape", typeShape);
+        } catch (PersistenceException ex) {
+            logger.warn("Can't persist to state the layer '" + this.getName() + "'.", ex);
+            throw ex;
+        } catch (RuntimeException ex) {
+            logger.warn("Can't persist to state the layer '" + this.getName() + "'.", ex);
+            throw ex;
         }
 
-        // state.set("bHasJoin", bHasJoin);
-        state.set("typeShape", typeShape);
     }
 
 
     public void loadFromState(PersistentState state) throws PersistenceException {
 
         DataStore store = null;
-        try {
-            super.loadFromState(state);
-        	store = (DataStore) state.get("featureStore");
-        } catch (PersistenceRuntimeException e) {
-            logger.debug("Unable to load store from persistence in layer: " + this.getName(), e);
-			this.setAvailable(false);
-			return;
-		}
+        IVectorLegend vectorLegend = null;
+        ILabelingStrategy labelingStrategy = null;
+        Boolean isLabeled = Boolean.FALSE;
 
         try {
-            this.bindToDataStore(store);
-        } catch (LoadLayerException e) {
-            throw new PersistenceException("While loading FLyrVect from state.",
-                e);
-        }
-        
-        IVectorLegend lgnd = null;
-        
-        try {
-            lgnd = (IVectorLegend) state.get("legend");
-        } catch (PersistenceRuntimeException pre) {
-            /*
-             * For example, symbol image file not found
-             */
-            logger.debug("Unable to instantiate persisted lagend.", pre);
-            this.setAvailable(false);
-            return;
-        }
-        
-        try {
-            this.setLegend(lgnd);
-        } catch (LegendLayerException e) {
-            throw new PersistenceException("While loading FLyrVect from state.", e);
-        }
+                super.loadFromState(state);
+                store = (DataStore) state.get("featureStore");
 
-        Boolean isLbl = new Boolean(false);
-        ILabelingStrategy lblst = null;
+            try {
+                this.bindToDataStore(store);
+            } catch (LoadLayerException e) {
+                throw new PersistenceException("Can't bind layer '"+this.getName()+"' to store '"+store.getFullName()+"'.",e);
+            }
 
-        try {
-            isLbl = (Boolean) state.get("isLabeled");
-            if (isLbl.booleanValue()) {
-                lblst = (ILabelingStrategy) state.get("labelingStrategy");
+
+            vectorLegend = (IVectorLegend) state.get("legend");
+
+            try {
+                this.setLegend(vectorLegend);
+            } catch (LegendLayerException e) {
+                throw new PersistenceException("Can't set vector legend to the layer.", e);
             }
-        } catch (Exception ex) {
-            throw new PersistenceException("While loading FLyrVect from state.",
-                ex);
-        }
 
-        /*
-         * String _labelFieldName = null;
-         * String _labelfield = null;
-         */
 
-        if (isLbl.booleanValue()) {
-            this.setIsLabeled(true);
-            this.setLabelingStrategy(lblst);
-        } else {
-            this.setIsLabeled(false);
-            this.setLabelingStrategy(null);
-        }
+            try {
+                isLabeled = (Boolean) state.get("isLabeled");
+                if ( isLabeled.booleanValue() ) {
+                    labelingStrategy = (ILabelingStrategy) state.get("labelingStrategy");
+                }
+            } catch (Exception ex) {
+                throw new PersistenceException("Can't load labeling strategi from persistent state.",
+                        ex);
+            }
 
-        typeShape = state.getInt("typeShape");
+            if ( isLabeled.booleanValue() ) {
+                this.setIsLabeled(true);
+                this.setLabelingStrategy(labelingStrategy);
+            } else {
+                this.setIsLabeled(false);
+                this.setLabelingStrategy(null);
+            }
 
+            typeShape = state.getInt("typeShape");
+
+        } catch (Throwable e) {
+            String storeName = (store == null)? "unknow" : store.getFullName();
+            logger.warn("can't load layer '" + this.getName() + "' (store="+storeName+") from persisted state.", e);
+            this.setAvailable(false);
+            return;
+        }
+
     }
 
     /**
