Wednesday, June 22, 2011

Eclipse: How to convert a Java Project into a Web Project

Eclipse Version: Helios Service Release 1

Java projects do not have the Export->WAR File option. To get this option you must convert your Java project into a web project.

Step 1: Create a new Dynamic Web Project
Step 2: Open the Dynamic Web Projects .project file and copy the following lines of XML to your Java projects .project file.


[2011-06-15 14:01:36 - ddms]null

<buildspec>
...
<buildcommand>   <name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
...
</buildSpec>

<natures>
...
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
...
</natures>


Step 3: Within the Java projects Project Facets enable the Dynamic Web Module and Java.

Tuesday, June 14, 2011

Android Programming: ddms]null java.lang.NullPointerException error

Starting Android emulator within Eclipse Helios I get:


[2011-06-15 14:01:36 - ddms]null
java.lang.NullPointerException
at com.android.ddmlib.Client.sendAndConsume(Client.java:572)
at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142)
at com.android.ddmlib.HandleHello.sendHelloCommands(HandleHello.java:65)
at com.android.ddmlib.Client.getJdwpPacket(Client.java:671)
at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:317)
at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)
}



To fix this problem set a Size on the SD card property within the Android Virtual Device (AVD).

Wednesday, February 23, 2011

Formatting code in Blogger


public class MyTestClass {
 public static void main(String[] args) {
  System.out.println("Nicely formated code");
 }
}



blogger-publish-code-in-stylish-box

Thursday, February 17, 2011

MyEclipse Webservice Explorer

Web service using MyEclipse (Helios) I came across this error:

IWAB0135E An unexpected error has occurred.
503
Service Unavailable

Retrieving the the WDSL file was fine but making a web service call continuously gave the above 503 error. Turns out the problem was an Eclipse proxy setting issue.

Go to Window->Preferences->Network Connections make sure localhost and 127.0.0.1 by pass any proxy settings.