My Quotes


When U were born , you cried and the world rejoiced
Live U'r life in such a way that when you go
THE WORLD SHOULD CRY






Wednesday, October 21, 2009

Reduce the EAR file size by trimming the WEB-INF\LIB folder jars

  • In my previous blog I said of removing the jar files basically from the APP-INF\lib.
  • But most of us want to remove the JAR files from the WEB-INF\LIB folder also just in case to truncate the EAR to the maximum possible extent.
  • How many of us will and have hindered this exception as "the path of the URI is wrong or no reference to the TLD" etc., etc.,
  • When you google it the best way is to add up the jar files like struts.jar into the WEB-INF\LIB and deploy the app and you are safe.
  • doing this actually increase the size of the ear and it does not really solve our problem at hand.
  • did not help a lot and I understood that many people have this problem at hand and there was no definitive answer.
  • here is a way to get rid of this also. Again this I tried in weblogic and there should be a way to accomplish this with other application servers too.

    Here are the steps to perform this reduction.
    Copy all the necessary TLD of the COTS jar files into a location in your workspace say WEB-INF\tld
    Change the web.xml to have the references to the TLD files
    
    http://java.sun.com/jsp/jstl/core
    /WEB-INF/tld/c.tld
    
    By default you can remove these jar files from the WEB-INF\LIB folder.
    Ensure that you have deployed these JAR files as LIBRARY into the application server
    Generate the EAR file and you should see happy smiles on the deployer.
    
  • JS and CSS compression


    Most of the web sites need to do this to ensure that the application performs much better in terms of performance.

    I have an ANT task which will do this in a much better way. Here are the steps for the same.
  • Download the jar file named YuiCompressorTask (originally from Yahoo) from the web site YUI Compressor
  • Place this jar file in the location <ant_home>\lib
  • Create ANT task as follows

  • Change the locations according to your needs.


  • 	
    		
    			
     			
    			
    					  
    			
    					  
    			
    			
    				
    		
    			
    		
    		
    			
    				
    	
    


    	
    		
    				
    				
    					
    		 			
    					
    							  
    					
    					 
    			    	
    				        
    					
    						
    		                
    						
    					
    				        
    						
    						
    	
    	
    			
    					
    				
    				
    					
    						
    		
    

    Weblogic server startup known errors and resolving

    Mostly when we re-start Admin Server or managed servers you will be getting the following errors. These are very famous noted from the server logs
    weblogic.management.ManagementException: 
                Unable to obtain lock on "Domain Path/servers/domainname/tmp/something.lok."
                Server may already be running
    
    Remedy action
  • Go to this folder, rename the .lok file to .kol
  • Re-start the server again, You SHOULD see the following error
    Could not obtain an exclusive lock for directory: 
                "Domain Path/servers/domainname/data/ldap/ldapfiles" 
                Waiting for 10 seconds and then retrying in case existing WebLogic Server is still shutting down
    
    Remedy action
  • Go to this folder
  • rename the EmbeddedLDAP.lok to EmbeddedLDAP.kol
  • Re-start the servers again and YOU SHOULD SEE that the weblogic servers start correctly.