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






Friday, December 28, 2012

Load Properties dynamically

Use Apache Commons Configuration and you can re-load property file dynamically.

Here is the complete code snippet for you


Java Code

import java.util.Arrays;

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;

public class ApacheCommonsTest {

private static final String PROPERTIES_FILE_NAME = "C:\\sampleconfig\\reloadconfig.properties"; // you can use your own folder for this

/**
* @param args
*/
public static void main(String[] args) {
ApacheCommonsTest classObj = new ApacheCommonsTest();
try {
classObj.getBackground();
classObj.getPieColors();
} catch (ConfigurationException e) {
e.printStackTrace();
}
}

private PropertiesConfiguration getPropertyConfig()
throws ConfigurationException {
PropertiesConfiguration config = null;
config = new PropertiesConfiguration(PROPERTIES_FILE_NAME);
config.setReloadingStrategy(new FileChangedReloadingStrategy());
config.setAutoSave(true);
return config;
}

private void readProperties() throws ConfigurationException {
PropertiesConfiguration config = getPropertyConfig();
config.load(PROPERTIES_FILE_NAME);
}

private void getPieColors() throws ConfigurationException {
readProperties();
String[] piecolors = getPropertyConfig().getStringArray("colors.pie");
System.out.println("colors.pie=" + Arrays.toString(piecolors));
}

private void getBackground() throws ConfigurationException {
readProperties();
String bgcolor = getPropertyConfig().getString("colors.background");
System.out.println("bgcolor=" + bgcolor);
}
}

Sample Property file
C:\\sampleconfig\\reloadconfig.properties


colors.pie=#FF0000,#00FF00,#0000FF,#123456
colors.background=#c53478


Jar files to run this program

You can get all the jar files from findjar.com

  1. commons-configuration-1.9.jar
  2. commons-lang-2.2.jar
  3. commons-logging-1.1.1.jar
Now no more reloading with server re-start


Thursday, December 27, 2012

Enable UML shapes in Visio


  • Stencil and Template for Visio 2010

Visio 2010 represents the first noticeable improvement in usability since Visio 2000, but no enhancement in the funtionality, upon which the UML 2.2 shapes are built upon. 
Therefore, the shapes for Visio 2010 are the same as for Visio 2007; there are minor changes in the template. 

Install: If you'd like the template to appear in the "Software and Database" category when you click File/New, together with Visio's own templates, 
create in any folder a subfolder called "Software and Database", for example, "...\My Documents\My Shapes\Software and Database". 

You could choose any folder, except of the Visio program folder, i.e., don't use C:\Program Files\Microsoft Office\Office14\Visio Content\1033. 

Unzip the stencils and template into "...\My Documents\My Shapes\Software and Database" or the folder you created. 

  1. Start Visio, 
  2. click the File tab, 
  3. click Options, 
  4. click Advanced, 
  5. and then, 
  6. under General at the very bottom, 
  7. click File Locations. 
  8. Type full path of this folder without the last segment "Software and Database" into the fields "Stencils" and "Templates". 
  9. That is, type in "C:\Document and Settings\<user name>\My Documents\My Shapes\" . 

The template "UML 2.2 Template (Visio 2010)" will appear in the category "Software and Database". 

If you'd like the UML 2.2 template to appear in another category, 
such as a "UML" category, use "UML" instead of "Software and Database" in the steps above.

The stencils and template are here: UML2.2-Visio2010.zip


  • Stencil and Template for Visio 2007

This stencil for Visio 2007 contains all the same shapes as the stencil for Visio 2003, 
as Visio 2007 has almost the same functionality as Visio 2003; there were only usability improvements.  

Install: If you'd like the template to appear in the "Software and Database" category 
when you click File/New, together with Visio's own templates, 
create in any folder a subfolder called "Software and Database", 
for example, "...\My Documents\My Shapes\Software and Database". 
You could choose any folder, except of the Visio program folder, 
i.e., don't use C:\Program Files\Microsoft Office\Office11\1033. 

