Tuesday Nov 04, 2008

Took me a day and a couple experiments to figure out what went wrong. Maven web application archetype creates project for J2EE 1.3 and has a web.xml with web-app_2_3.dtd, which seems to be the cause why JSTL is not working.

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
  <display-name>Archetype Created Web Application</display-name>
</web-app>
 

The solution? Simply copy over a web.xml in web-app_2_5.dtd seems to fix the problem.

<⁞?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    </web-app>

I am surprised that I cannot find a solution by searching the net, either I am very bad at search or the problem is too obvious to fix. Anyhow, hope this post would help people like me.

Wednesday May 28, 2008

For those who needs to develop for J2ME with more decent APIs and wants to run OpenSolaris x86, the choices were to run Linux or Windows in a virtual machine, or you can try to install MPowerPlayer or MicroEmulator yourself and tinkering around the settings.

Now there is a much easier choice, thanks to Karol Harezlak, who brings us the MicroEmulator support in Netbeans. Here is how easy it is:

1. Download MicroEmulator. Decompress the files into a folder.

2. Download the MicroEmulator Netbeans Plugin. Unzip and there are two nbm files.

3. In Netbeans, Select Tools|Plugins, click on Downloaded tab, and click "Add Plugins..." to add both nbm files.

4. Select Tools|Java Platforms, click on "Add Platform...", select "Java ME MIDP Platform Emulator", click on Next.

5. Select the folder with MicroEmulator in the chooser.

Now you can start develop J2ME applications on Solaris.

Based on my experience, MPowerPlayer does not work very well. Couple things bug me on Solaris:

1. Lacking of preverifer for Solaris. You can either download the source from phoneME project and build it yourself, or use ProGuard preverifier, which is implemented in Java.

2. Netbeans cannot detect MPowerPlayer on Solaris as it does for Mac. So I have to create customized J2ME platform.

3. Netbeans complains String.equalsIgnoreCase does not exist with MPowerPlayer. You can work around it by using jars from Wireless Toolkit, but that's a lot of hassle.

On the other hand, MicroEmulator works out of box with Karol's plugin. Thanks again, Karol.

Wednesday May 14, 2008

I have being upset that Solaris doesn't get latest Wireless Toolkit and decided to do something about it. The first thing I did is trying to build phoneME on Solaris as I was told that CLDC/MIDP is the main reason why Wireless Toolkit won't be available on Solaris(Aren't those available for Solaris with WTK2.1?), although I doubt all the different optional JSRs might be in problem as well.

Anyway, I started to port PCSL last year when worked on Robosapien, dropped it as I switched to other projects, and picked it up again recently. Thanks to Hinkmond, Gary and Yevgeny, the PCSL patch is now in the trunk. To build PCSL on Solaris:

gmake NETWORK_MODULE=bsd/generic

Moved on to CLDC, after tinkering around the build system and a patch, I can now build CLDC with

LD_ALTEXEC=/usr/gnu/bin/ld gmake

Noted that it has to be gnu ld, for some reason I don't know, the Solaris ld doesn't want to work by giving me following error:

linking ../bin/cldc_vm_g ...
ld: elf error: file ../bin/libcldc_vmtest_g.a: elf_getarsym
ld: fatal: File processing errors. No output written to ../bin/cldc_vm_g
collect2: ld returned 1 exit status
make[1]: *** [../bin/cldc_vm_g] Error 1
make[1]: Leaving directory `/export/home/henryjen/prj/phoneme/cldc/build/solaris_i386_gcc/target/debug'
make: *** [_debug] Error 2

Does anyone have an idea on what's going on with Solaris ld?

This blog copyright 2009 by slowhog