Coming Up for Air

Contract-First REST APIs with RAML

Yesterday, at the OKC JUG , I presented on the topic of Contract-first REST API development with RAML. This post is a rough blogification of that discussion. For those of you who were at the meeting, the preamble to the source demo (introduction, background, options discussion, etc) have been not been reproduced here.

tl;dr and play around with it.

So long, and thanks for all the fish

Jason Lee 2014-10-03

/images/2014/10/thanksforallthefish.png As so many of my friends and peers have done before me, it's time to use that admittedly overplayed Douglas Adams quote and announce my departure from Oracle.

I joined Sun Microsystems in July of 2008 as a member of the GlassFish team, working primarily on the Administration Console. Over time, I would add REST to my work load, which has been my primary responsibility for the past few years.

I've had the opportunity and honor to work with some very smart and talented people over the last six years. I've learned a lot from them, and made some great friends. While it's nothing as drastic as the destruction of the Earth to make way for an intergalactic highway, the time has come, though, to bid farewell to those friends and the job that's offered me so much opportunity and growth and move on to a new venture and more great opportunities and chances to learn and grow.

It's been a pleasure.

Can I Use Dropwizard for This?

Jason Lee 2014-08-11

I've been toying with using DropWizard as my... deployment platform for a personal project, but I need/want JAX-RS 2 and CDI, which is a problem for the the stable DW. There is a branch that is migrating to JAX-RS 2 (and Jersey 2.9), and it sort of works, but trying a simple injection is causing a failure I can't quite figure out:

Caused by: A MultiException has 1 exceptions.  They are:
1. org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at Injectee(requiredType=SayHelloService,parent=HelloWorldResource,qualifiers={}),position=-1,optional=false,self=false,unqualified=null,288169102)

    at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:74)
    at org.jvnet.hk2.internal.Utilities.justInject(Utilities.java:838)
    at org.jvnet.hk2.internal.ServiceLocatorImpl.inject(ServiceLocatorImpl.java:890)
    at org.jvnet.hk2.internal.ServiceLocatorImpl.inject(ServiceLocatorImpl.java:880)
    at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:517)
    at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:163)
    at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:323)
    at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
    at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
    at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:320)
    at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:285)
    at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:310)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:170)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:358)
    at javax.servlet.GenericServlet.init(GenericServlet.java:244)
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:540)
    ... 36 more
Caused by: org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at Injectee(requiredType=SayHelloService,parent=HelloWorldResource,qualifiers={}),position=-1,optional=false,self=false,unqualified=null,288169102)
    ... 55 more

If I create the Weld runtime and request the beans specifically, I get to good objects (instances of both A and B, with B having an injected instance of A), but once I tell DW to fire things, the app dies:

Weld weld = new Weld();
        WeldContainer container = weld.initialize();
        container.instance().select(SayHelloService.class).get();
        SayHelloService service = WeldContext.INSTANCE.getBean(SayHelloService.class);
        final HelloWorldResource resource = container.instance().select(HelloWorldResource.class).get();
        resource.setTemplate(configuration.getTemplate());
        resource.setDefaultName(configuration.getDefaultName());

        final TemplateHealthCheck healthCheck
                = new TemplateHealthCheck(configuration.getTemplate());
        environment.healthChecks().register("template", healthCheck);
        environment.jersey().register(resource);

It seems, then, my deployment environment will be, at least for now, a Java EE app server. They're small enough these days that it really shouldn't matter. I was just curious to see if DW might be viable for me, and it appears that the answer is "not yet".

I'll check back later.

LiveJournal Export

Jason lee 2014-06-24

I have a personal LiveJournal blog that I'd like to migrate to Awestruct . Unfortunately, LiveJournal's export tool is really limited, allowing the export of only one month at a time. There are tools to work around that, but the only ones I've seen require Windows, which rules me out. In typical geek fashion, then, I wrote my own tool, ljexport , a very quick-and-dirty JavaFX 8 application. All this does is export each month to its own file. Once you have the data, you're on your own. :)

Search

Quotes

Sample quote

Quote source

About

My name is Jason Lee. I am a software developer living in the middle of Oklahoma. I’ve been a professional developer since 1997, using a variety of languages, including Java, Javascript, PHP, Python, Delphi, and even a bit of C#. I currently work for Red Hat on the WildFly/EAP team, where, among other things, I maintain integrations for some MicroProfile specs, OpenTelemetry, Micrometer, Jakarta Faces, and Bean Validation. (Full resume here. LinkedIn profile)

I am the president of the Oklahoma City JUG, and an occasional speaker at the JUG and a variety of technical conferences.

On the personal side, I’m active in my church, and enjoy bass guitar, running, fishing, and a variety of martial arts. I’m also married to a beautiful woman, and have two boys, who, thankfully, look like their mother.

My Links

Publications