Unzip the stencils and template into "...\My Documents\My Shapes\Software and Database" or the folder you created. 

  1. Start Visio, 
  2. click "Tools" 
  3. and "Options". 
  4. In the "Advanced" tab, 
  5. click "File Paths..." 
  6. and type full path of this folder, 
  7. without the last element "Software and Database" into the fields "Stencils" and "Templates", 
  8. that is insert "C:\Documents and Settings\<user name>\My Documents\My Shapes\".  
  9. Restart Visio. 
  10. The template "UML 2.2 Template (Visio 2007)" will appear in the category "Software and Database". 

If you'd like the UML 2.2 template to appear in another category, 
such as a "UML" category, use "UML" instead of "Software and Database" in the steps above.

The stencils and template are here: UML2.2-Visio2007.zip.

Thursday, October 11, 2012

Tuning the compaction and thread local area (TLA) size.


a.      Compaction is used to reduce heap fragmentation, i.e., move objects to form contiguous ‘live regions’ of the heap space. Note when a full compaction is run the stopping of a concurrently running application is inevitable. We can say that compaction is one of the worst garbage collection bottlenecks. If anything is known about fragmentation and object sizes it might be beneficial to tune compaction.
b.      The compaction algorithm divides the heap into a number of equally large parts. Each of these is subject to separate compaction that can stop the world. The default is 4096 parts. When compaction is too disruptive it might help to increase the number of heap parts. When compaction fails to keep up with fragmentation it might help to decrease the number of heap parts. Note that, for strategies other than throughput the compaction areas are sized dynamically
c.       The proper tuning of compaction involves two parameters:
                                                              i.      Compaction ratio (-XX:compaction:percentage:<percentage> or -XX:compaction:internalPercentage=<percentage>,externalPercentage=<percentage>) – the percentage of the heap that the garbage collector compacts at each garbage collection. While the JVM is compacting the heap, all threads that want to access objects need to wait because the JVM is moving the objects around.
                                                            ii.      Maximum references (-XX:compaction:maxReferences:<value>) – the maximum number of references to objects in the compaction area. If the number of references exceeds this limit, the compaction is canceled. When compaction has moved objects, the references to these objects must be updated. The pause time introduced by this updating is proprotional to the number of references that have been updated
d.      steps to tune compaction are as follows:
                                                              i.      Set the compaction ratio to 1 and gradually increase the ratio until the pause time becomes too long.
                                                            ii.      If the garbage collection time is too long when the compaction ration is 1, the maximum number of references must be adjusted:
                                                          iii.      Set the maximum references to 10000 and gradually increase the references until the pause time becomes too long. To monitor compaction behavior, we can add the option -Xverbose:compaction to the command-line. If many compactions are skipped, the maximum references must be increased; if, on the other hand, the compaction pause times are too long the maximum references must be decreased.
                                                           iv.      As we are using a dynamic garbage collection that optimizes the pause time (-Xgc:pausetime), we do not need to tune the compaction manually in this case setting the -XpauseTarget is sufficient.
e.      Each thread allocates objects in a TLA that is promoted to the heap when full. The TLA size can be adjusted by using -XXtlaSize:min=<size>,preferred=<size>,wasteLimit=<size>, in which,
                                                              i.      min – sets the minimum size of a TLA.
                                                            ii.      preferred – sets the preferred size of a TLA. The system will try to get TLAs of the preferred size if possible, but accepts TLAs of minimum size as well.
                                                          iii.      wasteLimit – sets the waste limit for TLAs. This is the maximum amount of free memory that a TLA is allowed to have when a thread requires a new TLA

Wednesday, October 10, 2012

Garbage collector(s)


  1.  Garbage collector can be generational or single spaced with a parallel or a concurrent mark and a parallel sweep or a concurrent sweep:
  2. Generational garbage collection – In this case the heap is divided into two sections: an old generation and a young generation (nursery). Initially objects are allocated in the nursery and when it is full, live objects are promoted to the old generation. For this operation the collector has to stop the Java threads.
  3. Single-spaced garbage collection – All objects live in a single space on the heap, regardless of their age.
  4. Concurrent mark and sweep algorithm – The concurrent garbage collection algorithm does its marking and sweeping concurrently with all other processing, i.e., the Java threads are not stopped during garbage collection.
  5. allel garbage collection mark and sweep algorithm – The parallel garbage collection algorithm stops Java threads when the heap is full and uses all available CPUs to perform a mark and sweep of the heap. Typically a parallel collection has longer pause times than a concurrent collection, but maximizes the application throughput.
