Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
_dinob_
Posts: 4
Registered: ‎06-09-2009
My Device: Not Specified

Question re Blackberry working with Tomcat

Hi experts, I am new to Blackberry and I am trying to call a very simple servlet from Tomcat. I am using Ecllipse with BlackBerry plug in but have also separate installs for Blackberry simulator and MDS-CS. My MDS is listening on port 8080 (at least that what they say it listens to by default), and my Tomcat is listening on port 8080, too. I have placed my simple servlet in WEB-APS directory on Tomcat server. When I try to access it from Internet Explorer by entering: http://localhost:8080/myDir/myServlet I get reply from my servlet as I expected. If I do same from Blackberry browser, I get Forbidden access error (I believe it is 403). My Eclipse is set to run MDS when I run my black berry application. If I don't use Eclipse, then I run manually my MDS and Blackberry Device Simulator but get the same issue this way, too. I have tried changing my Tomcat port to 8081 so it does not listen to the same port as MDS (8080) but that had no effect. Anyone who could help me solve this, any help highly appreciated. Regards, _dino_
Developer
bneeman
Posts: 132
Registered: ‎02-11-2009
My Device: Not Specified

Re: Question re Blackberry working with Tomcat

Only one app can listen on a port at any given time. You will need to permanently move either tomcat or MDS to another port.

Once both are running (on different ports), try to access an internet page with the simulator. If it doesn't work, MDS setup problem. If you have internet on the simulator, it might be a tomcat setup problem. Who serves the 403, was it coming from tomcat?

 

Cheers, Barak

New Developer
_dinob_
Posts: 4
Registered: ‎06-09-2009
My Device: Not Specified

Re: Question re Blackberry working with Tomcat

Hi Barak,

Thanks for your reply.  I have tried having them running on different ports already (Tomcat on 8081 instead of 8080, and MDS on 8080, as my rimpublic.property config file states:

WebServer.listen.port=8080

)

 

If I try to access my sesrvlet from IE it works fine (I type http://localhost:8081/myDir/myServlet).

If I do the same from blackberry browser, I get something like no access or forbidden access and then the address http://localhost:8081/mydir/myservlet but I can go online (I tried going to www.google.com and it worked fine)

 

Much appreciated,

Dino

Developer
bneeman
Posts: 132
Registered: ‎02-11-2009
My Device: Not Specified

Re: Question re Blackberry working with Tomcat

Try with the Desktop's IP address instead of localhost (not the 127.0.0.1 one, the network one).

Check the tomcat log to see if there was a connection from the BlackBerry (and tomcat refused it) or if the connection never arrived.

 

Cheers, Barak.

New Developer
_dinob_
Posts: 4
Registered: ‎06-09-2009
My Device: Not Specified

Re: Question re Blackberry working with Tomcat

Hi Barak,

 

I am new to blackberry, tomcat.  I will take a look at that today, I guess tomcat log says the connection was from blackberry or? 

 

Huh, ... I just looked at logs directory of my Tomcat and there are lots of log files (admin.date.log, catalina.date.log, host-manager.date.log, jakarta.service_date.log, localhost.date.log, manager.date.log, stderr_date.log, stdout_date.log)

 

Which one do I look for and what do I look for?

 

Thanks,

Dino