2 Replies Latest reply on Mar 15, 2006 10:30 PM by Roy Russo

    Internal error: Query did not return a unique result: 2

    Vince Marco Newbie

      I am developing on JBoss 4.0.1sp3 + JBoss Portal 2.2.1rc2 on OSX 10.4.5, and I'm getting an error on display of a portal page. The exception indicates a hibernate.NonUniqueResultException, but I really can't detect what I did to cause this, as I haven't hooked up my own persistence layer yet. Also, I removed the page instance in the AdminPortlet and redeployed, but to no avail.

      I could really use some suggestions. Only one page blows up with the other 5 pages working fine with about 3-5 portlets per page.

      Vince


      15:48:19,853 ERROR [[PortalServletWithPathMapping]] Servlet.service() for servlet PortalServletWithPathMapping threw exception
      org.hibernate.NonUniqueResultException: query did not return a unique result: 2
      at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:663)
      at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:650)
      at org.jboss.portal.core.impl.model.portal.PersistentPortalObjectContainer.lookup(PersistentPortalObjectContainer.java:208)
      at org.jboss.portal.core.impl.model.portal.PersistentPortalObjectContainer.getObject(PersistentPortalObjectContainer.java:143)
      at sun.reflect.GeneratedMethodAccessor207.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy61.getObject(Unknown Source)
      at org.jboss.portal.core.command.WindowCommand.create(WindowCommand.java:107)
      at org.jboss.portal.core.command.CommandContext.execute(CommandContext.java:94)
      at org.jboss.portal.core.command.CommandContext.chain(CommandContext.java:141)
      at org.jboss.portal.core.command.RenderPageCommand.renderPortlets(RenderPageCommand.java:231)
      at org.jboss.portal.core.command.RenderPageCommand.execute(RenderPageCommand.java:164)
      at org.jboss.portal.core.command.ControllerCommand.dispatch(ControllerCommand.java:78)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:140)
      at org.jboss.portal.core.aspects.controller.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:85)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:38)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:168)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:38)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.controller.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:61)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:38)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.controller.NavigationInterceptor.invoke(NavigationInterceptor.java:58)
      at org.jboss.portal.core.command.CommandInterceptor.invoke(CommandInterceptor.java:38)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.server.invocation.Invocation.invoke(Invocation.java:175)
      at org.jboss.portal.core.command.CommandContext.execute(CommandContext.java:107)
      at org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:93)
      at org.jboss.portal.core.command.ExecutionContext.execute(ExecutionContext.java:77)
      at org.jboss.portal.core.CoreController.handle(CoreController.java:190)
      at sun.reflect.GeneratedMethodAccessor267.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.JMXInvocationHandler.invoke(JMXInvocationHandler.java:273)
      at $Proxy145.handle(Unknown Source)
      at org.jboss.portal.server.ServerInvocation.dispatch(ServerInvocation.java:76)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:140)
      at org.jboss.portal.core.aspects.server.SubjectAssociationInterceptor.invoke(SubjectAssociationInterceptor.java:47)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.server.PolicyAssociationInterceptor.invoke(PolicyAssociationInterceptor.java:52)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.server.aspects.server.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:68)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.server.LocaleInterceptor.invoke(LocaleInterceptor.java:69)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:184)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.server.aspects.server.SessionInvalidatorInterceptor.invoke(SessionInvalidatorInterceptor.java:87)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java:75)
      at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
      at org.jboss.portal.server.invocation.Invocation.invokeNext(Invocation.java:130)
      at org.jboss.portal.server.invocation.Invocation.invoke(Invocation.java:175)
      at org.jboss.portal.server.servlet.PortalServlet.doGet(PortalServlet.java:221)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:613)

        • 1. Re: Internal error: Query did not return a unique result: 2
          Vince Marco Newbie

          The seriousness of this issue it critical to portal developers. Out of the blue my portal starts blowing up. The only clue hinted at by the exception is that something, probably from my config, which is now in the portal DB is in error and I have no clue how to fix it.

          I did deploy to a different server and the page works fine. So do I need to blow away the DB, or is there something less intrusive that can be done to fix this.

          I realize you guys can't be aware of every problem, but some documented processes or scripts for recovery would be very useful. I really dislike scrapping the entire DB as my portal uses content in CMS which I can't afford to reload over and over. I suppose I'll pull all my content out of CMS. Perhaps a detailed knowledge of the portal DB would enable me to build my own scripts. Where are the docs to the portal DB structure?

          Thanks,

          Vince

          • 2. Re: Internal error: Query did not return a unique result: 2
            Roy Russo Master

            This is probably due to having more than one portal object (page, window) named the same.

            I fixed that, but i believe its in the RC3 release. You can safely leave the CMS tables alone... anything that starts with jbp_cms_*. Drop everything else and restart.