Java5 and WTK2.1

Hello,
I'm new to j2me and I've written cause I've got and error that I cannot understand. I'm on a Linux 2.6.9 Knoppix Debian box and I've java5 sdk and J2ME WirelessToolkit 2.1 installed. I read the Wireless Development Tutorial and I've tried to compile and run the example midlet from that. Compiling was ok but when I tried to 'run' midlet with emulator I've got an error and I don't know why. Anyway I 've pasted the source and two screen to let you understand and see that.
This is the source of midlet (taken by Wireless Development Tutorial Part 1)
http://tlug.interfree.it/HelloMIDlet.java
This is the first screen and shows the correct compilation
http://tlug.interfree.it/wtk.jpg
This is the second screen and shows the error and verbose error messages that I've got
http://tlug.interfree.it/wtk1.jpg
Could you help me to understand what is the problem? Maybe java5?
thank you

Source level in the project properties should do it.
But I guess If you use Netbeans ME it should already
be oke..I've been looking at this since my last post. I'm using Netbeans 5.0 (with the mobility pack) and Java 5 (1.5.0). If that's not what you mean by Netbeans ME, please let me know. I set the compiler to give verbose output and it appears that Netbeans is using source 1.3 and target 1.1. I've tried changing the 1.3 to 1.2 in a couple of places but it doesn't appear to change the output. Does changing this have any effect if I only have the one JDK installed?
The reason I'm investigating this is my threading code appears to cause the application to terminate on an old MIDP 1.0 phone. I've set the environment to generate 1.0 code. I even downloaded some threading code from someone else. Their jar runs fine on the phone, but if I compile the source myself, the resulting app terminates on the phone.

