Roo 1.2.0 basic application with datanucleus still buggy

╄→гoц情女王★ 提交于 2019-12-11 22:45:33

问题


A few days ago, I posted Roo 1.1.5 super basic application is buggy, and just recently on Dec 17, 2011, Spring Roo 1.2.0 has been released. I created the equivalent project:

project --topLevelPackage task --java 6 --projectName Task
jpa setup --provider DATANUCLEUS --database H2_IN_MEMORY 
entity jpa --class ~.domain.Task
field string --fieldName description --notNull --sizeMin 3 --sizeMax 512
field boolean --fieldName completed --notNull
web jsf setup 
controller all --package ~.controller
exit
mvn jetty:run

And I was greeted with java.lang.NoClassDefFoundError: javax/jdo/JDONullIdentityException. Not a good start, but easy to solve adding the missing jdo-api dependency, in the pom.xml (as Andy Datanucleus explained here)

<dependency>
        <groupId>javax.jdo</groupId>
        <artifactId>jdo-api</artifactId>
        <version>3.0</version>
</dependency>

At this point the application could run, but the duplicated record on update bug was still there. So, as explained in the JIRA ROO-1467, by Andy again, I've added to persistence.xml:

<property name="datanucleus.allowAttachOfTransient" value="true"/>

This time I didn't get the duplicated record, but an exception:

Cannot set Object parameter: value = 1 for column "TASK.VERSION" : Invalid value "6" for parameter "parameterIndex" [90008-161]; nested exception is javax.persistence.PersistenceException: Cannot set Object parameter: value = 1 for column "TASK.VERSION" : Invalid value "6" for parameter "parameterIndex" [90008-161]

I don't know if relevant or not, but I've also noticed many warnings similar to the following one:

WARN  DataNucleus.MetaData - Class task.controller.TaskController_Roo_Controller
was specified in persistence-unit persistenceUnit but not annotated, so ignoring

What other change should I do to make it work?

来源:https://stackoverflow.com/questions/8553495/roo-1-2-0-basic-application-with-datanucleus-still-buggy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!