Tuesday, October 6, 2009

Glassfish doesn't compile JSP

Well, I have everything set correctly:
All of JDK, JAVA_HOME and CLASSPATH are set correctly.
But as soon as I deploy a Hello World web app, this is what Glassfish returned
org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP
PWC1406: Servlet.service() for servlet
threw exception java.lang.NullPointerException
 at org.apache.jasper.compiler.Jsr199JavaCompiler.compile

There is direct solution to it. Update <glassfish_home>/domains/<DOMAIN_NAME>/config/domain.xml

<java-config classpath-suffix="" ... java-home="${com.sun.aas.javaRoot}" java-options="-g" ...></java-config>
<java-config classpath-suffix="" ... java-home="C:/Program Files/Java/jdk1.6.0_14" java-options="-g" ...></java-config>

what I did is I hard coded JDK_HOME (C:/Program Files/Java/jdk1.6.0_14) in the XML .

Monday, October 5, 2009

The php5apache2_2.dll Chaos.

I am a Java developer by my heart and soul. But you can't just ignore all this people pestering you for being conventionalist and non-agile developer. So, I happened to have install PHP on machine. I decided to install PHP and NOT WAMP because I already had MySQL 5 and Apache 2.2 on my WinXp Box.

After setting everything.. nothing worked... seemed like I have to do something with php5apache2_2.dll. People suggest weird stuffs and wasted half of the day stubbornly.

To cut the long story short, there are two type of Zip file released. One of them contains php5apache2_2.dll and other DON'T. To specify:

1. The Thread-safe version CONTAINS php5apache2_2.dll
2. The non-Thread-safe version DOES NOT contain php5apache2_2.dll

So, be cautious which one you're downloading.

Saturday, July 25, 2009

Setting-up VM Option in Eclipse

I was trying to play around with Maven and Eclipse. There was this nagging pop-up comes up every start-up saying,
The Maven Integration requires that Eclipse be running in a JDK, because a number of Maven core plugins are using jars from the JDK.
Please make sure the -vm option in eclipse.ini is pointing to a JDK and verify that Installed JREs are also using JDK installs.
Googled and found jdk1.x.x/bin/javaw.exe should be passed as vm parameter. I kept this parameter at the end of eclipse.ini file and it did not work.

Here is what I did (in eclipse.ini file under %ECLIPSE_HOME%) to get this working:
  1. Located javaw.exe which was here: C:\Program Files\Java\jdk1.5.0_06\bin\javaw.exe
  2. Placed vm parameter just above -vmargs parameter
    like this:

    C:\Program Files\Java\jdk1.5.0_06\bin\javaw.exe

  3. You must note two things here
    a. -vm and location of VM (C:\Program Files\Java\jdk1.5.0_06\bin\javaw.exe) has to be in separate lines.
    b. No - quote -- even if there exists a space in the path, the path should not be enclosed with double quotes.

Here is how my %ECLIPSE_HOME%/eclipse.ini looks like (click the image to see clearer)

  1. Eclipse SDK Help