Saturday, October 14, 2017

Deploy Java Web Application on Heroku with Heroku CLI

This post will describe how to create and deploy a Java Web Application war to Heroku using Heroku CLI. You will need a basic understanding of Git and Maven, and have Git and Maven already installed on your system.
  • Install Java 8, Maven and Git. For this post, I used Java 8 and Maven 3.5.
  • Create a free account on This account will be used from Heroku CLI to login
  • Download and Install Heroku CLI from here.
Following are the high-level steps to follow
  1. Create a Simple Spring Web Application.
  2. Create an application on Heroku
  3. Create the Procfile
  4. Create app.json
  5. Update Maven pom.xml
  6. Push code to Heroku

Sunday, October 08, 2017

Jenkins Offline Install on Red Hat Enterprise Linux Server

In this post we will see how to do an offline install Jenkins and required plugins on a Red Hat Enterprise Linux Server release 7.3. This is likely the case when your server is behind a firewall. But you have access to internet from your workspace. The assumption here is that you have sudo access on the server to do the install. Follow these steps...

Build Git From Source Code on Red Hat Enterprise Linux Server

Redhat Enterprise Linux provides Redhat Developer Toolset, which allows you to install Git. However, it is usually an older version. If you want the latest version of Git on your Server, then building Git from sources is the easiest way. Follow these steps to install Git from sources on Red Hat Enterprise Linux Server release 7.3. On our server, the following commands were run by the root user.

Saturday, October 07, 2017

Weblogic Remote Deploy from Red Hat Enterprise Linux Server: Unknown object in LOCATE_REQUEST

Recently I was attempting to deploy to weblogic from a Jenkins installed on a Red Hat Enterprise Linux Server release 7.3, to a remote Weblogic 12.1.3 cluster. Which was failing with a org.omg.CORBA.OBJECT_NOT_EXIST. Eventually, I ended up trying to do a manual deploy using the ANT task wldeploy, with the following command
 ant -lib /apps/wls12130/wlserver/server/lib deploy -Dweblogic.user=adminuser -Dweblogic.password=adminpassword -Dadminurl=t3://admin-server:admin-port -Dweblogic.cluster=ClusterName
As you can see from the command, we are passing command-line arguments which specify the location and credentials for the remote cluster. On the Linux machine to with the [wldeploy] Caused by: javax.naming.NamingException: Couldn't connect to the specified host [Root exception is org.omg.CORBA.OBJECT_NOT_EXIST: Unknown object in LOCATE_REQUEST vmcid: 0x0 minor code: 0 completed: No] error. Following is the full stacktrace, followed by a cause and resolution to this problem...

Wednesday, October 04, 2017

Java 9: Reactive programming with Flow API

In a previous post about Reactive programming with Java 8, we looked into reactive programming support by Reactor. Java 9 introduced reactive programming in Java with the Flow API. In this post, we will look at how the various components in the Flow API work with a few examples.

Tuesday, October 03, 2017

Java 9 : Private interface methods

Java 8 introduced default and static methods, the previous post gives a few examples of Java 8 default and static methods. Java 9 builds on that foundation and adds support for private interface methods. In this post, we will see a simple example of how to use private methods to interfaces. In general,
  1. Like any private method, private interface methods are accessible from within the enclosing interface only.
  2. Private methods can be declared using the private keyword.
  3. Any private method has to be implemented in the interface as it cannot implemented in a sub-interface or implementing classes.

Java 8 Interfaces: default and static methods

Java 8 introduces default static methods that enable you to add new functionality to the interfaces of your libraries and ensure binary compatibility with code written for older versions of those interfaces. While both static and default methods allow to add method implementations to interfaces, the difference is that you cannot override static methods. Both default and static methods are "public", and there is no need to explicitly declare them as public.

Monday, October 02, 2017

Java 9 Date Time API Changes

Java 9 added a few enhancements to the new Date and Time API which was introduced in Java 8. We will go over a few of these additions to LocalDate and LocalTime in this post
  • Stream<LocalDate> datesUntil​(LocalDate endExclusive) // LocalDate
  • public Stream<LocalDate> datesUntil​(LocalDate endExclusive, Period step) //LocalDate
  • public long toEpochSecond​(LocalTime time, ZoneOffset offset) //LocalDate
  • toEpochSecond​(LocalDate date, ZoneOffset offset) //LocalTime

Popular Posts