Generating EJB Code

Generating EJB Code
How do I fix these weird null pointer exceptions?

Often the various meta data files for an EJB project contain left over junk from development. This causes the WebSphere ejbDeploy tool to fail in mysterious ways.

Please check the following files:

  1. META-INF/Schema - must be in the jar file for CMP beans
  2. META-INF/Map.mapxmi - must contain references to tables in the META-INF/Schema directory for CMP Beans
  3. META-INF/ibm-ejb-jar-bnd.xmi - must reference beans in META-INF/ejb-jar.xml
  4. META-INF/ibm-ejb-jar-ext.xmi - must reference beans in META-INF/ejb-jar.xml

How do I fix errors about RMIC needing to be in the path when generating EJB code?

If you see something like this:

[java] Error generating RMI code: Cannot run RMIC because it is not installed. Expected location of RMIC is the following: On the system PATH..
[java] RMIC command was:
[java] rmic -keep -iiop -nowrite -d "ejbModule" -classpath ...

It's usually because you are using a JDK other than the IBM JDK shipped with AppServer. Usually it's enough to set JAVA_HOME to something like C:\WebSphere\AppServer\java

I get a strange FileNotFoundException compiling code. What's going on?

If you see a stack trace like this:

[java] Core exception: Could not write file: C:\Documents and Settings\...

Chances are that the directory path is too long and the file can't be written or read.

To fix this specify a shorter working directory, e.g.

maven.was40.workingDir=c:/temp/was40