brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aled Sage (JIRA)" <j...@apache.org>
Subject [jira] [Created] (BROOKLYN-520) NullPointerException thrown when type missing in yaml blueprint
Date Wed, 28 Jun 2017 15:04:00 GMT
Aled Sage created BROOKLYN-520:
----------------------------------

             Summary: NullPointerException thrown when type missing in yaml blueprint
                 Key: BROOKLYN-520
                 URL: https://issues.apache.org/jira/browse/BROOKLYN-520
             Project: Brooklyn
          Issue Type: Bug
    Affects Versions: 0.11.0
            Reporter: Aled Sage
            Priority: Minor


When attempting to deploy an app, it failed with the {{NullPointerException}} shown below.
The underlying cause was that the yaml catalog item was missing the type for one of the children:
{noformat}
brooklyn.children:
- name: myname
  brooklyn.config:
    mykey: myval
{noformat}

However, the error message did not make it easy to discover this! I'd much prefer a more meaningful
fail-fast error message about the type missing (and telling me where it is missing from).

{noformat}
2017-06-28 10:31:27,977 DEBUG 335 o.a.b.r.u.DefaultExceptionMapper [tp2115587762-154] Full
details of WebEntitlementContext[admin@0:0:0:0:0:0:0:1:fpV3Kf] javax.ws.rs.WebApplicationException:
HTTP 400 Bad Request (
logging debug on first encounter; subsequent instances will be logged trace)
javax.ws.rs.WebApplicationException: HTTP 400 Bad Request
        at org.apache.brooklyn.rest.util.WebResourceUtils.throwWebApplicationException(WebResourceUtils.java:81)[335:org.apache.brooklyn.rest-resources:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.rest.util.WebResourceUtils.badRequest(WebResourceUtils.java:101)[335:org.apache.brooklyn.rest-resources:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.rest.resources.ApplicationResource.createPoly(ApplicationResource.java:371)[335:org.apache.brooklyn.rest-resources:0.12.0.SNAPSHOT]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_121]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_121]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_121]
        at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_121]
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)[151:org.apache.cxf.cxf-core:3.1.10]
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)[151:org.apache.cxf.cxf-core:3.1.10]
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189)[155:org.apache.cxf.cxf-rt-frontend-jaxrs:3.1.10]
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)[155:org.apache.cxf.cxf-rt-frontend-jaxrs:3.1.10]
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)[151:org.apache.cxf.cxf-core:3.1.10]
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)[151:org.apache.cxf.cxf-core:3.1.10]
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)[151:org.apache.cxf.cxf-core:3.1.10]
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)[151:org.apache.cxf.cxf-core:3.1.10]
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:262)[163:org.apache.cxf.cxf-rt-transports-http:3.1.10]
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)[163:org.apache.cxf.cxf-rt-transports-http:3.1.10]
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)[163:org.apache.cxf.cxf-rt-transports-http:3.1.10]
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)[163:org.apache.cxf.cxf-rt-transports-http:3.1.10]
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)[163:org.apache.cxf.cxf-rt-transports-http:3.1.10]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)[163:org.apache.cxf.cxf-rt-transports-http:3.1.10]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:218)[163:org.apache.cxf.cxf-rt-transports-http:3.1.10]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)[95:javax.servlet-api:3.1.0]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274)[163:org.apache.cxf.cxf-rt-transports-http:3.1.10]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[215:org.eclipse.jetty.servlet:9.2.19.v20160908]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)[215:org.eclipse.jetty.servlet:9.2.19.v20160908]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)[235:org.ops4j.pax.web.pax-web-jetty:4.3.0]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[214:org.eclipse.jetty.server:9.2.19.v20160908]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[213:org.eclipse.jetty.security:9.2.19.v20160908]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[214:org.eclipse.jetty.server:9.2.19.v20160908]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)[214:org.eclipse.jetty.server:9.2.19.v20160908]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[235:org.ops4j.pax.web.pax-web-jetty:4.3.0]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[215:org.eclipse.jetty.servlet:9.2.19.v20160908]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[214:org.eclipse.jetty.server:9.2.19.v20160908]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[214:org.eclipse.jetty.server:9.2.19.v20160908]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[214:org.eclipse.jetty.server:9.2.19.v20160908]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[235:org.ops4j.pax.web.pax-web-jetty:4.3.0]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[214:org.eclipse.jetty.server:9.2.19.v20160908]
        at org.eclipse.jetty.server.Server.handle(Server.java:499)[214:org.eclipse.jetty.server:9.2.19.v20160908]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[214:org.eclipse.jetty.server:9.2.19.v20160908]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)[214:org.eclipse.jetty.server:9.2.19.v20160908]
        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)[206:org.eclipse.jetty.io:9.2.19.v20160908]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[217:org.eclipse.jetty.util:9.2.19.v20160908]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[217:org.eclipse.jetty.util:9.2.19.v20160908]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error in blueprint:
