On Thu, Nov 19, 2009 at 6:49 AM, Sudhir N <sudhir_nima...@yahoo.com> wrote: > Tests are passing now (I just commented those two lines for now) > > Generated CRUD and tried to access Profile list page.. > Got following exception (I use JPA) > > org.springframework.web.util.NestedServletException: Request processing > failed; nested exception is java.lang.NullPointerException > Caused by: java.lang.NullPointerException > at org.appfuse.dao.jpa.GenericDaoJpa.getAll(GenericDaoJpa.java:59) > at > org.appfuse.service.impl.GenericManagerImpl.getAll(GenericManagerImpl.java:68) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at > java.lang.reflect.Method.invoke(Method.java:585) > at > org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) > at > org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166) > at > org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) > at $Proxy43.getAll(Unknown Source) > at > com.ramanandi.matri.webapp.controller.ProfileController.handleRequest(ProfileController.java:22) > at > > org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) > at > org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:857) > at > org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792) > at > org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:475) > at > org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:430) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > at > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) > at > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362) > at > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) > at > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) > at > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712) > at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) > at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:224) > at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) > at > org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java:102) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) > at > com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118) > at > com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) > at > org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164) > at > org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141) > at > org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90) > at > org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:406) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) > at > org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) > at > net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75) > at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) > at > org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:74) > at > > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) > at > com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) > at > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) > at > org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) > at > org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) > at > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) > at > org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) > at > > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) > at > org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) > at > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) > at > org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) > at > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) > at > org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81) > at > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) > at > org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) > at > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) > at > > org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) > at > org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) > at > org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149) > at > org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) > at > org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) > at > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) > at > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) > at > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) > at > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712) > at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) > at > org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211) > at > org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) > at > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) > at org.mortbay.jetty.Server.handle(Server.java:313) > at > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506) > at > org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830) > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381) > at > > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396) > at > org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442) > > > Seems that entityManager isnt getting injected into... > > Is there any way to configure mvn jetty:run-war for remote debuggin with > eclipse?
Yes, you should be able to setup the remote debugger and then copy those settings into a MAVEN_OPTS environment variable, then run "mvn jetty:run-war". Here's a detailed explanation: http://www.mojavelinux.com/blog/archives/2007/03/remote_debugging_with_jetty/ Matt > > Thanks > Sudhir > > > Personally I'm always ready to learn, although I do not always like being > taught > > > ________________________________ > From: Sudhir N <sudhir_nima...@yahoo.com> > To: Appfuse <users@appfuse.dev.java.net> > Sent: Thu, 19 November, 2009 4:28:28 PM > Subject: Generated Web tests won't work when entities have members with > prefix _ (underscore) > > I think this is a catch in > BaseControllerTestCase.objectToRequestParameters() > > When I instance variables are prefixed with underscore Controller test for > form submission will fail. > > Appfuse would create mock request with parameters which are prefixed with > underscore and spring (WebDataBinder)would not bind those parameters but > instead set to null. > > Here's an example > > I have a Profile entity > > @Entity > @Table(name="profiles") > public class Profile { > > private Long _id; > private int _age; > private Date _dob; > > public Profile() { > > } > > @Id > @GeneratedValue(strategy=GenerationType.AUTO) > public Long getId() { > return _id; > } > > public void setId(Long id) { > _id = id; > } > > @Column(name="age") > public int getAge() { > return _age; > } > > public void setAge(int age) { > _age = age; > } > > @Column(name="dob") > public Date getDob() { > return _dob; > } > > public void setDob(Date dob) { > _dob = dob; > } > > > } > > I have to prefix all the instance variables with underscore.. this is a > coding convention in our organization and I can not change it. > > I generated CRUD using AMP and run tests.. but tests failed.. there were few > problems > > 1. AMP created following empty form tag into validation.xml which caused > SAXParserException when loading application context > <form name="profile"> > </form> > <!--Profile-END--> > > An empty form tag is not allowed it must have at least one child <field>. > Either AMP should not put this form tag into validation.xml at all if no > field requires validation, or I dont knw.. :) > > <form name="profile"> > <field property="age" depends="required"> > <arg0 key="profile.age"/> > </field> > </form> > <!--Profile-END--> > > > 2. ProfileFormControllerTest fails > Errors errors = (Errors) > mv.getModel().get(BindException.MODEL_KEY_PREFIX + "profile"); > assertNull(errors); > > assertion fails because There are binding errors.. Appfuse had created mock > request with paramaters prefixed with underscore which caused WebDataBinder > to ignore it and hence... > > > > > Personally I'm always ready to learn, although I do not always like being > taught > > > ________________________________ > The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. > ________________________________ > The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net For additional commands, e-mail: users-h...@appfuse.dev.java.net