10 Replies Latest reply on Sep 27, 2013 1:18 PM by Divya Pathak

    Server Error In Rho Mobile


      Hello Everyone,

       

      I am trying to build my deploy my code in RhoMobile. After building the code i am getting below error

       

      Server Error

       

      Error:undefined mething 'Property_value'

       

      for nil:NilClass

      Trace:

      (eval):88:in

      lib/rho/render.rb:175:in

      'eval_compiled_file'

      lib/rho/render.rb:175:in 'render'

      apps/app/Users/user_controller.rb:41:in 'index'

       

      lib/rho/rhocontroller.rb:104:in 'serve'

      lib/rho/rhoapplication.rb:248:in 'serve'

      lib/rho/rho.rb:883:in 'serve'

       

      The same code is working fine in Simulator.

      The interesting part is the sam code was working fine few days back and suddenly this error started coming in.

       

       

      I am using rhoelements-2.2.1.13 and rhodes-3.5.1.13.

       

      Please suggest.

       

      Thanks a lot in advance.

        • Re: Server Error In Rho Mobile
          Kutir Mobility

          Hi Divya,

          Could you please post the code snippets of "user_controller.rb" or if possible the entire app so that debug the code for you.

           

          Visnupriya R

          Kutir Mobility

            • Re: Server Error In Rho Mobile

              require 'rho/rhocontroller'
              require 'helpers/browser_helper'

              class UsersController < Rho::RhoController
                include BrowserHelper

                def do_login

                  if @params['users'] and @params['users']['Soe_Id'] and @params['users']['Soe_Id'].length > 0 and @params['users']['Password'] and @params['users']['Password'].length > 0
                    puts "logged in"
                    @loginUser = Users.find(:all,
                    :conditions => {'Soe_Id' => @params['users']['Soe_Id'].upcase,
                    'Password' => @params['users']['Password']}).first
                    @device_id = System.get_property('device_id')
                    if @loginUser
                      $session[:isLoggedIn] = 'true'
                      $session[:Soe_Id] = @loginUser.Soe_Id
                      $session[:Teller_Id] = @loginUser.Teller_Id
                      $session[:Scanner_Id] = @device_id
                      $session[:Department] = @loginUser.Admin
                    else
                      @msg = "Enter valid login and password" unless @msg && @msg.length > 0
                    end
                  else
                    @msg = Rho::RhoError.err_message(Rho::RhoError::ERR_UNATHORIZED) unless @msg && @msg.length > 0 
                  end
                  render :action => :index
                end
               
                def logout
                  SyncEngine.logout
                  $session[:isLoggedIn] = 'false'
                  @msg = "You have been logged out."
                  redirect :action => :index
                end
               
                # Display Home Page -- Either Login page or Menu Page will be displayed
                def index
                  #@userses = Users.find(:all)
                  #render :back => '/app/Users'
                  render :action => :index
                end
                def reload_master
                  # reload master data
                  puts "Reloading master data"
                  MasterDataLoader.loadData()
                  render :action => :index
                end

              end

            • Re: Server Error In Rho Mobile

              Divya,

              Easiest way to shed more light on this issue is to simply use the debugger to step through the code and see where the 'nil' exception is thrown.

              If this exception (as I understand it) isn't thrown in the Simulator, consider possible scenarios that could manifest on different devices.

               

              Best of luck

              • Re: Server Error In Rho Mobile

                Hello Every One,

                 

                I figured out that the issue was beacuse of the JDK upgrade in my machine.

                 

                I added the JDK bin folder in environment variable and also in Rho YML file. After doing these two changes the error got resolved.

                 

                Thanks a lot for all the suggetions.

                 

                Regards,

                Divya