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
Posts: 19
Registered: ‎06-19-2009
My Device: Not Specified

Exception "Malformed Address. Returning null connection" when opening a socket

We have a problem with our application on a device that works fine for a while, but sometimes ends up in a state where it is no longer able to open a socket. We get the exception "Malformed Address.  Returning null connection" when calling Connector.open(). We continue to get the exception until we reboot the phone, after which everything works fine. Any ideas on what could cause this, and/or how we could avoid this? The device in question is an 8320.
BlackBerry Development Advisor
Posts: 15,808
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Exception "Malformed Address. Returning null connection" when opening a socket

What BlackBerry handheld software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.

 

Are you opening an outgoing or incoming (listening) connection?  Can you provide sample URL syntax that is triggering the exception?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
New Developer
Posts: 49
Registered: ‎05-14-2009
My Device: Not Specified

Re: Exception "Malformed Address. Returning null connection" when opening a socket

Hi!

I’ve got the same problem.

When I’m using the simulator all is fine, but on a real BB (7130) – an error.

 

String    str = "socket://” + POP3Server + “:” + POP3Port ;

POP3Connection = (StreamConnection)Connector.open(str);

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Exception "Malformed Address. Returning null connection" when opening a socket

What level JDE are you using.  What level is the OS on the device?
New Developer
Posts: 49
Registered: ‎05-14-2009
My Device: Not Specified

Re: Exception "Malformed Address. Returning null connection" when opening a socket

JDE - 4.7
BB – v4.2.1.96
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Exception "Malformed Address. Returning null connection" when opening a socket

You cannot compile on 4.7 and deploy on a device running 4.2 (or anything lower than 4.7).

 

Recompile on 4.2.1 and try it again.

 

 

New Developer
Posts: 49
Registered: ‎05-14-2009
My Device: Not Specified

Re: Exception "Malformed Address. Returning null connection" when opening a socket

Thank you for your help!

I’ve tried JDE 4.1.0, 4.2.0, 4.2.1, but I still have the same.

Can it be because of wrong APN settings?

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

Re: Exception "Malformed Address. Returning null connection" when opening a socket

Sure - let's see the entire URL with the connection APN parameters.

 

New Developer
Posts: 49
Registered: ‎05-14-2009
My Device: Not Specified

Re: Exception "Malformed Address. Returning null connection" when opening a socket

Hi!
I’ve checked this thread: http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=29103#M29103. It was very helpful for me. I managed to implement the http connection, but I still can’t implement the direct TCP connection. My carrier gave me an APN string. The same string I found in Options->Advanced->Host Routing Table in my device.
Is it possible that the direct TCP is not allowed?
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Exception "Malformed Address. Returning null connection" when opening a socket

It is possible that direct TCP is not allowed, but I would not expect the error that you are reporting.  Can you confirm the device and OS you are seeing this on and confirm the error that you are seeing.