Saturday 11 December 2010

Compact Columns Hudson plugin

I just discovered the "Compact Columns plugin" for Hudson. It is much nicer to read than the standard layout, so this is my new default.

Monday 1 November 2010

Annoying problem with JAX-WS webservice

In order to monitor the connectivity of a webservice I have coded some junit tests which uses a JAX-WS soap client. These tests are fired of using Maven

Most of the time they work great but occasionally I get the following exception

java.lang.AssertionError: the tube must call the add(...) method to register itself before start copying other pipes,but weblogic.wsee.jaxws.tubeline.FlowControlTube$FlowControlAwareTube@834ed06 hasn't done so
at com.sun.xml.ws.api.pipe.TubeCloner.copy(TubeCloner.java:104)
at weblogic.wsee.jaxws.tubeline.FlowControlTube.<init>(FlowControlTube.java:31)
at weblogic.wsee.jaxws.tubeline.FlowControlTube.copy(FlowControlTube.java:50)
at weblogic.wsee.jaxws.tubeline.FlowControlTube.copy(FlowControlTube.java:13)
at com.sun.xml.ws.api.pipe.TubeCloner.copy(TubeCloner.java:102)
at com.sun.xml.ws.api.pipe.TubeCloner.clone(TubeCloner.java:74)
at com.sun.xml.ws.util.Pool$TubePool.create(Pool.java:170)
at com.sun.xml.ws.util.Pool$TubePool.create(Pool.java:161)
at com.sun.xml.ws.util.Pool.take(Pool.java:78)
at com.sun.xml.ws.client.Stub.process(Stub.java:245)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:135)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)


I don't know why we get that sometimes, but I have managed to hide the problem. The trick is to know that Maven surefire plugin enables assertions per default. In order to disable this particular assertion I configured the following in Maven POM

<plugin>
<groupId > org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-da:com.sun.xml.ws.api.pipe.TubeCloner</argLine>
</configuration>
</plugin>

Monday 13 September 2010

JavaZone 2010 summary

Last week I attended JavaZone 2010 in Oslo, and this is a brief summary of my experiences. I hope to write in more details about the individual sessions later.

At the conference there was almost all the time 7 parallel tracks, so while I saw 15 sessions I still missed a lot. This is almost always a problem with such conferences but the JavaZone people has prepared for it, all talks was filmed and the videos will hopefully be available online soon.

The logistics around the conference was very good, everything went very smooth even the food service :-) .While the conference did provide both food and soda for both lunch and diner, it would have been nice if there had been a place where one could buy more

The flow between the sessions was well planed, although as it is with all such conferences  it is difficult to really visit the exhibition floor without missing a session. The sessions was generally of high quality and I certainly got something out of all of them.

The exhibition floor was in my opinion the weak spot of the conference at least for me. Yes the major companies like IBM, Oracle etc. was represented but there was also a big group of Norwegian consultant companies looking both to promote and hire people. For the majority of the attendants they are very relevant but for a foreigner like me it sometimes felt a little to "local".

The Good:
* Planning and logistics
* High quality sessions and speakers
* The overflow room where one could sit and switch between the talks.

The bad:
* Sometimes felt a little "local" on the exhibition floor
* One or two talk held in Norwegian. While I as a danish person could understand it,I think all sessions should be held in English.


All in all I would go again next year if I get the opportunity, and I am looking forward to the videos coming online so I can see all the sessions I missed.

Sunday 25 July 2010

jax-ws maven plugin and wsdlLocation problem

I am using wsimport of jax-ws maven plugin in order to build my webservices, but I have run into a minor problem with the plugin.

The plugin has two ways of configuring how to find the wsdl files, either using the tag to point out the files or to point out the target namespaces using a catalog file to map to wsdl files. The approach chosen has an influence on what is generated as the "wsdlLocation" in the service class' webservice annotation.

If I use the and tags the calculated full path ends up in the annotation. This doesn't work for me because at runtime this full path is used to find the wsdl and it doesn't exist at that location on that machine. The jax-ws-catalog file is no help here as it normally contains the target namespace as key. 

I could put a full path in the catalog file, but I would need to keep maintaining that  depending on where the build server is building the project which is not very good.

If I on the other hand use the the target namespace goes into the annotation. This works at runtime because the jax-ws catalog matches the namespace to a relative path inside the jar file.

The problem with using is that the maven plugin is not smart enough to know if it should regenerate the classes because of the extra layer of redirection. The result is the classes are allways regenerated. 

I have created a issue on the topic: classes always regenerated when using wsdlUrls (#58)

I have not tested just placing the wsdl files in the default directory and letting the plugin auto discover them. I have avoided this because the default directory does not really follow maven standards.

Friday 9 July 2010

Maven compiler accepts "wrong layout" of java code.

When you code Java it normal to place the java files in a directory structure matching the package names. Although technically not required I think most IDEs enforce this.

However Maven compiler plugin does not enforce this. This can lead to situations where the build server sees everything working but when the developer imports this in a Eclipse or Netbeans  the build will fail.

Not sure if this is a bug or a feature..
Published with Blogger-droid v1.4.4