We can select a specific garbage collector by using -Xgc:<option>, with option being one of the following:

  • singlecon – Single-space, concurrent garbage collection. This mode reduces application throughput but keeps pause times to a minimum.
  • gencon – Generational, concurrent garbage collection. The gencon mode is better than the singlecon mode for applications that allocate lots of short-lived objects. This mode reduces application throughput but keeps pause times to a minimum.
  • singlepar – Single-space, parallel garbage collection. This mode increases pause times when compared with the concurrent mode but maximizes throughput.
  • genpar – Generational, parallel garbage collection. This mode is generally better than the singlepar mode for applications that allocate lots of short-lived objects. In this mode, a higher number of garbage collections are performed than in the singlepar mode, but the individual pause times are shorter, resulting in lower fragmentation in the old generation space.
  • genconpar – Generational garbage collection. Sets the garbage collection mode to generational with a concurrent mark algorithm and a parallel sweep algorithm.
  • genparcon – Generational garbage collection. Sets the garbage collection mode to generational with a parallel mark algorithm and a concurrent sweep algorithm.
  • singleconpar – Single-space garbage collection. Sets the garbage collection mode to single-spaced with a concurrent mark algorithm and a parallel sweep algorithm.
  • singleparcon – Single-space garbage collection. Sets the garbage collection mode to single-spaced with a parallel mark and a concurrent sweep algorithm.
  • throughput – The garbage collector is optimized for application throughput. This means that the garbage collector works as effectively as possible, giving as much CPU resources to the Java threads as possible. This might, however, cause non-deterministic pauses when the garbage collector stops all Java threads for garbage collection.
  • pausetime – The garbage collector is optimized for short pauses. This means that the garbage collection works concurrently with the Java application when necessary, in order to avoid pausing the Java threads. This inflicts a slight performance overhead to the application, as the concurrent garbage collector demands more system resources (CPU time and memory) than the parallel garbage collector that is used for optimal throughput. The target pause time is by default 200 milliseconds, which can be changed by using -XpauseTarget.
  • deterministic – Optimizes the garbage collector for very short and deterministic pause times. The garbage collector tries to keep the garbage collection pauses below a given pause target. The performance depends on the application and the hardware. Running on slower hardware, with a different heap size or with a large amount of live data can break the deterministic behavior or cause performance degradation over time; faster hardware or a less amount of live data might allows us to set a lower pause target. The pause target for the deterministic mode is by default 30 milliseconds, which can be changed by using -XpauseTarget


EhCache and Hibernate issue

Session factory issue in setting up hibernate distributed ehcache with terracotta.

If you want the cache (or the caches) to be available from different JVMs you will need Terracotta; ehCache alone cannot do that. 

EhCache is not a distributed solution. So you need to use it with Terracotta to obtain the result you want. 

You can use Hazelcast, but also Infinispan to obtain this result



a.      Add the following jar files
<dependency>
  <groupId>net.sf.ehcache</groupId>
  <artifactId>ehcache-core-ee</artifactId>
  <version>2.5.2</version>
  <scope>compile</scope>
</dependency>
<dependency>
  <groupId>net.sf.ehcache</groupId>
  <artifactId>ehcache-terracotta-ee</artifactId>
  <version>2.5.2</version>
  <scope>compile</scope>
</dependency>
<dependency>
  <groupId>org.terracotta</groupId>
  <artifactId>terracotta-toolkit-1.5-runtime-ee</artifactId>
  <version>4.2.0</version>
  <scope>compile</scope>
</dependency>

Tuesday, October 2, 2012

Tomcat locks Drools jar files

