Oracle® TopLink Developer's Guide 10g Release 3 (10.1.3.1.0) Part Number B28218-01 |
|
|
View PDF |
This chapter discusses some of the general troubleshooting issues surrounding entity bean configuration and deployment. It lists many of the common exceptions and exception messages that you may encounter when you try to deploy persistent entity beans, using TopLink.
If you have any problems installing TopLink, using TopLink Workbench, or require more information on any run-time exceptions that are generated by TopLink, consult the appropriate documentation.
This chapter contains information on:
If you experience trouble generating the JAR files for deployment:
Ensure all environment entries (such as classpath) are configured properly.
Identify which step of the build is failing (copying, compiling, running EJB compiler, and so on.)
Running the EJB compiler utility involves several processes, such as compiling, code-generation, EJB compliance verification, compiling RMI stubs by running rmic
, and so on. If an error occurs during execution of the EJB compile utility, try to determine which stage may be causing the failure.
For more information about the EJB compile utility, see the server documentation.
The following are some of the most common exceptions that may be encountered when you try to deploy a J2SE (non-J2EE) application using TopLink.
An exception may occur while setting up the connection pool. You must check the nested SQL exception to determine the cause of the exception. Typical reasons for this include the following:
The location of JDBC driver is not specified on the classpath.
The user name or password provided by the user is incorrect.
The server URL or driver name is not properly specified.
You should consult the application server documentation and the JDBC driver documentation for help with this exception.
If the required TopLink JAR files have not been copied into the application extensions classpath, a classpath exception will be raised. You must ensure that the toplink.jar
and antlr.jar
files are copied into the <Application Server install>
\lib\app
directory.
If TopLink encounters problems finding the deployment project.xml
or sessions.xml
files, a classpath exception will be raised. Refer to Chapter 10, "Deploying a TopLink Application".
JDeveloper places the sessions.xml
file in the META-INF
directory. To load the sessions.xml
file in a non-J2EE application, you must explicitly provide the location of the sessions.xml
file as shown in Example 15-1.
Example 15-1 Location of the sessions.xml file
XMLSessionConfigLoader loader = new XMLSessionConfigLoader("META-INF/sessions.xml"); session = (DatabaseSession)SessionManager.getManager().getSession( loader, "MySession", Thread.currentThread().getContextClassLoader());
If the J2SE application is a single-user application, a DatabaseSession
can be used instead of a ServerSession
. This provides improved performance and reduces the number of database connections and login time.
In situations where cache coordination is used, a communication exception may occur. A communication exception is a run-time exception that wraps all RMI, CORBA, or input and output exceptions that occur.
Refer to the Communication Exceptions (12000 - 12003) section in the TopLink Exception Reference chapter for detailed information on communication exceptions that may occur.
A descriptor exception is a development exception that is raised when insufficient information is provided to the descriptor. The message that is returned includes the name of the descriptor or mapping that caused the exception. If a mapping within the descriptor caused the error, then the name and parameters of the mapping are part of the returned message.
The internal exception, mapping and descriptor appear only if TopLink has enough information about the source of the problem to provide this information.
Refer to the Descriptor Exceptions (1 – 201) section in the TopLink Exception Reference chapter for detailed information on descriptor validation exceptions that may occur.
The following are some of the most common exceptions that are encountered when you deploy entity beans to a BEA WebLogic Server.
For more information about specific versions, see the following:
toplink.jar
file is not properly set on your classpath. The following exception message is returned:
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[Could not load class '
oracle.toplink
.internal.ejb.cmp.wls.WlsCMPDeployer': java.lang.ClassNotFoundException:
oracle.toplink
.internal.ejb.cmp.wls.WlsCMPDeployer
ERROR: ejbc found errors
ORACLE_HOME>
/toplink/jlib/toplink.jar
file is specified on your system classpath.DeploymentException
has occurred.[TopLink-8001]
). These errors may refer to errors in the specification of the project location reading in the properties file or validation errors due to improper mappings.toplink-ejb-jar.xml
file. The following exception message is returned:
<Error> <J2EE> <Error deploying application Account:
Unable to deploy EJB: AccountBean from Account.jar:
LOCAL EXCEPTION STACK:
EXCEPTION [TOPLINK-8001] (TopLink (WLS CMP) - X.X.X): oracle.toplink.ejb.DeploymentException
EXCEPTION DESCRIPTION: No
TopLink project was specified for this bean.
at
oracle.toplink.ejb.DeploymentException.noPro jectSpecified(DeploymentException.java:132) at oracle.toplink.internal.ejb.cmp.ProjectDeployment.readProject(ProjectDeployment.java:378)
toplink-ejb-jar.xml
file for either the project-xml
or project-class
.<Error> <J2EE> <Error deploying application Account:
Unable to deploy EJB: AccountBean from Account.jar:
LOCAL EXCEPTION STACK:
EXCEPTION [TOPLINK-8016] (TopLink (WLS CMP) - X.X.X): oracle.toplink.ejb.DeploymentException
EXCEPTION DESCRIPTION: An error occurred while setting up the project: [java.io.FileNotFoundException: Account.xml]
INTERNAL EXCEPTION: java.io.FileNotFoundException: Account.xml
at
oracle.toplink.ejb.DeploymentException.errorCreatingProject(Unknown Source)
toplink-ejb-jar.xml
file, and the location of the project file on the file system.<Error> <JDBC> <Cannot startup connection pool "ejbPool" weblogic.common.ResourceException: Cannot load driver class: org.hsqldb.jdbcDriver>
...
The JDBC driver is not on the classpath.
The user name or password provided by the user is incorrect.
The server URL or driver name is not properly specified.
You should consult the BEA WebLogic Server documentation and your JDBC driver documentation for help on the specific exception raised by BEA WebLogic.
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[Could not create an instance of class 'null': java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at weblogic.ejb20.persistence.PersistenceType. loadClass
(PersistenceType.java:309)
toplink.jar
file is not properly set on your classpath. The following exception message is returned:
ERROR: ejbc found errors
Error from ejbc: Error while loading persistence resource TopLink_CMP_Descriptor.xml Make sure that the persistence type is in your classpath.
<ORACLE_HOME>
/toplink/jlib/toplink.jar
file is specified on your system classpath.weblogic.ejb20.EJBDeploymentException: Error Deploying CMP EJB:; nested exception is: weblogic.ejb20.cmp.rdbms.RDBMSException: An error occurred setting up the project:
EXCEPTION [TOPLINK-13000] (vX.X [TopLink for WebLogic X.X] JDK1.2): oracle.toplink.xml.XMLDataStoreException
EXCEPTION DESCRIPTION: File not found...
toplink-ejb-jar.xml
file, and the location of the TopLink project file on the file system.toplink-ejb-jar.xml
file is referring to a local DTD file using a file name or location that is incorrect. The following exception message is returned:
Error deploying EJB Component:... weblogic.ejb20.EJBDeploymentException: Exception in EJB Deployment; nested exception is:
Error while deploying bean..., File... Not Found at weblogic.ejb20.persistence.PersistenceType.setup Deployer(PersistenceType.java:273)
Cannot startup connection pool "ejbPool" weblogic.common.ResourceException:
Could not create pool connection. The DBMS driver exception was:...
The driver is not on the classpath.
The user name or password is incorrect.
The server URL or driver name is not properly specified.
You should consult the BEA WebLogic Server documentation and your JDBC driver documentation for help on the specific exception raised by BEA WebLogic.
Other Exceptions
Occasionally, changes made to the server's configuration file (config.xml
) do not appear to be applied when the server is restarted. If this occurs, try removing the temporary directories created by BEA WebLogic Server. You can find them under the wlserver6.1
directory, at the same level as the config
directory.
The following are a few of the most common exceptions you may encounter when deploying JAR files with TopLink and BEA WebLogic Server 6.1:
persistence.install
file for TopLink CMP. This may occur if the TopLink installation was interrupted or a BEA WebLogic Server Service Pack was applied. The following exception message is returned:
ERROR: Error from ejbc: Persistence type 'TopLink_CMP_2_0' with version 'X.X which is referenced in bean 'Account' is not installed. The installed persistence types are: (WebLogic_CMP_RDBMS, 6.0), (WebLogic_CMP_RDBMS, 5.1.0)
.ERROR: ejbc found errors
<WebLogic InstallDir>
/wlserver6.1/lib/persistence
directory, edit the persistence.install
file to add a new line TopLink_CMP_Descriptor.xml
, or replace your existing persistence.install
file with the version of the file in the <ORACLE_HOME>
/toplink/config
directory.toplink.jar
file is not properly set in your classpath. The following exception message is returned:
Error while loading persistence resource TopLink_CMP_Descriptor.xml Make sure that the persistence type is in your classpath.
<ORACLE_HOME>
/toplink/jlib/toplink.jar
file.C:\
<ORACLE_HOME>
\toplink
\examples\weblogic\wls61\ examples\ejb\cmp20\singlebean\Account.java:10: cannot resolve symbol
symbol : class EJBLocalObject
location: interface examples.ejb.cmp20.singlebean.Account
public interface Account extends EJBLocalObject {
persistence.install
file for TopLink CMP. This may occur if the TopLink installation was interrupted, or a BEA WebLogic Server Service Pack was applied. The following exception message is returned:
Persistence type 'TopLink_CMP_2_0' with version 'X.X which is referenced in bean 'Account' is not installed. The installed persistence types are: (WebLogic_CMP_RDBMS, 6.0), (WebLogic_CMP_RDBMS, 5.1.0).
<WebLogic InstallDir>
/wlserver6.1/lib/persistence
directory, edit the persistence.install
file to add a new line: TopLink_CMP_Descriptor.xml
. You can also replace your existing persistence.install
file with the version of the file in the <ORACLE_HOME>
/toplink/config
directory.toplink.jar
file is not properly set in your classpath. The following exception message is returned:
<
DATE and TIME
> <Error> <J2EE> <Error deploying application ejb20_cmp_order:
Unable to deploy EJB: C:\
<ORACLE_HOME>
\toplink\examples\weblogic\wls61\server\config\TopLink_Domain\applications\wlnotdelete\wlap64280\ejb20_cmp_order.jar from ejb20_cmp_order.jar:
Error while loading persistence resource TopLink_CMP_Descriptor.xml Make sure that the persistence type is in your classpath.
at
weblogic.ejb20.persistence.InstalledPersistence.initialize(InstalledPersistence.java:214)
at
weblogic.ejb20.persistence.InstalledPersistence.getInstalledType(InstalledPersistence.java:113)
<ORACLE_HOME>
/toplink/jlib/toplink.jar
file.persistence-version
meant for BEA WebLogic Server 7.0. The following exception message is returned:
DATE and TIME
> <Error> <J2EE> <Error deploying application ejb20_cmp_account:
Unable to deploy EJB: Account from ejb20_cmp_account.jar:
java.lang.AbstractMethodError
at
weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.deploy(ClientDrivenBeanInfoImpl.java:807)
at
weblogic.ejb20.deployer.Deployer.deployDescriptor(Deployer.java:1234)
at
weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:947)
at
weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:30)
persistence-version
of 4.0.EXCEPTION [TOPLINK-7060] (TopLink (WLS CMP)-X.X):
oracle.toplink
.exceptions.ValidationException
EXCEPTION DESCRIPTION: Cannot acquire datasource [jdbc/ejbNonJTSDataSource].
INTERNAL EXCEPTION: javax.naming.NameNotFoundException: Unable to resolve jdbc.ejbNonJTSDataSource Resolved: '' Unresolved:'jdbc' ; remaining name 'ejbNonJTSDataSource'
<
DATE and TIME
> <Error> <Management> <Error parsing XML descriptor for application TopLink_Domain:Name=ejb20_cmp_account, Type=Application
weblogic.xml.process.ProcessorFactoryException: Could not locate processor for public id = "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
at
weblogic.xml.process.ProcessorFactory.getProcessor(ProcessorFactory.java:181)
at
weblogic.xml.process.ProcessorFactory.getProcessor(ProcessorFactory.java:164)
The following are a few of the most common exceptions you may encounter when deploying JAR files with TopLink and BEA WebLogic Server 7.0:
persistence.install
file for TopLink CMP. This may occur if the TopLink installation was interrupted, or a BEA WebLogic Server Service Pack was applied. The following exception message is returned:
Persistence type 'TopLink_CMP_2_0' with version 'X.0 which is referenced in bean 'Account' is not installed. The installed persistence types are: (WebLogic_CMP_RDBMS, 6.0), (WebLogic_CMP_RDBMS, 5.1.0), (WebLogic_CMP_RDBMS, 7.0)
ERROR:
ejbc found errors
<WebLogic InstallDir>
/weblogic700/lib/persistence
directory, edit the persistence.install
file to add a new line: TopLink_CMP_Descriptor.xml
. You can also replace your existing persistence.install
file with the version of the file in the <ORACLE_HOME>
/toplink/config
directory.persistence.install
file for TopLink CMP. This may occur if the TopLink installation was interrupted, or a BEA WebLogic Server Service Pack was applied. The following exception message is returned:
ERROR: at
weblogic.ejb20.persistence.InstalledPersistence.initialize(InstalledPersistence.java:214)
at
weblogic.ejb20.persistence.InstalledPersistence.getInstalledType(InstalledPersistence.java:113)
at
weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.getPersistenceType(MBeanDeploymentInfoImpl.java:584
<WebLogic InstallDir>
/weblogic700/lib/persistence
directory, edit the persistence.install
file to add a new line: TopLink_CMP_Descriptor.xml
. You can also replace your existing persistence.install
file with the version of the file in the <ORACLE_HOME>
/toplink/config
directory.ERROR: Error processing 'META-INF/weblogic-ejb-jar.xml': The public id, "-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN", specified in the XML document is invalid. Use one of the following valid public ids:
"-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN"
"-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN"
ERROR:
ejbc found errors
persistence.install
file for TopLink CMP. This may occur if the TopLink installation was interrupted or a BEA WebLogic Server Service Pack was applied. The following exception message is returned:
Error from ejbc: Persistence type 'TopLink_CMP_2_0' with version 'X.0 which is referenced in bean 'Account' is not installed. The installed persistence types are: (WebLogic_CMP_RDBMS, 6.0), (WebLogic_CMP_RDBMS, 5.1.0), (WebLogic_CMP_RDBMS, 7.0).
Persistence type 'TopLink_CMP_2_0' with version 'X.0 which is referenced in bean 'Account' is not installed. The installed persistence types are: (WebLogic_CMP_RDBMS, 6.0), (WebLogic_CMP_RDBMS, 5.1.0), (WebLogic_CMP_RDBMS, 7.0)
<WebLogic InstallDir>
/weblogic7.0/lib/persistence
directory, edit the persistence.install
file to add a new line: TopLink_CMP_Descriptor.xml
. You can also replace your existing persistence.install
file with the version of the file in the <ORACLE_HOME>
/toplink/config
directory.toplink.jar
file is not properly set in your classpath. The following exception message is returned:
java.lang.NullPointerException
at
weblogic.ejb20.deployer.EJBDeployer.deactivate(EJBDeployer.java:1513)
at
weblogic.ejb20.deployer.EJBDeployer.undeploy(EJBDeployer.java:301)
at
weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:875)
at
weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:70)
<ORACLE_HOME>
/toplink/jlib/toplink.jar
file.EXCEPTION [TOPLINK-7060] (TopLink (WLS CMP) - X.X.X):
oracle.toplink
.exceptions.ValidationException
EXCEPTION DESCRIPTION: Cannot acquire datasource [jdbc/ejbNonJTSDataSource].
INTERNAL EXCEPTION: javax.naming.NameNotFoundException: Unable to resolve jdbc.ejbNonJTSDataSource Resolved: '' Unresolved:'jdbc' ; remaining name 'ejbNonJTSDataSource'
The following are a few of the most common exceptions you may encounter when deploying JAR files with TopLink and BEA WebLogic Server 8.1:
persistence.install
file for TopLink CMP. This may occur if the TopLink installation was interrupted, or a BEA WebLogic Server Service Pack was applied. The following exception message is returned:
Persistence type 'TopLink_CMP_2_0' with version 'X.0 which is referenced in bean 'Account' is not installed. The installed persistence types are: (WebLogic_CMP_RDBMS, 7.0), (WebLogic_CMP_RDBMS, 6.0), (WebLogic_CMP_RDBMS, 5.1.0).
<WebLogic InstallDir>
/weblogic81/lib/persistence
directory, edit the persistence.install
file to add a new line: TopLink_CMP_Descriptor.xml
. You can also replace your existing persistence.install
file with the version of the file in the <ORACLE_HOME>
/toplink/config
directory.persistence.install
file for TopLink CMP. This may occur if the TopLink installation was interrupted, or a BEA WebLogic Server Service Pack was applied. The following exception message is returned:
ERROR:
ejbc couldn't invoke compiler
<WebLogic InstallDir>
/weblogic81/lib/persistence
directory, edit the persistence.install
file to add a new line: TopLink_CMP_Descriptor.xml
. You can also replace your existing persistence.install
file with the version of the file in the <ORACLE_HOME>
/toplink/config
directory.toplink.jar
file is not properly set in your classpath. The following exception message is returned:
Error occurred while loading persistence resource TopLink_CMP_Descriptor.xml. Make sure that the persistence type is in your classpath.
ERROR:
ejbc couldn't invoke compiler
<ORACLE_HOME>
/toplink/jlib/toplink.jar
file.ERROR: ejbc found errors while processing the descriptor for std_cmp20-singlebean.jar:
ERROR: ejbc found errors
while processing 'META-INF/weblogic-ejb-jar.xml': The public id, "-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN", specified in the XML document is invalid. Use one of the following valid public ids:
"-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN"
"-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN"
"-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN"
ERROR
ejbc found errors
persistence.install
file for TopLink CMP. This may occur if the TopLink installation was interrupted or a BEA WebLogic Server Service Pack was applied. The following exception message is returned:
Error Deployer BEA-149201 Failed to complete the deployment task with ID 0 for the application _appsdir_cmp20-singlebean_ear. weblogic.management.ApplicationException: Exception:weblogic.management.ApplicationException: prepare failed for cmp20-singlebean.jar
Module: cmp20-singlebean.jar Error: Exception preparing module: EJBModule(cmp20-singlebean.jar,status=NEW)
Persistence type 'TopLink_CMP_2_0' with version 'X.0 which is referenced in bean 'Account' is not installed. The installed persistence types are: (WebLogic_CMP_RDBMS, 7.0), (WebLogic_CMP_RDBMS, 6.0), (WebLogic_CMP_RDBMS, 5.1.0)
<WebLogic InstallDir>
/
weblogic81/lib/persistence
directory, edit the persistence.install
file to add a new line: TopLink_CMP_Descriptor.xml
. You can also replace your existing persistence.install
file with the version of the file in the <ORACLE_HOME>
/toplink/config
directory.toplink.jar
file is not properly set in your classpath. The following exception message is returned:
Error Deployer BEA-149201 Failed to complete the deployment task with ID 2 for the application _appsdir_cmp20-relationships_ear.
weblogic.management.ApplicationException: Exception:weblogic.management.ApplicationException: prepare failed for cmp20-relationships.jar
Module: cmp20-relationships.jar Error: Exception preparing module: EJBModule(cmp20-relationships.jar,status=NEW)
Unable to deploy EJB:.\TopLink_Demos\stage\_appsdir_cmp20-relationships_ear\cmp20-relationships.jar from cmp20-relationships.jar:
[EJB:011004]Error occurred while loading persistence resource TopLink_CMP_Descriptor.xml. Make sure that the persistence type is in your classpath.
at weblogic.ejb20.persistence.InstalledPersistence.initialize(InstalledPersistence.java:212)
at weblogic.ejb20.persistence.InstalledPersistence.getInstalledType(InstalledPersistence.java:114)
<ORACLE_HOME>
/toplink/jlib/toplink.jar
file.When the IBM WebSphere application server is started, it attempts to deploy the JAR files that are specified for deployment within the application server.
Exceptions that occur when the server is started are usually configuration problems that involve classpath issues, environment variable configuration, and database login configuration. Review the IBM WebSphere application server documentation after starting the server.
This section contains some of the exceptions that can be encountered when running the IBM WebSphere application server, along with their possible causes and recommended solutions.
[TopLink-1016]
). Exceptions observed here may be exceptions in reading in the properties file, or validation errors due to improper mappings.
Refer to the Database Exceptions (4002 – 4018) section in the TopLink Exception Reference chapter for detailed information on database exceptions that may occur; refer to the Communication Exceptions (12000 - 12003) section in the TopLink Exception Reference chapter for detailed information on communication exceptions that may occur.
oracle.toplink.exceptions.QueryException: The object <Object> of class <class> with identity hashcode <hashcode> is not from this Unit of Work object space but the parent session's. The object was never registered in this Unit of Work, but read from the parent session and related to an object registered in the Unit of Work. Ensure that you are correctly registering your objects. If you are still having problems, you can use the UnitOfWork.validateObjectSpace() method to help debug where the error occurred. Please see the manual and FAQ for more information.
ejbPassivate
method.ejbPassivate
method removes the bean.oracle.toplink.exceptions.ValidationException: Exception occurred in reflective EJB bean primary key extraction, please ensure your primary key object is defined correctly: key = 301, bean = <beanName>
oracle.toplink.exceptions.ValidationException: Cannot create or remove beans unless a JTS transaction is present, bean=<bean>
toplink.properties
file for the session specified on the toplink_session_name environment
variable cannot be found. The following exception message is returned:
oracle.toplink.exceptions.ValidationException: The project class
<projectclass>
was not found for the
<toplink_session_name>
using default class loader.
oracle.toplink.exceptions.ValidationException: An exception occurred looking up or invoking the project amendment method,
<amendmentMethod>
on the class
<amendmentClass>
;
toplink.properties
file cannot be found. The following exception message is returned:
oracle.toplink.exceptions.ValidationException: A toplink.properties resource bundle must be located on the classpath in a
TopLink directory.
toplink.properties
file is on the classpath.EXCEPTION DESCRIPTION: The descriptor for [<bean class>] was not found in the session [<session name>]. Check the project being used for this session.
toplink-ejb-jar.xml
file is the desired project. Also check that the project includes a descriptor for the missing bean class.toplink-ejb-jar.xml
file was not found. The following exception message is returned:
No "meta-inf/toplink-ejb-jar.xml" could be found in your classpath. The CMP session could not be read in from file.
toplink-ejb-jar.xml
file is located in the deployed ejb-jar
file under the meta-inf
directory.toplink-ejb-jar.xml
file cannot be found. The following exception message is returned:
EXCEPTION [TOPLINK-9002] (TopLink - X.X.X): oracle.toplink.exceptions.SessionLoaderExceptionEXCEPTION DESCRIPTION: Unable to load Project class [<project class>].
This section lists some of the common exceptions that can occur at run time when using the TopLink CMP for IBM WebSphere application server.
This section lists common exceptions that may occur when running the TopLink for IBM WebSphere application server Deploy Tool.
Note: The Deploy Tool calls external IBM classes to generate deployed code. Any exceptions that are thrown from these classes are written toSystem.out . Check Tracing to view the most detailed information. |