Wednesday, October 23, 2013

error occurred during initialization of vm could not reserve enough space for object heap

I was facing this error today where everytime I was trying to run my tomcat server in eclipse I was getting

"error occurred during initialization of vm could not reserve enough space for object heap"

It looked like a problem with the heap size VM arguments I  checked my eclipse.ini it had below correct heap size settings, Still I was getting the problem

-Xms256m
-Xmx768m
Soultion

I found that there is another place in eclipse where I had to set these VM aruguments and that was the option under

Windows-->Prefrences-->Java --> Installed JRE
I had to edit the configured JDK and add "-Xms256m -Xmx768m" to Default VM Argument.
 

Spring forward to another controller

I use the following approach in my spring applicaitons whenever I need to forward the request from one controller to another controller


@RequestMappping({"/MyURL"})

public String execute(Model model){
   if(){
       //Do Something
      return "forward:/URLNO1"
   } else {
      //Do Something
      return "forward:/URLNO2"
   }

}


As recomended in the below stackoverflow thread

http://stackoverflow.com/questions/7366170/spring-3-0-forwarding-request-to-different-controller/7366199#7366199
 

Sunday, October 13, 2013

java.lang.IllegalArgumentException: Can't convert argument: null



Problem

java.lang.IllegalArgumentException: Can't convert argument: null

I got this exception when I was trying to run a JEE web application in tomcat 6 using ECLIPSE IDE.

Problem Cause
I noticed that my web.xml file contained many "javaee:" tags although the namespace for javaee was already defined at < web-app >  level as xmlns="http://java.sun.com/xml/ns/javaee"

Solution

This is the first time I noticed these javaee tags in a web.xml so I got rid of those , and tried to run the application again on tomcat this time it is working fine.

The below stackoverflow thread has some good details about it

http://stackoverflow.com/questions/2293797/tomcat-startup-web-xml-issue


 

Tuesday, October 8, 2013

A Better Prototyping Approach


I would like to share one experience I had changing the way of prototyping and making it more fun for myself and the user also saving time.

 
Prototyping is very important in a project , a finished prototype having  the user agreement may mean you have already developed 70-80 percent of your database and you have clear understanding of what you will be needing in terms of data , now you are in a better position to find out the availability of that data and less risk of finding surprises later on.

Traditional Way Of Prototyping

                The common practice is to gather the user requirements and use HTML , FLEX,MS WORD or any other technology to build screenshots and show it to user get his feedback change the screens again and repeat the same process few number of times until you have an agreement with the user. This process takes time to finalize the prototype. Sometime we also go ahead and introduce some functionality into the system where a prototype is actually saving and getting the data from database , and this adds some more time to the whole effort.

Remember the goal of this effort is to get user’s agreement on what he needs in the application.

Prototyping approach recommended by David A.Patterson
I took a course at Coursera instructed by David A.Patterson where he shared his experience with the traditional prototyping and the approach he came up with (in fact he said the approach is widely being used these days ).

 Basically he recommended to forget about all the prototyping tools at this stage of your project and take a paper a pencil and sit with user let him draw whatever he has in his mind for what he really wants in the application , of course it will span on multiple screens and discuss all one by one repeat the process until you both agree on a single screen and then do it for other screens. He said this is the fastest and fun way of working on a prototype. Once you agree on a screen think about it in different prospective , like who should be able to see this screen , what should he see and what should be hidden based on role , here you are preparing your test/acceptance cases.

I tried this approach in one recent system I developed for my company and it really helped and saved some time and involve the user at very early stage of the project. Since he drew his requirements for me he had the right expectations from the first iteration of the project J.

Sunday, September 29, 2013

stacktrace to string in java , exception stacktrace

I wanted to get the exception stacktrace from any exception in my application and send it as an email to support staff so that we can do teh proactive support of our application , I came up with the following solution which requires using commons liabrary like below

org.apache.commons.lang.exception.ExceptionUtils.getStackTrace(Throwable)

For more detail and exploring the other options please look at below link

http://stackoverflow.com/questions/1149703/stacktrace-to-string-in-java

Saturday, September 28, 2013

Oracle list of Active Directory errors and there meannings


