Long accountId = _accountService.finalyzeAccountId(accountName, domainId, projectId, true); _accountService didn't get initialized/injected!?! The spring stuff should have taken care of that. I think the problem is in the test initialization not in the base code.
On Fri, May 30, 2014 at 7:58 AM, Meghna Kale <meghna.k...@sungardas.com> wrote: > Hi Daan, > > I'm testing on 4.4-forward-iam branch. > > Thanks > Meghna. > > > On Thu, May 29, 2014 at 6:56 PM, Daan Hoogland <daan.hoogl...@gmail.com> > wrote: > >> Megha, >> >> in my current 4.4 line 411 of DeployVMCmd reads >> if (accountId == null) { >> hence it doesn't refer a pointer at that line. >> which version are you using to get this: >> java.lang.NullPointerException >> at >> org.apache.cloudstack.api.command.user.vm.DeployVMCmd.getEntityOwnerId(DeployVMCmd.java:411) >> >> >> On Thu, May 29, 2014 at 12:53 PM, Meghna Kale <meghna.k...@sungardas.com> >> wrote: >> > Hi All, >> > >> > I was trying to create a autoscalevmprofile with a sample data for a test >> > case. Can anyone help me to know is there anything I'm missing in the >> input >> > parameters ? >> > >> > I get a nullpointer error is it due to the missing deployParams >> parameter ? >> > >> > I'm running this test on simulator. >> > >> > self.account_1A = Account.create( >> > self.apiclient, >> > self.services["account1A"], >> > admin=False, >> > domainid=self.domain_1.id >> > ) >> > >> > self.userapiclient_1A = >> > self.testClient.getUserApiClient(self.user_1A.username, >> > self.domain_1.name) >> > >> > self.service_offering = ServiceOffering.create( >> > self.apiclient, >> > >> self.services["service_offering"]["small"] >> > ) >> > self.zone = get_zone(self.apiclient, testClient.getZoneForTests()) >> > >> > list_users = User.list( >> > self.apiclient, >> > listall=self.services["listall"], >> > account=self.account_1A.name, >> > domainid=self.domain_1.id >> > ) >> > >> > self.template = get_template(self.apiclient, self.zone.id, >> > self.services["ostype"]) >> > counterparam = { "snmpcommunity": "public", "snmpport": "161"} >> > >> > autoscalevm_profile_1A = Autoscale.createAutoscaleVmProfile( >> > >> > self.userapiclient_1A, >> > >> > serviceofferingid=self.service_offering.id, >> > zoneid= >> > self.zone.id, >> > >> templateid= >> > self.template.id, >> > >> > autoscaleuserid=list_users[0].id, >> > >> > destroyvmgraceperiod='100', >> > >> > counterparam=counterparam >> > ) >> > >> > I get this error in the logs : >> > >> > ERROR [c.c.a.ApiServer] (25349580@qtp-22625812-44:ctx-76e14380 >> ctx-e717232f >> > ctx-7cea9dc0) unhandled exception executing api command: >> > [Ljava.lang.String;@17c7c4d >> > java.lang.NullPointerException >> > at >> > >> org.apache.cloudstack.api.command.user.vm.DeployVMCmd.getEntityOwnerId(DeployVMCmd.java:411) >> > at >> > >> com.cloud.api.dispatch.ParamProcessWorker.doAccessChecks(ParamProcessWorker.java:227) >> > at >> > >> com.cloud.api.dispatch.ParamProcessWorker.processParameters(ParamProcessWorker.java:221) >> > at >> > >> com.cloud.api.dispatch.ParamProcessWorker.handle(ParamProcessWorker.java:93) >> > at >> > com.cloud.api.dispatch.DispatchChain.dispatch(DispatchChain.java:37) >> > at >> > >> com.cloud.network.as.AutoScaleManagerImpl.createAutoScaleVmProfile(AutoScaleManagerImpl.java:373) >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> > at >> > >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) >> > at >> > >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> > at java.lang.reflect.Method.invoke(Method.java:606) >> > at >> > >> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) >> > at >> > >> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) >> > at >> > >> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) >> > at >> > >> org.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:106) >> > at >> > >> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) >> > at >> > >> com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:51) >> > at >> > >> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) >> > at >> > >> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) >> > at >> > >> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) >> > at >> > >> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) >> > at com.sun.proxy.$Proxy254.createAutoScaleVmProfile(Unknown >> Source) >> > at >> > >> org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmProfileCmd.create(CreateAutoScaleVmProfileCmd.java:263) >> > at >> > >> com.cloud.api.dispatch.CommandCreationWorker.handle(CommandCreationWorker.java:47) >> > at >> > com.cloud.api.dispatch.DispatchChain.dispatch(DispatchChain.java:37) >> > at >> > com.cloud.api.ApiDispatcher.dispatchCreateCmd(ApiDispatcher.java:74) >> > at com.cloud.api.ApiServer.queueCommand(ApiServer.java:614) >> > at com.cloud.api.ApiServer.handleRequest(ApiServer.java:506) >> > at >> > com.cloud.api.ApiServlet.processRequestInContext(ApiServlet.java:330) >> > at com.cloud.api.ApiServlet.access$000(ApiServlet.java:54) >> > at com.cloud.api.ApiServlet$1.run(ApiServlet.java:118) >> > at >> > >> org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56) >> > at >> > >> org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103) >> > at >> > >> org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53) >> > at com.cloud.api.ApiServlet.processRequest(ApiServlet.java:115) >> > at com.cloud.api.ApiServlet.doGet(ApiServlet.java:77) >> > 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:511) >> > at >> > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401) >> > at >> > >> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) >> > at >> > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) >> > at >> > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) >> > at >> > org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) >> > at >> > >> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) >> > at >> > >> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) >> > at >> > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) >> > at org.mortbay.jetty.Server.handle(Server.java:326) >> > at >> > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) >> > at >> > >> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) >> > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) >> > at >> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) >> > at >> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) >> > at >> > >> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) >> > at >> > >> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) >> > >> > >> > Thanks >> > Meghna. >> >> >> >> -- >> Daan >> >> -- Daan