The EJB checklist presents various
questions or tasks that you can go through to help determine or
eliminate possible problems that are preventing you from successfully
doing what you want to do within this product.
Some of the items in this checklist are merely things you should ask
yourself during your troubleshooting process and some are tips or links
to information you might find useful.
Jump to a section below that best describes what you were trying to
do:
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)?
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.
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).
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.
Always select the JAR files in Java JAR Dependencies first as it will automatically add the JAR files to your Java Build Path.
Check to see if your problem is
a limitation with the specifications
Is this a stateless or a
stateful session bean?
Is your session bean using
container managed or bean managed transactions?
Are all requires resource
references defined correctly?
Which database are you trying to map your EJBs to?
Some EJB deploy code directly depends on the Database vendor type and Operating System that you choose.
For example, if you choose DB2 on Windows and generate the EJB deploy
code, it is possible that it may fail if your intended runtime target
is DB2 on z/OS.
Make sure that your backend database defined for your EJB is your
intented runtime database and Operating System so that when you
generate the EJB deploy code it will be correct for that platform.
The ideal situation is to have both development and production
databases on the same platform; However, this may not be realistic so
you can create multiple backends and switch between them in the EJB
Deployment descriptor. Ensure that after you change your backend in the
EJB Deployment descriptor that you generate the EJB deploy code again.
Verify that your database metadata files are not currupted
Look in your EJB modules backend folder in your workspace.
Can all the tables listed in the database and schema definition file be opened using their corresponding editors?
If the answer is yes, then your metadata files are
ok
If the answer is no, then try to import the
database information again by using the EJB to RDB Mapping wizard (right-click on your EJB project > EJB to RDB Mapping >
Generate Map) and use your new backend information.
Verify that you have mapped your EJB to your database correctly: (The
following are yes or no questions to jog your mind)
Are all the ejb attributes and corresponding tables mapped?
Are the defined ejb relationships correct given the actual
relationships among the tables?
Are the CMRs properly mapped to the Foreign Key constraints?
Are Queues/Topics and their connection factories properly configured?
Are the listener ports defined?
Are the JNDI names properly specified?
Is JAAS security id specified correctly and used if required by a
connection factory?
EJB App
Exceptions are not thrown by MDBs as they have no client to intercept
them
BMP
EJBs are an advanced programming model. The best resources for debugging
your code or learning about how to write BMPs are books on the topic. See the useful how-to information at the top of this topic for links to books.
Is the datasource JNDI name correctly associated with the ejb projects
or individual cmp ejbs?
Is the correct backend ID specified in the WebSphere bindings section of the EJB Deployment Descriptor?
An EJB project may have multiple backends and each one needs to have it's EJB deploy code generated
Are transactional attributes and access intents specified in the EJB
Deployment descriptor and understood?
The
best source for this information is in the WebSphere Application Server
information center. See this listed in the Information Centers and Libraries site
Does the generate code work correctly?
Have you tried to debug or step through the generated code to
identify the bad code or queries being used? This is a difficult task
and depends on your skill level.
When
troubleshooting ejbdeploy problems, go through the tooling first before
you debug your generated code.
The best source for server related information is in the WebSphere Application Server information center. See this listed in the
Information Centers and Libraries site
. Questions you might want to ask yourself are:
Which version of the server is indicated in your console?
Is this a datasource configuration issue?
Does the server start cleanly?
Is this a server runtime issue?
The best source for server related information is in the WebSphere Application Server information center. See this listed in the
Information Centers and Libraries site
. Questions you might want to ask yourself are:
Check the Websphere Troubleshooting tips
Is this a classloading issue?
Is this a DataSource configuration issue?
Does the server start cleanly?
Do you get a "Failure uploading archive to server" message when you are trying to publish an application to a remote WebSphere application server?
This message may result if the machine running Rational Developer cannot ping the IP address or hostname that is containted in the remote server's serverindex.xml.
To resolve this problem, on the server machine modify the hostname defined in <WAS_HOME>\profiles\<PROFILENAME>\config\cells\<CELLNAME>\nodes\<NODENAME>\serverindex.xml file and change the hostname to one that the machine running Rational Developer can resolve