rcaloras / spring-roo-addon-timestamp Goto Github PK
View Code? Open in Web Editor NEWSpring Roo Timestamp Add-on
Spring Roo Timestamp Add-on
Hi, I tried your plugin and it got working in a flash. But i am stuck in a related problem, which I am not able get the solution for. here's what i did:
everything is fine until i had to incrementally reverse engg the Roo managed entities. Now since the created/updated columns are present in the entities, it creates a duplicate and results in errors. I tried searching for a way to ignore a specific columns while reverse engg, but could not found a way.
So, please help how to do the incremental reverse engg with Spring roo when timestamp is installed for entities to avoid conflicts of created/updated columns.
I downloaded the 0.1.2 version from you github maven repository (https://raw.github.com/rcaloras/rcaloras-mvn-repo/master/releases) or the 0.1.3-SNAPSHOT from your link in the wiki (I hope the maven repository URL is correct as I had to figure it out from your wiki stuff). In either case here is what happens:
osgi start file:///C:/Users/mario/Documents/workspace-sts-3.6.1.RELEASE/troo/com.rcaloras.roo.addon.timestamp-0.1.3-20130815.014141-2.jar
and the roo prompt comes back.ERROR: Bundle org.springframework.roo.startlevel [67] Error starting file:/C:/springsource/spring-roo-1.2.5.RELEASE/bundle/org.springframework.roo.startlevel-1.2.5.RELEASE.jar (org.osgi.framework.BundleException: Activator start error in bundle org.springframework.roo.startlevel [67].)
java.lang.IllegalStateException: Could not open null
at org.springframework.roo.startlevel.Activator.process(Activator.java:108)
at org.springframework.roo.startlevel.Activator.start(Activator.java:179)
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:629)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1904)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1822)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1192)
at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:266)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.springframework.roo.startlevel.Activator.process(Activator.java:103)
... 7 more
Nov 01, 2014 3:06:31 PM org.springframework.roo.felix.JdkDelegatingLogListener logNow
SEVERE: [org.springframework.roo.startlevel [67]] FrameworkEvent ERROR
org.apache.felix.log.LogException: org.osgi.framework.BundleException: Activator start error in bundle org.springframework.roo.startlevel [67].
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1951)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1822)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1192)
at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:266)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.felix.log.LogException: java.lang.IllegalStateException: Could not open null
at org.springframework.roo.startlevel.Activator.process(Activator.java:108)
at org.springframework.roo.startlevel.Activator.start(Activator.java:179)
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:629)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1904)
... 4 more
Caused by: java.lang.NullPointerException
at org.springframework.roo.startlevel.Activator.process(Activator.java:103)
... 7 more
____ ____ ____
/ __ \/ __ \/ __ \
/ /_/ / / / / / / /
/ _, _/ /_/ / /_/ /
/_/ |_|\____/\____/ 1.2.5.RELEASE [rev 8341dc2]
Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
roo>
Some read-up I have done seem to imply that there is some Java 8 code involved which is not supported by Roo 1.2.5.RELEASE. Do you compile the timestamp addon with Java 8? How do you make this work?
Please help as I want to use this addon in a semi production app and it is not working.
When I run the following:
osgi start --url https://raw.github.com/rcaloras/rcaloras-mvn-repo/master/snapshots/com/rcaloras/roo/addon/timestamp/com.rcaloras.roo.addon.timestamp/0.1.3-SNAPSHOT/com.rcaloras.roo.addon.timestamp-0.1.3-20130815.014141-2.jar
timestamp setup
I see this:
Updated ROOT/pom.xml [added repository https://raw.github.com/rcaloras/rcaloras-mvn-repo/master/snapshots; added dependencies com.rcaloras.roo.addon.timestamp:com.rcaloras.roo.addon.timestamp:0.1.3-SNAPSHOT, org.springframework.batch:spring-batch-core:2.1.1.RELEASE, org.springframework.batch:spring-batch-admin-manager:1.0.0.RELEASE]
When spring-batch-admin-manager:1.0.0 gets installed, so does a dependency on hsqldb:hsqldb:1.8.0-7 (the oldest hsqldb in my m2 folder)
When JPA persistence is set-up is run:
jpa setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT
Updated ROOT/pom.xml [added dependencies org.hsqldb:hsqldb:2.2.9, org.hibernate:hibernate-core:4.2.2.Final, org.hibernate:hibernate-entitymanager:4.2.2.Final, org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final, commons-collections:commons-collections:3.2.1, org.hibernate:hibernate-validator:4.3.1.Final, javax.validation:validation-api:1.0.0.GA, javax.transaction:jta:1.1, org.springframework:spring-jdbc:${spring.version}, org.springframework:spring-orm:${spring.version}, commons-pool:commons-pool:1.5.6, commons-dbcp:commons-dbcp:1.4]
We see **org.**hsqldb:hsqldb:2.2.9 get added...
These two hsqldb instances are in conflict and prevent any generated web app from initializing.
I'm not sure what the best way to resolve this conflict between old and new hsqldb dependencies, maybe there's something you can add to the roo-addon which will make it depend on a more recent version of hsqldb?
Invalid property 'updated' of bean class []: Bean property 'updated' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
Below is the full stack
org.springframework.beans.NotReadablePropertyException: Invalid property 'updated' of bean class [ae.ac.uaeu.cit.domain.DailyCleaning]: Bean property 'updated' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:729)
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:721)
at org.springframework.validation.AbstractPropertyBindingResult.getActualFieldValue(AbstractPropertyBindingResult.java:99)
at org.springframework.validation.AbstractBindingResult.getFieldValue(AbstractBindingResult.java:219)
at org.springframework.web.servlet.support.BindStatus.(BindStatus.java:120)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:178)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:198)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getName(AbstractDataBoundFormElementTag.java:164)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.writeDefaultAttributes(AbstractDataBoundFormElementTag.java:127)
at org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.writeDefaultAttributes(AbstractHtmlElementTag.java:421)
at org.springframework.web.servlet.tags.form.InputTag.writeTagContent(InputTag.java:142)
at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:102)
at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)
at org.apache.jsp.tag.webform.fields.datetime_tagx._jspx_meth_form_005finput_005f0(datetime_tagx.java:720)
at org.apache.jsp.tag.webform.fields.datetime_tagx.doTag(datetime_tagx.java:327)
at org.apache.jsp.WEB_002dINF.views.dailycleanings.create_jspx._jspx_meth_field_005fdatetime_005f1(create_jspx.java:325)
at org.apache.jsp.WEB_002dINF.views.dailycleanings.create_jspx.access$9(create_jspx.java:308)
at org.apache.jsp.WEB_002dINF.views.dailycleanings.create_jspx$Helper.invoke0(create_jspx.java:383)
at org.apache.jsp.WEB_002dINF.views.dailycleanings.create_jspx$Helper.invoke(create_jspx.java:401)
at org.apache.jsp.tag.webform.create_tagx$Helper.invoke0(create_tagx.java:697)
at org.apache.jsp.tag.webform.create_tagx$Helper.invoke(create_tagx.java:739)
at org.apache.jsp.tag.webutil.panel_tagx._jspx_meth_c_005fif_005f0(panel_tagx.java:193)
at org.apache.jsp.tag.webutil.panel_tagx.doTag(panel_tagx.java:139)
at org.apache.jsp.tag.webform.create_tagx.doTag(create_tagx.java:242)
at org.apache.jsp.WEB_002dINF.views.dailycleanings.create_jspx._jspx_meth_form_005fcreate_005f0(create_jspx.java:111)
at org.apache.jsp.WEB_002dINF.views.dailycleanings.create_jspx._jspService(create_jspx.java:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:684)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:678)
at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103)
at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96)
at org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
at org.apache.tiles.renderer.impl.ChainedDelegateAttributeRenderer.write(ChainedDelegateAttributeRenderer.java:76)
at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:336)
at org.apache.tiles.template.InsertAttributeModel.renderAttribute(InsertAttributeModel.java:210)
at org.apache.tiles.template.InsertAttributeModel.end(InsertAttributeModel.java:126)
at org.apache.tiles.jsp.taglib.InsertAttributeTag.doTag(InsertAttributeTag.java:311)
at org.apache.jsp.WEB_002dINF.layouts.default_jspx._jspx_meth_tiles_005finsertAttribute_005f2(default_jspx.java:234)
at org.apache.jsp.WEB_002dINF.layouts.default_jspx._jspService(default_jspx.java:96)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)
at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)
at org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
at org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:147)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
This is short descripion of my environment :
This is a short description of my test with your addon :
roo> project --topLevelPackage foo.bar.sample
roo> timestamp setup
NullPointerException at java.util.Properties$LineReader.readLine(Unknown Source)
Unless I'm mistaken or I don't understand, I think the source of this problem is located in the file TimestampOperationsImpl.java when the function "initialize" tries to read properties in the file /project.properties.
Could you help to solve this problem ?
Thank you in advance for your response.
Best regards,
Franck
Hello,
Thanks for this addon. My environment is roo 1.2.2.
After updating an entity, the created date is becoming null. Also is there any way i can add userId(user logged in) along with created date and updated date?
Neat little add-on this. It would be great if a repository was created and RooBot informed:
http://static.springsource.org/spring-roo/reference/html/simple-addons.html#d4e3384
Here's a small change that makes the time visible when viewing the records:
https://gist.github.com/jumpkick/6345364
Now if only there was a way to get Roo to not display (or read-only display) the "updated" field in the record edit screen...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.