Here is a list of Active Directory errors:
525 - user not found
52e - invalid credentials
530 - not permitted to logon at this time
532 - password expired
533 - account disabled
701 - account expired
773 - user must reset password



Common Active Directory LDAP bind errors:

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 525, v893
HEX: 0x525 - user not found
DEC: 1317 - ERROR_NO_SUCH_USER (The specified account does not exist.)
NOTE: Returns when username is invalid.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 52e, v893
HEX: 0x52e - invalid credentials
DEC: 1326 - ERROR_LOGON_FAILURE (Logon failure: unknown user name or bad password.)
NOTE: Returns when username is valid but password/credential is invalid. Will prevent most other errors from being displayed as noted.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 530, v893
HEX: 0x530 - not permitted to logon at this time
DEC: 1328 - ERROR_INVALID_LOGON_HOURS (Logon failure: account logon time restriction violation.)
NOTE: Returns only when presented with valid username and password/credential.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 531, v893
HEX: 0x531 - not permitted to logon from this workstation
DEC: 1329 - ERROR_INVALID_WORKSTATION (Logon failure: user not allowed to log on to this computer.)
LDAP[userWorkstations: <multivalued list of workstation names>]
NOTE: Returns only when presented with valid username and password/credential.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 532, v893
HEX: 0x532 - password expired
DEC: 1330 - ERROR_PASSWORD_EXPIRED (Logon failure: the specified account password has expired.)
LDAP[userAccountControl: <bitmask=0x00800000>] - PASSWORDEXPIRED
NOTE: Returns only when presented with valid username and password/credential.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 533, v893
HEX: 0x533 - account disabled
DEC: 1331 - ERROR_ACCOUNT_DISABLED (Logon failure: account currently disabled.)
LDAP[userAccountControl: <bitmask=0x00000002>] - ACCOUNTDISABLE
NOTE: Returns only when presented with valid username and password/credential.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 701, v893
HEX: 0x701 - account expired
DEC: 1793 - ERROR_ACCOUNT_EXPIRED (The user's account has expired.)
LDAP[accountExpires: <value of -1, 0, or extemely large value indicates account will not expire>] - ACCOUNTEXPIRED
NOTE: Returns only when presented with valid username and password/credential.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 773, v893
HEX: 0x773 - user must reset password
DEC: 1907 - ERROR_PASSWORD_MUST_CHANGE (The user's password must be changed before logging on the first time.)
LDAP[pwdLastSet: <value of 0 indicates admin-required password change>] - MUST_CHANGE_PASSWD
NOTE: Returns only when presented with valid username and password/credential.

80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 775, v893
HEX: 0x775 - account locked out
DEC: 1909 - ERROR_ACCOUNT_LOCKED_OUT (The referenced account is currently locked out and may not be logged on to.)
LDAP[userAccountControl: <bitmask=0x00000010>] - LOCKOUT
NOTE: Returns even if invalid password is presented.

For more details please see below thread

https://forums.oracle.com/thread/1157585?start=0&tstart=0

Sunday, September 15, 2013

ERROR ~ IO Exception attempting to acquire interprocess lock

Problem Statement
I was getting below exception in my Documentum code (DFC) yesterday

ERROR ~ IO Exception attempting to acquire interprocess lock
java.io.FileNotFoundException: /bea/documentumCache/cache/6.7.1000.0027/bof/myDocBase/content.lck (No such file or directory)

I was able to login successfully on Documentum but the above problem comes when I was trying to fetch a folder’s content like below

IDfFolder folder = session.getFolderByPath(folderPath);

Reason :
Luckily found out the reason after discussing it with server team , we found out that a the
folder "/bea/documentumCache/cache/6.7.1000.0027/bof/myDocBase" was recently being deleted by the server team. And somehow it was not created again by documentum/weblogic.

Solution :
Like Always once we knew the reason the solution was very easy , we restarted the weblogic server and I believe weblogic/documentum created all those needed folders again. Now I am able to fetch the contents of my folder and do other operations like workflow e.t.c. without any problem.

Note :
Exceptions like this may waste a significant amount of our time to find out the solution while others may have already faced the same problem and their knowledge can be used and solution can be applied in no time.