1301
public synchronized void setCustomerId(String id) {...}
public String getFirstName() {...}
public synchronized void setFirstName(String firstName) {...}
public String getLastName() {...}
public synchronized void setLastName(String lastName) {...}
@OneToOne()
public Address getAddress() {...}
public synchronized void setAddress(Address address) {...}
}
However, the customer entity EJB uses the synchronized keyword for the set methods to attempt
to provide thread safe synchronization for the member variables. The use of synchronized methods
violate the restriction of the EJB specification against the use synchronization primitives within
EJBs. Using synchronization primitives may cause inconsistent behavior of the EJB when used
within different EJB containers.
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 1001 SFP Secondary Cluster: Use of an Improper API 888 2420
MemberOf 1401 Comprehensive Categorization: Concurrency 1400 2526
Taxonomy Mappings
Mapped Taxonomy Name Node ID Fit Mapped Node Name
Software Fault Patterns SFP3 Use of an improper API
CWE-575: EJB Bad Practices: Use of AWT Swing
Weakness ID : 575
Structure : Simple
Abstraction : Variant
Description
The product violates the Enterprise JavaBeans (EJB) specification by using AWT/Swing.
Extended Description
The Enterprise JavaBeans specification requires that every bean provider follow a set of
programming guidelines designed to ensure that the bean will be portable and behave consistently
in any EJB container. In this case, the product violates the following EJB guideline: "An enterprise
bean must not use the AWT functionality to attempt to output information to a display, or to input
information from a keyboard." The specification justifies this requirement in the following way: "Most
servers do not allow direct interaction between an application program and a keyboard/display
attached to the server system."
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 695 Use of Low-Level Functionality 1524
CWE Version 4.14
CWE-575: EJB Bad Practices: Use of AWT Swing
CWE-575: EJB Bad Practices: Use of AWT Swing