Posts

Showing posts from June, 2012

Update the LOG Level at Runtime without Restarting the server

Update the LOG Level at Runtime without Restarting the server-  Thanks to avajava.com .I have enchnaced the code by providing a jsp file and adding log4j.xml properties as well. Find the update src code and screen shots in the PDF below. Log4j-Update Log Level of the Application without restarting the server.PDF

JDOM-Modify xml or add new elements to XML

 The JDOM api is used for modifying the xml and adding new Element and values to the existing xml. /*  * add jdom2.2 jaR TO CLASSPATH FOR THE PROGRAM TO WORK*/ jaxen, xercesImpl.jar,xml-apis.jar Download the source code from the below link. The Jar file contains a main program, which demonstates how to use the JDOM api. All we have to do is modify the main program-with your file name and provide the parameters. Add the other source file to the class path.Or add the jar to the class path with above mentioned JAR-Jdom and xml related jar https://docs.google.com/open?id=0Bw0JiVGLs_kUckZmSWt4NGpFNms package com.anjana.xmlutils; import java.io.File; public class ModifyMain {     public static void main(String args[]){         File xmlFile = new File("c:\\myfile.xml");         ModifyXMLFileClient modifyclient=new ModifyXMLFileClient(xmlFile);         modifyclient.modify_xmlattribute("staff","id","3");         modifyclient.add_xmlelement

JAAS Authentication Process

JAAS Authentication Process: Creating  an Instance of Login context-using the constructor- LoginContext(String,CallbackHandler) The First paramenter takes the name of the configuration file Second Parameter is a callbackhander it has a Handle() method-this passes the information to the loginModule. An empty Subject is created before authentication begins-this subject is passed to the login modules.On Success the SUbject is attached with credentials. login() method is called to instiate the  login process-after success the application can retrive the Subject using getSubject(); on failure throws authentication failure exception .

Working with Open LDAP JAAS and JBOSS

http://devbank.wordpress.com/2011/06/16/jaas-authorization-with-jboss-tutorial-part3/ https://community.jboss.org/wiki/JBossLDAPAuthenticationWithJAAS  http://www.len.ro/work/jboss-and-ldap/

web.xml and web-app xsd

web.xml  - http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd the xsd provides lot of other options available in  web.XML file other than servlet ,filter and listener mapping. security constraints tag gives info about how we can secure resources and is useful in configuring JAAS.

Installing openldap for windows

The open ldap manual gives all the options(BDB,LDIF--SQL etc) for installing open ldap. Userbosster is a good openldap for windows tool. If you are using open ldap for windows-- select the LDIF format. The client tools like apache studio works with LDIF format. JExplorer client- is also a better options and gives a nice tree.

OPEN LDAP Installer for windows

http://www.userbooster.de/en/download/openldap-for-windows.aspx I was searching for open-LDAP-- found--only linux  os - installers finally found the above link. http://www.userbooster.de/downloadablecontent/freeware/openldap-for-windows.msi  Install- steps- http://www.userbooster.de/en/support/feature-articles/openldap-for-windows-installation.aspx Open LDAP Client- http://www.userbooster.de/en/download/userbooster-freeware.aspx  Open LDAP on Tomcat comparison of LDAP on database ref: http://www.userbooster.de/forum/yaf_postst75_On-first-connect-with-Userbooster--Error-process-search-result--No-such-object.aspx   http://viralpatel.net/blogs/implement-ldap-authentication-in-tomcat-jboss-server-for-java-app/  http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol