Archive for the ‘en’ category

OC4J Deployment: invalid archive: 6-Byte UTF8-Code not supported

5. August 2010

If you get an error message like this while deploying an EAR into the Oracle Application Server 10.1.3.4 (oc4j) …

don’t waste the time checking the ZIPencoding. Have a look at the deployment descriptors first: do they contain characters which are not supported by the chosen UTF-8? Maybe some forgotten umlauts in a comment …

Probleme mit dem Gerüstbauer

31. Juli 2010

Es ist ja doch interessant, was Gerüstbauer sich ausdenken, um die Kunden zu verar***

Wir haben unsere strassenseitige Hausfront gedämmt und uns vom Gerüstbauer Schürzeberg aus Viersen ein Gerüst aufstellen lassen. Es fehlten:

  • die abgemachte Aussockelung, damit die Verlängerung des Dachüberstands gemacht werden konnte
  • eine Leiter für den Einstieg
  • die Beleuchtung des Gerüsts
  • laut Putzer eigentlich sogar die „Boards“ – eine Absicherung gegen herunterfallene Kleinteile

Das feinmaschige Netz, was wegen der Putzarbeiten benötigt wird, kam auch erst nach telefonischer Nachfrage zwei Tage später – nachdem der Putzer zum ersten mal da war …

Aber berechnet wurde natürlich alles – inklusive einer Genehmigung der Stadt.

Mit dieser Genehmigung, die im Amtsdeutsch „Erlaubnis zur Sondernutzung des öffentlichen Strassenraumes“ heißt, hat es folgende Bewandnis: der Bauherr – also ich – muss diese bei einer Kontrolle des Ordnungsamtes vorweisen können. Hätte der Gerüstbauer diese also besorgt, hätte er sie mir aushändigen müssen. Ob er sie überhaupt eingeholt hatte …. wurde mir zumindest nicht nachgewiesen.

Glücklicherweise verfügte ich über ein zweites Angebot von Schürzeberg und konnte eine Differenz ermitteln, die ich dann zurückgehalten hatte. Dafür revangierte dieser sich, indem er ohne Rücksprache das Gerüst früher abbaute.

Aber da unser Putzer früh genug fertig war, kam uns das schon fast gelegen – hatten wir doch so früher das Teil vom Hals 😉

Links for 2010-07-20

20. Juli 2010

According to Entwickler.COM Microsoft has published a free ebook about „Cloud Computing“ by Bob Muglia.

On Wakaleo the development of an open source book about Hudson: „Continuous Integration with Hudson„. First chapters are online …

Golem.DE has found a free German video workshop about Gimp 2.6.

On DZone Hudson creator Kohsuke Kawaguchi introduced his new startup, InfraDNA, which provides support and consulting for the Hudson Continuous Integration system.

Again on DZone there is a nice introduction into HtmlUnit. It provides a Java based WebClient which you can control via its API. With this you could write JUnit tests. But more easily you could write them with the additional assert-Methods:

@Test
public void testGoogle(){
 WebClient webClient = new WebClient();
 HtmlPage currentPage = webClient.getPage("http://www.google.com/");
 assertEquals("Google", currentPage.getTitleText());
}
@Test public void htmlunitAsserts() {
 // Load a page
 webClient.getPage("http://www.google.com/search?q=htmlunit");

 // JUnit asserts and WebClient API
 assertEquals(200,currentPage.getWebResponse().getStatusCode());
 assertEquals("OK",currentPage.getWebResponse().getStatusMessage());

 // HtmlUnit asserts
 WebAssert.assertTextPresent(currentPage, "htmlunit");
 WebAssert.assertTitleContains(currentPage, "htmlunit");
 WebAssert.assertLinkPresentWithText(currentPage, "Advanced search");

 // XPath Query
 assertTrue(currentPage.getByXPath("//h3").size()>0); //result number

 // Cookies
 assertNotNull(webClient.getCookieManager().getCookie("NID"));
}

