To not be able to find a core jdk class such as java.io.PrinterWriter, the runtime classpath of the servlet has to be completely screwed up. The Sun J2EE jdk should not be used with ecplise when using jboss. Only the J2SE jdk that is bundled with eclipse is needed.
I need a reference to the J2EE JDK so that I can write EJBs.
I do not know exactly what caused the problem, but your reply got me looking in the right place.
I changed the build classpath order, which caused Eclipse to recompile everything. I then changed it back to the way that it was to start with and it recompiled everything again. I then restarted the JBoss server and redeployed the application and it wirked.
Thanks for your help,
You don't need the j2ee sdk to compile ejbs. Every app server will includes its own implementation of the j2ee classes. The jboss classes are located in one of:
depending on which components you are using.
I just got the same problem in the following environment:
- Eclipse 3.1.1 with JBossIDE 1.5
- Fedora Core 4 Linux
- JDK 1.5.0_06
- JBoss 4.0.3SP1 (installer used with install everything)
I've been trying to follow the EJB3 Trailblaizer demo with my own Classes and when running the Servlet I get the same error NoClassDefFaundException for java.io.PrintWriter.
I created a Debug instance for 4.0.3SP1 (using the JDK5) - I'm also starting Eclipse with Java5.
Seems very strange since this is such a basic functionality that it should work.