• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 2.4
    • 2.3
    • REST API
    • Standalone

      Hitting /rest/api/latest/project/?expand=projects.project.plans.plan or {{/rest/api/latest/plan/BAM-KEY}}on any 2.3+ Bamboo returns

      <status>
      <status-code>500</status-code>
      <message>
      Unknown entity class: com.atlassian.bamboo.resultsummary.BuildResultsSummaryImpl; 
      nested exception is net.sf.hibernate.MappingException: 
      Unknown entity class: com.atlassian.bamboo.resultsummary.BuildResultsSummaryImpl
      </message>
      </status>
      

      Exception is:

      20/08/2009 5:15:57 PM com.sun.jersey.server.impl.application.WebApplicationImpl onException
      SEVERE: Internal server error
      org.springframework.orm.hibernate.HibernateSystemException: 
      Unknown entity class: com.atlassian.bamboo.resultsummary.BuildResultsSummaryImpl; 
      nested exception is net.sf.hibernate.MappingException: Unknown entity class: com.atlassian.bamboo.resultsummary.BuildResultsSummaryImpl
      Caused by: net.sf.hibernate.MappingException: Unknown entity class: com.atlassian.bamboo.resultsummary.BuildResultsSummaryImpl
      	at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:347)
      	at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2718)
      	at net.sf.hibernate.impl.SessionImpl.getOuterJoinLoadable(SessionImpl.java:3677)
      	at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3642)
      	at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:238)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao$1.doInHibernate(BuildResultsSummaryHibernateDao.java:75)
      	at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370)
      	at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao.findBuildResultsSummaries(BuildResultsSummaryHibernateDao.java:67)
      	at com.atlassian.bamboo.resultsummary.BuildResultsSummaryManagerImpl.getAverageBuildTime(BuildResultsSummaryManagerImpl.java:591)
      	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:597)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      	at com.atlassian.bamboo.security.acegi.intercept.aopalliance.AuthorityOverrideMethodSecurityInterceptor.invoke(AuthorityOverrideMethodSecurityInterceptor.java:30)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      	at $Proxy22.getAverageBuildTime(Unknown Source)
      	at com.atlassian.bamboo.build.DefaultBuild.getAverageBuildDuration(DefaultBuild.java:169)
      	at com.atlassian.bamboo.build.DefaultBuild$$FastClassByCGLIB$$eed095ba.invoke(<generated>)
      	at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
      	at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:108)
      	at com.atlassian.bamboo.build.DefaultBuild$$EnhancerByCGLIB$$f97c4a7a.getAverageBuildDuration(<generated>)
      	at com.atlassian.bamboo.plugins.rest.model.plan.RestPlan.expand(RestPlan.java:179)
      	at com.atlassian.bamboo.plugins.rest.model.plan.RestPlanExpander.expandInternal(RestPlanExpander.java:17)
      	at com.atlassian.bamboo.plugins.rest.model.plan.RestPlanExpander.expandInternal(RestPlanExpander.java:10)
      	at com.atlassian.plugins.rest.common.expand.AbstractRecursiveEntityExpander.expand(AbstractRecursiveEntityExpander.java:9)
      	at com.atlassian.plugins.rest.common.expand.resolver.CollectionEntityExpanderResolver$ListExpander.expand(CollectionEntityExpanderResolver.java:43)
      	at com.atlassian.plugins.rest.common.expand.resolver.CollectionEntityExpanderResolver$ListExpander.expand(CollectionEntityExpanderResolver.java:35)
      	at com.atlassian.plugins.rest.common.expand.EntityCrawler.expandFields(EntityCrawler.java:92)
      	at com.atlassian.plugins.rest.common.expand.EntityCrawler.crawl(EntityCrawler.java:35)
      	at com.atlassian.plugins.rest.common.expand.resolver.ListWrapperEntityExpanderResolver$ListWrapperEntityExpander.expand(ListWrapperEntityExpanderResolver.java:57)
      	at com.atlassian.plugins.rest.common.expand.resolver.ListWrapperEntityExpanderResolver$ListWrapperEntityExpander.expand(ListWrapperEntityExpanderResolver.java:31)
      	at com.atlassian.plugins.rest.common.expand.EntityCrawler.expandFields(EntityCrawler.java:92)
      	at com.atlassian.plugins.rest.common.expand.EntityCrawler.crawl(EntityCrawler.java:35)
      	at com.atlassian.plugins.rest.common.expand.AbstractRecursiveEntityExpander.expand(AbstractRecursiveEntityExpander.java:12)
      	at com.atlassian.plugins.rest.common.expand.resolver.CollectionEntityExpanderResolver$ListExpander.expand(CollectionEntityExpanderResolver.java:43)
      	at com.atlassian.plugins.rest.common.expand.resolver.CollectionEntityExpanderResolver$ListExpander.expand(CollectionEntityExpanderResolver.java:35)
      	at com.atlassian.plugins.rest.common.expand.EntityCrawler.expandFields(EntityCrawler.java:92)
      	at com.atlassian.plugins.rest.common.expand.EntityCrawler.crawl(EntityCrawler.java:35)
      	at com.atlassian.plugins.rest.common.expand.resolver.ListWrapperEntityExpanderResolver$ListWrapperEntityExpander.expand(ListWrapperEntityExpanderResolver.java:57)
      	at com.atlassian.plugins.rest.common.expand.resolver.ListWrapperEntityExpanderResolver$ListWrapperEntityExpander.expand(ListWrapperEntityExpanderResolver.java:31)
      	at com.atlassian.plugins.rest.common.expand.EntityCrawler.expandFields(EntityCrawler.java:92)
      	at com.atlassian.plugins.rest.common.expand.EntityCrawler.crawl(EntityCrawler.java:35)
      	at com.atlassian.plugins.rest.common.expand.jersey.ExpandResponseFilter.filter(ExpandResponseFilter.java:39)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:675)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:612)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:603)
      	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:309)
      	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:425)
      	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:198)
      	at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:689)
      	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:112)
      	at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)
      	at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)
      	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55)
      	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41)
      	at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)
      	at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)
      	at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)
      	at com.atlassian.plugins.rest.module.servlet.RestServletUtilsUpdaterFilter.doFilterInternal(RestServletUtilsUpdaterFilter.java:26)
      	at com.atlassian.plugins.rest.module.servlet.RestServletUtilsUpdaterFilter.doFilter(RestServletUtilsUpdaterFilter.java:40)
      	at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)
      	at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)
      	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55)
      	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
      	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:1139)
      	at com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:88)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
      	at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)
      	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55)
      	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
      	at com.atlassian.bamboo.filter.AccessLogFilter.doFilter(AccessLogFilter.java:76)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
      	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      	at com.atlassian.bamboo.filter.SeraphLoginFilter.doFilter(SeraphLoginFilter.java:61)
      	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 com.atlassian.bamboo.filter.BambooAcegiProxyFilter.doFilter(BambooAcegiProxyFilter.java:25)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
      	at com.atlassian.bamboo.filter.LicenseFilter.doFilter(LicenseFilter.java:76)
      	at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
      	at com.atlassian.johnson.filters.AbstractJohnsonFilter.doFilter(AbstractJohnsonFilter.java:72)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
      	at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:204)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
      	at com.atlassian.seraph.filter.BaseLoginFilter.doFilter(BaseLoginFilter.java:138)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
      	at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)
      	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55)
      	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
      	at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:170)
      	at com.atlassian.spring.filter.FlushingSpringSessionInViewFilter.doFilterInternal(FlushingSpringSessionInViewFilter.java:29)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
      	at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)
      	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55)
      	at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
      	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:1139)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:378)
      	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:765)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:324)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
      
      

      Seems to be only reproducible on Standalone, not running through IDEA. Haven't tested 2.3.2-beta WAR but functions correctly on BEAC, JBAC etc, so it would seem that the WAR versions work correctly.

            [BAM-4384] Unable to view Plan in REST

            made public

            Just additional info - as an effect of refactoring I'm doing now - the BambooService will disappear. All dependencies will we autowired directly to Resource classes. I'm not sure if it will help, but component wiring will change slightly.
            Probably it will not solve the problem anyway...

            Marek Went (Inactive) added a comment - Just additional info - as an effect of refactoring I'm doing now - the BambooService will disappear. All dependencies will we autowired directly to Resource classes. I'm not sure if it will help, but component wiring will change slightly. Probably it will not solve the problem anyway...

            MarkC added a comment -

            The problem is that the System classloader also has the BuildResultsSummaryImpl in it. When Hibernate tries to load the class through the ContextClassLoader when RESTing, it goes through the ChainedClassLoader in the plugin module, which then delegates back to the system classloader. It the barfs since it can't find the matching Entity mapper (the class object is used as a key)

            The moral of the story is that we need to change the way we build / package our standalone. Basically, the system classpath to only contain the minimal jars to fire off the Jetty server.

            We should look at having a valid manifest class + classpath while we're at it to make the server.war executable

            MarkC added a comment - The problem is that the System classloader also has the BuildResultsSummaryImpl in it. When Hibernate tries to load the class through the ContextClassLoader when RESTing, it goes through the ChainedClassLoader in the plugin module, which then delegates back to the system classloader. It the barfs since it can't find the matching Entity mapper (the class object is used as a key) The moral of the story is that we need to change the way we build / package our standalone. Basically, the system classpath to only contain the minimal jars to fire off the Jetty server. We should look at having a valid manifest class + classpath while we're at it to make the server.war executable

            James Dumay added a comment - - edited

            To rebuild standalone

            • Install the latest Install4J from the web
            • In your settings.xml's <properties> section set "install4j.home" to be the location of the install4j installation
            • Use the licensing details at https://extranet.atlassian.com/display/SYSADMIN/Install4J+License+Server
            • change the default modules in the bamboo root pom to include the distribution module
            • run mvn clean install -Dmaven.test.skip from the root of bamboo

            James Dumay added a comment - - edited To rebuild standalone Install the latest Install4J from the web In your settings.xml's <properties> section set "install4j.home" to be the location of the install4j installation Use the licensing details at https://extranet.atlassian.com/display/SYSADMIN/Install4J+License+Server change the default modules in the bamboo root pom to include the distribution module run mvn clean install -Dmaven.test.skip from the root of bamboo

            MarkC added a comment -

            A possible suspect in this case is that maybe there're two sessionFactory floating around and the plugins are resolving to the wrong one... The UI works fine, seems to just be plugins 2.

            James will comment in with how to build a standalone

            MarkC added a comment - A possible suspect in this case is that maybe there're two sessionFactory floating around and the plugins are resolving to the wrong one... The UI works fine, seems to just be plugins 2. James will comment in with how to build a standalone

              mark@atlassian.com MarkC
              mark@atlassian.com MarkC
              Affected customers:
              0 This affects my team
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: