Wednesday, November 14, 2012

MQ on a shoestring - Connection Details

Now that the necessary software has been installed, we can continue the configuration. The next item on the list is the connection details. The MQ admin needs to provide at least five pieces of information. If your admin keeps to IBM naming conventions, the setting should look similar to the following:


The username and password is required when connecting to an AS400. There may be ways to drop this requirement but within my organisation it was mandatory for all AS400 connections.

Moving back the code, add the following references.


You should be able cut and paste this and call it with relative ease.



As you can see from the above code there is a dedicated MQException. When raised, they include an additional piece of information; the ReasonCode. The following link provides an explanation of the codes and should give you enough information to do more research.

Wednesday, November 7, 2012

Marvelution APIv2 plugin fails with java.lang.NullPointerException

One of the Jenkins plugins I installed was for Marvelution JIRA Hudson Integration. All the other plugins loaded with no issues except this one. Specifically it failed to load the hudson-apiv2-plugin-5.0.4 plugin.

31/10/2012 3:06:03 PM org.apache.wink.server.internal.servlet.RestServlet init SEVERE: null java.lang.NullPointerException at com.marvelution.hudson.plugins.apiv2.wink.HudsonWinkApplication.getClassesFromPackage(HudsonWinkApplication.java:102) at com.marvelution.hudson.plugins.apiv2.wink.HudsonWinkApplication.getClasses(HudsonWinkApplication.java:78) at org.apache.wink.server.internal.application.ApplicationProcessor.process(ApplicationProcessor.java:84) at org.apache.wink.server.internal.DeploymentConfiguration.addApplication(DeploymentConfiguration.java:339)
...

Searching on the error pointed me to a ticket on Marvelution's JIRA but had been closed without a resolution posted.

Looking through the log file I found this entry.

INFO: Loading classes from Classpath Package: file:/C:/Program%20Files%20(x86)/Jenkins/plugins/hudson-apiv2-plugin-5.0.4/WEB-INF/classes/com/marvelution/hudson/plugins/apiv2/resources

When I did the initial install of Jenkins, I clicked through the default options which put Jenkins in C:/Program Files (x86)/Jenkins This got me thinking that the RestServlet didn't like the embedded spaces. I moved my Jenkins installation to C:\Jenkins and the problem was resolved.

INFO: Loading classes from Classpath Package: file:/C:/Jenkins/plugins/hudson-apiv2-plugin-5.0.4/WEB-INF/classes/com/marvelution/hudson/plugins/apiv2/resources
31/10/2012 4:33:12 PM org.apache.wink.common.internal.registry.metadata.ProviderMetadataCollector isProvider

In one of the posts on Marvelution, the poster mentions that the plugin works on production but not on their new test installation. I suspect they clicked through the install process the same way I did on their new 64bit Windows server.

Finally, a quick note on moving Jenkins.
  1. Stop Jenkins
  2. Move Jenkins directory to new location
  3. If you're using a windows service, search the registry for Jenkins.exe and amend the paths where necessary.
  4. Restart Jenkins