Wednesday, October 15, 2014

Java Service Wrapper : IPv6 : server socket creation failed.



              Recently while testing windows service developed using Java Service wrapper[JWS], we faced problem that service  was not starting. The windows box was running 2012 64bit OS and IPv6 only.

when we check log for wrapper we found following doubtful lines 

  
WARN   | wrapper  | 2014/10/14 05:25:08 | Unable to query network interfaces for valid HostIds. (The operation completed successfully. (0x0))
.
.
.
DEBUG  | wrapper  | 2014/10/14 05:25:09 | Enqueue Event 'wrapper_start'
DEBUG  | wrapper  | 2014/10/14 05:25:09 | Preparing to restart with mode 1.
ERROR  | wrapperp | 2014/10/14 05:25:09 | server socket creation failed. (An address incompatible with the requested protocol was used. (0x273f))
DEBUG  | wrapper  | 2014/10/14 05:25:09 | Enqueue Event 'wrapper_stop'
STATUS | wrapper  | 2014/10/14 05:25:09 | <-- Wrapper Stopped



when i googled it first, I did not found any useful help. So I decided to put this blog entry so that if any  one faces same issue he can found it immediately


This problem was occurred because the wrapper  communicate with JVM of application via socket.JWS by default used ipv4 address to bind socket. As my machine is Ipv6 only it was failing.

The solution to this problem is to change the communication way to PIPE, which can be done by adding following property in wrapper.conf


   wrapper.backend.type= PIPE 
 
 
you can refer the link  http://wrapper.tanukisoftware.com/doc/english/prop-backend-type.html
Thanks to JWS support they are pretty quick, and ready to help.
 
 
 
 
 
 

Tuesday, May 8, 2012

Ant task to find all java files in dir

                     

                   Some time we need to identify all file names in our project. For documentation purpose or for creating modification estimate etc. Following is the ant target that you can use to do the job. here the list of file name will be printed with semi colon ; as delimiter.
  
 
  
   
    
   
   
    list of files: 
   ${prop.javafiles}
  
                     
                   In above snippet:  ${dir.src} will be the location of source code Output will look like following
  
list:

  [echo]  list of files: 

  [echo]com\test\listproject\AdapterController.java;com
\test\listproject\cleanup\BppmDifferenceData.java;com\
test\listproject\cleanup\CleanupException.java; 
com\test\listproject\cleanup\CleanupManager.java

BUILD SUCCESSFUL

Total time: 0 seconds