« Return to Thread: Error when using SimpleRealm

Error when using SimpleRealm

by boycook :: Rate this Message:

Reply to Author | View in Thread

Error when using SimpleRealm Hi,
I want to create a custom security realm for my instance of nexus, and have been looking at your SimpleRealm example here:

https://docs.sonatype.com/display/NX/Security%20Example

And having got the code here:

http://svn.sonatype.org/nexus/trunk/nexus/nexus-test-harness/nexus-simple-memory-realm/

I’m using your war distribution (1.2.1) and put the compiled jar file for the SimpleRealm in my WEB-INF/lib folder.
I’ve added the config mentioned to my nexus.xml and security.xml to tell nexus about the realm. The problem is that when I start nexus I get the below error.
Can you please help:

this realm =    plexus.core
this strategy = org.codehaus.plexus.classworlds.strategy.ForeignStrategy
Number of imports: 0


-----------------------------------------------------
2009-02-05 17:50:28,885 ERROR [org.sonatype.jsecurity.locators.RealmLocator:default] - Unable to lookup security realms
org.codehaus.plexus.component.repository.exception.ComponentLookupException: Component descriptor cannot be found in the component repository: org.jsecurity.realm.Realm [Simple] (lookup realm: ClassRealm[plexus.core, parent: null]).
      role: org.jsecurity.realm.Realm
  roleHint: Simple
classRealm: plexus.core
    at org.codehaus.plexus.DefaultComponentLookupManager.lookup(DefaultComponentLookupManager.java:139)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:484)
    at org.sonatype.nexus.jsecurity.locators.NexusRealmLocator.getRealms(NexusRealmLocator.java:40)
    at org.sonatype.jsecurity.selectors.DefaultRealmSelector.selectAllRealms(DefaultRealmSelector.java:32)
    at org.sonatype.jsecurity.web.WebPlexusSecurity.getRealms(WebPlexusSecurity.java:209)
    at org.jsecurity.mgt.RealmSecurityManager.applyCacheManagerToRealms(RealmSecurityManager.java:117)
    at org.jsecurity.mgt.RealmSecurityManager.setRealms(RealmSecurityManager.java:81)
    at org.jsecurity.mgt.AuthenticatingSecurityManager.setRealms(AuthenticatingSecurityManager.java:148)
    at org.jsecurity.mgt.AuthorizingSecurityManager.setRealms(AuthorizingSecurityManager.java:128)
    at org.jsecurity.mgt.RealmSecurityManager.setRealm(RealmSecurityManager.java:65)
    at org.sonatype.jsecurity.web.WebPlexusSecurity.initialize(WebPlexusSecurity.java:484)


Cheers,

Craig Cook | Business Technology Consultant | BT Design:DSO | E-mail
craig.cook@... | Web: craigcook.co.uk boycook.com

 « Return to Thread: Error when using SimpleRealm