Thursday, December 11, 2008

On Healthy Haiti

I just found out about an organic & fair trade coffee p that is donating proceeds to Partners In Health.

http://www.deansbeans.com/coffee/HAITI

On User Feedback

For those on the OpenMRS dev call this morning (11 Dec 2008), here's a look at a project using uservoice.com.

https://slimtimer.uservoice.com/pages/general?referer_type=top3

I found out about UserVoice while attending the AspirationTech conference in Oakland right before Thanksgiving. A lot of open source projects and web 2.0 sites are using it. It's a pretty cool site and might be a good way for us to solicit feedback from our users with respect to what features they want to see implemented next. It doesn't (yet) integrate with issue tracking systems (like JIRA/Trac) or ToDo sites (like Remember the Milk), but I'm not sure that would even be necessary or useful.

Let me know what you think.

Thursday, October 9, 2008

On Starting the Modern Compiler

Today (10/09/2008) I ran into a weird bug with Eclipse 3.3.x. The other day, I had to remove my internal hard-drive because I was sending the laptop in for repair. I used an external exclosure to turn the internal hard-drive into an external hard-drive and plugged it into the USB port on my personal laptop. The external drive came up as the E:\ drive. Anyway, long-story-short I was abe to use my Eclipse workspace on the external drive with my personal laptop for a few days. I had to switch some Eclipse settings (i.e. ANT HOME) in order to compile code. When I switched back to using the drive in my laptop (yesterday), I kept getting the following error message.


Buildfile: C:\Documents and Settings\Justin Miranda\My Documents\My Workspace\LogicRestModule\build.xml
init:
compile-module:
[javac] Compiling 5 source files to C:\Documents and Settings\Justin Miranda\My Documents\My Workspace\LogicRestModule\build

BUILD FAILED
C:\Documents and Settings\Justin Miranda\My Documents\My Workspace\LogicRestModule\build.xml:42: Error starting modern compiler

After playing around with the Java Compiler and Ant settings and restarting Eclipse a few times, nothing seemed to be helping. I downloaded the latest version of the code I was trying to compile and was able to successfully compile that code. But on restart, an attempt to "ant clean", then "ant package-module" caused the same error.

Then I remembered a nice little trick: Eclipse Clean. For some reason that worked.

Thursday, August 28, 2008

On running multiple instances of OpenMRS on the same server

I couldn't find a good place for this on the OpenMRS wiki, so I decided to add it here. I will add this post to the wiki once it's completed and ready to be posted.

To setup multiple instances of OpenMRS, follow this general procedure:
  1. Checkout the latest source code from Subversion
  2. Create separate instances of your database (i.e. openmrs1, openmrs2)
  3. Create separate instances of your OpenMRS runtime file (i.e openmrs1-runtime.properties)
  4. Build an instance of the WAR file
  5. Rename openmrs.war to openmrs1.war
  6. Copy the openmrs1.war to openmrs2.war
  7. Modify runtime properties to point to correct database
  8. Copy openmrs1.war, openmrs2.war to Tomcat webapps
  9. Start tomcat
If you run multiple instances of OpenMRS on a single worskstation or server, be sure to check the global properties and runtime properties files for the following issues:

[runtime] Make sure Database connection URL is pointing to the right database.
connection.url=jdbc:mysql://localhost:3306/openmrs?autoReconnect=true

[global] Make sure that the form entry global properties are distinct.
formentry.infopath_server_url=http://localhost:8080/openmrs1
formentry.queue_dir=formentry/openmrs1/queue
formentry.queue_archive_dir=formentry/openmrs1/archive/%Y/%M

In Malawi we had an issue that caused the creation of duplicate encounters for each form entry. We realized that it was due to the fact that we had multiple instances of OpenMRS running. In our scenario, the form entry queue processor was scheduled on both instances and was looking at the same queue directory. Therefore, both tasks got to the queue at the same time and processed the incoming form entry submissions. We happened to be using the same database instance for each (one was a read-only OpenMRS instance).

Tuesday, July 15, 2008

On Losing Internet (and Insanity) After a Standby

So I've got a Lenovo T60p running Windows XP. Every time I bring the laptop out of standby mode the wireless device stops working. The issue manifests itself in a "No wireless connections available" error reported from the Wireless Network Connection wizard. I'm sure this happens on other platforms, but I've only ever seen it with the Atheros wifi drivers on the Lenovo T60p (Atheros 11a/b/g/n Wireless LAN Mini-PCI Express Adapter).

Anyway, it appears to be a bug in how the driver handles power saving. I think such thoughts because by disabling the power-save mode of the driver, the issue goes away.

So how does one disable power save mode on their wifi driver.

1. Right-click My Network Places, select Properties.
2. Richt click Wireless Network Connection.
3. In the General tab, click on the Configure... button.
4. Select the Advanced tab
5. Choose Power Save Mode from the Property field.
6. Select Off for the Value.

I just upgraded to the Atheros 7.4.2.105 driver, so I'm going to need to test Standby mode again with Power Save Mode set to Maximum.

On OutOfMemoryErrors In JUnit Tests

I ran into an OutOfMemoryError while running a JUnit test in Eclipse. OutOfMemoryErrors are usually really simple to fix ... just increase the amount of memory to the JVM. This issue was a little try

So first of all, I figured JUnit would be running inside the Eclipse JVM, so I increased the memory settings in eclipse.ini to 1 Gig (from 512m).

-vmargs
-Xms1024m
-Xmx1024m
-XX:PermSize=256m
-XX:MaxPermSize=256m

I restarted Eclipse and reran the JUnit test. Same result.

I then decided to try to execute the same code in our webapp (running in Tomcat 5.5 configured with 512m of heap) and it completed successfully. This made me realize that the JUnit tests must be running in a separate JVM (either spawned or forked). The critical piece is that the JUnit JVM was not using the Eclipse memory settings from eclipse.ini. Instead, it must be using the default JVM memory settings (i.e. 64m). I searched a bit for how one might allocate more memory to a JUnit test in Eclipse and didn't find anything conclusive, so I went in and played around with the JUnit settings myself.

I started by opening up the Eclipse page that allows a user to manage JUnit configuration settings (right click a JUnit class file and select Run As > Open Run Dialog). From this dialog, click on the "Arguments" tab and paste the following settings into the "VM arguments" field:

-Xms512m
-Xmx512m

Apply the settings and Close the dialog. Rerun your test and reconfigure these settings if necessary.



Tuesday, March 4, 2008

MySQL Conference 2008 (April 14 - 17)

Fellow OpenMRS Developer, Ben Wolfe, and I will be attending the 2008 MySQL Conference in Santa Clara this April 14 - 17. If there are any OpenMRS followers out there who'd like to come by, hang out, talk, or not talk, we'll be in the DotOrg Pavillion from Monday thru Thursday, pretty much all day, every day. Looking forward to seeing you all there.

For more information, check out the O'Reilly conference website.