Unable to instantiate item; 2 errors including: Transformer for brooklyn-camp gave an error
creating this plan: Transf
ormer for catalog gave an error creating this plan: Unable to instantiate amp-cluster-tests;
2 errors including: Error in definition of amp-cluster-tests:0.4.0-SNAPSHOT: NullPointerException
        at org.apache.brooklyn.rest.util.WebResourceUtils.throwWebApplicationException(WebResourceUtils.java:78)[335:org.apache.brooklyn.rest-resources:0.12.0.SNAPSHOT]
        ... 44 more
Caused by: org.apache.brooklyn.util.exceptions.CompoundRuntimeException: Unable to instantiate
item; 2 errors including: Transformer for brooklyn-camp gave an error creating this plan:
Transformer for catalog gave
 an error creating this plan: Unable to instantiate amp-cluster-tests; 2 errors including:
Error in definition of amp-cluster-tests:0.4.0-SNAPSHOT: NullPointerException
        at org.apache.brooklyn.util.exceptions.Exceptions.create(Exceptions.java:474)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.BasicBrooklynTypeRegistry.createSpec(BasicBrooklynTypeRegistry.java:240)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.BasicBrooklynTypeRegistry.createSpec(BasicBrooklynTypeRegistry.java:179)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.BasicBrooklynTypeRegistry.createSpecFromPlan(BasicBrooklynTypeRegistry.java:247)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.EntityManagementUtils.createEntitySpecForApplication(EntityManagementUtils.java:95)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.rest.resources.ApplicationResource.createEntitySpecForApplication(ApplicationResource.java:410)[335:org.apache.brooklyn.rest-resources:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.rest.resources.ApplicationResource.createPoly(ApplicationResource.java:364)[335:org.apache.brooklyn.rest-resources:0.12.0.SNAPSHOT]
        ... 42 more
Caused by: java.lang.IllegalStateException: Transformer for brooklyn-camp gave an error creating
this plan: Transformer for catalog gave an error creating this plan: Unable to instantiate
amp-cluster-tests; 2 erro
rs including: Error in definition of amp-cluster-tests:0.4.0-SNAPSHOT: NullPointerException
        at org.apache.brooklyn.util.guava.IllegalStateExceptionSupplier.get(IllegalStateExceptionSupplier.java:40)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.util.guava.IllegalStateExceptionSupplier.get(IllegalStateExceptionSupplier.java:26)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.util.guava.Maybe$Absent.getException(Maybe.java:345)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.util.guava.Maybe$Absent.get(Maybe.java:338)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.BasicBrooklynTypeRegistry.createSpec(BasicBrooklynTypeRegistry.java:226)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        ... 47 more
Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Transformer for
brooklyn-camp gave an error creating this plan: Transformer for catalog gave an error creating
this plan: Unable to instan
tiate amp-cluster-tests; 2 errors including: Error in definition of amp-cluster-tests:0.4.0-SNAPSHOT:
NullPointerException
        at org.apache.brooklyn.util.exceptions.Exceptions.create(Exceptions.java:466)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.TypePlanTransformers.transform(TypePlanTransformers.java:148)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.BasicBrooklynTypeRegistry.createSpec(BasicBrooklynTypeRegistry.java:200)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        ... 47 more
Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Transformer for
brooklyn-camp gave an error creating this plan: Transformer for catalog gave an error creating
this plan: Unable to instan
tiate amp-cluster-tests; 2 errors including: Error in definition of amp-cluster-tests:0.4.0-SNAPSHOT:
NullPointerException
        at org.apache.brooklyn.core.typereg.TypePlanTransformers.transform(TypePlanTransformers.java:131)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        ... 48 more
Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Transformer for
catalog gave an error creating this plan: Unable to instantiate amp-cluster-tests; 2 errors
including: Error in definition
 of amp-cluster-tests:0.4.0-SNAPSHOT: NullPointerException
        at org.apache.brooklyn.util.exceptions.Exceptions.create(Exceptions.java:466)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.resolve.entity.DelegatingEntitySpecResolver.resolve(DelegatingEntitySpecResolver.java:116)
        at org.apache.brooklyn.core.resolve.entity.DelegatingEntitySpecResolver.resolve(DelegatingEntitySpecResolver.java:83)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.BrooklynComponentTemplateResolver.resolveSpec(BrooklynComponentTemplateResolver.java:161)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.BrooklynAssemblyTemplateInstantiator.buildTemplateServicesAsSpecs(BrooklynAssemblyTemplateInstantiator.java:114)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.BrooklynAssemblyTemplateInstantiator.createServiceSpecs(BrooklynAssemblyTemplateInstantiator.java:73)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.BrooklynAssemblyTemplateInstantiator.createApplicationSpec(BrooklynAssemblyTemplateInstantiator.java:90)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.CampResolver.createEntitySpecFromServicesBlock(CampResolver.java:147)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.CampResolver.createSpecFromFull(CampResolver.java:111)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.CampResolver.createSpec(CampResolver.java:80)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.CampTypePlanTransformer.createSpec(CampTypePlanTransformer.java:70)
        at org.apache.brooklyn.core.typereg.AbstractTypePlanTransformer$1.visitSpec(AbstractTypePlanTransformer.java:105)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.RegisteredTypeKindVisitor.visit(RegisteredTypeKindVisitor.java:32)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.AbstractTypePlanTransformer.create(AbstractTypePlanTransformer.java:116)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.TypePlanTransformers.transform(TypePlanTransformers.java:117)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        ... 48 more
Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Transformer for
catalog gave an error creating this plan: Unable to instantiate amp-cluster-tests; 2 errors
including: Error in definition
 of amp-cluster-tests:0.4.0-SNAPSHOT: NullPointerException
        at org.apache.brooklyn.core.resolve.entity.DelegatingEntitySpecResolver.resolve(DelegatingEntitySpecResolver.java:109)
        ... 61 more
Caused by: org.apache.brooklyn.util.exceptions.CompoundRuntimeException: Unable to instantiate
amp-cluster-tests; 2 errors including: Error in definition of amp-cluster-tests:0.4.0-SNAPSHOT:
NullPointerException
        at org.apache.brooklyn.util.exceptions.Exceptions.create(Exceptions.java:474)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.BasicBrooklynTypeRegistry.createSpec(BasicBrooklynTypeRegistry.java:240)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.BasicBrooklynTypeRegistry.createSpec(BasicBrooklynTypeRegistry.java:179)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.resolve.entity.CatalogEntitySpecResolver.resolve(CatalogEntitySpecResolver.java:67)
        at org.apache.brooklyn.core.resolve.entity.DelegatingEntitySpecResolver.resolve(DelegatingEntitySpecResolver.java:101)
        ... 61 more
Caused by: java.lang.IllegalStateException: Error in definition of amp-cluster-tests:0.4.0-SNAPSHOT:
NullPointerException
        at org.apache.brooklyn.util.guava.IllegalStateExceptionSupplier.get(IllegalStateExceptionSupplier.java:40)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.util.guava.IllegalStateExceptionSupplier.get(IllegalStateExceptionSupplier.java:26)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.util.guava.Maybe$Absent.getException(Maybe.java:345)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.util.guava.Maybe$Absent.get(Maybe.java:338)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.BasicBrooklynTypeRegistry.createSpec(BasicBrooklynTypeRegistry.java:226)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        ... 64 more
Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error in definition
of amp-cluster-tests:0.4.0-SNAPSHOT: NullPointerException
        at org.apache.brooklyn.util.exceptions.Exceptions.create(Exceptions.java:466)[142:org.apache.brooklyn.utils-common:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.TypePlanTransformers.transform(TypePlanTransformers.java:148)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.BasicBrooklynTypeRegistry.createSpec(BasicBrooklynTypeRegistry.java:200)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        ... 64 more
Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error in definition
of amp-cluster-tests:0.4.0-SNAPSHOT: NullPointerException
        at org.apache.brooklyn.core.typereg.TypePlanTransformers.transform(TypePlanTransformers.java:131)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        ... 65 more
Caused by: java.lang.NullPointerException
        at org.apache.brooklyn.core.resolve.entity.AbstractEntitySpecResolver.getLocalType(AbstractEntitySpecResolver.java:54)
        at org.apache.brooklyn.core.resolve.entity.DelegatingEntitySpecResolver.resolve(DelegatingEntitySpecResolver.java:77)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.BrooklynComponentTemplateResolver.resolveSpec(BrooklynComponentTemplateResolver.java:161)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.BrooklynComponentTemplateResolver.populateSpec(BrooklynComponentTemplateResolver.java:230)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.BrooklynComponentTemplateResolver.resolveSpec(BrooklynComponentTemplateResolver.java:191)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.BrooklynAssemblyTemplateInstantiator.buildTemplateServicesAsSpecs(BrooklynAssemblyTemplateInstantiator.java:114)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.BrooklynAssemblyTemplateInstantiator.createServiceSpecs(BrooklynAssemblyTemplateInstantiator.java:73)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.BrooklynAssemblyTemplateInstantiator.createApplicationSpec(BrooklynAssemblyTemplateInstantiator.java:90)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.CampResolver.createEntitySpecFromServicesBlock(CampResolver.java:147)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.CampResolver.createSpecFromFull(CampResolver.java:111)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.CampResolver.createSpec(CampResolver.java:80)
        at org.apache.brooklyn.camp.brooklyn.spi.creation.CampTypePlanTransformer.createSpec(CampTypePlanTransformer.java:70)
        at org.apache.brooklyn.core.typereg.AbstractTypePlanTransformer$1.visitSpec(AbstractTypePlanTransformer.java:105)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.RegisteredTypeKindVisitor.visit(RegisteredTypeKindVisitor.java:32)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.AbstractTypePlanTransformer.create(AbstractTypePlanTransformer.java:116)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        at org.apache.brooklyn.core.typereg.TypePlanTransformers.transform(TypePlanTransformers.java:117)[121:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
        ... 65 more
{noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message