This blogpost is a short summary of the Vaadin 7.0 project I did last year, including tools used, lessons learned and a bunch of screenshots to show the results.
- Spring 3.2 including annotation based configuration, Spring Task*Executor framework
- JPA2 with Hibernate 4.2 + JPA modelgen, including Envers for auditing
- JMS 2
- Vaadin 7.0.1
- JAXB 2.1
- Spring WS 2.1
- Shiro 1.2
- JUnit 4.8
- Eclipse 3.7
- SOAP + SoapUI
- MySql 5.5 + H2
- Tomcat 7
- Maven 3
- Java 6
- Don't only trust SoapUI of being able to validate your WSDL. Also try to generate stubs with Axis2 and JAXWS generators. *AND* actually make sure you can make a call to the webservice, because on our project it did work perfectly fine in SoapUI, but not in Axis nor JAXWS. Example: soap fault in operation but not in porttype defined. It required the project to defining one or more xyz.jaxb files for JAX-WS (using .episodes dit not work for us). Then use these in the wsimport etc. Related links: Compiling multiple WSDLs that share a common schema and Customizing Java Packages.
- If sources not found of e.g junit-4.11 (junit.org is also giving a lot of 404s), then run mvn clean dependency:sources, that will download the sources too into the .m2 repo.
- Try to keep the WSDL and XSD as semantic as possible, so use Strings instead of IDs for for example lookup /reference values like: started, finished. Makes the interface much more readable and understandable by just looking at it.
- count(case ...) is NOT supported by Hibernate criteria API, when using it it gives: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: case near line 1, column 92 [... Use sum(case) since that is supported.
So instead of:
cb.count(cb.selectCase().when(cb.equal(workOrder.get(WorkOrder_.priority), 1), workOrder.get(WorkOrder_.priority)).otherwise(0)),
selectCase().when(cb.equal(workOrder.get(WorkOrder_.priority), 1), 1).otherwise(0))
COUNT(CASE WHEN priority = 1 THEN priority ELSE NULL END) AS prio1,
SUM(CASE WHEN priority = 1 THEN 1 ELSE 0 END) AS prio1,
Links about this:
Sums replacement for count
JPA 2.0 spec including 'case expressions' and this one and this one.
- When trying to upgrade from Vaadin from version 7.0.1 to 7.0.4 by updating the version number in the pom.xml, a serial UID problem occurred when generating the widgetset for this new version:
[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:177)
[INFO] Caused by: java.io.InvalidClassException: com.google.gwt.dev.jjs.ast.JMethod; local class incompatible: stream classdesc serialVersionUID = 5017484276333252513, local class serialVersionUID = 9103713597467037978
Tried it then with 7.0.2, that one worked fine! 7.0.3 gave the same error. This post talks about maybe the GWT cache being the problem. So I deleted the directory (even though the timestamp on that directory was recent!) and that worked. In my case the directory to delete was: