Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Websphere and the fly likes adEjbModule error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "adEjbModule error " Watch "adEjbModule error " New topic

adEjbModule error

Mike Jones
Ranch Hand

Joined: Dec 12, 2001
Posts: 109
I'm trying to install one of the applications (MyBank) from a WebSphere tutorial in WAS AEs 4.0.2.
Lab: Build a WebSphere Application
url ->
I get the following error in the stdout log file:
X WSVR0040E: addEjbModule failed for (desiredExecutionState: START) (uri: Deployed_MyBankEJB.jar)
java.lang.LinkageError: Class WebSphereSamples/AccountAndTransfer/AccountKey violates loader constraints
The java AccountKey class from the tutorial follows. Can someone tell me why it violates the loader constraints?
Sorry about the formatting.
// 5630-A23, 5630-A22, (C) Copyright IBM Corporation, 1997, 2000
// All rights reserved. Licensed Materials Property of IBM
// Note to US Government users: Documentation related to restricted rights
// Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule with IBM Corp.
// This page may contain other proprietary notices and copyright information, the terms of which must be observed and followed.
// This program may be used, executed, copied, modified and distributed
// without royalty for the purpose of developing, using,
// marketing, or distributing.
package WebSphereSamples.AccountAndTransfer;
* The key class of the Account entity bean.
public class AccountKey implements Serializable {
public long accountId;
* Constructs an AccountKey object.
public AccountKey() {}
* Constructs a newly allocated AccountKey object that represents the primitive long argument.
public AccountKey(long accountId) {
this.accountId = accountId;
* Determines if the AccountKey object passed to the method matches this AccountKey object.
* @param o java.lang.Object The AccountKey object to compare to this AccountKey object.
* @return boolean The pass object is either equal to this AccountBMKey object (true) or
public boolean equals(Object o) {
if (o instanceof AccountKey) {
AccountKey otherKey = (AccountKey) o;
return (((accountId == otherKey.accountId)));
} else {
return false;
* Generates a hash code for this AccountKey object.
* @return int The hash code.
public int hashCode() {
return ((new Long(accountId).hashCode()));

Mike Jones
Ranch Hand

Joined: Dec 12, 2001
Posts: 109
Also, a related question. Where do I lookup the information for a specific error code. In this case, does the output from the log "X WSVR0040E:" represent an error code?
Saritha Sarla

Joined: Oct 23, 2003
Posts: 6
I am also experiencing a similar error.
Can somebody tell me how to get rid of this error
age spets
Ranch Hand

Joined: Aug 07, 2002
Posts: 68
The problem is that you are running two EJB JAR files on the same server and you have a name violation. Remove one JAR file or rename the classes.
I agree. Here's the link:
subject: adEjbModule error
It's not a secret anymore!