Netbeans 6.8 Install Problems?

December 17th, 2009

Like a lot of development companies, The Untangled Web has been eagerly awaiting the release of Netbeans 6.8. While previous versions supported PHP and some affiliated frameworks, 6.8 offers the most comprehensive integration of the Symfony Framework we are aware of in an IDE.

Installing the program on our Windows machines required a couple of steps as the installer complained over-and-over about the absence of a compatible Java runtime.

Java SE Development Kit (JDK) was not found on this computer

JDK 6 or JDK 5 is required for installing the Netbeans IDE. Make sure that the JDK is properly installed and run installer again. You can specify valid JDK location using -javahome installer argument.

This is odd, we thought, since we have been using Netbeans 6.5 happily for some time and it was running off Java 1.5. After mucking with JAVA_HOME, CLASSPATH and trying to pass the –javahome path to the installer at the command line, we found a way (Google is your friend) to force feed the Netbeans 6.8 installer.

First, extract the JAR installer from the executable:

This will dump a file into your directory called bundle.jar. The JAR file can be executed using your Java 1.5 or 1.6 installation as follows:

Your command window will begin to churn out all the verbosity that is the Netbeans installer and, within a few moments, the installer wizard will appear in all its glory:

Follow along with the usual machinations of software installation and your Netbeans IDE will run happily thereafter.

iTunes App Store and Quality Code

September 1st, 2009

I recently read an article about an angry iPhone / iPod Touch developer who wrote a harsh criticism of Apple on his blog. The developer, Joe Stump, created an application called Chess Wars that allows for chess to be played by Facebook users via these mobile devices. Sounds cool.

What’s not cool is that the software contained numerous bugs upon release. Joe admits that the defects were missed by his company: Blunder Move. He also notes that Apple did not identify the bugs during the app review process.

In response, Blunder Move submitted a patch for the chess app to fix the problems users were experiencing. Apple made the patched version available on the App store. Once again, the app contained a serious flaw. This flaw was not detected by Blunder Move or Apple before release.

A third version has been created and submitted to Apple for release. Joe is furious with Apple because this latest build has not yet been made available by Apple. He fears, perhaps correctly, that the defective program is ruining his company’s reputation and hurting future sales.

I empathize with Joe. It’s a serious bummer when, as a developer, you release software with bugs. Every seasoned developer has been there. The feeling is akin to having your guts turned inside out. You are anxious to see a patch released and ‘your baby’ fixed.

However, who is at fault for this unfortunate situation? My understanding is that the developer is responsible for the quality of the product. That the code should be thoroughly tested before release. That integration, regression and acceptance testing be performed to minimize mishaps.

Apple Computer’s role in this business relationship is to provide a distribution model, which they do quite effectively. They are to examine the app to ensure that it adheres to their policies (no porn, etc). I do not believe that they can be viewed as an extension of a company’s QA department unless they are contacted directly using the ADC support incident request:

The iPhone Developer Program includes two Technical Support Incidents where Apple engineers will provide you with code-level assistance, helpful guidance, or point you towards the appropriate technical documentation to fastrack your development process.

In regard to the initial bug fix release also containing bugs, Joe states ’shit happens’. Nonchalant but true. Vilifying Apple and shifting responsibility does not address the greater issue: releasing quality, well-tested software. And while I feel for Joe having to wait 6 weeks (so far) for the next version of Chess Wars to be queued for distribution, I’d also caution developers to be 99.999% sure that the product you release is ready for prime time.

Multiple Environment Configuration in .Net

February 22nd, 2009

You have DEV, QA, SIT, UAT and PROD environments in your shop. Each environment has its own database connection, username, password, logging, etc. settings. You could deploy a distinct config file for each environment. This introduces complexity into the build process and increases the chance of error. You could comment out sections of your configuration but the same problems exist.

In Java, it is common to use the application server’s JNDI abilities to access database connection (among other) parameters so that the app does not have to have hardcoded values. This separation allows for a more dynamic, trouble free deployment. The DEV application server has the DEV settings for your app and your app now how to ask for those settings.

To my knowledge, IIS and the .Net Framework, as an application server, do not have a defined method of handling custom variables for application’s use. So, the task to tackle was to provide a standard means by which applications can configure themselves at runtime based upon the server they are running on.

My solution was to create a DLL that can be included into a .Net application. This DLL must work with both .Net 1.x and 2.x applications for backward compatibility. One of the niceties of .Net is that since code is compiled into CLR, the DLL can be used with both VB.Net and C# programs. In addition, the library can be of benefit to web, console and winforms apps equally.

So, what does it do and how does it work? After including the DLL as a reference, in the main method of the app (or in the case of a web app, in the global.asax file) you’ll find the environment.

GetEnvironmentVariable(“RuntimeEnv”).ToString().ToUpper()

As you can see, the DLL looks for the environment variable on the Windows Server itself: RuntimeEnv=DEV for example. Based on this lookup and armed with the knowledge of where it is executing at runtime, the app can then take additional action: looking up the values we want from the config.

<code>
<configSections>
<sectionGroup name=”runtimeEnvironments”>
<section name=”DEV”        type=”DLLAssemblyName.HandlerClass, DLLAssemblyName” />
<section name=”QA”          type=”DLLAssemblyName.HandlerClass, DLLAssemblyName” />
<section name=”UAT”        type=”DLLAssemblyName.HandlerClass, DLLAssemblyName” />
<section name=”PROD”      type=”DLLAssemblyName.HandlerClass, DLLAssemblyName” />
</sectionGroup>
</configSections>
</code>

Using configuration lookup, we’ll grab the section and parameters for the environment we’re running on like these encrypted strings (to be decrypted later).

<runtimeEnvironments>
<DEV
username=”DFGfdfgf7474hfh”
password=”SDFsdfsd77#@”
server=”SDFGdsfgf89747s#$WDff”
/>
<QA
username=”DFGfdfgf7474hfh”
password=”SDFsdfsd77#@”
server=”SDFGdsfgf89747s#$WDff”
/>
<!– Etc… –>
</runtimeEnvironments>

Since we don’t know all of the key/values that a app may need, the DLL loops over them and enters them into a Hashset. We can then grab a reference to the Hashset and pull the items out by key as needed.


All works licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License. And that's a mouthful!