Posts

Showing posts with the label eclipse

Maven attach source code for external Jar

For Java project that uses Maven for dependency and building we can attach the third party library source. By default the source is not available, using the following commands we can down load the associated source and java doc from maven repository by reading the project pom file. Maven will not be able to download sources and docs if those were not published for a particular library. mvn dependency:sources mvn dependency:resolve -Dclassifier=javadoc //to download source for only one library mvn dependency:sources -DincludeArtifactIds=spring-boot Now after executing the above two commands, maven will download the respective sources and java docs. Now we can attach the source in the IDE. For eclipse specially it is better to use the Maven Eclipse plugin mvn eclipse:eclipse -DdownloadSources=true mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=false Executing the above commands will also download the sources and it also updates the .classpath file. Now refr...

How to take JAX-WS request and response dump

Image
It took me a while to figure out how to see the request and response along with HTTP headers for JAX-WS based clients. Definitely we can write Handler to log the request/response, but that wont generate the HTTP headers. The quickest and best way for debugging purpose is to set Http TransportPipe.dump  property. We can set the following JVM property to see the Request and Response dump while invoking a particular web service using JAX-WS. The property should be set as, -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump="true" The dump generated will be outputted to System.out, and it contains The Whole SOAP Request and Response along with HTTP headers. To set the property go to Run Configuration , select the configuration and then go to the Arguments Tab. Enter the value in the box marked as  VM Arguments . Now upon calling web service from your client though eclipse, you should be getting the reqeust and response in the console. ...

Eclipse Crashing During starting up

I have experienced several issues of eclipse crashing with workspace configured. It would generally take lot of time and will simply display the splash screen. Initially I thought it is due to lack of memory(RAM), but I saw similar symptoms even with massive configuration(16GB Ram, Quad Core etc) After googling I found the actual cause of eclipse crashing, The solution is simple, delete specific .snap file from eclipse workspace location. For me deleting the following files worked, \.metadata\.plugins\org.eclipse.core.resources\.snap   and \.metadata\.plugins\org.eclipse.core.resources\.root\.markers.snap Eclipse uses .snap files for remembering workspace state during runtime. Deleting these files' does not effect any projects in the workspace, every thing for me just worked fine.

Eclipse plugin for maintaining copyright text in source code

Wondering how to maintain copyright or disclaimer text on source files. Specially when you have a number of files in your project, and you probably want to add some sort of info text or say copyright text as header in each and every file. Recently I found a easy simple to use eclipse plugin  http://www.wdev91.com/update/  which can be used easily to add or even replace existing header information text from source files. Since adding the text in each file is manually is very error prone and takes lots of effort, this plugin is very useful. You can find more information here  http://www.wdev91.com/

Setting User Name in Eclipse For Comments Generation

Recently I have noticed that eclipse IDE on Fedora inserts the default system user name "root" in the @author attribute for java comments. I have found two ways to change the Default System User name to what ever you like, The First way is to The other one is just by  changing the associated templates in Window -> Preferences -> Java -> Editor -> Templates -> @author , and hard coding the author's name. The Other way is by editing the eclipse.ini file, For example , the following eclipse.ini file shows what I have done to set my name -showsplash org.eclipse.platform -framework plugins/org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m -XX:MaxPermSize=256m -Duser.name="Siddhartha(Sidd)" Notice the  attribute Duser.name , that I have set to Siddhartha(Sidd),  after changing eclipse.ini we should restart eclipse so that changes can take effect. Now, when ever I want to a...