3 Replies Latest reply on Dec 7, 2005 7:43 AM by pulsar

    Can't view topics in forums (nullpointer)

    pulsar

      Hi,
      I've started to play around with JBoss Portal to see how it can be used in different systems as the presentation layer for us in J2EE systems (and 2.2 seems to be nice in the near future too).

      While playing around I installed the forums and it seems to work fine to add categories and forums, post new topics and even preview the topics before the actual submit. But when trying to open a topic for reading I get a null pointer exception (see below). Regardless of user ("admin" or "user" used as the creator and/or viewer.

      JBoss Portal: 2.0.1RC3
      JBoss Portal Forums: 2.0.1RC3
      DB: MySQL 5.0.16
      DB connector: mysql-connector-java-3.1.11
      OS: Win XP sp2

      Additional information:
      The hibernate mapping was not working and confirmed in the forum here in posts I found (mysql 5 incompatibility with booleans) so I manually changed the types of those columns in both the jbp-tables (2 columns) and jbp_forums tables (1 column). I then manually added the information in the portal installation (setup.txt script). Didn't seem to be needed for the forums, as all it does is create a category with 2 forums and I could do that in the gui anyway.

      Also changed to use PortalDS_2_0_0 in the forums installation as that was used in the portal config files for 2.0.1rc3.

      No other problems found in the portal+forums setup while clicking around and trying things.

      Stack trace when clicking on a topic in the forums:
      java.lang.NullPointerException
      at java.util.Calendar.setTime(Calendar.java:1032)
      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:785)
      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:778)
      at java.text.DateFormat.format(DateFormat.java:314)
      at org.jboss.portlet.forums.ForumsPortlet.fillShowTopicContext(ForumsPortlet.java:5253)
      at org.jboss.portlet.forums.ForumsPortlet.doView(ForumsPortlet.java:437)
      at org.jboss.portlet.JBossPortlet.doDispatch(JBossPortlet.java:217)
      at org.jboss.portlet.JBossPortlet.render(JBossPortlet.java:204)
      at org.jboss.portlet.JBossPortlet.render(JBossPortlet.java:347)
      at org.jboss.portal.portlet.invocation.DispatcherInterceptor.invokeRequest(DispatcherInterceptor.java:163)
      at org.jboss.portal.portlet.invocation.DispatcherInterceptor.invoke(DispatcherInterceptor.java:195)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.portlet.invocation.PreferencesInterceptor.invoke(PreferencesInterceptor.java:93)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.server.invocation.component.ContextTrackerInterceptor.invoke(ContextTrackerInterceptor.java:27)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.server.invocation.component.ContextDispatcherInterceptor$InvokeNextCommand.execute(ContextDispatcherInterceptor.java:94)
      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:585)
      at org.jboss.portal.server.servlet.CommandServlet.doGet(CommandServlet.java:49)
      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.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:539)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
      at org.jboss.portal.server.invocation.component.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:58)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.core.invocation.AccessControlInterceptor.invoke(AccessControlInterceptor.java:125)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.server.invocation.component.CacheInterceptor.invoke(CacheInterceptor.java:90)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:238)
      at org.jboss.portal.server.Component.invoke(Component.java:205)
      at org.jboss.portal.server.invocation.portal.MainDispatcherInterceptor.invoke(MainDispatcherInterceptor.java:93)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.core.invocation.StrategyInterceptor.invoke(StrategyInterceptor.java:184)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.core.invocation.ViewInterceptor.invoke(ViewInterceptor.java:118)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.server.invocation.portal.TargetInterceptor.invoke(TargetInterceptor.java:153)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.core.invocation.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:117)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.core.invocation.UserContextInterceptor.invoke(UserContextInterceptor.java:92)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.server.invocation.portal.SessionInvalidatorInterceptor.invoke(SessionInvalidatorInterceptor.java:77)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:213)
      at org.jboss.portal.server.impl.invocation.InvocationImpl.invokeNext(InvocationImpl.java:238)
      at org.jboss.portal.server.PortalServer.invoke(PortalServer.java:186)
      at org.jboss.portal.server.servlet.AbstractMainServlet.invoke(AbstractMainServlet.java:78)
      at org.jboss.portal.server.servlet.AbstractMainServlet.doGet(AbstractMainServlet.java:71)
      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.portal.core.servlet.TransactionFilter.doFilter(TransactionFilter.java:79)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      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:482)
      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:595)


      Any help appreciated.
      Thanks
      Mattias

        • 1. Re: Can't view topics in forums (nullpointer)
          pulsar

          Oh and using JBoss 4.0.3SP1

          /Mattias

          • 2. Re: Can't view topics in forums (nullpointer)
            bdaw

            hmm... I wonder if it's yet another mysql5 issue. Could you test if there are same issues with mysql4.1?

            If there aren't the best advise for now could be not to use mysql5 with portal...

            According to your stack trace it's happening on:

            (SimpleDateFormat)sdf.format(poster.getRegistrationDate())

            poster is a portal user so it's rather strange...

            • 3. Re: Can't view topics in forums (nullpointer)
              pulsar

              Hmm I guess I should've seen that little hint. In the database the regdate for the users where null. Didn't see that set in the setup script (done behind the scenes?), my apologies. Thanks for the reply, it solved my problem.
              Are there many problems with mysql 5, other than the datatype mapping thing with booleans and bit(1) ?