1

So i'm trying a integration on Xamarin with MobileFirst Platform and i am following this steps: http://www.ibm.com/developerworks/library/mo-develop-a-xamarin-forms-app-for-ibm-mobilefirst/index.html

I already added the IBM MobileFirst SDK to my project and added the add-in to xamarin studio, and with this it should start the server with no problems, but when i go to tool -> start server nothing happens.

The CLI and the Java are set in the right location, so i can't see what i'm doing wrong.

  • I'm using Xamarin Studio version 5.9, the SDK and the add-on are in version 7.0.0.1 and the CLI is in version 7.0.0.

There is another way of integrate the mobilefirst server with xamarin? or any ideias of what's happing?

This is the error i got:

ERROR [2015-06-02 16:05:40Z]: Error while executing command: Start Server
System.ArgumentException: Item has already been added. Key in dictionary: 'JAVA_HOME'  Key being added: 'JAVA_HOME'
   at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
   at System.Collections.Hashtable.Add(Object key, Object value)
   at System.Collections.Specialized.StringDictionaryWithComparer.Add(String key, String value)
   at IBMWorklight.WLCommandExecuter.executeWLCommand(String wlCommand, String executionFolder)
   at IBMWorklight.WLCommandExecuter.init()
   at IBMWorklight.StartServerHandler.Run()
   at MonoDevelop.Components.Commands.CommandHandler.Run(Object dataItem)
   at MonoDevelop.Components.Commands.CommandHandler.InternalRun(Object dataItem)
   at MonoDevelop.Components.Commands.CommandManager.DefaultDispatchCommand(ActionCommand cmd, CommandInfo info, Object dataItem, Object target, CommandSource source)
   at MonoDevelop.Components.Commands.CommandManager.DispatchCommand(Object commandId, Object dataItem, Object initialTarget, CommandSource source)

thanks.

3 Answers3

3

Thanks for providing the error log. It was useful. The behaviour you're seeing appears to be a bug in the addin code.

As an immediate workaround, you should be able to get the start server and other operations working by unsetting your JAVA_HOME environment variable (restart the system too).

Please also open an IBM support ticket to report the issue.

Srik
  • 7,907
  • 2
  • 20
  • 29
0

The problem is the name (and command) changed recently from Worklite to MobileFirst. I think the addin is still trying to use wl while the new command is mfp. Running mfp start on the command line from inside the directory that your test server lives should work. mfp stop will stop it. You can find more commands/info here

c0lby
  • 226
  • 2
  • 3
0

It's not a direct answer to your question, but in general, I find it more straightforward to use the MobileFirst Platform CLI to manage your MobileFirst server independently of the Xamarin Studio, which means you don't need to use the Xamarin add-in. You simply create a MobileFirst server outside of Xamarin, create a fresh MobileFirst project, and add iOS and Android API 'environments' to the application as needed. There are some instructions in "Appendix I" here which indicate somewhat how to do that (although they incorrectly refer to the old wl command).

Andrew Ferrier
  • 16,664
  • 13
  • 47
  • 76