How to Fix java.lang.NoSuchField

Eric J. Bruno - September 2017
Recently, after part of my hard drive crashed and I restored my Java development environment, I had trouble debugging one of my projects. This particular project was large, spread across multiple JAR files, and everything compiled just fine. However, when I went to run or debug it within my IDE, I consistently got a java.lang.NoSuchField Exception for a class member variable that was certainly there. When I ran the code from the command line via a script, it ran fine. I was perplexed.

Read more...


Calling Java Code from C/C++ Transparently

Eric J. Bruno - August 2017
I recently needed to create a C/C++ API for some existing Java code. The first thing that came to mind was to use the Java Native Interface (JNI). However, that can get ugly, mainly because JNI was designed to do the reverse (call C code from Java) and because it adds additional compilation steps. For example, you need to generate the JNI layer using the JDK’s javah tool, implement and compile the native C/C++ side of things, and then keep it all in sync as the Java code changes. Fortunately, there is an alternative: Java Native Access.

Read more...


Modularization Isn’t Just About Code

Eric J. Bruno - May 2017
Breaking a large project into more maintainable modules is more than splitting code across files. It involves componentization, distribution, developer considerations, ease of debugging, the effectiveness of testing, performance concerns, scripts, tools, and more. Then, after all that, you can consider the structure of the code itself. Let’s take a look at the forces you need to consider when modularizing your system.

Let’s begin with an important point in large-scale software development: good object-oriented design doesn’t equate to ideal code modularization. In a nutshell, this means it’s okay to break down a single C++ class into multiple source files. You can even break classes out across directories (or packages in other languages). In fact, this is one advantage of C++ over Java; it allows you to have different logical and physical class representations when it comes to the filesystem. Let’s look at some strategies to achieve this.

Read more...


Using HTML5 Server Sent Events (SSE)

Eric J. Bruno - September 2016
You’ve probably heard of HTML5 WebSockets , which is a powerful method to support full duplex, reliable messaging over HTTP/S. But have you explored HTML5’s Server-Sent Events (SSE), which is a simpler (albeit not as full featured) method of sending dynamic updates from an HTTP server to code in a browser? It works outside the browser as well, between applications written in any language. I like SSE because it doesn’t require a separate WebSockets server, it works over HTTP and HTTPS, it’s firewall friendly, and it’s simple. In this article, we’ll explore simple messaging over HTML5 SSE using a Java Servlet as the server and some JavaScript code in a web page as the client.

What Are Server-Sent Events?

You’ve probably heard of HTML5 WebSockets , which is a powerful method to support full duplex, reliable messaging over HTTP/S. But have you explored HTML5’s Server-Sent Events (SSE), which is a simpler (albeit not as full featured) method of sending dynamic updates from an HTTP server to code in a browser? It works outside the browser as well, between applications written in any language. I like SSE because it doesn’t require a separate WebSockets server, it works over HTTP and HTTPS, it’s firewall friendly, and it’s simple. In this article, we’ll explore simple messaging over HTML5 SSE using a Java Servlet as the server and some JavaScript code in a web page as the client.

Read more...


Increase Your Digital Enterprise Intensity

Eric J. Bruno - April 2016
How serious are you with your digital strategy and initiatives? Be careful not to let your customers be more digitally transformed than you are. Instead, make sure you’re ahead of your competition, your customers, and even the traditional business models of your very own company. Shoot for the impossible with what Google calls moon shots and set goals for digital transformation and enablement that may seem impossible. Let’s explore six principals that will help you create the digital enterprise of the future, today.

1. Think beyond cost savings and efficiencies.

If your goal is a multi-billion dollar valuation, you need to stop using technology just to cut costs and begin thinking about how it will truly grow your business. For example, technology can help you:
  • Define new pricing models to compete globally
  • Reduce time and effort it takes to complete a sale
  • Bundle goods and services
  • Create digital partnerships (i.e. offering a car rental when booking a hotel)
  • Improve user experience (by making it fast and easy, or even fun via gamification).

Read more...


CoAP Messaging In Depth

Eric J. Bruno - April 2016

CoAP is a protocol not unlike HTTP or REST communication where the messages generally fall into the category of GET, POST, PUT, and DELETE. CoAP is also more conversational by nature since it’s request/response driven, as opposed to the publish/subscribe nature of MQTT (for details, see our article on MQTT).

At a lower level, CoAP messages are sent and received over UDP, which by nature is unreliable, so a basic reliability scheme is built into CoAP’s communication protocol on top of UDP. For added security, messages can be sent using Datagram Transport Layer Security (DTLS) protocol instead of UDP. In either case, each CoAP message needs to fit into a single UDP/DTLS datagram packet. Further, CoAP supports datagram messaging over IPv4 and IPv6 networks and variants such as 6LoWPAN.

Although unicast UDP is used for the request/reply CoAP protocol, multicast UDP messaging is used to support CoAP device/sensor discovery. CoAP clients and servers support a special “All CoAP Nodes” multicast address, with port 5683, to discover other CoAP servers and their shared resources.

Read more...


Java Message Service (JMS) 1.1 and 2.0 In Depth

Eric J. Bruno - April 2016

JMS is a specification that describes the properties and behavior of an information pipe for Java software. It also describes how Java client applications interact with the information pipe. This article will go into detail on messaging concepts, JMS application implementation, and some available JMS providers. It begins with a brief discussion on various types of inter-component messaging, quickly moving to the concepts of reliable messaging and JMS. Also covered are discussions on the two main revisions of the JMS specification, JMS 1.1 and JMS 2.0 All throughout, critical points will be explained with working code, with the differences between JMS specification revisions compared.

The concept of messaging begins with the goal of delivering data. Enterprise messaging forms the communication infrastructure between disparate components and devices in a distributed software system. The important components in a messaging system—producers, consumers, and the messages themselves—are abstracted through the use of interfaces. The result is a set of loosely-coupled components and devices that are part of a cohesive, efficient, reliable IoT system. Components that are loosely-coupled have as few direct interactions with one another as possible. This isolation leads to more robust software, as changes to one part of the system do not ripple through to other parts.

Most messaging systems consist of a broker component that is responsible for delivering messages to and from the various client applications. Messaging brokers generally treat messages as opaque. In fact, the broker doesn’t need to know the purpose or content of a message in order to deliver it. In turn, the software components that send and receive messages don’t need to know how the messages are delivered and, in most cases, which components sent them. The important part is that they are sent and received reliably.

Read more...


Gartner warns of approaching apocalypse for IoT data management

Melissa Thompson - SmartDataCollective (linked by Eric J. Bruno) - March 2016

Data management in terms of capture and storage, analytics, and governance and compliance are rapidly becoming critical needs for IoT systems as they roll out. There’s a large possibility that many of the companies implementing IoT solutions, or integrating enterprise systems with new IoT systems may put their enterprise or users at risk if they’re not managing that data carefully. A recent Gartner survey shows that 43% of organizations are planning to use IoT in 2016. Be prepared to start your IoT solutions over if you don’t consider these issues early on.

The unprecedented expansion of the Internet of Things (IoT) has led to a rapidly expanding amount of generated data. Industry experts are warning that at the current rate of growth, unstructured data will inevitably become an unmanageable tsunami. Data management overload is a near-certainty.

Gartner states that information management must be a key core competency in the near future to avoid disaster. The capabilities of IT managers and others will be challenged by the new governance infrastructure -- this will also impact their tools, skills, and traditional processes.

The ability to handle data management overload is crucial.

Read more...