Uploaded image for project: 'Brooklyn'
  1. Brooklyn
  2. BROOKLYN-426

NoClassDefFoundError from whitelisted bundle causes catalog listing to fail

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.11.0
    • None

    Description

      With a downstream project of Brooklyn, we extend the whitelisted bundle regex.

      Unfortunately, one of these bundles' manifests was wrong. When it tried to load a class that is in that bundle, it threw a NoClassDefFoundError. The error was thrown when trying to list the catalog. The error is not caught (we just catch ClassNotFoundException), so the catalog listing is aborted. The json returned in the REST call to http://localhost:8081/v1/catalog/applications was malformed as a result.

      The full stacktrace is shown below:

      2017-01-18 17:35:29,574 WARN  130 o.a.b.r.u.DefaultExceptionMapper [tp1855067852-839] REST call generated exception type class java.lang.NoClassDefFoundError unrecognized in class org.apache.brooklyn.rest.util.DefaultExceptionMap
      per (subsequent occurrences will be logged debug only): java.lang.NoClassDefFoundError: org/apache/brooklyn/core/entity/StartableApplication
      java.lang.NoClassDefFoundError: org/apache/brooklyn/core/entity/StartableApplication
              at java.lang.ClassLoader.defineClass1(Native Method)[:1.8.0_111]
              at java.lang.ClassLoader.defineClass(ClassLoader.java:763)[:1.8.0_111]
              at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2370)
              at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2154)
              at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1542)
              at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
              at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_111]
              at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1925)
              at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:978)
              at org.apache.brooklyn.util.core.osgi.ContainerFramework.loadClassFromBundle(ContainerFramework.java:47)[120:org.apache.brooklyn.core:0.11.0.20170112_2100]
              at org.apache.brooklyn.util.core.LoaderDispatcher$ClassLoaderDispatcher.tryLoadFrom(LoaderDispatcher.java:44)[120:org.apache.brooklyn.core:0.11.0.20170112_2100]
              at org.apache.brooklyn.util.core.ClassLoaderUtils.tryLoadFromBundleWhiteList(ClassLoaderUtils.java:338)[120:org.apache.brooklyn.core:0.11.0.20170112_2100]
              at org.apache.brooklyn.util.core.ClassLoaderUtils.load(ClassLoaderUtils.java:240)[120:org.apache.brooklyn.core:0.11.0.20170112_2100]
              at org.apache.brooklyn.util.core.ClassLoaderUtils.loadClass(ClassLoaderUtils.java:151)[120:org.apache.brooklyn.core:0.11.0.20170112_2100]
              at org.apache.brooklyn.core.mgmt.classloading.JavaBrooklynClassLoadingContext.tryLoadClass(JavaBrooklynClassLoadingContext.java:89)
              at org.apache.brooklyn.core.mgmt.classloading.BrooklynClassLoadingContextSequential.tryLoadClass(BrooklynClassLoadingContextSequential.java:81)
              at org.apache.brooklyn.core.mgmt.classloading.AbstractBrooklynClassLoadingContext.tryLoadClass(AbstractBrooklynClassLoadingContext.java:61)
              at org.apache.brooklyn.core.resolve.entity.JavaEntitySpecResolver.tryLoadJavaType(JavaEntitySpecResolver.java:96)
              at org.apache.brooklyn.core.resolve.entity.JavaEntitySpecResolver.canResolve(JavaEntitySpecResolver.java:50)
              at org.apache.brooklyn.core.resolve.entity.AbstractEntitySpecResolver.accepts(AbstractEntitySpecResolver.java:46)
              at org.apache.brooklyn.core.resolve.entity.DelegatingEntitySpecResolver.resolve(DelegatingEntitySpecResolver.java:100)
              at org.apache.brooklyn.core.resolve.entity.DelegatingEntitySpecResolver.resolve(DelegatingEntitySpecResolver.java:88)
              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:145)
              at org.apache.brooklyn.camp.brooklyn.spi.creation.CampResolver.createSpecFromFull(CampResolver.java:109)
              at org.apache.brooklyn.camp.brooklyn.spi.creation.CampToSpecTransformer.createCatalogSpec(CampToSpecTransformer.java:102)
              at org.apache.brooklyn.core.catalog.internal.BasicBrooklynCatalog$1.apply(BasicBrooklynCatalog.java:376)[120:org.apache.brooklyn.core:0.11.0.20170112_2100]
              at org.apache.brooklyn.core.catalog.internal.BasicBrooklynCatalog$1.apply(BasicBrooklynCatalog.java:373)[120:org.apache.brooklyn.core:0.11.0.20170112_2100]
              at org.apache.brooklyn.core.plan.PlanToSpecFactory.attemptWithLoaders(PlanToSpecFactory.java:126)
              at org.apache.brooklyn.core.plan.PlanToSpecFactory.attemptWithLoaders(PlanToSpecFactory.java:118)
              at org.apache.brooklyn.core.catalog.internal.BasicBrooklynCatalog.internalCreateSpecLegacy(BasicBrooklynCatalog.java:373)[120:org.apache.brooklyn.core:0.11.0.20170112_2100]
              at org.apache.brooklyn.core.catalog.internal.BasicBrooklynCatalog.peekSpec(BasicBrooklynCatalog.java:336)[120:org.apache.brooklyn.core:0.11.0.20170112_2100]
              at org.apache.brooklyn.rest.transform.CatalogTransformer.catalogEntitySummary(CatalogTransformer.java:82)[130:org.apache.brooklyn.rest-resources:0.11.0.20170112_2100]
              at org.apache.brooklyn.rest.transform.CatalogTransformer.catalogItemSummary(CatalogTransformer.java:119)[130:org.apache.brooklyn.rest-resources:0.11.0.20170112_2100]
              at org.apache.brooklyn.rest.resources.CatalogResource$1.apply(CatalogResource.java:91)[130:org.apache.brooklyn.rest-resources:0.11.0.20170112_2100]
              at org.apache.brooklyn.rest.resources.CatalogResource$1.apply(CatalogResource.java:88)[130:org.apache.brooklyn.rest-resources:0.11.0.20170112_2100]
              at com.google.common.collect.Lists$TransformingRandomAccessList$1.transform(Lists.java:617)[68:com.google.guava:18.0.0]
              at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)[68:com.google.guava:18.0.0]
              at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:133)
              at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:112)
              at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:25)
              at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:253)
              at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1425)[63:com.fasterxml.jackson.core.jackson-databind:2.7.5]
              at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:930)[63:com.fasterxml.jackson.core.jackson-databind:2.7.5]
              at com.fasterxml.jackson.jaxrs.base.ProviderBase.writeTo(ProviderBase.java:635)
              at org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1378)[156:org.apache.cxf.cxf-rt-frontend-jaxrs:3.1.4]
              at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:235)[156:org.apache.cxf.cxf-rt-frontend-jaxrs:3.1.4]
              at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:118)[156:org.apache.cxf.cxf-rt-frontend-jaxrs:3.1.4]
              at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAXRSOutInterceptor.java:81)[156:org.apache.cxf.cxf-rt-frontend-jaxrs:3.1.4]
              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)[152:org.apache.cxf.cxf-core:3.1.4]
              at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83)[152:org.apache.cxf.cxf-core:3.1.4]
              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)[152:org.apache.cxf.cxf-core:3.1.4]
              at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)[152:org.apache.cxf.cxf-core:3.1.4]
              at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)[164:org.apache.cxf.cxf-rt-transports-http:3.1.4]
              at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)[164:org.apache.cxf.cxf-rt-transports-http:3.1.4]
              at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)[164:org.apache.cxf.cxf-rt-transports-http:3.1.4]
              at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)[164:org.apache.cxf.cxf-rt-transports-http:3.1.4]
              at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)[164:org.apache.cxf.cxf-rt-transports-http:3.1.4]
              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)[164:org.apache.cxf.cxf-rt-transports-http:3.1.4]
              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:217)[164:org.apache.cxf.cxf-rt-transports-http:3.1.4]
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)[95:javax.servlet-api:3.1.0]
              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268)[164:org.apache.cxf.cxf-rt-transports-http:3.1.4]
              at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[215:org.eclipse.jetty.servlet:9.2.14.v20151106]
              at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)[215:org.eclipse.jetty.servlet:9.2.14.v20151106]
              at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:70)[235:org.ops4j.pax.web.pax-web-jetty:4.2.4]
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[214:org.eclipse.jetty.server:9.2.14.v20151106]
              at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[213:org.eclipse.jetty.security:9.2.14.v20151106]
              at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[214:org.eclipse.jetty.server:9.2.14.v20151106]
              at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)[214:org.eclipse.jetty.server:9.2.14.v20151106]
              at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:271)[235:org.ops4j.pax.web.pax-web-jetty:4.2.4]
              at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[215:org.eclipse.jetty.servlet:9.2.14.v20151106]
              at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[214:org.eclipse.jetty.server:9.2.14.v20151106]
              at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[214:org.eclipse.jetty.server:9.2.14.v20151106]
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[214:org.eclipse.jetty.server:9.2.14.v20151106]
              at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[235:org.ops4j.pax.web.pax-web-jetty:4.2.4]
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[214:org.eclipse.jetty.server:9.2.14.v20151106]
              at org.eclipse.jetty.server.Server.handle(Server.java:499)[214:org.eclipse.jetty.server:9.2.14.v20151106]
              at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[214:org.eclipse.jetty.server:9.2.14.v20151106]
              at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)[214:org.eclipse.jetty.server:9.2.14.v20151106]
              at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)[206:org.eclipse.jetty.io:9.2.14.v20151106]
              at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[217:org.eclipse.jetty.util:9.2.14.v20151106]
              at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[217:org.eclipse.jetty.util:9.2.14.v20151106]
              at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
      Caused by: java.lang.ClassNotFoundException: org.apache.brooklyn.core.entity.StartableApplication not found by xxxxxxxxxxxxxxx [295]
              at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)[org.apache.felix.framework-5.4.0.jar:]
              at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)[org.apache.felix.framework-5.4.0.jar:]
              at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)[org.apache.felix.framework-5.4.0.jar:]
              at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_111]
              ... 87 more
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            aled.sage Aled Sage
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment