We can now do Spring certification without going for Pivotal training. It was long due and here it is finally!
Can you take Spring certification without Pivotal Training Course?
Read more: http://javarevisited.blogspot.com/2017/05/can-you-take-spring-certification-without-training-course.html#ixzz4hVUNb9fW
5 Spring Framework Books for Java developers (Includes Spring Security and Spring Boot) – Best of lot
Read more: http://www.java67.com/2016/12/5-spring-framework-books-for-java-programmers.html#ixzz4hVU7visy
I needed to install a local jar file into my laptop’s local maven repository and found this article. I used this approach to install this jar file in my repo:
mvn install:install-file -Dfile=my-model-1.2.1.jar -DgroupId=com.cyberaka.my.package -DartifactId=my-model -Dversion=1.2.1 -Dpackaging=jar -DgeneratePom=true
This duly added the local jar file under appropriate group id and artifact id inside my maven repository and I was able to refer to this dependency through my project’s pom.
I needed to email an HTML report and I was not happy with the fact that we have to create zip file containing the HTML, Images etc. I knew it was possible to embed base64 data directly into HTML I started looking for some PoC. My search took me to an online base64 encoder and decoder. This gave me the idea to convert the external image files into base64 string and embed it directly into HTML. On some search I landed up Apache Commons Codec Library which contains a Base64 class which can be used to covert an input stream into a base64 string.
I recently received a couple of REST Web Service endpoints where the implementation technology was not Java. So I had to either rollout my own object and then rely on the object mapper to map the JSON to Java or come up with an approach to generate the relevant POJO file. On a little bit of looking around I found out the following two links for generating Java Code from JSON.
The POJO generated were decent and got the job done. I didn’t have to write the POJO myself and the code generated by these websites did the job well.
Another link recommended in the posts comments.
http://www.freecodeformat.com/json2pojo.php (Thanks Daniel)
I use Fiddler extensively in Windows for debugging any HTTP traffic in my web applications. However on Mac Fiddler is not available. On some search I have found out the following tools which can do the job:
In Chrome just type “chrome://net-internals/#http2” in the address bar and you will be able to see all the HTTP traffic that is going on in your system. Not sure when it got added to Chrome but it is a very simple yet powerful utility.
This is Java based commercial utility which can be used for almost Fiddler like functionality. This works in Windows, Linux and Mac so it is good deal I think for any developer.
Update: On using Charles Proxy I found it to be dead simple to use and it fulfilled all the requirements I had on my Mac. There is 30 minute lockout feature for unlicensed version which seems fair. It is completely worth the 50$ price tag.
I wanted to try out Tomcat 8 and Java 8 for one of my production servers. The following link summarizes the various steps required for installing and configuring both Java 8 and Tomcat 8 from scratch.
Installing Java 8.x and Tomcat 8.x on Debian Jessie
I use Maven for almost all Java projects I work in. I prefer using Netbeans with Maven as it has solid integration with Maven and I find it a hassle free approach of working with Maven without cluttering up your project with ‘special’ project files. However I have found out that Eclipse cannot be ignored as it has much faster performance and it needs lesser memory than Netbeans. So here are some tricks to work around the build issues I have faced with Eclipse when combined by Maven. The usual issue I faced was that I could build my project from console but I saw lots of build issues when building from inside Eclipse and lot of build errors were logged inside Eclipse ‘Problem’ view.
Refresh Project On pom.xml change
If you have changed anything in the pom.xml you should refresh your Eclipse project. It is possible Eclipse will pick up your changes from pom.xml and resolve any build / dependency issue in this step itself.
Re-generate Eclipse Project Files
If you have added a dependency in pom.xml you should ensure that the following commands are executed to regenerate the Eclipse project configuration files.
This will delete the .project, .classpath and .settings folder of Eclipse.
This will regenerate the .project, .classpath and .settings folder for your project.
Once you execute the above commands go back to your Eclipse project and refresh your project by right clicking on the project and clicking on refresh in the context menu or by pressing the ‘F5’ key after selecting the project.
In my experience so far Eclipse is able to resolve all dependence / build issue and you should have a trouble free coding experience now.
I was trying to setup Jenkins web app inside the Tomcat server and it continuously gave me this error:
SEVERE: Failed to initialize Jenkins
This I fixed by creating the folder ‘/usr/share/tomcat7/.jenkins’
On redeploying Jenkins I again noticed the following error.
WARNING: Failed to record boot attempts
java.io.FileNotFoundException: /usr/share/tomcat7/.jenkins/failed-boot-attempts.txt (Permission denied)
I fixed this issue by giving full access to this folder.
sudo chmod 777 /usr/share/tomcat7/.jenkins
I believe 777 is not a good approach in a production environment, but for development perspective it looks ok.
I recently had to find out if a particular package was properly installed in my Debian Linux OS as something was broken. I used the following command to do that.
dpkg --get-selections | grep -v deinstall | grep oracle
This basically lists out all the packages which contain the text ‘oracle’ in them. Once I find out the exact package name I can actually decide to remove all packages containing them.
sudo apt-get purge oracle*
sudo apt-get autoremove oracle*
We can use the jps command that is part of JDK to find out which Java processes are running in the current user’s session. We can further find out which network ports have been opened by a particular java process.
Use the follwing command to list all java processes:
If you want more details about a process you can execute the following command:
jps -v | findstr <process id>
The following variant of netstat command lists all the listening as well as established socket connection in a system:
This command can be further used to find out what sockets are opened by a specific process
netstat -ano | findstr <process id>