Friday, August 5, 2011
Tuesday, August 17, 2010
Session Tracking in Java
Maintaining client sessions is the ability for servers to associate multiple stateless http requests within a single session context. Often, implementing session seems to be magic, but an actual mechanism exists by which this is implemented.
The main requirement for maintaing client sessions is the server's ability to associate one request with a previous request. In order to do this, a session id must be generated and passed back from the server to client. The client will then pass this session id in subsequent requests to associate these with the previous request. The main difference between the various methods of maintaing a session is the form of the session id, such as the way the session id is generated or how it is stored on the client and/or on the server.
Java web servers provide a default implementation using Http Session. However, there are several other ways. The server
1) Using HttpSession
Generation: web server
Client Location: cookies or url
Server Location: web server
Server Location: web server
Java web servers by default can maintain http sessions by generating at request a session id, or the JSESSION_ID. Once the session has been established, the Java web developer can save any type of information in the new session when processing the request. The web server is responsible for storing this session and any saved information without any additional coding. Once the request has been processed, a JSESSION ID is passed back to the browser as a cookie. The browser saves the cookie. On subsequent requests to the same web server, the cookie is passed back to the server, and the web server picks up the session cookie and retrieves the JSESSION ID. Once the session id has been identified, the session associated with the id is set on the request.
2) Encrypt and Decrypt
Generation: servlet
Client Location: cookies
Server Location: N/A
Server Location: N/A
When the client makes a request with a particular user-specific id, the server can generate the session id from this user id. The user id
3) Memcached
Generation: servlet
Client Location: cookies
Server Location: N/A
Server Location: N/A
Tuesday, July 27, 2010
LDAP Modify - Changing your password
File contents: mod_attribute.ldif
dn: uid=mtan,ou=People,dc=mlbam,dc=com
changetype: modify
replace: userPassword
userPassword: {clear text password}
ldapmodify -x -h ldap01.mlbam.com -p 389 -D "uid=mtan,ou=People,dc=mlbam,dc=com" -f /Users/tan/mod_attribute.ldif -W
Enter LDAP Password:
Enter your current password.
Possible outcomes:
additional info: invalid password syntax: no numeric character
This indicates your password must contain a numeric character
additional info: invalid password syntax: dictionary word match
This indicates your new password contains a dictionary word, which is not allowed.
additional info: invalid password syntax: no special character
This indicates your new password must contain a special character.
SASL/EXTERNAL authentication started
ldap_sasl_interactive_bind_s: Unknown authentication method (-6)
additional info: SASL(-4): no mechanism available:
You should use the -x option for simple authentication.
Tuesday, September 29, 2009
Mule 2.x Start Error
Message:
Root Exception stack trace:
oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType'
at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:418)
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:284)
Solution:
The Mule 2.x app does not contain the correct Spring library. Please include the spring-context-2.5.jar
Thursday, August 20, 2009
Wednesday, July 29, 2009
Java Performance Diagnosis Tools
prstat / prstat -mLp
- the last number of each column is the NLWP (number light weight processes aka threads) that are currently active.
- prstat -mLp
will show the current threads for one process. The last column is the LWPID (light weight process ID) - LWPID’s increment by one, hence the highest LWPID indicates how many threads have been launched since process creation.
ps -fLp
- indicates how many threads have been launched since process creation.
truss -f -p /
- new system calls for one thread
/usr/jdk/jdk1.6.0_10/bin/jstatd -J-Djava.security.policy=jstatd.all.policy -p 52074
- starts an rmi server on the local host to be able to monitor application running on this host
/usr/jdk/jdk1.6.0_10/bin/jps -q
- determines the running java processes
Subscribe to:
Posts (Atom)