Error executing: wsimport
When setting up Java web services projects, there are a couple of principles that I really like to follow. First of all, I like to stick to open standards as much as possible. And I like to use up-to-date, but not bleeding-edge versions. I think this currently means Java EE 5, JAX-WS/JAXB 2.1, and Java SE 6: a well-known stack that is available on GlassFish, JBoss, WebLogic and many other servers. As a build tool, I think Maven should be preferred in most cases. And, since web services are all about interoperability, I believe in a start-from-wsdl approach: generate the Java from the contract, not the other way around. Finally, I think classes for value objects should have sensible implementations of equals, hashCode and toString, and that this applies to generated code as well.
Can these wishes all be fulfilled? In theory, this should be fairly easy. JAX-WS comes with the wsimport tool to implement the start-from-wsdl approach. A Maven plugin is available for that tool. Wsimport relies on JAXB’s xjc to perform schema compilation. There are a lot of plugins available for xjc, including the JAXB2 Basics plugins for generating equals, hashCode and toString.
In reality, it’s not that easy. Combining these tools is a bit of a challenge. In this post, I’ll discuss some of the problems that occur and show a solution.
read more…
Spring and Java EE
Let me start with a confession: I have never written an application using the Spring Framework (henceforth “Spring”). I’m used to writing ‘plain’ Java EE apps. Several colleagues have been telling me that Spring is really great, and that I should check it out. So I did.
After examining it for a while, I have come to believe that Spring is a high-quality product. Its creators have demonstrated thought leadership and have been an extremely positive influence in the development of enterprise Java. Also, I’ve noted that Spring developers tend to be very happy with the framework they’re using. This must mean that Spring is doing something right.
However, I’ve also encountered a lot of false arguments being put forward in favor of Spring. Some being made out of ignorance, some being simple propaganda. In this post, I will defend several theses to rebut these false arguments.
read more…
jBPM, JPA, Hibernate, Transactions
After having worked with Oracle BPEL as a tool for business process management for a long time, I got a chance to work on a project with an open source alternative, JBoss jBPM, using its native jPDL language. I immediately liked jBPM. I’ll save a discussion of the benefits of jBPM, and its comparison to Oracle BPEL, for some later time.
For now, I’d like to elaborate on some technical issues that bothered me and my colleagues for days before we figured them out completely. It had to do with jBPM, Hibernate and transactions. According to Google, many people are having trouble with that, but there aren’t a lot of good answers.
read more…
JAX-WS and OC4J 10.1.3 / 10g R3
Recently, I had to start a new web service oriented project, but it had to run on the rather outdated OC4J 10.1.3 (also known as OC4J 10g R3) container, with the ability to migrate to WebLogic 11g later on. Of course, I wanted to use JAX-WS and JSR-181 web services annotations (which makes sense regardless of the choice of JAX-WS RI, CXF or Axis2).
I managed to get it working, but there are some quirks you have to take into account. Also, not all information you can find on this topic is reliable. So I thought it might be useful to share my findings.
read more…