Monday, October 19, 2015

Solution for Tomcat Server Start issue - A child container failed to start...

Environment: Tomcat 8 + Spring + Eclipse+J2EE
Issue: Starting the Tomcat server gives the following issue:


A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Spring3Hibernate]]
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
    at java.util.concurrent.FutureTask.get(FutureTask.java:111)
    at org.apache.catalina.core.ContainerBase.startInternal(Contai...


Solution: Add commons-logging jars to the lib folder and restart the server. This will solve the issue.




Tuesday, September 1, 2015

Selenium-Webdriver-Java-IssuesList

1. Incompatibility of webdriver-java bindings with browser version. Encountered issues with Firefox. IE and Chrome used to work fine.
Sol: Upgrade or Downgrade the Browser version to be compatible with webdriver. Refer the changelog or release notes on the java binding.

2. GUI Automation Issues with TeamCity running as a service. Webdriver unable to locate elements when running TeamCity as a service but it is able to do so if TCAgent is run via OSConsole.

3. Issue with TestNG parallelism not working with already designed framework due to Grouping.

4. cacert import issue:
“PKIX path building failed” and “unable to find valid certification path to requested target”
SSLHandshake issue while using httpclient to connect to a website and getting response.
Sol: Generally import RootCertificate not the intermediate ones and add them to cacert file.


I will keep updating this post if and when I encountered any issues.

Wednesday, August 19, 2015

Internet of Things - Part 2 - Web of Things

Introduction to Web of Things Architecture:
                To develop any solution or a product which should last for a longer time and be adaptable, a solid "Architecture" is necessary. Architecture, by definition, is a style or method of building any structure. Similarly, an Internet of Things solution needs an architecture. 


This architecture should address the following needs:
1. Enable solution developers to build things rapidly and reduce the entry barrier
2. Users should be able to access IoT or Smart things with no additional softwares and promote using the existing platforms eg: Browsers
3. There should be a lightweight access to the data generated by Smart things as this data is going to be consumed by smart phones or other smart things which are resource constrained.

Web of Things(WoT) is one such architecture which is able to address these. 
The Web of Things (WoT) is a term used to describe approaches, software architectural styles and programming patterns that allow real-world objects to be part of the World Wide Web. Similarly to what the Web (Application Layer) is to the Internet (Network Layer), the Web of Things provides an Application Layer that simplifies the creation of Internet of Things applications.

Rather than re-inventing completely new standards, the Web of Things reuses existing and well-known Web standards used in the programmable Web (e.g., REST, HTTP, JSON), semantic Web (e.g., JSON-LD, Microdata, etc.), the real-time Web (e.g., Websockets) and the social Web (e.g., oauth or social networks).

Source: wikipedia.org

WoT has 5 layers:
1. Accessibility
2. Findability
3. Sharing
4. Composition
5. Applications



Below is a block diagram showing how the above layers are connected to one another.

Source: Dessertation submitted by Dominique Guinard
IoT Architecture from dissertation written by Dominique Guinard


Details of every layer:

1. Accessibility layer:
This layer deals with the seamless access and connectivity to smart things. To achieve this purpose we apply REST architectural style to the smart things(devices).

Why REST?
RESTful architecture, proposed by Roy Fielding, is an architectural style that was used as a set of guidelines to implement the second wave of Web standards.
Prior to REST, web was used as a way of transferring static documents(HTTP 0.9). With the advent of REST, web became HTTP 1.1 a full fledged Application layer. 


REST ensures the following:
Scalability of component interactions, generality of interfaces, the independent deployment of components as well as intermediary components to reduce interaction latency, enforce security, and encapsulate legacy systems.

REST can be implemented with Web or any other systems as it is independent of either of them.

REST - Web implementation:

The idea of REST revolves around 'Resource' and 'Service'
Resource can be - Physical device(Any type of sensors attached to Micro-controllers), Collection of Objects(virtual), Server-side state or Transaction
Service: Functionality offered by the Resources such as : Adjust Temperature, Report Temperature etc..

Following are features that make REST a best fit for IoT.
Resource Identification - Each resource and its services are given unique URI for identification   
Uniform Interface: HTTP protocol is the RESTful interface provides uniform access to various services via the methods - GET, PUT, DELETE and POST
Self describing Messages: Light weight technologies such as JSON or XML used for data transport among smart things
Hypermedia Driving Application State: All the services offered by IOT devices should have sufficient links to other services and resources so that clients can browse and access them.



2. Findability layer:
Coming soon...

3. Sharing layer:
Coming soon...4. Composition layer:Coming soon...5. Applications layer:Coming soon...

How J2EE components work together in any Container - Spring or Application Server

In a Spring+Jersey+Hibernate RESTful webapplication, we can spot various J2EE components - JTA, JPA, Java Bean Validation, JSON-B API for B...