ALERT: Native method 'com/sun/midp/io/NetworkConnectionBase::initializeInternal' not found!

M

M.I.K.U

Hi at all,

anyone knows this error: ALERT: Native method
'com/sun/midp/io/NetworkConnectionBase::initializeInternal' not found! ? I
use netbeans to my debug and this is my code for connect a remote
webservice:


String getViaHttpConnection(String url) throws IOException {
HttpConnection c = null;
InputStream is = null;
StringBuffer str = new StringBuffer();

try {
c = (HttpConnection)Connector.open(url);

// Get the ContentType
//String type = c.getType();

// Getting the InputStream will open the connection
// and read the HTTP headers. They are stored until
// requested.
is = c.openInputStream(); <--- Close the emulator and show
the error in the subject!


// Get the length and process the data
int len = (int)c.getLength();
int ch;
while ((ch = is.read()) != -1) {
str.append((char)ch);
}

} finally {
if (is != null)
is.close();
if (c != null)
c.close();
}


// Before returning, the resultant String should be parsed to get
Exchange Rate

String val = str.toString();
return val;
}
 
J

John C. Bollinger

M.I.K.U said:
Hi at all,

anyone knows this error: ALERT: Native method
'com/sun/midp/io/NetworkConnectionBase::initializeInternal' not found! ? I

It probably means that either Netbeans or your Java implementation is
incorrectly installed. If Netbeans comes with its own Java
implementation and you also have another, of a different version,
installed on your system then it may be that your code is getting
confused as to which it should use (and somehow using a mixture of the
two). Some things to try:

(1) Recompile the whole project in Netbeans and test against the result.

(2) Check whether you get the same error when running your project via
the command line Java launcher. That won't get you Netbeans' debugger,
but if you don't get the error there then it supports the hypothesis of
an installation problem.

(3) Install Netbeans on a clean machine (w/o Java), and use it for your
tests.


John Bollinger
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top