I was deploying my application with Tomcat and Drools 5. But most of the time, it seems that Tomcat locks the Drools jar files.

I was trying to unlock it but every time I had to do a complete Tomcat shut down wait for 5-10 mins and bring it up.

I was searching for an appropriate answer but the closest one was the one from the threads in Stack Overflow.

It solved my problem immediately.

"Try using antiResourceLocking='true' in your$tomcat_home/conf/context.xml. This should at least help to release the locks"

Hopefully some one gets this benefit from my forum.

Thursday, September 13, 2012

there is no wsdl-file element for webservice-deployment descriptor number

When I deployed a web services developed using RAD 7 using JAX-WS into websphere environment , I get the following error message


Additional Return Codes: com.ibm.ws.scripting.ScriptingException: com.ibm.websphere.management.ap  
plication.client.AppDeploymentException: com.ibm.websphere.management.application.client.AppDeploymentException: ADMA0093E: An unexp
ected exception occurred while completing task GetServerName. Check the server machine First Failure Data Capture tool (FFDC) for mo
re information. [Root exception is com.ibm.websphere.management.application.client.AppDeploymentException: WSWS0021E: In the Web ser
vices Deployment Descriptor for module "ALSWebService.war,WEB-INF/web.xml", there is no wsdl-file element for webservice-deployment
descriptor number 0.]
com.ibm.websphere.management.application.client.AppDeploymentException: com.ibm.websphere.management.application.client.AppDeploymen
tException: WSWS0021E: In the Web services Deployment Descriptor for module "ALSWebService.war,WEB-INF/web.xml", there is no wsdl-fi
le element for webservice-deployment descriptor number 0.

I searched for multiple forums and they keep saying that I need to fix my deployment descriptor, but none told me how.

Even though my web.xml had the tag <wsdl-file>

I figured it myself. Hope this helps some one

1) Open the webservices.xml in webservice editor
2) Go to the Design View
3) Go to the "Web Service Overview" 
4) Expand Web Services --> WebService Description 
5) On the Right Hand side you will see Web Service Description Implementation Details
6) Besides the "WSDL File" you will see a BROWSE window.
7) Select the WSDL file from your workspace and save this file.
8) On to the Source view you should see  the tag 
    <wsdl-file> added as below

<webservice-description>
<webservice-description-name>XXX</webservice-description-name>
<wsdl-file>WEB-INF/wsdl/myappWSDL.wsdl</wsdl-file>


Save this file and now if you deploy this EAR into websphere, it will go thru seamlessly.

Hope this helps some one.

Friday, September 7, 2012

Force Axis2 as web service runtime in eclipse



  1. Put your WSDL file somewhere in your project. 
  2. I created a wsdl folder and put it there. 
  3. Once that is done, right click on the project and select New > Other > Web Service. 
  4. In the next dialog box, choose "Top down Java bean web service" from the first menu, then browse to your WSDL file. 
  5. I then hit next a few times, and got the following error.  
  6. IWAB0489E Error when deploying Web service to Axis runtime   axis-admin failed with  http://schemas.xmlsoap.org/soap/envelope/}Client The service cannot be found for the endpoint reference (EPR) http://localhost:8080/... and so on

