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





      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- and rhodes-


      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
                      @msg = "Enter valid login and password" unless @msg && @msg.length > 0
                    @msg = Rho::RhoError.err_message(Rho::RhoError::ERR_UNATHORIZED) unless @msg && @msg.length > 0 
                  render :action => :index
                def logout
                  $session[:isLoggedIn] = 'false'
                  @msg = "You have been logged out."
                  redirect :action => :index
                # 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
                def reload_master
                  # reload master data
                  puts "Reloading master data"
                  render :action => :index


            • Re: Server Error In Rho Mobile


              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.