Tuesday, August 7, 2012

What happened when I deleted standalone/tmp/vfs/

So I was trying to clear up some disk space on one of our Liferay servers and deleted the temporary deployment files under /apps/liferay/jboss-7.0.2/standalone/tmp/vfs/. After I rm -rf'ed the crap out of that directory and started the server back up I saw that it did not want to start. Great, it's the end of the day and I've just downed a box. YAY.

boot.log spits out:

20:14:24,985 ERROR [stderr] Exception in thread "Controller Boot Thread" java.lang.RuntimeException: org.jboss.as.controller.persistence.ConfigurationPersistenceException: Failed to parse configuration
20:14:24,985 ERROR [stderr] at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:89)
20:14:24,986 ERROR [stderr] at java.lang.Thread.run(Thread.java:722)
20:14:24,987 ERROR [stderr] Caused by: org.jboss.as.controller.persistence.ConfigurationPersistenceException: Failed to parse configuration
20:14:24,987 ERROR [stderr] at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:115)
20:14:24,987 ERROR [stderr] at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:104)
20:14:24,988 ERROR [stderr] at org.jboss.as.server.ServerService.boot(ServerService.java:195)
20:14:24,988 ERROR [stderr] at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:83)
20:14:24,989 ERROR [stderr] ... 1 more
20:14:24,990 ERROR [stderr] Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
20:14:24,990 ERROR [stderr]  at [row,col {unknown-source}]: [1,0]
20:14:24,991 ERROR [stderr] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:677)
20:14:24,991 ERROR [stderr] at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2104)
20:14:24,991 ERROR [stderr] at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2010)
20:14:24,992 ERROR [stderr] at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1102)
20:14:25,003 ERROR [stderr] at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1125)
20:14:25,003 ERROR [stderr] at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:57)
20:14:25,004 ERROR [stderr] at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:107)
20:14:25,004 ERROR [stderr] ... 4 more

Since the first line is complaining about the configuration, I figured I'd take a look at standalone.xml. Wait a sec, why is it blank? Mystery solved.

Copied the latest backup config back to it's rightful location and started it up.

cp /apps/liferay/jboss-7.0.2/standalone/configuration/standalone_xml_history/<year-month-date-timestamp>/standalone.last.xml /apps/liferay/jboss-7.0.2/standalone/configuration/standalone.xml 

Success. If I can consistently reproduce this, it may be worthwhile to file a bug report.

Monday, August 6, 2012

MySQL command-line utilities on OSX

I was looking for mysql command-line utilities on my mac and couldn't seem to find them. Admittedly, I wasn't looking all that thoroughly. I had previously installed mysql-workbench from here - http://www.mysql.com/downloads/workbench/. I like the gui and everything, but it's nice to know what commands you're running when you do an export, import, show databases, etc. 

Anyway, if you're looking for the command-line utilities, cd here:

/Applications/MySQLWorkbench.app/Contents/Resources/

To help avoid repetitive stress and be more effecient (lazy), I created a couple aliases.

alias mysql='/Applications/MySQLWorkbench.app/Contents/Resources/mysql'
alias mysqldump='/Applications/MySQLWorkbench.app/Contents/Resources/mysqldump'

Hope this helps.