PDA

View Full Version : Realm/Tomcat/Acegi Configuration Problem



dr_pompeii
Sep 21st, 2006, 09:06 PM
hello guys

i have already resolved how work with acegi (studying) the examples in the forum and the 2 war files in the acegi distribution
, well i am trying to work now with Realm and i am following the simple steps to do that.

http://www.acegisecurity.org/docbook/acegi.html#ca-tomcat

well i had the same obvious question that i saw in other post , where is the famous acegisecurity.xml ???

so found this post http://forum.springframework.org/showthread.php?t=15096 that had the same question

and 2 possible answer here

http://forum.springframework.org/showthread.php?t=23046
http://forum.springframework.org/showthread.php?t=13708

well how should be this acegisecurity.xml ???? , i make a copy of the second link and place the mentionated file into the
/conf folder (is just almost how the sample-tutorial - users roles and passwords) (i am using almost the same example)

the same with the jars , and of course i changed the server.xml

but when i start up the tomcat i saw this message





21-sep-2006 20:24:20 org.apache.tomcat.util.digester.Digester startElement
GRAVE: Begin event threw error
java.lang.NoClassDefFoundError: org/acegisecurity/AuthenticationException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Cla ss.java:2328)
at java.lang.Class.getConstructor0(Class.java:2640)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.tomcat.util.digester.ObjectCreateRule.b egin(ObjectCreateRule.java:205)
at org.apache.tomcat.util.digester.Rule.begin(Rule.ja va:152)
at org.apache.tomcat.util.digester.Digester.startElem ent(Digester.java:1275)
at com.sun.org.apache.xerces.internal.parsers.Abstrac tSAXParser.startElement(AbstractSAXParser.java:533 )
at com.sun.org.apache.xerces.internal.parsers.Abstrac tXMLDocumentParser.emptyElement(AbstractXMLDocumen tParser.java:220)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl.scanStartElement(XMLDocumentF ragmentScannerImpl.java:872)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl$FragmentContentDispatcher.dis patch(XMLDocumentFragmentScannerImpl.java:1693)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl.scanDocument(XMLDocumentFragm entScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLPars er.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.Abstrac tSAXParser.parse(AbstractSAXParser.java:1242)
at org.apache.tomcat.util.digester.Digester.parse(Dig ester.java:1561)
at org.apache.catalina.startup.Catalina.load(Catalina .java:473)
at org.apache.catalina.startup.Catalina.load(Catalina .java:509)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.load(Bootstr ap.java:243)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:408)


how i can resolve this??? , i am following the instructions

i am working with tomcat 5.5.9 , acegi 1.0.1 and spring 2.0 RC2
why i want to work with Realm?? , well i am making an integration with struts and i am using "role" in the action's definition
in the struts-config, i know how to work with realm with struts , but now i want make this integration

second question:





<Realm className="org.acegisecurity.adapters.catalina.CatalinaAcegiU serRealm"
appContextLocation="conf/acegisecurity.xml"
key="my_password" />


sorry for my ignorance, but the key and the password, for what reason is??? , in what moment is used this???
i am rookie with realm-acegi

i saw this



Adapters create Authentication objects which are immutable and implement the AuthByAdapter interface. These objects store the hash of a key that is defined by the adapter. This allows the Authentication object to be validated by the AuthByAdapterProvider. This authentication provider is defined as follows:

<bean id="authByAdapterProvider" class="org.acegisecurity.adapters.AuthByAdapterProvider">
<property name="key"><value>my_password</value></property>
</bean>


i am confuse in this little point, i hope that some good guy can share his knowledge


thanks so much for advanced