0 Replies Latest reply on Aug 30, 2012 8:25 PM by Steve Pallen

    Blackberry renders index multiple times and gives java exception

      Simple app which runs fine on iphone sim, rhosimulator, but not on blackberry sdk 6.0 9800 simulator. Logs show that the index action runs 12 times and finally gives null pointer exception on the simulator screen.

       

       

      app/index.erb

      <div data-role="page" data-url="<%= Rho::RhoConfig.start_path %>/">

        <div data-role="header" data-position="inline">

          <h1>Blog3</h1>

          <% if SyncEngine::logged_in > 0 %>

          <a href="<%= url_for :controller => :Settings, :action => :do_sync %>" class="ui-btn-left" data-icon="refresh">

            Sync

          </a>

          <a href="<%= url_for :controller => :Settings, :action => :logout %>" class="ui-btn-right" data-icon="star">

                    Logout

                  </a>

          <% else %>

              <a href="<%= url_for :controller => :Settings, :action => :login %>" class="ui-btn-right" data-icon="star">Login</a>

          <% end %>

        </div>

        <div data-role="content">

          <ul data-role="listview">

            <li><a href="/app/Blog">Blog</a></li>

                    <li><a href="<%= url_for :controller => :Article %>">Articles</a></li>

          </ul>

        </div>

      </div>

       

       

      ArticleController.rb index method

        def index

          @articles = Article.find(:all)

          app_info "---> article controller #{@articles.size}"

          render :back => '/app'

        end

      Article/index.erb

        <div data-role="content">

          <ul data-role="listview" data-filter="true" data-theme="b" data-filter-placeholder="" class="article-list">

            <% puts "=======> view #{@articles.count}" %>

            <% @articles.each do |a| %>

              <% puts "==> article #{a.object}" %>

              <li>

                <a href="<%= url_for :action => :show, :id => a.object %>" data-transition="slide">

                  <img src="" class="ui-li-icon" alt="catagory_1" />

                  <p><%= a.catagory.name %><span class="list-date"><%= a.date %></span></p>

                  <h3><%= a.title %></h3>

                  <p><%= a.summary %></p>

                </a>

              </li>

            <% end %>

          </ul>

        </div>

       

       

      log file exerpt

      I 08/30/2012 19:19:01:89 17f08000             APP| Migrate schema sources: {}

      I 08/30/2012 19:19:03:871 17f08000             APP| ====> articles init

      I 08/30/2012 19:19:03:871 17f08000             APP| ====> articles init count 12

      I 08/30/2012 19:19:03:871 17f74800             APP| on_ui_created.navigate to start url: '/app'

      I 08/30/2012 19:19:03:887 17f08000             APP| RHO serve_index: /apps/app/index_erb.iseq

      I 08/30/2012 19:19:03:887 17f08000 RHO Rho::RhoCon| inst_render_index

      I 08/30/2012 19:19:03:902 17f08000 RHO Rho::RhoCon| index layout

      I 08/30/2012 19:19:03:902 17f08000   RhoConnection| dispatch end

      I 08/30/2012 19:19:07:137  worker0             APP| RHO serve: /apps/app/Article

      I 08/30/2012 19:19:07:137  worker0      RhoSupport| require_compiled: Article/article_controller

      I 08/30/2012 19:19:07:152  worker0      RhoSupport| require_compiled: helpers/browser_helper

      I 08/30/2012 19:19:07:152  worker0 APP ArticleCont| ---> article controller

      I 08/30/2012 19:19:07:199  worker0 APP ArticleCont| ---> article controller 12

      I 08/30/2012 19:19:07:199  worker0             APP| =======> view 12

      I 08/30/2012 19:19:07:199  worker0             APP| ==> article 1.1558274038600592E14

      I 08/30/2012 19:19:07:215  worker0             APP| ==> article 1.1558274038600692E14

      I 08/30/2012 19:19:07:215  worker0             APP| ==> article 1.1558274038600792E14

      I 08/30/2012 19:19:07:231  worker0             APP| ==> article 1.1558274038600892E14

      I 08/30/2012 19:19:07:231  worker0             APP| ==> article 1.1558274038600992E14

      I 08/30/2012 19:19:07:246  worker0             APP| ==> article 1.1558274038601092E14

      I 08/30/2012 19:19:07:246  worker0             APP| ==> article 1.1558274038601192E14

      I 08/30/2012 19:19:07:262  worker0             APP| ==> article 1.1558274038601292E14

      I 08/30/2012 19:19:07:262  worker0             APP| ==> article 1.1558274038601392E14

      I 08/30/2012 19:19:07:277  worker0             APP| ==> article 1.1558274038601492E14

      I 08/30/2012 19:19:07:277  worker0             APP| ==> article 1.1558274038601592E14

      I 08/30/2012 19:19:07:293  worker0             APP| ==> article 1.1558274038601692E14

      I 08/30/2012 19:19:07:293  worker0   RhoConnection| dispatch end

      I 08/30/2012 19:19:07:356  worker0             APP| RHO serve: /apps/app/Article

      I 08/30/2012 19:19:07:371  worker0 APP ArticleCont| ---> article controller

      I 08/30/2012 19:19:07:402  worker0 APP ArticleCont| ---> article controller 12

      I 08/30/2012 19:19:07:402  worker0             APP| =======> view 12

      I 08/30/2012 19:19:07:418  worker0             APP| ==> article 1.1558274038600592E14

      I 08/30/2012 19:19:07:418  worker0             APP| ==> article 1.1558274038600692E14

      I 08/30/2012 19:19:07:434  worker0             APP| ==> article 1.1558274038600792E14

      I 08/30/2012 19:19:07:434  worker0             APP| ==> article 1.1558274038600892E14

      I 08/30/2012 19:19:07:449  worker0             APP| ==> article 1.1558274038600992E14

      I 08/30/2012 19:19:07:449  worker0             APP| ==> article 1.1558274038601092E14

      I 08/30/2012 19:19:07:449  worker0             APP| ==> article 1.1558274038601192E14

      I 08/30/2012 19:19:07:465  worker0             APP| ==> article 1.1558274038601292E14

      I 08/30/2012 19:19:07:465  worker0             APP| ==> article 1.1558274038601392E14

      I 08/30/2012 19:19:07:481  worker0             APP| ==> article 1.1558274038601492E14

      I 08/30/2012 19:19:07:496  worker0             APP| ==> article 1.1558274038601592E14

      I 08/30/2012 19:19:07:512  worker0             APP| ==> article 1.1558274038601692E14

      I 08/30/2012 19:19:07:527  worker0 RHO ArticleCont| Layout file: /apps/app/layout_erb.iseq. Content size: 8534

      I 08/30/2012 19:19:07:527  worker0   RhoConnection| dispatch end

      I 08/30/2012 19:19:07:543  worker0             APP| RHO serve: /apps/app/Article

      I 08/30/2012 19:19:07:543  worker0 APP ArticleCont| ---> article controller

      I 08/30/2012 19:19:07:590  worker0 APP ArticleCont| ---> article controller 12

      I 08/30/2012 19:19:07:590  worker0             APP| =======> view 12

      I 08/30/2012 19:19:07:606  worker0             APP| ==> article 1.1558274038600592E14

      I 08/30/2012 19:19:07:606  worker0             APP| ==> article 1.1558274038600692E14

      I 08/30/2012 19:19:07:621  worker0             APP| ==> article 1.1558274038600792E14

      I 08/30/2012 19:19:07:621  worker0             APP| ==> article 1.1558274038600892E14

      I 08/30/2012 19:19:07:637  worker0             APP| ==> article 1.1558274038600992E14

      I 08/30/2012 19:19:07:637  worker0             APP| ==> article 1.1558274038601092E14

      I 08/30/2012 19:19:07:652  worker0             APP| ==> article 1.1558274038601192E14

      I 08/30/2012 19:19:07:652  worker0             APP| ==> article 1.1558274038601292E14

      I 08/30/2012 19:19:07:668  worker0             APP| ==> article 1.1558274038601392E14

      I 08/30/2012 19:19:07:668  worker0             APP| ==> article 1.1558274038601492E14

      I 08/30/2012 19:19:07:684  worker0             APP| ==> article 1.1558274038601592E14

      I 08/30/2012 19:19:07:684  worker0             APP| ==> article 1.1558274038601692E14

      I 08/30/2012 19:19:07:699  worker0 RHO ArticleCont| Layout file: /apps/app/layout_erb.iseq. Content size: 8534

      I 08/30/2012 19:19:07:699  worker0   RhoConnection| dispatch end

      I 08/30/2012 19:19:07:715  worker0             APP| RHO serve: /apps/app/Article

      I 08/30/2012 19:19:07:715  worker0 APP ArticleCont| ---> article controller

      I 08/30/2012 19:19:07:746  worker0 APP ArticleCont| ---> article controller 12

      I 08/30/2012 19:19:07:762  worker0             APP| =======> view 12

      I 08/30/2012 19:19:07:762  worker0             APP| ==> article 1.1558274038600592E14

      I 08/30/2012 19:19:07:762  worker0             APP| ==> article 1.1558274038600692E14

      I 08/30/2012 19:19:07:777  worker0             APP| ==> article 1.1558274038600792E14

      I 08/30/2012 19:19:07:777  worker0             APP| ==> article 1.1558274038600892E14