Tag Archives: jenkins

Find a class inside all jars

When having class path issues caused by an old version of a library in your class path, it might be convenient to find all the jars provided this class to figure out what component is loading the old version. So here is a command to do this:

for f in `find /home/jenkins -name '*.jar' -print -exec echo {} \;`; do echo "$f: "; unzip -l $f | grep 'javax.ws.rs.core.MultivaluedMap'; done

Deploy Jenkins on WebSphere 8.5

I’ve been struggling for a short time to deploy Jenkins on IBM WebSphere Application Server 8.5, so here is a few tips.

First, Jenkins needs Java EE 7 or newer, it won’t work on Java EE 6. The official help is located here.

The main step is to configure the class loader to load the parent last, for the module and the application.

Applications > WebSphere enterprise applications > application_name > Class loading and update detection > Classes loaded with local class loader first (parent last)
and
Applications > WebSphere enterprise applications > application_name > Manage modules > Jenkins v1.xxx > Classes loaded with local class loader first (parent last)

What the documentation does not say, is that there is a conflict with WAS 8.5 because Jenkins tries to configure the JSESSION cookie for the path /. Basically you will get the following error message:

Could not invoke an operation on object: WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=P8Node01,version=8.5.0.0,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=P8Node01Cell,spec=1.0 because of an mbean exception: com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: SRVE8111E: The application, jenkins_war, is trying to modify a cookie which matches a pattern in the restricted programmatic session cookies list [domain=*, name=JSESSIONID, path=/].

To fix this, you can change the name of the cookie
Applications > WebSphere enterprise applications > application_name > Session management > Tick Override session management > Click Enable Cookies > Change cookie name JSESSIONID

You should also be able to remove the restriction in Global Security > Programmatic session cookie configuration but I haven’t tried that way.

Automated delivery of an ICN plug-in for continuous delivery

Agile is in vogue. Chances are good that your boss asked you to set up a build server to build your plug-ins and deliver them. At some point you’ll ask yourself, how do I automatically refresh the plugin on my environment, meaning without going to the ICN desktop and click the load button.

Here are 4 options, there might be more of course:

  1. Copy the jar and restart the whole web server (all of then if cluster). This reloads the plug-ins from their jars but that’s not conceivable for a production platform.
  2. Copy the jar and restart the ICN application on the web server. This also reloads the plug-ins. It’s better but still not conceivable for a production environment, we don;t want any interruption.
  3. Use Selenium and write a procedure to open the admin desktop, go to your plug-in, click the Load button and save. This is actually good, there is no interruption, just a bit boring to write and not easy to integrate to a build server (requires Selenium, running the browser…).
  4. Fake the behavior of going to the admin desktop and clicking load by calling the ICN rest api. This is what I’m going to develop here.

How does it work, the basics

Continue reading