Tag: java

Running Weblogic 10.3 config utils in console mode, and gui mode in a Docker container

Most of Weblogic’s config utilities can run in a console/text mode if you need to run them from a terminal session in text mode, by passing the option: -mode=console

E.g. the apps here: /[middlewarehome]/wlserver_10.3/common/bin, like config.sh will run in console mode.

config_builder.sh however does not, and only runs in gui mode. This is an issue if you’re running Weblogic in a Docker container. All is not lost however, as you can forward X out of a Docker container, but it takes a few steps to get running.

Follow the steps in this logged issue to install and run socat, and then pass ‘-e DISPLAY=’ where the IP address is the address of the vbox interface.  On my Mac this looked like:

socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"


docker run -it -e DISPLAY= imageid bash

My image included xterm and dependencies installed via the Dockerfile with:

RUN yum install -y xterm

When attempting to run config.sh in gui mode however, it gave me this error:

Unable to instantiate GUI, defaulting to console mode.

This is fine for config.sh at it runs in console mode, but since config_builder.sh does not, it must run in gui mode with forwarded XWindows.

This post on ServerFault held the key – you need to also install libXtst:

yum install libXtst

Now all the utils will run in GUI mode forwarding X to your host. On Mac OS X this assumes also that you have XQuartz installed too.

Java EE App Servers – are they still relevant in a world of Docker containers?

This year at JavaOne 2015 there was a recurring theme across many of the Cloud and DevOp tech sessions that was promoting self-contained deployable Jars (not EARs or WARs) as a more efficient approach for deploying lightweight Java based services. This approach also plays well for a microservices type architecture and can also easily make use of containers, like Docker, PaaS offerings like CloudFoundry or Heroku, or even Oracle’s new Java SE Cloud Services offering.

Being able to deploy small, self-contained services (compared to large, monolithic EARs) brings a whole range of benefits, like being able to deploy more often, and deploy individual services individually without touching or impacting any of the other deployed services.

If you go a step further to consider a deployable unit as a disposable Docker container, then you have to start asking questions about whether a traditional Java EE App Server is still required, or even fits at all this this kind of deployment approach.

Oracle has a supported project on GitHub for Dockerfiles to build images running Weblogic 12c… if you try to do this you also wonder just just how practical it is to even attempt to run Docker containers that are 2GB+ in size… yes, you can do it, but are you really getting the benefits of the lightweight and lean, disposable containers at this point?

I came across this article by James Strachan, “The decline of Java application servers when using docker containers“, which is an interesting read on this topic. The more you look into Docker, containers and lightweight services, you have to question whether Java EE App Servers are losing their relevance. Or at least whether they are relevant for this approach of containerized deployments.

Are Oracle abandoning Java?

That’s an alarmist question, but recent goings on at Oracle suggest something is changing.

Today there was an eye opening story on InfoWorld about a letter from a ‘former high ranking Java official’ (maybe one of the Java Evangelist team recently laid off?), that

… the company [Oracle] was becoming a cloud company, competing with Salesforce, and “Java has no interest to them anymore.” The subject line cited “Java — planned obsolescence.”

This follows the recent layoffs in August/September of several key players on their Java evangelist team: Simon Ritter, Cameron Purdy, James Weaver, and others.

Maybe I’m scraping the barrel for facts here, but I noticed earlier this year that the java.net site hadn’t been updated with any new stories or updates since April:

And @javanetbuzz, who used to tweet Java related stories from the java.net site hasn’t tweeted since February 18th this year:

Incidentally, this might just be horribly bad timing, but both java.net and netbeans.org websites have been down today:

So have Oracle been quietly ramping down their Java related efforts this year? JavaOne is only 3 weeks away at this point – is there going to be some news or announcement from Oracle about their plans for Java, or are they just going to continue as if nothing has changed?

Updated: As I wrote this, java.net is back with this message (although this is dated from a few days back, so I’m assuming this message was already there on the site for a few days):

Wrapping up a Java2D game: custom fonts and transparent pngs

A while back (turns out it was about 8 years ago) I started working on a simple 2d game in the style of Nintendo Game and Watch LCD games that were popular in the 1980s, but I never finished it completely.

I dug up the source and committed it to GitHub in its original state, how I last left it, and then took a look at wrapping up the last few issues and adding finishing touches.

Here’s the source for the game, and here’s the source for a generic 2d game framework that I abstracted from the game as I was developing it. Here’s a couple of posts from when I was actively working on developing this, here and here.

There was a couple of bugs in the animation that I never fixed, and I wanted to polish it up a bit.

It never really had the look of an old monochrome LCD display, so I first changed the background (using a color dropper to pick a color from online photos), but then realized none of the images were transparent so it ended up looking like this:



Notice the bank on the top-left now has the first of the sprites updated to add transparency. I did this by adding an alpha layer in Gimp per simple steps here. I updated each of the image sprites to resave them as PNGs with a transparent layer.

The end result now looks like this:









The LCD segment font is from http://www.styleseven.com/. To load the custom font, use:

ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, System.class.getResourceAsStream("/fonts/digital-7.ttf")));

And then when you need to use it, create a new Font using it’s name and you can use it in place of any regular system font:

g.setFont(new Font("digital-7", Font.BOLD, 20));

