Skip to Content

Deployment of JSP MI applications – the easy way for development


as I did my first Mobile developments, I was really not that happy with the process. Each and every new version I had to deploy via the mobile administrator. And because some changes are only possible to test in the real environment and not in debug mode, I ended up with a really huge number of versions in the Mobile Administrator. After I really lost the overview between all the different versions and my admin really was not really that friendly any more, I soon found out, that there is a better way to test and deploy applications while we are in development.

First of all you setup the device the normal way and deploy the WAR file as usual. Once MI is restarted, the WAR file is unpacked and the folder for the application gets created inside the WEBAPPS folder. If you are using MAM for example, the folder will look like that:

Folder after first deployment

After this restart of MI, you can sync again to get the data for this app and then you can use it. Debugging, testing, …. everything like normal.

Now the new stuff:

After you did some changes in the code, you can follow the easy process. Just stop MI, place the new created WAR file directly into the WEBAPPS folder and rename the folder of the already deployed App – so you will have the last version as reference. I renamed the folder from “XMAM30_HANDHELD_SR3” to “XMAM30_HANDHELD_SR3_orig”.

Folder with new WAR file

Now start MI again. This restart will create the folder for the application and then you can use it. If you have done changes on the persistence of the App that needed a new MEREPMETA.XML file, then you need to reset the client persistence. After this restart of MI the folder will look like that:

Folder Structure after restart of MI

On the PDA the process is similar to the described metod above – yes it is working on PDA as well! In some cases you can not rename the folder, because MI has access to that folder. If this happens to you, move the “MIServer” startlink from folder “WINDOWS/STARTUP” to the “/TEMP” folder. If you restart the PDA now, Mi does not start automatically any more. Follow the above described process. To restart MI, either copy the link back to the startup folder and do a soft reset or just simply click on the link. Be aware: if you have removed the link from the startup folder, MI does not start automatically. And if MI is already running – you can click the MIServer startlink and the creme window is shown – but that does not start another instance of MI nor does it restart MI. The best thing to restart MI is always: do a soft reset of the PDA to do the restart and have the MIStart link int the startup folder. On the PDA you can find the status of Creme in the file “jscpout”. This file you find in the root folder of the PDA. If anything is not correct, have a look into that file and into the trace files of MI as well. You will find these in folder MI/log and MI/logs.

On the PC it helps to use the startup.bat file to start MI while you are in development. If you use System.out.println() inside the code, you see the traces and even better, the status of MI is available with a short look – even the deployment process you can see there. If you use that process to start MI, open a browser and type the URL: http://localhost:4444 to connect to MI.

This deyployment process works fine on Laptop and on PDA – and once you have reached a final release, you can deploy that WAR file to the J2EE and you will end up with far less versions in there.

Hope this helps you to speed up your development process.

Have fun,

You must be Logged on to comment or reply to a post.
  • Hello Oliver,

    there is one thing I want to add: I did it exactly the same way, however, sometimes my application was not behaving as I expected it.

    It drove me crazy, until I used Eclipse to check which Java classes are loaded. In your example, the class files and jars in the “XMAM30_HANDHELD_SR3” folder are loaded, BUT, the classes from the “XMAM30_HANDHELD_SR3_orig” folder are loaded as well. In which order? I don’t know. I just know that Tomcat is automatically loading all webapps in the MI webapps folder, no matter if they are registered as MI application or not

    If you are lucky, the right version is loaded first and “wins” therefore. But it could be the other way around as well.

    I would suggest not to rename the old application, but to move it to a backup folder. That way you are on the save side.

    Best regards,
    alexander ilg
    msc mobile

    • Hello Alexander,

      nice to hear from you and thanks for the reply.

      Anyhow, this confuses me: Tomcat standard behaviour takes the folder name as part of the namespace. So the order of the import should not make a difference,  because the class should be in another namespace.

      But thanks a lot, I will check that and adapt the blog based on the findings if necessary!