To fix this, I had to change the server runtime to Axis2 (Eclipse should warn you about this when you add the Axis2 facet, but it doesn't). Do this by going to the Window menu, select Preferences > Web Services > Server and Runtime. Choose your server (Tomcat 5.5 in my case), then select Apache Axis2 as the web service runtime


URISyntaxException at index 18 of WSDL

Boy I had to suffer a lot. Figured that Eclispe behaves differently when the path of the WSDL your are loading has SPACES.

So virtually had to move the WSDL file to a location without SPACES.

Then Do File --> New --> Other --> Web Service and then it worked like CHARM

Disable WS-I validation in WSDL and Eclipse

Whenever I imported a WSDL file into eclipse and try to generate the web services out of it, I get the following WARNINGS in eclipse WSDL editor.

wsdl:types element contained a data type definition that is not an XML schema definition

The errors you're seeing are Web Service Interoperability (WS-I) 
compliance errors. Your WSDL document is valid. You can disable WS-I 
validation under Window->Preferences->Web Services->Profile Compliance and 
Validation. Set both WS-I AP and WS-I SSBP to Ignore compliance.

Thursday, April 19, 2012

Create SSL cert in Websphere 7


Click on the Serveres --> Server Types --> Web Servers--> <<your web server name>>
Get the *Conf File Name

Edit this file and add the following at the end of the file

LoadModule ibm_ssl_module modules/mod_ibm_ssl.so

<IfModule mod_ibm_ssl.c>
  Listen *:8080 (This is the port number that is opened for SSL. Check with your sys admin)
  <VirtualHost *:8080>
    SSLEnable
    SSLClientAuth None
    DocumentRoot "/app/IHSv7/htdocs"
    ServerName localhost:8080
    ServerAdmin root@localhost
    ErrorLog /apps/WasApps/<<myapp>>/logs/ssl_error.log
    TransferLog /apps/WasApps/<<myapp>>/logs/ssl_access.log
    KeyFile "/apps/WasApps/<<myapp>>/<<myappCerts>>/myapp_key.kdb"
    <Directory /app/IHSv7/htdocs/en_US>
        SSLVersion SSLV3
    </Directory>
    SSLClientAuth   0
    SSLCipherSpec 3A
    SSLCipherSpec 35b
    SSLCipherSpec 2F
  </VirtualHost>
</IfModule>

Friday, April 13, 2012

Hibernate in a pocket


Points to remember
-----------------
Identity
Equality
SubTypes - inheritence using sub and super classes
Granularity
Associations
Object Graph navigation - minimize the numebr of requests to DB

Why ORM
------
Productivity
Maintainability
Performance
Vendor independence
Two-Phase Commits


Points to Ponder for ORM
-----------------------
1) Core Interfaces called by applications to perform basic CRUD
 Session, SessionFactory,Configuration,Transaction,Query and Criteria
2) Callback interfaces that allow the application to react to events occurring inside Hibernate
 Interceptor, Lifecycle, and Validatable.
3) Interfaces that allow extension of Hibernate’s powerful mapping functionality
 Dialect,PropertyAccessor,Cache and CacheProvider,UserType, CompositeUserType, and IdentifierGenerator
4) makes use of existing Java APIs, including JDBC), Java Transaction API (JTA, and Java Naming and Directory Interface (JNDI). 
5) Configuration in managed environments using Resource Manager and Transaction Manager
6) Configuration in non-managed environments using Conenction Pool and user-managed JDBC Connections.
7) write-behind 
 Hibernate executes SQL statements asynchronously. SQL statements are usually issued at the end of a transaction.
8) Addressing leakage of concerns
 Domain model implementation shouldn’t depend on other Java APIs. shouldn’t perform JNDI lookups or call the database via the JDBC AP
9) Transparent and automated persistence
 complete separation of concerns between the persistent classes of the domain model  and the persistence logic
10) Hibernate doesn’t require that persistent classes implement Serializable. However, when objects are stored in an HttpSession or passed by value using RMI, serialization is necessary.
11) Hibernate requires a constructor with no arguments for every persistent class
12) object/relational mapping metadata
 ORM tools require a metadata format for the application to specify the mapping between classes and tables, properties and columns, associations and foreign keys,
 Java types and SQL types
13) The Hibernate mapping  DTD should be declared  in every mapping file Mappings are declared inside a <hibernate-mapping> element
14) Hibernate property mapping defines a JavaBeans property name, a database column name, and the name of a Hibernate type.
    derived properties 
         <property name="averageBidAmount"  formula="( select AVG(b.AMOUNT) from BID b ? where b.ITEM_ID = ITEM_ID )" type="big_decimal"/>
    property access strategies         
15) Support for fine-grained object models "more classes than tables" for implementing type-safety and behavior
16) An object of entity type has its own database identity (primary key value).
    Entity classes are always mapped to the database using <class>, <subclass>,and <joined-subclass> mapping elements
    An object of value type has no database identity; it belongs to an entity
