Posts

Showing posts with the label Java

Methods to Integrate Axis and CXF Webservices in our Code

Axis Download and Unzip the Axis Standard Distribution.Get all the required Axis libraries for generating java files from WSDL. set the Classpath to these libraries from the command prompt.The libraries list are given below axis.jar,org.apache.commons.logging_1.0.4.v200904062259.jar, org.apache.commons.logging_1.0.4.v201005080501.jar, commons-discovery-0.2.jar,jaxrpc.jar,jaxws-rt.jar,jaxws-tools.jar, saaj.jar,resources.jar,javax.wsdl_1.5.1.v200806030408.jar, javax.wsdl_1.5.1.v200806030408.jar use the command from Command Prompt for Eg: java org.apache.axis.wsdl.WSDL2Java mywebservice.WSDL to generate the Java Stub Files. Either write a build script or set the classpath and using javac compile the entire Java Files This will generate required stub classes for you to invoke the actual Service. Configure the WebService EndPoints in your Custom Classes and create an instance of the Stub and pass the URl. Create the Necessary Input which will be passed as the request to t...

Java StringBuilder to concatenate strings - Sample Code

Concatenation of string using “+” operator can be seen very common in sysout,logDebug statements.This will have an impact on the performance. it should be avoided to improve the performance.instead you can use  StringBuilder.append().This will really improve the efficiency of CPU utilization by 2.3 times compare with concatenation of string using “+” operator. Please find the usage below System.out.println("request params :"                     + " contextPath=" + pRequest.getContextPath()                     + ", " + PATH_Info + "=" + pathInfo                     + ", " + BASIC_AUTH + "=" + basicAuth               ...

SVN Best Practices - Basic/Essential SVN things developer must know

Synchronize your code base Consider synchronize your code base as the first task towards your development activity. 1.   Synchronize all the modules, 2.   Accept all incoming changes and 3.   Merge all the conflicts,if any. This makes your code base in sync with the actual code base. Check -in/Commit Once you have completed one file/functionality,repeat the above steps from 1-3.Now  open  synchronize perspective from Eclipse you will see only your outgoing changes.You have to build all the modules now, This will make sure the whole activity has  not created build breaks. If no build errors!!!  go ahead and Commit. 1. You can select all the files and select commit in one go ,      but  doing so will allow one common comment     to all the  files. 2. You can commit file one by one . In this case you can enter a    com...

java.lang.RuntimePermission modifyThread

Image
I encountered this issue while trying to run an ear module  from our application, the console logs are given below After researching a while,it seems that we need to add a specific permission,'modifyThread' in the java policy file if its not there. I had tweaked the java.policy file(location - jdk_xxx->jre->lib->security->java.policy) and added the below entry Be sure to take a back up of your policy file before doing  such changes,as there are chances your original file may get corrupt if something goes wrong. Now restart your Server and load your application, This solved the issue !!! if anybody has other thoughts,please share it here. Next tip

configure jadclipse in eclipse platform

Image
download the zip file jad158.zip,This can  be downloaded from the following link. Java Decompiler extract the zipfile to verify the files 'net.sf.jadclipse_3.3.0.jar' and 'jad.exe' are present. copy the net.sf.hadclipse_3.3.0.jar  to the working copy of your eclipse plugin folder. open your eclipse goto  Window->Preferences,Expand the Java Tab,now you will see the JadClipse option. click on the 'JadClipse' option tab,you may find two fields.set the values as below. 1. Path to decompiler to your jad executable location    (eg D:\workspace\setup\JAD\jad158.exe). 2. Directory for temporary files to  any desired folder(eg    D:\workspace\setup\JAD). Click Apply,Ok and Restart your Eclipse,done !!! Now press F3 button on the class to view the source for that class. Configure JUnit Download the junit-4.10.jar file from the location  and add this file in the java build path ...

download,copy jad158.zip file for JadClipse

Image
click on the link jad158.zip download the jar file. let me know if you are finding any difficulty in downloading this  file ,i have already downloaded this and its working,if you have faced some issue in downloading this file,i can upload the file in some free ware site,or i can send the zip file via email since the file size is not big.Please leave your email id in the comments section in that case. Junit Download Navigate to the link http://sourceforge.net/projects/junit/files/junit/4.10/ .Click on the link junit4.10.jar.   also see Configure JadClipse and JUnit in Eclipse