You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by dd...@apache.org on 2009/01/26 10:10:08 UTC

svn commit: r737656 - /portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java

Author: ddam
Date: Mon Jan 26 09:10:07 2009
New Revision: 737656

URL: http://svn.apache.org/viewvc?rev=737656&view=rev
Log:
Throw IllegalStateException when default security domain is not found. Had a lengthy discussion about this with Randi, Ate and Woonsan. A better solution would be to seed required data on portal startup. Since this requires a major refactoring of the Spring bean load phases, it was decided not to pursue that for now. To throw an IllegalStateException is ok, because the portal is required to have the default domain ID. If it doesn't, then the portal is in an unexpected, illegal state. That should never occur when the portal is seeded using the serializer: the serializer *always* inserts both the default and security domain, even when those domains are not present in the seed XML.

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java?rev=737656&r1=737655&r2=737656&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/spi/impl/JetspeedSecurityPersistenceManager.java Mon Jan 26 09:10:07 2009
@@ -1019,8 +1019,7 @@
             }
             else
             {
-                // return fake id that should not exist
-                return new Long(-1);
+                throw new IllegalStateException("The default security domain could not be found.");
             }
         }   
         return defaultSecurityDomainId;



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org