According to Entwickler.COM Microsoft has published a bunch of Powerpoint-Templates for demonstrating the new features of PPT 2010.

If you ask yourself what Darth Vader and Yoda are doing after making the movies with George Lucas, GolemDE has found the answer: they are creating TomToms next voices … 😉

If you are updating to Java 1.6_21 and having problems with Eclipse, have a look at this blog entry: it show how to tune the JVM settings …

Also if you write JPA applications you should have a good test suite. So looking at the blog „Patterns for Better Unit Testing with JPA“ is not waste of time 😉

Hudson: Overview of the suggestd timeout settings

13. Juli 2010

In my last post I explained why and how to check the timeout settings for Hudson jobs.

On our mailinglist for Hudson users at Apache there was a suggestion to get an overview of (computed) suggested timeout settings.

So here is the follow up to my earlier code …

hudsonInstance = hudson.model.Hudson.instance</pre>
allItems = hudsonInstance.items
activeJobs = allItems.findAll{job -> job.isBuildable()}
wrappableJobs = activeJobs.findAll{job -> job instanceof hudson.model.BuildableItemWithBuildWrappers}

jobsWithoutTimeout = wrappableJobs.findAll { job ->
 job.getBuildWrappersList().findAll{it instanceof hudson.plugins.build_timeout.BuildTimeoutWrapper }[0] == null
}

println "Suggested timeout values for jobs without any ($jobsWithoutTimeout.size in total):"
jobsWithoutTimeout.each { job ->
 defaultTimeout = Math.round(job.estimatedDuration * 2 / 1000 / 60)
 if (defaultTimeout < 10) defaultTimeout = 10
 String s = defaultTimeout
 s = s.padLeft(4)
 println "$s | $job.name"
}

x = ""

The new stuff is only the creation in the last few lines. Nothing special – apart from the conversion from Long to String for getting padLeft() work 😉

The result is a „table“ like this:

Suggestion of Timeout values per Job

How to check if all Hudson jobs have a timeout?

11. Juli 2010

At Apaches Hudson installation I have sometimes seen the situation where too many builds are stuck and therefore blocking the executors. And sadly for me – the executors my own jobs require …

