How to Install Glassfish

Glassfish is a Java Library for creating Java Message Queues. Regular readers my be surprised to know I am also a Java coder since I usually talk about Python and C++, but just as I occasionally speak Italian, I am multilingual. In this case, though, this is all about Java.

Unfortunately, despite what it’s billed to be, Glassfish 5 isn’t as turn-key an application as it appears to be and therefore I wanted to fill in the gaps for would be message queuers—whatever the word is—who may be struggling.

First, let’s download Glassfish: https://javaee.github.io/glassfish/download

When you check out the readme file, you’ll see the following text:

2. Starting GlassFish
=====================
The 'asadmin' command-line utility is used to control and manage GlassFish (start, stop, configure, deploy applications, etc).

To start GlassFish, just go in the directory where GlassFish is located and type:
        On Unix: glassfish5/glassfish/bin asadmin start-domain
        On Windows: glassfish5\glassfish\bin asadmin start-domain

After a few seconds, GlassFish will be up and ready to accept requests. The default 'domain1' domain is configured to listen on port 8080. In your browser, go to http://localhost:8080 to see the default landing page.

To manage GlassFish, just go to web administration console: http://localhost:4848

The GlassFish README.txt file.

That’s all well and good, but, if you’ve never used Glassfish before, when you follow those steps, you’ll see the following cryptic error:

Exception in thread “main” java.lang.NullPointerException: Cannot invoke “org.glassfish.hk2.api.DynamicConfigurationService.createDynamicConfiguration()” because “dcs” is null
      at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.initializeServiceLocator(AbstractModulesRegistryImpl.java:152)
      at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.newServiceLocator(AbstractModulesRegistryImpl.java:144)
      at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:218)
      at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:224)
      at com.sun.enterprise.module.single.StaticModulesRegistry.createServiceLocator(StaticModulesRegistry.java:88)
      at com.sun.enterprise.admin.cli.CLIContainer.getServiceLocator(CLIContainer.java:217)
      at com.sun.enterprise.admin.cli.CLIContainer.getLocalCommand(CLIContainer.java:255)
      at com.sun.enterprise.admin.cli.CLICommand.getCommand(CLICommand.java:231)
      at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:371)
      at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:306)
      at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:57)

$ glassfish5/glassfish/bin/asadmin start-domain

Clearly, Glashfish is not a turn-key installation.

From here, it was up to me. Google was no help. "dcs" is null as a search term was too generic and including the full, topmost error only gave a page with sample Java code, not how to actually start the server.

To the best of my ability, I believe the error is related to the DynamicConfigurationService object—that’s what dcs stands for.

Looking through the QuickStart document I thought maybe it’s because I didn’t install to my home directory, ~, but moving it there produced the same results.

The next thing to try is to downgrade to Java 8. I’m not fond of Java 8 as it was one of the last Java versions to be 32-bit—which is incompatible with MacOS Catalina—but fortunately, Oracle provides a 64-bit, Catalina-compatible version.

Once Java 8 was installed, I just needed to tell my terminal to use that version instead of the default one. First, I needed to get the location for Java 8 in the list of installed Java VMs:

$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
    15, x86_64:         "OpenJDK 15" /Users/username/Library/Java/JavaVirtualMachines/openjdk-15/Contents/Home
    13.0.4, x86_64:     "Zulu 13.33.25" /Users/username/Library/Java/JavaVirtualMachines/azul-13.0.4/Contents/Home
    1.8.0_261, x86_64:  "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home

/Users/username/Library/Java/JavaVirtualMachines/openjdk-15/Contents/Home
$

What Java VMs are available?

Finally, I had to set the local Terminal to use the Java 8 VM:

