Posts

Showing posts from July, 2013

Glassfish changing master password and saving it to a file

Saving the master password when creating a domain is pretty straight forward just pass the --savemasterpassword flag when executing the create-domain command ${glassfish_install}/bin/asadmin create-domain --savemasterpassword mydomain Enter admin user name [Enter to accept default "admin" / no password]> admin Enter the admin password [Enter to accept default of no password]> Enter the admin password again> Enter the master password [Enter to accept default password "changeit"]> Enter the master password again> Default port 4848 for Admin is in use. Using 55187 Default port 8080 for HTTP Instance is in use. Using 55188 Default port 7676 for JMS is in use. Using 55189 Default port 3700 for IIOP is in use. Using 55190 Default port 8181 for HTTP_SSL is in use. Using 55191 Using default port 3820 for IIOP_SSL. Using default port 3920 for IIOP_MUTUALAUTH. Default port 8686 for JMX_ADMIN is in use. Using 55192 Using default port 6666 for OSGI_SHELL. Using…

Glassfish asadmin without password

If like me you hate having to type your user/password combination every-time that you run the asadmin utility command you have 2 options Creating a password file and then using the --user --passwordfile options everytime you execute an asadmin command (ugh...)Using the asadmin login command and never think about your password againHere's how you could implement both solutions : 1.- Creating the password fileFirst you will need to create a file following the directives that can be found here AS_ADMIN_MASTERPASSWORD=mypassword AS_ADMIN_USERPASSWORD=mypassword AS_ADMIN_ALIASPASSWORD=mypassword ${glassfish_install}/glassfish/bin/asadmin --user admin --passwordfile ${glassfish_install}/glassfish-password.txt list-applications mydomain Now even though this works perfectly I find it a bit of a nag to have to write all this every-time I want to execute an asadmin command and sure I could write a bash script that wraps the underlying asadmin tool with the --user and --passwordfile opti…

Glassfish cluster ssh node. Subsystem request failed error when creating a ssh node

Recently I stumbled upon a nasty and obscure error while configuring a glassfish 3.x cluster I had all my ssh configuration properly in place with all my ssh keys between my nodes I could connect with no issues between the different machines by executing the ssh command : [user@das~]$ssh machine1.com Even when I executed the asadmin command to setup the ssh configuration on the remote server everything comes up normally : [user@das~]$ ./asadmin setup-ssh machine1.com Successfully connected to user@achine1.com using keyfile /home/user/.ssh/id_rsa SSH public key authentication is already configured for user@achine1.com Command setup-ssh executed successfully. But every-time I wanted to add a ssh node either by using the asadmin tool or the glassfish administration console I kept getting the following error message : [user@das~]$ asadmin create-node-ssh --nodehost=machine1.com node1 remote failure: Warning: some parameters appear to be invalid. SSH node not created. To force cre…

Context menu disappears in Intellij idea when right clicking and using eclipse keymap

Image
As a former user of Eclipse I switched to the Eclipse keymap (the mac version can be found here) on Intellij Idea, but there was a bug that was pretty annoying, every-time i right clicked somewhere the context menu will quickly disappear unless I moved the mouse while clicking... This was actually caused by a bug that was filled sometime ago and the workaround is pretty easy as stated in the bug page just remove the 'button3' mouse shortcut from the "show context menu" action in your IDE preferences I made the small change to the XML file and filled a pull request with the author, so if it gets accepted it should take care of the bugIn any case you can either download the xml file once the pull request gets accepted or do it yourself from your IDE preferences as explained in the bug page : Open Settings | Keymap, press Copy button to create an editable copy of the Eclipse keymap, in the copy find "Show Context Menu" action in the Other group, it has mu…

Redeploying to a remote glassfish with cargo (previous blog post follow up) - Solving the "application already registered error"

Sometimes right after you spent a whole day working on something (and blogging about it) you realize that there's actually an easier and faster way to accomplish the something.. d'oh (thank you very much brain In my previous post here I was talking about an issue that I was having while trying to redeploy different versions of my application on the same glassfish context To sum things up, the first time I deployed the application everything will work as expected but subsequent deployments will throw an error telling me that an application already exists for that context root (see message below) : Caused by: org.codehaus.cargo.util.CargoException: Deployment has failed: Action failed Deploying application to target server failed; Error occurred during deployment: Application with name myapp-1.4.8 is already registered. Either specify that redeployment must be forced, or redeploy the application. Or if this is a new deployment, pick a different name. Please see server.log …

Glassfish remote redeploy with maven and the mojo exec plugin

So a few days ago I run into a bug that took me almost a whole day to sort out.. I usually use cargo when I want to deploy an app to a running container but today I've spent several hours trying to make my app redeploy on a remote glassfish web profile server while working within my development/integration environment. Just to give you some context in this environment I needed to continually deploy the same application on the same server but with different versions. The first time I deployed the application everything will work as expected but subsequent deployments will throw an error telling me that an application already exists for that context root (see message below) : Caused by: org.codehaus.cargo.util.CargoException: Deployment has failed: Action failed Deploying application to target server failed; Error occurred during deployment: Application with name myapp-1.4.8 is already registered. Either specify that redeployment must be forced, or redeploy the application. Or if …

Enabling reading stats on kobo devices with side loaded epubs

I'm a big fan of ereaders and I've own several of them, I currently own a Kobo Aura HD and I'm really happy with it, but there was something missing, something from the Kindle world that I really liked the "time remaining" feature Kobo firmware 2.3 introduced some nice utilities, similar to what amazon brought with their Kindle Paperwhite, to enhance the reading experience, among them chapter pagination and "remaining time" for book and chapter The issue with these features is that by default they are only available for EPUBs that you bought directly from Kobo since these are actually no longer EPUBs but KEPUBs (Kobo epubs) so that they can add these new gimmicks But as usual Calibre comes to the rescue since someone has developed a plugin (which is actually an extended Kobo driver for calibre) that enables the Kobo specific stuff to side-loaded epubs You can find it here and the mobileread thread where you can get more infos regarding this pluginThe …