Saturday, 18 January 2014

Data


1)Searching a word in Eclipse


Go to Market Place >> "Quick search" install the plugin .This Plugin is given by STS(Spring tool suite)

In Mac shortcut to Search    "command+Shift+L"

2)View the Jar File Code


Go to Market Place >> "Enhanced Class Decompiler" install the plugin .

Eclipse>>preferences>>FIle Associations
File types               :   *.class without sources
Associated editors : class Decomiler Viewer(default) By click on Default
Apply and Close

 

3)Check out the Project from Git in Eclipse


Eclipse>>Project Explorer>>Import>>Import>>Projects from Git>>Clone URI>>Give the URI username/password
select the Branch you what to check out>>select the Work Space you what check out
Select the Radio Button "Import existing Eclipse Projects"
Click on Finish


4)Commit History of Line in Git via Eclipse


Select/Open a file>>Right click>> Team>>show Revision information

5)How to Create Unique user Identifier in java 


import java.util.UUID;
String uniqueTranscationId = UUID.randomUUID().toString();

6)How to call the REST call in using Spring REST template

private static final String API_CALL= "/ProjectName/integration/saveData";
String url=someObject.getDetails()//https://hostName.XX.XX.com:PortNumber

import org.springframework.web. client.RestTemplate;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpEntity;

Restemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> entity = new HttpEntity<String>(payLoad.toString(), headers);
ResponseEntity<String> portalResponseService  = restTemplate.exchange(url+API_CALL, HttpMethod.POST, entity, String.class);

7)debugging the java script in chrome


To debug in chrome by pressing F12 or moretools>Dev tools or ctrl+shift+I

debugging shortcuts

---------------
f10 step over -next
f11 step into -into the method
shift+f11 step out -out of the method
f8 to continue -break point to break point

options

----------
break point -to stop the control while executing the javascript  to debug the javascript
conditional break points -this is break point will stop the execution  when the condition matches  ( eg :-var empid==10)
watches -we can see the variables values at runtime will debugging how the variable values are changing
call stack-if are debugging or else if error in the JavaScript execution  we can able to know what are the methods called in stopping this break point get to know



Best Practices

--------------
do not use == or != will not check the type instead  use === and !== to check the type as well

8)Setting user Environment variables


   Setting user Environment variables


1)JAVA_HOME
         C:\Program Files\Java\jdk1.6.0_45
2)M2_HOME
          C:\Program Files\apache-maven-3.1.1

Setting System Environment variables

1)path
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_45\bin;C:\Program Files\apache-maven-3.1.1\bin;

9)Error   in Web Service when using Axis

In Web services
If U got the following Error
IWAB0489E Error when deploying Web service to Axis runtime
 *
 * IWAB0489E Error when deploying Web service to Axis runtime axis-admin failed
 * with {http://xml.apache.org/axis/}HTTP (403)Proxy Unacknowledged

solution

1)IE>Settings>Internet options>connections>LAN Settings>Proxy server>
copy Address xx.xx.xx.xxxx and port 80
2)windows >preferences>General>Network Connections
Active provider select Manual>HTTP >Add> paste the copied Ip and port >ok

10)How to Configure Axis and CXF in Eclipse

create a dynamic web project>write a class under package>
windows>preference >webservice>

1) Axis

    i)axis2 preference>D:\from_ruhul\axis2-1.6.2-bin\axis2-1.6.2(installed axis2)>ok
    ii)right click on project>properties>project Facets>enable Axis2 web services

2)CXF

       i)CXF 2.x preference>Add>Home directory of unziped CXF 2.7.7>enable                     the check box
      ii)right rick on project>properties>enable the CXF 2.x Web Services>ok

Right click on project>new >other>web services>web service>Next>browse XX.java  file
drag up the both>finish/next
then we can see the  web service explorer click on the method(service) give the neccessary  input. we get theoutput in the status scroll and see
To access fromm broweser
copy the url in nthe wsdl file in the <soap:address locaation=http://localhost:8080/WebServiceCXFHello/services/HelloWorldPort>

paste in the browser http://localhost:8080/WebServiceCXFHello/services/HelloWorldPort?wsdl

No comments:

Post a Comment