Monthly Archives: February 2011

5 posts

Some thoughts on software testing

If you are working as a software developer in a project based development environment you will, hopefully, encounter the day the customer wants to see the result that was promised to him. The worst thing that can happen is that after months of development you finally end up in a scenario of it is not working or it is not what we need. Sure there are numerous reasons of why this happened and what types development process you could have used. But often quality management and software development definitions are written once and never lived as described. developers consider it a burden that is unnecessary and is blocking them in their daily task of creating new functionality.

Continue reading

Access to WMI in Java using Eclipse SWT OLE integration

Today I ran into a problem which could easily solved using a short WMI query. The problem was that the query must be executed within a Java UI application. Googling for a solution I came only up with either quite some ugly workarounds (like generating a VBScript fragment, forking off the VBScript runtime and parsing the result) or some full blown COM/DCOM interfaces (like J-Integra or J-Interop). Although I really like J-Interop (we are using it for DCOM when accessing OPC server in OpenSCADA Utgard) it has some drawbacks. For J-Interop every access (even local access) is a network based access. Since J-Interop only supports DCOM it is free of any platform specific code but required the machine to be accessible using “remoting” functionality (DCOM). Since I wanted to query the WMI from a UI application and I am sure that the WMI query will stay on the Win32 version of the application I was not keen on adding “remoting” as a requirement to the UI application.

After some digging I remembered that SWT brings an OLE interface which provides direct COM access. So I started poking around and finally come up with a solution that works quite well.

For the impatient: The full source code is available from github https://github.com/ctron/wmisample and the screenshot is here.

Continue reading

Eclipse Install Issue

I just stumbled over a strange issue when installing an additional plugin into a fresh Eclipse installation:
An error occurred while collecting items to be installed
session context was:(profile=SDKProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,org.eclipse.team.cvs.ssh,3.2.100.I20090508-2000

I was unable to add any new plugin and searching Google for help was not successfull. There was an issue somewhere in the Eclipse Bugzilla that the plugin org.eclipse.team.cvs.ssh was optional and no longer installed or required. Seems that P2 thinks the somewhat required for the installation process.

ButI found one hint that deactivating the option “Contact all update sites during install to find required software” helps. And it did.

Screenshot of Eclipse Dialog

Workaround for LoadTimeWeaver issue with JBoss 6 and Spring 3

A possible workaround for the LTW issue that appeared in JBoss 6 using Spring 3 (SPR-7887) is to add an empty jboss-scanning.xml file to EAR and WAR files.

The reason to this issue as explained by one comment that JBoss pre-loads classes when scanning for annotations. Which triggers the class loader before Spring has a chance to add the AspectJ transformer to the class loader. The LTW support of Spring loads fine but after all classes are loaded.

Adding the empty jboss-scanning.xml to EAR and WAR files will skip the scanning for the modules and trigger the transformer later.

Example for jboss-scanning.xml:

[sourcecode language=”xml”]
<?xml version="1.0" encoding="UTF-8"?>

<scanning xmlns="urn:jboss:scanning:1.0">
</scanning>
[/sourcecode]

Thanks to Marius Bogoevici and Costin Leau for looking into this issue.