Installing Worklight Server CE and deploying the SWAMI app - Page 6

So......me being me, I wanted to have what I just achieved on a Windows 7 laptop running on the new MacBookPro that I've just received.

I thought, hey, that should be simple..... well, it kind of was, but it had a few gotcha's along the way that "challenged" me for a couple of days.  Naturally, 6pm on a Friday, I got it cracked!

....and it all comes back to that earlier quote about "maybe I'll come back to using ANT scripts one day", well that day was today and it made things work.

I followed all the earlier steps, install WLP, install MySQL, install MySQL connect/J jar, install IBM Installation Manager, install IBM Worklight Server CE.

The bit that was failing me was running the "Server Configuration Tool".

It would be fine up until the 'Database selection' screen.  It has 3 options, DB2, MySQL and Oracle, it didn't matter what you selected, the [Next] button was still disabled and the rainbow/busy icon would just spin....forever.



No amount of log file reviewing or googling shed any light on what was going wrong.
I have a spare linux laptop running Linux Mint, I thought, hey let's check on there.  No problem at all, it let me select 'MySql' and the [Next] button became enabled and let me continue.
Then I played the game of, "so what is different?".

I concluded that on the Mac I was running JDK 1.7 and the Linux Mint was using Java 1.6.  Quick google later and I had JDK 1.7 removed and Java 1.6 running.  Great!  Nope, still same problem :-(

I was just scanning through some StackOverFlow postings and someone mentioned, "hey the GUI is just a front-end to the ANT scripts, y'know....".  Well.....challenge accepted.

After taking a look at the trusty PDF, I followed the steps to locate the 'configure-liberty-mysql.xml' template file.
I took a copy, opened it up in XCode, then set about entering all the correct details.


Then I went about executing the ANT scripts using this XML file and passing the action that I needed to perform.

>ant -f configure-liberty-mysql-simpleServer.xml admdatabases
>ant -f configure-liberty-mysql-simpleServer.xml adminstall

>./server stop simpleServer
>./server start simpleServer

>ant -f configure-liberty-mysql-simpleServer.xml databases
>ant -f configure-liberty-mysql-simpleServer.xml install

Then I opened up a web browser to: http://localhost:9080/worklightconsole
logged in as admin/admin and YES! We have the Worklight Console screen.

Press the [choose file], select the 'simpleApp-common.wlapp' file, press [submit] and there we go, uploaded successfully.  Can press the 'View' and it opens up and displays the screen that we are expecting.



Sweet!
So, I now don't care that the 'Server Configuration Tool' doesn't work, I have a working solution.... maybe I'll get around to asking about how others have fixed this, but until then, I'll use this work around and not be so skeptical about using ANT in the future  :-D

I then created another config XML file that pointed to the MIR.war file (the real project).  I repeat the same steps and it all worked as expected.

Until..... it came to the [submit] button press on the MIR.wlapp files.  As these were 9mb or 18mb they were failing to upload into MySQL.  Yes, I remembered that I changed the 2 system variable values in the Windows 7 setup and I "thought" the the MySQL options file was setup correctly.  In the Workbench it all looked okay, but for some reason it was still using default values.  Most odd.
After a bit of the usual Googling, I found that if I created a my.cnf file and dropped it into /etc/local then MySQL would pick it up and use it.  I added the 2 variables that I needed to change.
Restarted MySQL and voila, easily imported the .wlapp files, no problem.


So there we have it.  I now have installed and working on the MacBookPro:
1) Worklight Studio (within Eclipse)
2) Worklight Server CE
3) The ability to Deploy Mobile apps to the Worklight Server and have the Client (Android/iPad) Mobile apps communicate to the Worklight Server Adapter and perform the server-side tasks.

.....now that I've learnt a lot of stuff through trial & error, I need to set aside a little bit of time to get it working on the Raspberry Pi (just the Worklight Server part) and expose it to the Internet so I can have my Mobile apps working out in the wild.  yeah.

right, now to get back to the ACE! app...

Comments