17) aggregation "a part of" relationship. Aggregation is a strong form of association    
18) Inheritance
     Table per concrete class Discard polymorphism and inheritance
     Table per class hierarchy Enable polymorphism by denormalizing using "discriminator" and "subclass"
     Table per subclass Represent "is a" (inheritance) relationships as "has a"(foreign key) relationship using "joined-subclass"
19) Association
 Simple = using getter methods from parent to child. Mapping file of parent will have <many-to-one>  to class child.
 Bidirctional = mapping file of child will have <Set> <one-to-many> to class parent with inverse="true" 
20) The cascade attribute is directional: It applies to only one end of the association
 cascade="none"
  the default, tells Hibernate to ignore the association.
 save-update: 
  cascades save and update actions from the parent to the child.  Tells Hibernate to navigate the association when the
  transaction is committed and when an object is passed to save() or update() and save newly instantiated transient instances and persist changes to
  detached instances.
 delete: 
  cascades the delete action from the parent to the child. Delete children that are shared with existing parents
  tells Hibernate to navigate the association and delete persistent instances when an object is passed to delete()
 All: 
  all actions are cascaded from the parent to the child. All is the union of save-update and delete
  calls to evict and lock
 all-delete-orphan: 
  Hibernate will delete any persistent entity instance that has been removed
  all actions are cascaded from the parent to the child, orphan children are deleted
  means the same as cascade="all" but, in addition, Hibernate deletes any persistent entity instance that has been removed
 delete-orphan :
   
21) Transient objects 
 instantiated using the new operator aren’t immediately persistent. 
 Their state is transient, which means they aren’t associated with any database table row, and so their state is lost as soon as they’re dereferenced
22) Persistent objects
 objects instantiated by the application and then made persistent by calling the save()  
23) Detached objects - indicating that their state is no longer guaranteed to be synchronized with database state;
 When a transaction completes, the persistent instances associated with the persistence manager still exist.
 instances lose their association with the persistence manager when you close() the Session
24) persistence by reachability 
 instance becomes persistent when the application creates an object reference to the instance from another instance that is already persistent 
25) Fetching strategies
 Immediate fetching - The associated object is fetched immediately, using a sequential database read (or cache lookup). 
 Lazy fetching - The associated object or collection is fetched "lazily," when it’s first accessed. 
   This results in a new request to the database (unless the associated object is cached). 
 Eager fetching - The associated object or collection is fetched together with the owning object, 
    using an SQL outer join, and no further database request is required. 
 Batch fetching - This approach may be used to improve the performance oflazy fetching by retrieving a 
   batch of objects or collections when a lazy association is accessed. 
   (Batch fetching may also be used to improve the performance of immediate fetching.) 
26) Isolation problems
 Lost update
 Dirty read - One transaction reads changes made by another transaction that hasn’t yet been committed
 Unrepeatable read - reads a row twice and reads different state each time
 Second lost updates problem
 Phantom read - caused by another transaction inserting new rows between the execution of the two queries
27) Isolation levels
 Read uncommitted - Permits dirty reads but not lost updates
 Read committed - Permits unrepeatable reads but not dirty reads. momentary shared read locks and exclusive write locks
 Repeatable read - Permits neither unrepeatable reads nor dirty reads. using shared read locks and exclusive write lock
 Serializable - Provides the strictest transaction isolation
28) pessimistic lock 
 Lock that is acquired when an item of data is read and that is held until transaction completion 
 LockMode.NONE -  Don’t go to the database unless the object isn’t in either cache.
 LockMode.READ - Bypass both levels of the cache, and perform a version check to 
   verify that the object in memory is the same version that currently exists in the database
 LockMode.UPDGRADE - 
 LockMode.UPDGRADE_NOWAIT  - 
 LockMode.WRITE  -
29) Optimistic Locking
 version or timestamp columns
30) Collections
 Set
 Map and List - needs an index column to the database table
 Sorted collection  -  Sorted in memory using a Java comparator. 
 Ordered collection  -  ordered at the database level using an SQL query with an order by clause

