I recently bumped into the following problem: I needed to setup a test environment for OTA download. For this I planned to use Tomcat version 4, and JDE 3.7 which comes with MDS and simulators for the different Blackberry devices available. Below is a description of how to do it:
Step 1: Install Tomcat
- run setup and indicate a listening port other than 8080(which is default) for example 8001. This is necessary as MDS (which by the way is also a Tomcat implementation) listens on port 8080. Do not forget to check the option that installs Tomcat as a Windows service. It is very useful when restarting the application server very often.
- if during the installation you forget to set Tomcat to listen on a different port, you can edit the file %TOMCAT HOME%/conf/server .xml and look for 8080 inside it. Tomcat documentation has more if you need to enter into details
-verify that Tomcat installed correctly by accessing with a web browser (I prefer Firefox)
http://localhost:8001. You should see Tomcat homepage.
Step 2: Create a small web application that will represent the webpage you will connect to using the simulator. For that write a small jsp page:
Start.jsp
Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "httpxxx58;//www.wapforum.org/DTD/wml13.dtd">
<%@ page contentType="text/vnd.wap.wml" %>
<wml>
<head>
<meta http-equiv="Cache-Control" content="max-age=0" forua="true"/>
</head>
<card title="MyTest">
<p align="center">
Welcome to my wml test page
</p>
<p>Please click on the link below to download your application</p>
<p align="left">
<%
String a="<a href='TestAplic.jad' accesskey='1'>TestAplic</a><br/>";
out.printlnxxx40;axxx41;;
%>
</p>
</card>
</wml>
Also needed is the web.xml file where you should include the MIME types for .jad and .cod files:
web.xml
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"httpxxx58;//java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>MyTest</display-name>
<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>start.jsp</welcome-file>
</welcome-file-list>
<!—Added the MIME types -->
<mime-mapping>
<extension>jad</extension>
<mime-type>text/vnd.sun.j2me.app-descriptor</mime-type>
<extension>cod</extension>
<mime-type>application/vnd.rim.cod</mime-type>
</mime-mapping>
</web-app>
Step 3: Deploy the web application including .jad and .cod files
The directory structure should be “webapps/mytest/WEB-INF/web.xml”
Also in “mytest” directory copy the files “start.jsp” the TestAplic.jad file and the TestAplic.cod file
Step 4: Run it:
- Start Tomcat
- Start MDS by clicking on Start->Programs->RIM->JDE3.7->MDS
- Start the simulator and using the web browser access the page “
http://localhost:8001/mytest”
- Click on the link to download the application into the Blackberry simulator
Note: During the testing I noticed that when using JDE 4.0 one does not need to specify the MIME types for jad and cod files.