$ export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_261`
$

Set the Java VM to Java 8.

Success!

$ glassfish5/glassfish/bin/asadmin start-domain
Waiting for domain1 to start ......
Successfully started the domain : domain1
domain  Location: /Users/username/glassfish5/glassfish/domains/domain1
Log File: /Users/username/glassfish5/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.
$

Starting Glassfish!

I hope that helps and I am so happy with my new job!

My Statement to the Virginia DMME

Today is the last day you can leave comments for the Virginia Department of Mines, Minerals, and Energy with respect to an electric car rebate for both new and used Electric Vehicles. If you do wish to leave comments, please try to watch the video attached to the comments form.

For the record, here is my testimony:

Thank you Delegate Reid for proposing HB717. I am sorry it’s taken so long for me to add my testimony but what I want to say is to add, as I said in my committee testimony, that providing Rebates on new and used Electric Cars has long-term CO₂ benefits. Considering first when someone is interested in buying their first vehicle. If we put a rebate on that first vehicle, new or used, then the buyer will be more inclined to stick with electric for the second, third, and fourth car. What’s more, it makes her family more likely to continue the tradition of an electric car family.

Secondly, some of the most polluting vehicles in our Commonwealth are owned by those Virginians of lesser means. The problem for them is that electric cars are too expensive, even used electrics. We need a rebate that puts the $5,000 LEAF into the hands of those folks who now drive the most polluting ICE vehicles of all. This would give us the biggest bang for the buck. They are also usually the least fuel efficient vehicles, and thus moving them to use fuel generated right here in the Commonwealth would greatly reduce our local fuel imports.

That is why we need a rebate of the maximum amount for both the cheapest of vehicles and for first time car buyers.

This is also why it must be a Rebate at the dealership. It shouldn’t be like Maryland where the application is submitted and the buyer has to wait for money allocated in the General Fund. The Virginia bill should be based on a fuel tax, in this case, I think a tax should be passed on all coal and natural gas (CH₄, methane) plants which generate power for the electric car. That would have the dual benefit of pushing Dominion to move more of its generation to renewable. Since electric cars will be generating more revenue for the Power Utilities, using a tax on Dominion to pay for more revenue for Dominion seems very apropos. What’s more, this will get us out of the trap of waiting for more money from the General Fund when many used vehicle drivers can’t afford to wait that long. Indeed, ideally, if the dealership could apply the rebate and then file it with the Commonwealth to be reimbursed, then this would be idea for first time electric car buyers. If that can’t be done, having the dealership file the paperwork and send the check to the buyer would be acceptable.

Beyond that, please consider not the MSRP of a vehicle when setting the cap on the Rebate, but rather the value used to generate property tax. None of the feature add-ons like Tesla Autopilot should put a vehicle outside of the price cap. AutoPilot is a feature that makes electric cars safer, and pricing it out of the rebate could result in fewer cars with that feature and thus less safe vehicles.

I think the Maryland cap of $60,000 is good for Virginia as we are similar states. I would also accept $50,000, which is still available to the base model Tesla if Autopilot is ignored. But the top of the cap should be graded, such that, if the cap is $50,000, a $49,000 vehicle gets a maximum of $1,000, a $48,000 gets $2,000 max, until the price goes down to a point where the full cap can be realized. That would alleviate any shock by the price going up astronomically at $50,001.

As for how to scale the rebate, I would like our goal to be based on the total number of vehicle registrations in the Commonwealth. Ideally, we should target total registrations, like 1% of all vehicles registered in Virginia be the goal for full funding, and 2% of all registrations be 66% of the rebate, and 3% of all registrations grant 33% of the rebate. I don’t think those are necessarily the best drawdown numbers, but I think the drawdown should be in those terms.

Finally, as I said, first and cheapest cars should get the biggest rebate, regardless. But for vehicles not in those categories, that still fall under the price caps, I’d like a sliding scale based on the battery pack size. Any battery rated at least 10kWh or more would qualify for the full rebate, but each kWh less removes 10% from the rebate. Thus, a 5kWh battery gets 50% of the rebate.

Thank you for reading my comments and I look forward to the final report.

Testimony by Jeffrey C. Jacobs to the Virginia DMME

I’m quite fond of the sliding scales in terms of tapering rather than full cutoff for the rebate and the reduced payout for smaller electric car batteries. I didn’t mention the poverty rate and left it vague in those terms, letting others fill in those details. I also spelled Delegate Reid’s name incorrectly, though it is fixed here.

The DMME plans to have its final report ready around October so it’ll be interesting if they incorporate any of my ideas into the final bill. I wish I could have attended the original public session but the news got to me too late. This is all I could do.

I miss cruising upon a cloud these days, but I hope this passes so more can enjoy the pleasure!

Jeffrey’s Jammin Birthday Bash

Join me to find out how I like my new job, the exciting plans I have for the upcoming year, and so I can give a personal thanks for your personal friendship!

Please note, the official start time is 20:00 because I want to make sure not to start it before I finish my first full day of work at the new job. If I finish sooner, I will open the room earlier. This is, after all, an exciting time for me. My first new job in 18 years, and the first of four steps on the route to make me a better man, and much, much happier!

This event is opened to everyone who claims to know me! All of my software colleagues, all of my fellow authors, fellow science readers, fellow Doctor Who fans, fellow cosplayers, fellow Electric Car drivers and enthusiasts, all of my Equal Rights Amendment sisters and brothers in arms, all of my National Popular Vote Interstate Compact supporters, all of my avid gaming friends, all of my friends abroad except those in Europe—have your kip, mates—all of my fellow Toastmasters, all of my fellow aviators, all of my fellow musicians, tous mes amis qui parle français oder Deutsch или по-русский o italiano, my acting friends and my friends who eschew meat!

The only thing I ask is you be respectful, kind, and know that I hope you all consider any friend of mine a potential friend of yours!

There is a password to this event. It’s not hard to guess if you know me but if you want to know, and you are reading this on from Twitter, message me, on Tumblr, message me, on LinkedIn, again, message me, or join me via the Facebook event. Or, just comment on this blog, with your email address, and I will mail it to you.

See you all next Wednesday!

Meeting does not exist: 83969414860.

18 Years and thanks for all the Fleets

Today I tendered my official resignation with the Naval Research Laboratory. I worked at the Laboratory for 18 years, under three Presidents and many Congresses. In that time, I pushed for at work EV Charging in the FAST Act, I started the NRL EV Group (link accessible within NRL), I sang with Polly and the Saccharides (no link available), and I even gave some Toastmasters speeches (NRL Link).

I very much enjoyed my time there and really am sad to go but I have been having so many problems paying for #CO2Fre and its maintenance that I have no choice but to accept a new job in the private sector. My only other solace—besides finally getting to write code again—is that I can finally use a part of my McGill degree that I’ve not been able to exercise beyond writing fiction.

Thus, it’s not so much an end, but a new beginning. And who knows what the future may bring! After all, I would like to return to Federal Service on day and accrue at least two more years to get my FERS to 1.1%. The only thing for sure is I’m a lot less available as a coder now.

Tesla OS 2020.16.2.1

Finally!

TeslaFi had been spamming me with news about TeslaOS 2020.16 for a while and I’ve been itching to see what, after giving us the amazing stop at a stop sign in the last minor update.

Turns out, not much. I am mostly unimpressed by Tesla with this update, though nonetheless very appreciative. Autoformatting a DashCam drive—I wonder if it supports 2TB yet—and a better layout for Easter Eggs are, after all, improvements, even if the Easter Eggs aren’t really hidden gems anymore.

The coolest new feature, though, is the new SuperCharger filter, allowing the driver to only see Version 3 stations and filter out all the slower ones. I love the fact that I have free, lifetime SuperCharging, and one of these days, I’m gonna cross the continents with that perk.

Overall, I’m not disappointed despite being underwhelmed. And one rumor is that this, or a soon to be released version will add V2G to the Tesla. I can’t wait until that rolls out as the Tesla Battery Pack may make for a new, mobile Powerwall. Mind you, even if #CO2Fre could do V2G, my house isn’t equipped for it anyway. So, even if it doesn’t have V2G, it’s still a cool update!

Tesla OS 2020.16.2.1
Tesla OS 2020.16.2.1 adds a new toy box interface, a SuperCharger filter, and auto-formatting of DashCam media. © 2020, Jeffrey C. Jacobs

Gentle reader, if you have been keeping up with me since 11 February of this year, you know that I have been posting once a day since then. As such, today marks a hundred days of a hundred daily posting. Through that, I’ve shared with you exciting electric car news, updated to the National Popular Vote Interstate Compact, my struggles to get the Equal Rights Amendment to be our Twenty-Eighth Amendment to the Constitution, written about my many works of fiction, and the many books of nonfiction I voraciously read to be a better scientist. I’ve shared with you my cosplay adventures, and my love of Doctor Who, my love of games, and a bit of my speaking in tongues as well as delivering speeches and singing to my heart’s content. I’ve talked about international travel and how I love to fly there in my own plane, discussed my acting and my dietary needs. And most of all I’ve told you I’m an excellent coder who is always keen for new work. Thanks for riding with me as we cruise upon the cloud to another one hundred posts!

Tired of Midnight Blue

The sun went down the sky. Way up high, the clouds told me that they knew.

Harrison, George, “Tired of Midnight Blue”, Extra Texture: Read All About It, 1975 LP.

Today was one of those days that could have gone better, but with so many people asking for interviews, it was hard to focus on my TED Talk for an interview. I had anticipated how difficult it would be to give an extemporaneous speech with so little time to plan it, but so be it. I tried to keep the entire morning free, but one interview moved from Wednesday to Tuesday, squeezing me ever further.

In the end, I failed, and I accept that. I don’t know what turned my interviewers off, but I have other job opportunities I’ve just this evening so I’m just going to move on and forget about all the effort I put into that position. After all, I did just sign two memo to accept a pending offer so it’s not like I have nothing to fall back on. And, who knows, maybe they wouldn’t offer me enough money anyway.

I’m just tired. Tired of sleepless nights, of midnight blue. And as I love that obscure George Harrison song, from the obscure solo album Extra Texture: Read All About It, I could think of no more appropriate way to express my mood. The song is deep and sorrowful, steeped with lament to a almost jazzy-blues beat.

The sun came into view. As I sat with the tears in my eyes.

Harrison, George, “Tired of Midnight Blue”, Extra Texture: Read All About It, 1975 LP.

Tomorrow will be a new day, and who knows what it will bring. Sometimes, I think about the pain the Hypochondriac causes me. The hours I had to spend, insult after insult, belittlement and cruel advice. How I long to be with someone who appreciated me and all I try to do. Because, in the end, I’m Tired of Midnight Blue.

Extra Texture: Read All About It
Extra Texture: Read All About It, the 1975 Solo Album by George Harrison

Thanks for reading and next time won’t you sing along with me?

I’m Running Late Setback: Can’t Send Texts in the Background

Originally, I wanted to implement an texting in the background for the I’m Running Late iOS app. After all, the whole idea of the app is that you may be stuck in traffic and not really in any position to send the I’m Running Late while you’re driving or otherwise indisposed in transit. If you in the car, for instance, sending that text, even if it just means clicking the Send Button, is dangerous. It totally defeats the purpose.

The idea of I’m Running Late is it’s a background process like cron for the iPhone. It just programs events based on the clock and your calendar, then, when the grace period begins, if your Sat Nav notices you’re not within a prescribed number of meters from your event location, it automatically informs the host—or your boss—that you’re running late.

How is this not a thing?

It’s not a thing because Apple‘s philosophy is, if you can send one text without consent, you will be able to spam infinite texts without consent. But, the thing is, the App Review team should be able to detect of an app was abusing the option to text without consent, so why prevent this safety feature when you could just stop it from being abused?

For the record, texting without consent is a safety feature. When you’re driving to an Event, it’s dangerous to have to look at your phone and hit a consent button. Forcing the user to do so may even violate some state laws. Yet, you want to send the text because you are running late, yet you can’t because you’re stuck in traffic.

Sadly, you need a user interaction to send an email too.

With both options stupidly closed by Apple, making this very important use case at first impossible to solve, the only option left is to send the text via a GET Query, for example, to a web service, and rely on the web service to send the text.

One such service is Twilio. Twilio seems to be the leader in Web to SMS transactions. Unfortunately, as far as I can tell, Twilio is a paid service and I’m still trying to figure out how this service works. I created an account and want to test it, but if all users of I’m Running Late are going to be using the service, I’m sure I will have to set it up as a business account.

One possibility I’m considering is having a monthly fee to use I’m Running Late, that I can use to pay Twilio for the use of their service. However, I want the fee to be small, like 15¢ per user per month. And then, say if Twilio costs $15 per month for one hundred users, then one hundred I’m Running Late users would completely cover the cost and I won’t need to let TimeHorse, LLC go further into debt.

The question is, though, what if I have less than one hundred users. In that case, I may have to disable the service or come up with some poor-man version on this very server. Initially, all text message requests could come here, and when the numbers crack one hundred, I can tell I’m Running Late to switch to the Twilio server.

On the other hand, maybe I’m going about this all wrong. IIRC, all Teslas are running Linux. And if the Tesla is connected to the driver’s Phone, and it knows the time, and it has the Phone’s calendar, then surely it could have an app that texts the Event organizer when the driver is running late.

And I could write that code!

Hear that Tesla? You could be bidding on me, because I’m still available for hire but my rates are going up with all the offers!

When Zoom Fails, Google Meet to the rescue

This morning, I had set up The Hourlings on Zoom early, before I went to bed, hoping, if I ran late, the meetup would already be set up, Marty would be early, and I could make him co-host in case I still needed time to read before we began at 10:00.

Instead, to my delight, my friend Cynthia was the first to log in around 09:30 and we had a few minutes to chat about life and her adorable Clove. I really admire Cynthia, or Max as she’s sometimes called. She writes some great LGBTQ literature and is a great guide of conscious for me. She’s also an ex-Marine. Sempre Fi, my friend!

Unfortunately, we couldn’t get her video working, so, thinking that it would be as simple as restarting the meeting, I did just that. She promptly requested to rejoin and I accepted, looking forward to continuing our conversation.

It failed.

We tried again. No dice. I created a new Zoom event. That didn’t work. I asked the account owner to try. Still no success. It was already 10:00 and almost everyone was waiting to get in. I accepted them all, but none of them could connect.

Finally, our unofficial moderator, Evan Friedman brought up an instance of Microsoft Teams. He, Marty, and I verified its feasibility a while ago, so I knew it could work and joined the Teams meeting. The nice thing is now Teams allows virtual backgrounds, which was cool. But, unfortunately, Teams was as wickedly hard to invite people into as before.

Meanwhile, Marty set up a Google Meet account. Back when we tried Google Meet before when I created a Google Apps account. Back then, you had to pay for a Google Meet account by having a Google Apps account, and the Google Meet didn’t have a grid view, however, it already accommodated a lot of people.

In the end, we went with Google Meet and decided to make that Meet event out official backup for whenever Zoom misbehaves again, though we shall still default to Zoom. Unfortunately, my nightmare hair isn’t hidden by Google Meet’s cameras like it is in Zoom, so I must have looked atrocious today. I wish the Hypochondriac would let me use my hair trimmer.

Google Meet
Google Meet

We found out during the meeting that we weren’t the only ones straining for Zoom capacity. Fortunately, there is a Zoom Status we can check the next time this happens, so we’re not left trying so hard to beat a dead TimeHorse. And the Zoom system was back up, just in time for us to finish our meeting.

Unfortunately, because of all the kerfuffle and notifications, I missed a 13:30 Zoom I was planning to attend. But at least I got to hang out with my fellow writers. Thank you for reading, and I should now get back to writing.

An Unearthly Child

I’ve been so crazy-busy on I’m Running Late today that my computer locked up and I was bored so I decided to watch some Doctor Who, which is what everyone should do when they’re waiting for a computer to behave.

I could have continued on with The Mutants, but I was feeling nostalgic to see again how it all began and see the source of my first cosplay, Ian Chesterton. I love Ian because he’s a Science Teacher and that suits me as a Scientist who runs The Science Book Club. Plus, I was enthralled by my very dear friend Ilona, who cosplays a simply smashing Susan! I must admit, I’ve been thinking about Ilona a lot recently so I guess it’s no coincidence I pulled up the first Doctor Who story ever, which of course features Ian and Susan.

Of course, Ian was always fond of Barbara and we’ve had a lot of trouble finding a Barbara cosplayer but I’m always happy to have find someone cosplaying The First Doctor for photoshoots. But usually it’s just me and Ilona and I have always felt we make a great team. That’s why she’s my cosplay bestie.

Meanwhile, not much actually happens in the story. A student is acting queer, the teachers investigate, and the Doctor kidnaps them. Not much more to say to that. Or maybe I was just too busy reciting the lines with the actors, I’ve seen the episode so often. Overall, a fun story, with light bits and campy students. I always enjoy that one and will watch it again… and again… and again…

Susan with Radio
“It’s John Smith and the Commonmen, they’ve gone from nineteen to two.” Susan is enjoying some tunes on her transistor radio. From An Unearthly Child © 1963, British Broadcasting Corporation

Will you watch Doctor Who with me?