Having a policy to use the „build timeout plugin“ and kill jobs which are running too long (thinking more of „not running any more“ 😉 is good. But having a program which checks this is better …

So I tried a little bit Groovy’in for the Groovy console:

hudsonInstance = hudson.model.Hudson.instance
allItems = hudsonInstance.items
activeJobs = allItems.findAll{job -> job.isBuildable()}
wrappableJobs = activeJobs.findAll{job -> job instanceof hudson.model.BuildableItemWithBuildWrappers}

jobsWithoutTimeout = wrappableJobs.findAll { job ->
 job.getBuildWrappersList().findAll{it instanceof hudson.plugins.build_timeout.BuildTimeoutWrapper }[0] == null
}

println "There are $jobsWithoutTimeout.size jobs without timeout:"
jobsWithoutTimeout.each { println "- $it.name" }

x = ""

In line 1 we get the reference to the Hudson singleton. Then we get the list of all item in line 2 which we filter in line 3 to get only buildable items, like our jobs. The line 4 contains the first thing special to this requirement: the item must be able to have a BuildWrapper.

But the most thing is done in line 5 which filters again with a closure: get all BuildWrappers for the job, but only if it is our TimeOut-Plugin. Because it can be registered only once, I check the first element of that list. It must be null for being a problem. Otherwise the job has a timeout setting.

After that, the last two lines are simply out … and the last line supresses the result output in the console.

Update:

Antoine Tulme had consulted Kohsuke Kawaguchi and he sees three possibilities of forcing the timeout setting:

  1. We cannot make the timeout field mandatory.
  2. We can create a plugin that presets the timeout field.
  3. We can iterate over the projects and set a value for the timeouts en masse.

Good, so I evaluate my „iteration solution“ a little more.

We have a list of all jobs without settings and so we only have to iterate over this list, instantiate and initialize the BuildTimeoutWrapper and add it to the jobs wrapper-list:

jobsWithoutTimeout.each { job ->
 defaultTimeout = 180
 defaultFailBuild = false
 plugin = new hudson.plugins.build_timeout.BuildTimeoutWrapper(defaultTimeout, defaultFailBuild)
 job.getBuildWrappersList().add(plugin)
}

BTW – If you want to work with a plugin, you could start with the Create Job Advances Plugin – maybe this requires code enhancement … and it will only for future jobs, not for existing one.

Update:

The last update of the script for setting the timeout value is this:


hudsonInstance = hudson.model.Hudson.instance
allItems = hudsonInstance.items
activeJobs = allItems.findAll{job -> job.isBuildable()}
defaultFailBuild = true

println "Cur   |  Est  | Name"
activeJobs.each { job ->
 // Get the Timeout-PlugIn
 wrapper = job.getBuildWrappersList().findAll{it instanceof hudson.plugins.build_timeout.BuildTimeoutWrapper }[0]

 // Get the current Timeout, if any
 currentTimeout = (wrapper != null) ? wrapper.timeoutMinutes : ""

 // Calculate a new timeout with a min-value
 defaultTimeout = Math.round(job.estimatedDuration * 2 / 1000 / 60)
 if (defaultTimeout < 10) defaultTimeout = 10

 // Update the timeout, maybe requires instantiation
 action = (wrapper != null) ? "updated" : "established"
 if (wrapper == null) {
 plugin = new hudson.plugins.build_timeout.BuildTimeoutWrapper(defaultTimeout, defaultFailBuild)
 job.getBuildWrappersList().add(plugin)
 } else {
 wrapper.timeoutMinutes = defaultTimeout
 }

 // String preparation for table output
 String defaultTimeoutStr = defaultTimeout
 defaultTimeoutStr = defaultTimeoutStr.padLeft(5)
 String currentTimeoutStr = currentTimeout
 currentTimeoutStr = currentTimeoutStr.padLeft(5)
 String jobname = job.name.padRight(40)

 // Table output
 println "$currentTimeoutStr | $defaultTimeoutStr | $jobname | $action "
}

x = ""

This updates all timeout settings and reports this like here:

Report of Timout-Setter

Ant: 2nd article

9. April 2010

My 2nd (German) article about Ant is online. Here I write about subprojects and sandbox experiments like Ivy, props, autoconf, parallel executor, …

Ant Article online

24. März 2010

After a long time of not-writing I have finished my (German) article about Ant 1.8.0. It is now published on JaxCenter: Der ANTwickler – Das neue Majorrelease

Musical production has finished

30. Januar 2010

Some years ago a friend of mine – Richard – has written a musical (with his cousin). I joined with my trumpet and wrote the brass parts. Then sadly the project stopped …

But Richard has restarted the project and could produce the musical on CD (without brass 😦 ). But a demo is on youtube:

Concerts of my ensemble

25. November 2009

My brass tentett Niederrhein Brass gives its yearly christmas concerts on GoogleMaps: concert location and GoogleMaps: concert location – both at 17:00 (5pm). If you are interested in – you are welcome. Entry is free of charge (but a donation at the end is welcome 😉

nrb_flyer_weihnacht_s1 nrb_flyer_weihnacht_s2

Ant: Use optional dependencies in JavaDoc

19. November 2009

If you create your Javadocs you sometimes get unresolved reference warnings: package xy does not exist or cannot find symbol

If you define the path with these dependencies outside of the target you could reference that path using the classpathref attribute.

But if the path definition is done in an other target and you don’t want to have a dependency on that (e.g. many dependencies are downloaded there, e.g. using Ivy), using the classpathref would throw a BuildException because the path is not defined: Reference my-path.reference not found.

You could do a little hack: use a classpath attribute and use a special PropertyEvaluator for using that path: classpathref=“${toString:my-path.reference}“. If your defining target is executed before, the toString: resolves that into a usable path-string. If the target is not executed before, the resulting string toString:my-path.reference is just ignored by the javadoc task.