Wednesday, April 11, 2012

Clear DNS cache in various OS


To flush DNS cache in Microsoft Windows (Win XP, Win ME, Win 2000):-

  1. Start -> Run -> type cmd
  2. in command prompt, type ipconfig /flushdns
  3. Done! You Window DNS cache has just been flush.


To flush the DNS cache in Linux, restart the nscd daemon:-


  1. To restart the nscd daemon, type /etc/rc.d/init.d/nscd restart in your terminal
  2. Once you run the command your linux DNS cache will flush.


To flush the DNS cache in Mac OS X Leopard:-

  1. type lookupd -flushcache in your terminal to flush the DNS resolver cache.
  2. ex: bash-2.05a$ lookupd -flushcache
  3. Once you run the command your DNS cache (in Mac OS X) will flush.


To flush the DNS cache in Mac OS X:-
  1. type dscacheutil -flushcache in your terminal to flush the DNS resolver cache.
  2. ex: bash-2.05a$ dscacheutil -flushcache
  3. Once you run the command your DNS cache (in Mac OS X Leopard) will flush.


To flush the DNS cache in Solaris:-
Do a
-          # ps -ef | grep nscd
This will find the PID for the NSCD daemon.
Now, do a
-          #pkill <PID>
or
-          #kill <PID>
Now, check if the nscd process is killed by using
-          # ps -ef | grep nscd
Now, start the nscd daemon by using
-          #/usr/sbin/nscd
This should start the nscd daemon and there you go, you have flushed the DNS Cache in your Solaris Server

Monday, January 30, 2012

SimpleDateFormat not available with GWT


Fix  - Add the following lines of code in your .gwt.xml

            <!--  see http://code.google.com/p/gwtx/ -->

      <inherits name="com.googlecode.gwtx.Java" />

b. Add the gwtx-1.5.3.jar to your WEB-INF/lib

Unable to start Google APP Engine java.lang.NoSuchMethodError: org.mortbay.thread.Timeout


This usual indicates problems with the classpath. Do you have multiple versions of Jetty in your classpath by any chance?

To identify duplicate classes in eclipse, hit Ctrl+Shift+T to bring the 'Open Type' dialog. Search for the class org.mortbay.thread.Timeout. Ideally it should only come in gwt-dev.jar, but I suspect in your case some other jar file would also have it.

Also open .classpath in your eclipse

GWT container comes before the APP ENGINE

<classpathentry kind="con"

path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>

<classpathentry kind="con"

path="com.google.appengine.eclipse.core.GAE_CONTAINER"/>



I had the same issue and I swapped the order of the classpath

and my errors are

gone now.

Mirroring Subversion Repository


Create a new repository to be the mirror:

·         svnadmin create MIRROR_CONTAINER

·         Create a "pre-revprop-change" action by creating a hook script by the same name.

o        Go to MIRROR_CONTAINER\hooks.

o        create a file named pre-revprop-change.bat

o        The contents will be as follows

Change the <<SVN USER>> to the user who will be performing the sync

IF "%3" == "<<SVN USER>>" (goto :label1) else (echo "Only the syncuser user may change revision properties" >&2 )

exit 1

goto :eof

:label1

exit 0

·         Save this file

·         Initialize a path within the repository to contain the mirrored data, and specify the source by

o        If the path has spaces then enlose them with the double quotes

o        For example my remote repository (MIRROR_CONTAINER) was in my shared folder so I use like the following

·         svnsync init --username <<SVN USER>> file:///"<<MIRROR_CONTAINER>>" <<BASE SVN location>> svn://162.66.224.77:48000/UFG

·         svnsync sync --username <<SVN USER>> file:///"<<MIRROR_CONTAINER>>"

Eclipe SVN integration after deleting a project


Once you delete a project in eclipse, the SVN sharing will automatically go OFF.

Without knowing this, I was trying to update the SVN plugin again and again.



The easy way is to right click on the Project à Share Project à Choose SVN and give your SVN location again.



Its as simple as that