Updated results for the game are here and the 2d game engine here.

Oracle lays off Java Evangelists – what’s going on?

Not sure what’s going on over at Oracle, but news on Twitter is that they just laid off (what sounds like) their entire Java Evangelist team:

Other than this article on InfoWorld there’s not much else to go on, but from various tweets from some of those involved it seems to involve Simon Ritter, Cameron Purdy, Jim Weaver and others too. That’s a lot of top Java talent. Would love to hear what’s going on at Oracle right now. Seems odd timing as well, 1 month before JavaOne?

Oracle: Google has ‘destroyed’ the future of Java on mobile devices

As a long time Java developer (since 1996) and advocate of the language and platform, the legal action from Oracle against Google and Android deeply saddens me. If anything, what Google has achieved is nothing but incredible and outstanding, as they have turned an arguably Java based/influenced platform into the most successful mobile device platform by far, something which Sun and now Oracle were never able to achieve.

Instead of crying over their lost opportunity, Oracle should be doing everything possible to partner with Google and license Android and/or adopt it as the mobile device platform for Java.

The joke that is Java ME needs to be ditched. It’s had it’s time. It was on almost all (what are now called) feature phones sold years back, but no-one apart from (some) Java developers knew this, so now even that potential success is nothing but a lost opportunity.

Please Oracle, do yourself a favor, preserve what little respect you have left from your loyal Java developers: if there’s anything being destroyed here it is our faith in you as a Company and as the guardian of Java.

Ditch Java ME, and license Android from Google as the new Java ME.

Android is what Java ME should have been from day one.

Local javac path issues on older OpenShift WildFly8.2 based project

I have an app that I created a few months back on OpenShit based on the WildFly 8.2 cartridge. Locally in Eclipse the project builds and compiles fine, but executing mvn directly or in Netbeans (which also builds using your mvn pom.xml), it fails with an error regarding a path to javac:

Failure executing javac, but could not parse the error:
/bin/sh: ${env.OPENSHIFT_WILDFLY_DIR}usr/lib/jvm/jdk1.8.0_05/bin/javac: bad substitution
1 error

This is obviously setup for building specifically in the OpenShift environment with this property defining the path to javac:


There’s a few posts and discussions about this (e.g. here and I suspect this is related), but I’m guessing the version of the pom.xml I have is older and been changed recently. I created a new OpenShift WildFly based project to compare the created pom.xml, and these two properties are no longer in the pom.xml file:


Removing them fixes my local builds, and pushing the code to OpenShift still seems to build ok too.

Happy 20th Birthday Java! What’s your Java story?

I started learning Java in 1996, from the book ‘Learn Java in 21 Days’, published by SAMS. For some reason I even still have the same book:wpid-20150521_081822.jpg

At the time I was working for Royal Sun Alliance and we were doing OS/2 client/server development using Application Manager, against a CICS/COBOL backend. One of the guys I was working with, Mike, said I should take a look at this new language called Java because it can run on any platform. At that time developing on OS/2 and seeing demand slowing for OS/2 AM developers, the promise of a development language not tied to a specific platform seemed an attractive offer, and a potential ticket to move away from OS/2.

I started working through the exercises in the book, building my first Applets – I think one of the first applets I built was a lottery ticket number generator that I had on my webpage at the time. In 1996 it was pretty cool to have interactive content on your web site! Even though this turned out to not be Java’s strong point (most Java development is arguably server side now days), it was where it all got started.

Although I continued to play with Java in my own time, it wasn’t until I changed jobs in 1997 and moved to TSW/Indus, a software house developing Enterprise Asset Manager software, that I had the opportunity to start Java development ‘on the job’. At the time the company had a Powerbuilder/Oracle PL/SQL based client/server product, and while in that first year I cross trained to Powerbuilder, we started prototypes of building a web-based replacement for the Powerbuilder client, against a Java backend. At the time this was using a ‘Java Cartridge’ on Oracle Application Server (I think it was called), and the Java code was invoked CGI-BIN style using HTTP GET query string parameters that were passed into Java code on the server.

At some point pretty soon after these first prototypes the Servlet API came along, and then EJB1.x came along… looking back which was an absolute nightmare from a developer productivity point of view. Somewhere in there I also dabbled with some CORBA based backend running on a server that I think was called IONA (although those memories are long gone now).

I’ve seen a lot of incredible changes in the Java space, and 19 years later from where I started, I’m still coding Java and it’s still going strong!

Enjoy your additional ‘leap second’ on June 30th 2015

This year on June 30th at 23:59:59 UTC, rather than the 59th second ticking to 00, there is an additional second added so clocks will tick to 60 before going to 00.

If this sounds rather odd, check out a more detailed explanation here on Wikipedia.

So what does this mean for us as software developers? Well, for Java JVMs, you can use the provided tzupdater tool (updates described here, and usage described here), download the updated timezone file and apply the update. For other platforms and operating systems, check release notes and updates from your vendors (e.g. For RHEL, check here).

Should you be worried about the impact to your systems? Well that depends on how sensitive your system is to the date/time and synchronization with other systems that you integrate with. For example, the ICE futures exchange have announced they are taking their systems down for an hour overlapping with 23:59:59 on June 30th to avoid any unexpected issues. Whether you have to go that far depends on your system.