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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 44
Registered: ‎03-17-2012
My Device: Blackberry playbook
My Carrier: none
Accepted Solution

HTTP Status 500 when I get webpage with HTTPConnection

Hello,

I have a method that get a string with the  HTML source of a webpage. I use HTTPConnection utils for this. This method works perfectly, I used this in other project and I didn´t have any problem. In my new project I want to use this method again for a specific webpage(I can´t say the URL of this web).

My problem is that this page return an 'HTTP Status 500' error. If I use the BlackBerry browser,  the web loads perfectly, and in the BB simulator too. 

I thought that the problem was the HTTP Request Header, and I included some Request properties like:

 

httpConnection.setRequestProperty("Content-Type", rawInputContentType);

Connection", "keep-alive");
httpConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (BlackBerry; U; BlackBerry 9360; es) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.190 Mobile Safari/534.11+");
httpConnection.setRequestProperty("Accept", "text/html,application/xhtml+xml,application/xml,*/*;q=0.5");
httpConnection.setRequestProperty("Accept-Language", "es");
httpConnection.setRequestProperty("Accept-Encoding","gzip,deflate");
httpConnection.setRequestProperty("x-wap-profile", "\"http://www.blackberry.net/go/mobile/profiles/uaprof/9360_80211g/7.1.0.rdf\"");

 

But the error is the same. The exception is:

 

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.RuntimeException: de.arvatomobile.bdev.scr.exception.MissingDeviceDetectionHeaderException
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:681)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:574)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:108)
info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:216)
com.mondiamedia.shop.magnolia.filter.MagnoliaContextFilter.doFilter(MagnoliaContextFilter.java:113)
info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:88)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
com.mondiamedia.common.filter.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:83)
com.mondiamedia.shop.vodafone.es.adult.filter.BlacklistFilter.forwardToBlacklist(BlacklistFilter.java:221)
com.mondiamedia.shop.vodafone.es.adult.filter.BlacklistFilter.doFilter(BlacklistFilter.java:99)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

 

Do you know why I get this error?. Thank you.

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: HTTP Status 500 when I get webpage with HTTPConnection

Your user-agent looks incorrect for a Blackberry device.

 

At the end of the day, your best bet is to get the logs from the host web site. Thios will tell you exactly what the complaint is.

 

 

Developer
Posts: 44
Registered: ‎03-17-2012
My Device: Blackberry playbook
My Carrier: none

Re: HTTP Status 500 when I get webpage with HTTPConnection

It´s resolved. It had two problems. The first, I connected with WIFI of my office, and this had very bad signal. The second, it was only neccesary to specify the user-agent, others header parameters gave problems.