Chapter 7. Assembly and Deployment

Assemble Web components, EJB components, and application client components into enterprise applications

EJB troubleshooting checklist

  1. Check how you have structured your application:

    • Look at your workspace and count how many EARs are there. How many enterprise applications do you have?

    • How have you mapped your Enterprise Application modules (J2EE Application Client project, EJB project, or Web project) to your Enterprise Application project(s) (EAR project)?

  2. Check to see if you have a classpath problem:

    • Are you using any java utilty projects or static JAR files? If you are using static JAR files where have you placed them?

      Place static JAR files in WEB-INF/lib if you are only using them in a web application or place them in the Enterprise Application (EAR) if you wish to share them between multiple Enterprise Application modules (Application Client, EJB, or WEB projects) or if being used by only your EJB application.

    • Have all of your Project Utility JARs been mapped to the Enterprise Application module that they will be used in?

      Ensure that you have added your Java Project to the Project Utility JARs form on the Module page of the Enterprise Application deployment descriptor.

      Project Utility JARs

    • Are you getting a java.lang.NoClassDefFoundError stack trace at runtime dealing with classes that are contained in the Java Utility project or static JAR file?

      Check your Java JAR Dependencies for your Enterprise Application module and ensure that all the required JAR files are checked off on this page (right click on the Project > Properties > Java JAR Dependencies):

      Project Utility JARs

      There are two different classpaths that you need to be concerned with when development and testing an Enterprise Application. The Java Build Path is the classpath that is used by the compiler to locate dependent classes for compilation purposes only. The Java JAR Dependencies (a front-end to the MANIFEST.MF file) is used by the runtime to locate dependent classes that are located in your Enterprise Application or in other Entperise Application modules contained within your Entperise Application. So in your workspace your application may compile properly and you might think that it is working but you need to ensure that the same JARs are visible at runtime by adding them on the Java JAR Dependencies page to avoid java.lang.NoClassDefFoundError errors from happening.

      TIP: Always select the JAR files in Java JAR Dependencies first as it will automatically add the JAR files to your Java Build Path.

BOOT.BY - Tech Industry News         Free SCBCD 1.3 Study Guide     Free SCDJWS 1.4 Study Guide     SCDJWS 1.4 Quiz     Free IBM Certified Associate Developer Study Guide     Free SCJP 5.0 (Tiger) Study Guide     Free Mock Exam Engine     Free SCWCD 1.4 Study Guide     IBM Test 000-287. Enterprise Application Development with IBM WebSphere Studio, V5.0 Study Guide     Free SCBCD 5.0 Study Guide