Current position:  Home > Default > Error in running MIDlet

Error in running MIDlet

Time:October 11
Advertisement
Hi, all
I have a problem around MIDlet.
Here, the MIDlet source code :
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.io.*;
import java.io.*;
public class BolaMidlet extends Form implements CommandListener
+{     +
private Display display;
private static final Command cmExit = new Command("Keluar", Command.EXIT, 1);
private static final Command cmSubmit = new Command("Login", Command.OK, 1);
private BolaMidlet midlet;
private TextField tfUsername;
private TextField tfMajor;
private String result;
public BolaMidlet(BolaMidlet midlet, Display display)
+{+
super("BolaMidlet");
this.midlet = midlet;
this.display = display;
tfUsername = new TextField("Username", "", 20, TextField.ANY);
tfMajor = new TextField("Major", "", 20, TextField.ANY);
append(tfUsername);
append(tfMajor);
addCommand(cmExit);
addCommand(cmSubmit);
setCommandListener(this);
+}+
public void startApp()
+{+
display.setCurrent(this);
+}+
public void pauseApp()
+{+
display.setCurrent(null);
+}+
public void destroyApp(boolean unconditional)
+{+
+}+
public void exitMIDlet()
+{+
destroyApp(false);          
+}     +
public void commandAction(Command c, Displayable s)
+{+
if(c == cmExit)
+{+
midlet.exitMIDlet();
+}+
else if(c == cmSubmit)
+{+
try
+{+
submit(tfUsername.getString(), tfMajor.getString());
+}catch(Exception e)+
+{+
e.printStackTrace();
+}+
+}          +
+}+
public void submit(String user, String major)
throws IOException
+{+
String url = "http://localhost:8080/hello/sayhello?user=user&pass=major";
HttpConnection hc = null;
StringBuffer sb = null;
InputStream is = null;
try
+{+
hc = (HttpConnection)Connector.open(url, Connector.READ_WRITE);
hc.setRequestMethod(HttpConnection.GET);
hc.setRequestProperty("User-Agent", "Profile/MIDP-2.1 Configuration/CLDC-1.1");
hc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
if(hc.getResponseCode() == HttpConnection.HTTP_OK)
+{+
sb = new StringBuffer();
int ch;
is = hc.openInputStream();
while((ch = is.read()) != -1)
sb.append((char)ch);
+}+
else
+{+
System.out.println("Network error");
+}     +
+}catch(IOException e)+
+{+
e.printStackTrace();
if(hc != null)
hc.close();
if(sb != null)
result = sb.toString();
if(is != null)
is.close();
+}finally+
+{+
if(is != null)                    
is.close();                    
if(sb != null)               
result = sb.toString();                    
if(hc != null)                    
hc.close();                    
+}+
+}+
when I compiled it, there was no problem.
But, when I launched it on the emulator
there was an error in WTK console like this :
Unable to create MIDlet BolaMidlet
java.lang.IllegalAccessException
at com.sun.midp.midlet.MIDletState.createMIDlet(34)+
at com.sun.midp.midlet.Selector.run(22)+
and then the emulator said : BolaMidlet, BolaMidlet exception : java.lang.IllegalAccessException
can someone help me to solve this ?
I really need help for this one.
Thank You,
Best Regards,
CHi
Edited by: ichiwan on Sep 30, 2007 11:23 AM
Advertisement
{color:#000080}The code you have posted is for a class that extends Form, not MIDlet.
To post code, use code tags --{color} [code]CODE[/code] {color:#000080}is displayed as CODEPlease do not try to format parts of your code as bold or italic as that reduces the readability still more.
db{color}

Runtime Error, when running midlet.

-0001-11-30

I can build the midlet without problems. This error occurs when the emultator starts the midlet. I can se the phone for a sec or two then i turns of and the error occurs in the console. I am using, j2me, eclipse, eclipseme, cldc1.1,mipd2.2. Running w

Error while running a Java Program

2015-10-11

Can anyone help me, I am getting the following error while running a Java program, Below is the exception thrown, please help. java.nio.BufferOverflowException at java.nio.Buffer.nextPutIndex(Buffer.java:425) at java.nio.DirectByteBuffer.putChar(Dire

Error while running a report

2015-10-11

Hi all, I am getting this particular error while running a report. The error is: <b>SQL Error: 604 System error in program SAPLRRK0 and form RSRDR;SRRK0F30-01- Diagnosis This internal error is a targeted termination since the program has an incorrec

Error While Running a page on JDeveloper

2015-10-11

Hi All , I am getting the following error while running a page in Jdeveloper . Can any body help me? (AppsContext.java:686) at oracle.apps.fnd.common.WebAppsContext.(WebAppsContext.java:846) at oracle.apps.fnd.framework.server.OAUtility.getWebAppsCon

Error while running a KPI Watchlist in obiee 11g dashboard

2015-10-11

I am getting the following error while running a KPI Watchlist : *" Odbc driver returned an error (SQLExecDirectW) "* I added two KPI's (KPI 1 & KPI 2)into that Watchlist , one from the default "Sample Sales Lite" (sub 1) and anoth

Error while running a customize report in oracle ebs

2015-10-11

Hi .. can anybody suggest how to solve the follwing error while running a customize report in oracle ebs? XXIFMS: Version : UNKNOWN Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved. Current system time is 03-JUN-2011 11:09:24 +------

Error in running a function to convert coordinates in degrees to decimal for EXCEL VBA

2015-10-11

For your information, I have 3 cross-posts regarding this question - and all I can said there is still no firm solution regarding this error. 1) http://stackoverflow.com/questions/27634586/error-in-running-a-function-to-convert-coordinates-in-degrees

Error while running web application through JDEV (10.1.3.0.3) in OC4J

2015-10-11

Error while running web application through JDEV (10.1.3.0.3) in OC4J. Here is the error message. 07/10/02 14:45:28 Exception in thread "OC4J Launcher" oracle.classloader.util.AnnotatedNoClassDefFoundError:      Missing class: javax.xml.bind.JAX

I am facing error while running Quickpay in Fusion payroll that "The input value Periodicity is missing for element type KGOC_Unpaid_Absence_Amount. Enter a valid input value". Any idea?

2015-10-11

I am facing error while running Quickpay in Fusion payroll that "The input value Periodicity is missing for element type KGOC_Unpaid_Absence_Amount. Enter a valid input value". Any idea?This is most probably because the Periodicity input value h

500 Internal server error while running sqlsrv_query in PHP

2015-10-11

Hello everyone I am having a problem with sqlsrv_query I will be grateful to you please provide some help. I am running a query through php: $ls_parcel_query = "select  * from  ParcelDetail order by ExtractDate"; $result = sqlsrv_query($conn, $l

Error while running the Report

2015-10-11

Hi , I am trying to run the Report in Bex Analyzer. and once I enter the value for the variable, it gives me message that "Element is not correctly define (please check query)" and when i click on the error it gives me detail message as below :

Urgent.....Error while running a jsp report from Jdeveloper

2015-10-11

Hi, I am getting following error while running a jsp report from Jdeveloper. I am using version 10.1.2.1.0. The same report is working fine when I am running it from report builder. ( Both these tools were installed using Oracle Developer Suite 10g v

Error while running a test case in Jcaps 6 JDBC project

2015-10-11

I encountered an error while running the testcase for a JDBC BC project in Jcaps 6. BPCOR-6135:A fault was not handled in the process scope; Fault Name is {http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure; Fault Data is null.

Error  while running custom BI report in R12.1.1

2015-10-11

Hi All, We are encountering below error while running custom BI report in R12.1.1... Forcing NLS_NUMERIC_CHARACTERS to: '.,' for XDO processing APPLLCSP Environment Variable set to : Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables a

Error while running the financial report in the workspace.

2015-10-11

Hi, Im getting the below error while running the financial report in the workspace in HTML mode. *"Required application module reporting.HRRunDlg is not configured. Please contact your administrator".* And im not able to login to the Hyperion Fi

Urgent...Error while running a jsp report in Jdeveloper

2015-10-11

Hi, I am getting following error while running a jsp report from Jdeveloper. I am using version 10.1.2.1.0. The same report is working fine when I am running it from report builder. ( Both these tools were installed using Oracle Developer Suite 10g v

Error while running OBIA configuration configApps.bat

2015-10-11

I am receiving error while running configapps.bat. I have the following wnvironment installed: 64 Bit windows Java 6 (JDK1.6.x) Weblogic server 10.3.6 in software only mode Ran OBIEE 11.1.1.7.0 RCU utility to create BIPLATFORM and MDS schemas. config

Error while running Helloworld page from Jdeveloper

2015-10-11

Hi I am getting the following error while running HelloworldPG.xml from Jdeveloper. Any help in this will be greatly appreciated .. Error Page Exception Details. oracle.apps.fnd.framework.OAException: Application: FND, Message Name: FND_GENERIC_MESSA

Error when running crystal report

2015-10-11

i saw the error in log file 'Only TrueType fonts are supported. This is not a TrueType font' and 'Error while running Crystal report' Help me to fix this problem.Thanks inadvanced. I used some software developed in vb6.It changed some system font whe