Similar Messages

  • Linux and wtk2.5

    Why is not possible to download the " Sun Java Wireless Toolkit 2.5 for CLDC, Beta" for LInux?
    when it will be possible?
    Thanks

    Hey,
    From what I can tell Sun Java does not seem to be releasing a 2.5 version for linux :(

  • On 6u13, new plug-in fails to load on Windows 2003 and IE7

    I'm attempting to load an applet in IE7 with an OBJECT tag in Windows 2003. This is a mature product that has, for this release, moved from 5 to 6. The CLSID was changed from the CAFEEFAC one for any version of 5 to the one for any version of 6. Java 5 version worked fine on Windows 2003. Now, on some, but not all, of our 2003 systems the ActiveX control for the new Java Plug-in fails to load.
    These configurations work:
    - Windows XP and any Java and any IE
    - Windows 2003 and Java5 and any IE
    - Windows 2003 and Java6, old plug-in, and any IE
    - Windows 2003 and Java6 and APPLET tag and any IE
    This one doesn't...on some machines:
    - Windows 2003 and Java6, new plug-in, IE7, OBJECT tag
    This is not a security problem. If I turn off the new style plug-in in the control panel, it works. However, I'd really like to avoid doing this, as the new plug-in has much needed features. Also, the APPLET tag works where the OBJECT tag doesn't. I can implement this change if needed, but it would be fairly painful and I'd prefer to avoid it.
    Does anyone know why this might be happening? Is there a good way for me to diagnose this? The browser is quite silent as to what the error might be.
    I appreciate any help. This one is truly vexing me!

    Okay, I'm wrong...I thought I could move to APPLET tags...I cannot. LiveConnect from JavaScript to Java does not support APPLET tags, only OBJECT tags. This makes my problem worse, as I don't have any recourse so far, except to disable the new plugin.
    However, this did lead to a clue: disabling the new plugin caused it to work again. When the new plugin was re-enabled to see it fail again, much to my surprise, it worked! Does anyone know what flipping that option actually does? Registry change or something else?

  • Multi threading race condition in JTable while rendering and truncating?

    Hi All,
    It seems that there is a race confition when rendering a large table which is truckated by another thread while rendering it on a JTable view.
    Let me try to explain what I think is the problem:
    When considering the folowing code from BasicTableUI
    First the size of the tbale model is determined in
    public void paint(Graphics g, JComponent c) {
    [snip]
            if (rMax == -1) {
             rMax = table.getRowCount()-1;
            }then this cMax is passed to:
    private void paintCells(Graphics g, int rMin, int rMax, int cMin, int cMax) {
         JTableHeader header = table.getTableHeader();
         TableColumn draggedColumn = (header == null) ? null : header.getDraggedColumn();
         TableColumnModel cm = table.getColumnModel();
         int columnMargin = cm.getColumnMargin();
            Rectangle cellRect;
         TableColumn aColumn;
         int columnWidth;
         if (table.getComponentOrientation().isLeftToRight()) {
             for(int row = rMin; row <= rMax; row++) {
              cellRect = table.getCellRect(row, cMin, false);
                    for(int column = cMin; column <= cMax; column++) {
                        aColumn = cm.getColumn(column);
                        columnWidth = aColumn.getWidth();
                        cellRect.width = columnWidth - columnMargin;
                        if (aColumn != draggedColumn) {
                            paintCell(g, cellRect, row, column);
                        cellRect.x += columnWidth;
         } else {The prepareRenderer works like this:
        public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
            Object value = getValueAt(row, column);
    [snip]
         return renderer.getTableCellRendererComponent(this, value,
                                                       isSelected, hasFocus,
                                                       row, column);
        }Here the above getValueAt is called for every cell to be rendered (in one thread) , while async a row can be deleted (in another thread) while the tables rendereing is still in progress. This leads to a value to be unexpectedly be null in the above return renderer.getTableCellRendererComponent method call: this method could return an empty panel to indicated that the cell is gone which is strange behaviour because the row doesn't exists anymore. The other option would be to return a null renderer so that the cell won't be rendered but that is impossible because the code doens't expect a null renderer. The third option could to be synchronize somehow the 2 threads so that any delete on the model has to wait until the rendering has finished.
    A possble solution could be to make paintCells at least protected and change to code to see if the designated row still exists, and if not don't increment the row height
    Any help/feedback is greatly appreciated!
    Note that this question is based upon Java5 and I do not know if this is also true for Java6
    Thnx
    Andr'e

    So this means that a TableModel must be manupulated (setValueAt , adding deleting and/or updating objects in this TableModel) through a thread in the EventQueue!
    i.e. (pseudo code)
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    getTableModel().setValueAt(........)
            });A

  • JRockit R28 and XStream

    Hi,
    fyi: testing JRockit R28 we ran into a small compatibility issue - in R28 vendor name has change from BEA to Oracle and out xstream-based code will not work anymore.
    This patch "http://jira.codehaus.org/browse/XSTR-618" is solving this issue. Both, xstream 1.3 and 1.3.1 are affected.
    regards,
    makiey

    I opened an SR and got this clarified. There are separate downloads for the Java5 and Java6 versions of R27 and R28. If you have a support contract, log in, select "Patches & Updates" at the top of the screen, then select the "Product or Family (Advanced)" link. Product is "Oracle JRockit." Then select your desired release and platform.

  • Enum in java 5 to be replaced in java2

    Hi,
    Could anyone suggest for the following problem
    Now in a lot of programs, enum keyword is used which use java5 and this keyword is to be replaced by some codes which would run with java2 .
    Could anyone please say a generic way by which i will not need to change in each file and solve the purpose which can be run by java2 too.

    : /\ P:^P would look better. ;)
    0 0
      >
      U

  • Alternatives to waiting for Future.get()?

    Hi,
    I'm new to the Java5 and 6 concurrency classes. But so far they seem very cool. My goal is to bulk load data concurrently by using multiple threads. A FixedThreadPool seems like it will do the job just fine.
    My question has to do with retrieving the value from Future objects. It seems that since Future.get() blocks, it would kind of slow down my entire process if say for example, the first thread takes 10 minutes to complete (whereas all the other threads would take just a few seconds).
    I was using Runnable instead of Callable, but the reason I changed to use Callable was so I could return a boolean if an error occurred during processing. Then I could abort the entire batch process if for example, the first 20 tasks were failing due to a server being down, etc.
    Any ideas on how I could improve the design to accomplish my goal?
    Here is a little proof-of-concept I put together for demonstrating:
    import java.util.ArrayList;
    import java.util.List;
    import java.util.concurrent.Callable;
    import java.util.concurrent.ExecutorService;
    import java.util.concurrent.Executors;
    import java.util.concurrent.Future;
    public class CallableExample {
        public static void main(String[] args) throws Exception {
            CallableExample callableExample = new CallableExample();
            callableExample.runExample();
        private void runExample() throws Exception {
            System.out.println("Starting threads");
            ExecutorService executorService = Executors.newFixedThreadPool(2);
            List<Future<String>> futures = new ArrayList<Future<String>>();
            for (int i = 0; i < 2; i++) {
                final int finalI = i;
                Future<String> future = executorService.submit(new Callable<String>() {
                    public String call() {
                        if (finalI == 0) {
                            try {
                                Thread.sleep(30000);
                                System.out.println("Running thread: " + finalI);
                            } catch (InterruptedException e) {                           
                        if (finalI == 1) {
                            try {
                                Thread.sleep(5000);
                                System.out.println("Running thread: " + finalI);
                            } catch (InterruptedException e) {                           
                        return Integer.toString(finalI);
                futures.add(future);
            executorService.shutdown();
            System.out.println("Threads started, main ended");
            for (Future<String> future : futures) {
                System.out.println("Future value: " + future.get());
    }Here is the output I get:
    Starting threads
    Threads started, main ended
    Running thread: 1
    Running thread: 0
    Future value: 0
    Future value: 1Thanks!
    Edited by: user13426024 on Dec 6, 2010 12:45 PM

    user13426024 wrote:
    My question has to do with retrieving the value from Future objects. It seems that since Future.get() blocks, it would kind of slow down my entire process if say for example, the first thread takes 10 minutes to complete (whereas all the other threads would take just a few seconds).
    I think in reality this is a non-scenario: the Future.get() is called where the result is actually used, right? While a thread is blocked in the get(), the other threads in your thread pool will continue to proceed and any other thread requesting the result of those futures will not block in their get() calls.

  • J2ME WTK not connect to network in user mode

    Hi
    I am using Linux - Fedora, I have been using J2ME WTK in root user and then shifted to normal user account. After that I have installed the J2ME WTK in normal user mode.
    /home/tharindu
    it contains j2mewtk folder and WTK2.5.2 also installed under /tharindu folder. But still I need to shift to root user and run ktoolbar from command line shows following
    Loading simple Config module ...
    Creating backend ...
    Loading socket FrontEnd module ...
    Starting SCIM as daemon ...
    OTA server emulation started ...
    HTTPS server emulation started ...But when I run from normal user it only shows
    OTA server emulation started ...
    HTTPS server emulation started ...And also I can't connect to even localhost. How can I solve this. Please kindly help me.
    Thank you,
    Tharindu

    Given there is no way to know what your fiancée did to the system the best course of action is to re-install ML.
    Re-installing the OS will not touch your user data, only the system files will be restored.
    Before doing this it is a good idea to have a backup of the system.
    regards

  • WTK 2.5.1on Linux

    Hi I am migrating my development enviroment from windows to linux but I am finding some problems, here are three issues I have seem:
    1 =======================
    The scripts run.sh does not work to solve this I had to:
    1. change permission chmod 755
    2. change the file where it says:
    DEMO=demos
    put
    DEMO=Demos
    2 =======================
    I am trying to test a jar file using jsr75 to access cell filesystem it works great on WTK2.5.1 on windows but it stops when reading a directory on Linux the emulator asks permission to read the user press yes it goes when it asks again to read the contents of that directory the user press yes and nothing happens. I have double checked permissions on the appd/filesystem/root1 permissions even with chmod 777 it does not work. See that this same .jar works well on Windows WTK2.5.1
    3 =======================
    In the games demo the push-puzzle when play a sound it sounds too strange, as it was played fast foward
    =======================
    I am using netbeans 5.5.1 and wtk2.5.1 that came with it on Ubuntu 7.04 with kernel 2.6.20-16 and java -version returns
    java version "1.5.0_11"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
    Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
    ===============
    Thanks, hope to hear from you soon

    Hi Thanks for your answer the issue 1 was done with the Ktoolbar but issue 2 dtill not working even if i am using ktoolbar to create a project build and run it.
    Here is the KtoolBar console output:
    Warning: Cannot convert string "-b&h-luxi sans-medium-r-normal--*-140-*-*-p-*-iso8859-1" to type FontStruct
    Warning: Cannot convert string "-misc-ar pl shanheisun uni-medium-r-normal--*-*-*-*-p-*-iso10646-1" to type FontStruct
    /usr/share/themes/Human/gtk-2.0/gtkrc:71: Engine "ubuntulooks" is unsupported, ignoring
    /usr/share/themes/Human/gtk-2.0/gtkrc:241: Priority specification is unsupported, ignoring
    Running with storage root DefaultColorPhone
    Running with locale: pt_BR.UTF-8
    Running in the identified_third_party security domain
    Warning: To avoid potential deadlock, operations that may block, such as
    networking, should be performed in a different thread than the
    commandAction() handler.and here is my code:
    * MIDletAcessoFileSystem.java
    * Created on 9 de Junho de 2007, 16:24
    import java.io.DataInputStream;
    import java.io.DataOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Enumeration;
    import javax.microedition.io.Connector;
    import javax.microedition.io.file.FileConnection;
    import javax.microedition.io.file.FileSystemRegistry;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    * Exemplo de utiliza&#65533;&#65533;o do FileSystem
    * @author Tadeu Ferreira Oliveira
    * @version 0.1
    public class MIDletAcessoFileSystem extends MIDlet implements CommandListener{
         * Uma lista para exibir o nome dos arquivos encontrados
        private List lista;
         * Comando para sair do programa
        private Command sair;
         *Acionado para exibir o conte&#65533;do de um diret&#65533;rio no sistema de arquivos
        private Command listarArquivos;
         * Versao da API FileConnection
        private String versao;
         * Construtor obtem o valor da vari&#65533;vel versao
        public MIDletAcessoFileSystem(){
            this.versao = System.getProperty("microedition.io.file.FileConnection.version");
         * Localiza todos os drives dispon&#65533;veis no aparelho
         * @return Retorna um Enumeration de String com o nome dos drives encontrados
        private Enumeration obterListaDeDrives(){
            Enumeration drives =  FileSystemRegistry.listRoots();                           
            return drives;
         * Localiza todos os arquivos em um determinado drive
         * @return Retorna um String[] com o nome dos arquivos encontrados
         * @param drive O drive que dever&#65533; ser listado sem barra no in&#65533;cio Ex.: root1/
        private Enumeration obterListaDeArquivos(String drive){
            Enumeration arquivos =  null;
            try {
                FileConnection fc = (FileConnection) Connector.open("file://localhost/"+drive, Connector.READ);
                arquivos = fc.list();
            } catch (IOException ex) {
                ex.printStackTrace();
            return arquivos;
        public List get_lista(){
            if (this.lista == null){
                String[] elementos = null;           
                lista = new List("Arquivos",List.EXCLUSIVE);
                lista.addCommand(get_sair());
                lista.addCommand(get_listarArquivos());
                lista.setCommandListener(this);
            return lista;
        public Command get_sair(){
            if(sair == null){
                sair = new Command("Sair",Command.EXIT,0);
            return sair;
        public Command get_listarArquivos(){
            if(this.listarArquivos == null){
                this.listarArquivos = new Command("Listar",Command.ITEM,1);
            return this.listarArquivos;
        public void startApp() {
            Display d = Display.getDisplay(this);
            if (versao != null){
                if (versao.equals("1.0")){
                    d.setCurrent(get_lista());
                String elem = null;
                Enumeration em = this.obterListaDeDrives();           
                while (em.hasMoreElements()) {
                    elem = (String) em.nextElement();
                    get_lista().append(elem,null);  
            }else{
                Alert alErro = new Alert("Erro","Aparelho sem suporte a arquivos",null,AlertType.ERROR);
                alErro.setTimeout(Alert.FOREVER);
                d.setCurrent(alErro,get_lista());
        public void pauseApp() {
        public void destroyApp(boolean unconditional) {
        public void commandAction(Command command, Displayable displayable) {
            if (command == get_sair()){
                this.destroyApp(true);
                Display.getDisplay(this).setCurrent(null);
                this.notifyDestroyed();
            }else{
                if(command == get_listarArquivos()){               
                    //obtem o drive selecionado no momento
                    int indice = this.get_lista().getSelectedIndex();
                    String drive = this.get_lista().getString(indice);
                    //limpar a lista
                    this.get_lista().deleteAll();
                    String elem = null;
                    Enumeration en = this.obterListaDeArquivos(drive);
                    //adicionar os arquivos na lista
                    while (en.hasMoreElements()) {
                        elem = (String) en.nextElement();
                        this.get_lista().append(elem,null);  
    }

  • Java.lang.SecurityException: untrusted domain is not configured

    anyone familiar with this exception?
    help...thanks

    Hi,
    I've got the same problem with netbeans 4.0 and WTK2.2... but I don't have some MIDP_HOME variable. I tried to uninstall and reinstall properly the both (netbeans and WTK) but the problem doesn't disappear.
    After some test it make that for all projects I create... Have you got any idea about this problem ?
    Thank you
    @++

  • Re: ToolKit 2.5, sample app

    Hi Bill,
    The video file is stored locally with the installation of the WTK. In the Beta2, the location of the file is here: C:\WTK25-Beta2\apps\MobileMediaAPI\res\video.
    Stay tuned as we'll be releasing the final version of WTK 2.5 soon.
    Thanks,
    E-ming
    WTK Product Manager

    The IDE i'm using is NetBeans. I have WTK2.5 and WTK2.5.2 installed. When I flick the "emulator platform" from WTK2.5 to WTK2.5.2 the error "Missing end tag for body or envelope" does go away, and the SOAP response is successfully parsed. However, when I flick it back to WTK2.5, I get the error back. The SOAP message is being sent properly, and a good response is returned. The problem is with parsing the response. WTK2.5 can't seem to parse it, but WTK2.5.2 can.
    So I can get the application working fine (when the emulator platform is set to WTK2.5.2), but the problem is, I still get the error when I install the app on any phone, and I don't understand why???
    If anyone can shed any light on this, i'd be very grateful.
    p.s I've tested the app on the following handsets:
    Sony Ericsson P1i, K800i
    Nokia E70, E61

  • WT 2.5 / WT 2.5.2 - Web Services problem - Missing end tag??

    Hi,
    I'm trying to create a J2ME web services client using the wireless toolkit. I used the Stub Generator to create my STUB from my WSDL file.
    With the Wireless Toolkit 2.5 I was getting a "Missing end tag for body or envelope" error when I invoked a web method. I read that this was a problem with that version of the Wireless Toolkit (a parsing problem).
    I then upgraded to Wireless Toolkit 2.5.2. When running my app on the emulator, the "Missing end tag for body or envelope" error went away, and I was successfully invoking web methods, and the results were being parsed fine. However, when I put this .jar on to my handset (a Nokia E70) I still see the "Missing end tag for body or envelope" error!
    Does anyone know why this is?

    The IDE i'm using is NetBeans. I have WTK2.5 and WTK2.5.2 installed. When I flick the "emulator platform" from WTK2.5 to WTK2.5.2 the error "Missing end tag for body or envelope" does go away, and the SOAP response is successfully parsed. However, when I flick it back to WTK2.5, I get the error back. The SOAP message is being sent properly, and a good response is returned. The problem is with parsing the response. WTK2.5 can't seem to parse it, but WTK2.5.2 can.
    So I can get the application working fine (when the emulator platform is set to WTK2.5.2), but the problem is, I still get the error when I install the app on any phone, and I don't understand why???
    If anyone can shed any light on this, i'd be very grateful.
    p.s I've tested the app on the following handsets:
    Sony Ericsson P1i, K800i
    Nokia E70, E61

  • Oracle Client NOT INSTANT on Mac OSX Tiger NOT X SERVER PPC

    Has anyone been able to install The Oracle Mac Client from on a g4 ppc. It has tiger and the latest updates ie java5 and gcc 4.
    I have seen many postings on installing Oracle 10g on Tiger ppc but not just the client. Does anyone have any experience with this. With some many developers going to macs, I would imagine someone has to.
    http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/macsoft.html
    Thanks
    Steve

    i,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • IDE that works?

    Hello!
    I'm looking for an IDE that works.....
    First I tried Suns Java Studio Mobility..... it was extremely buggy....got exceptions when trying to import......
    Then I tried the eclipseME plugin for eclipse..... it was even more buggy......the J2ME categories did'nt show up in Project > Properties....
    Do I have to buy Borlands JBuilder ...or is there something free that works....?
    Please help
    /Arnold

    I am using Eclipse 3.0 with EclipseME and WTK2.1. It works perfectly fine.
    May be u can try to enable the plugin. Try this:
    Help -> Software Updates -> Manage Configuration
    On the toolbar of the pop-up window, click on "Show Disable Features". If EclipseMe shows up on the left panel, click the check box to enable it.
    Hope this helps.

  • Web services using OIM Client API.

    Hi All,
    decided to try out some webservices talking to OIM via the client api. have a few questions.
    is it better if the webservice app server and the OIM ejb app server are the same? i.e. weblogic.
    I noticed in some of the code that configurationclient is using "web-client" rather than "Discovery.Coreserver" as the first param. what's the difference?
    Im currently using tomcat5 and java5 with xfire. and I think tomcat is not liking the weblogic jar. I could swap out the app server but would like to keep using java5 and xfire if that's possible.
    curious to hear abut other setups.
    Thanx.
    Fred

    I have a couple of clients using web services to expose OIM APIs. The most common approaches is to either use Apache Axis or the web service module in Websphere.
    Perhaps you should try migrating to Apache Axis if your application server doesn't like the Weblogic jars?
    I personally like Axis but that is mostly because I have used Axis a couple of times.
    Best regards
    /M

Maybe you are looking for