Yair Ivan

+ Follow
since Jul 13, 2008
Yair likes ...
Eclipse IDE Firefox Browser Oracle
Bogotá, Colombia
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Yair Ivan

congrats .. is cool! ..
9 years ago
For example, you need in backingbean:

where the Servlet "ExportExcelServlet" is management export to excel.

9 years ago
Hi Enrrique:

Which aplication server you used? Tomcat or JBoss ? .... are using some Datasource ?.

10 years ago
Hi Jeremiah:

In this case attribute type the method is REQUIRED.
See you section "Specification of Transaction Attributes with Metadata Annotations" of the la SCBCD 5.0 Study Guide Mikalai Zaikin


Good lucky.

In that case definitely have to check persistence.xml.

If you define the attribute transaction-type="JTA" also need datasource.

Try this:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">;
<persistence-unit name="LibraryApp-ejbPU" transaction-type="JTA">
<property name="toplink.logging.level" value="INFO"/>
<property name="toplink.jdbc.user" value="nbuser"/>
<property name="toplink.jdbc.password" value="nbuser"/>
<property name="toplink.jdbc.url" value="jdbc:derby://localhost:1527/LibraryDB"/>
<property name="toplink.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
<property name="toplink.ddl-generation" value="drop-and-create-tables"/>

See the following "TopLink JPA Persistence Unit Extensions":

Hi Dan:

public class LibraryServicesBean implements LibraryServicesLocal {

@PersistenceContext EntityManager em;

public void addCategory(Category cat) {

The client (Suppose what client is managed-container) :

@EJB private LibraryServicesLocal library;

public static void main(String[] args) {

Category cat = new Category();
library.addCategory(cat );

If persist() is called within a transaction, the insert may happen immediately, or it may be queued until the end of the transaction, depending on the flush mode. You may force the insertion manually within a transaction by calling the flush() method.

Hi Celinio:

The method on which the PostConstruct annotation is applied MUST fulfill all of the following criteria:

- The method MUST NOT have any parameters except in the case of EJB interceptors in which case it takes
an InvocationContext object as defined by the EJB specification.

- The return type of the method MUST be void.

- The method MUST NOT throw a checked exception.

- The method on which PostConstruct is applied MAY be public, protected, package private or private.

- The method MUST NOT be static except for the application client.

- The method MAY be final.

- If the method throws an unchecked exception the class MUST NOT be put into service except in
the case of EJBs where the EJB can handle exceptions and even recover from them.


Hi Ravi:

I have read the book EJB 3 in action (11.3.5 Using vendor-specific annotations and descriptors)
that these configurations are left to the vendors as proprietary features,
and they can be supported with "proprietary annotations", "proprietary deployment descriptors", or both.

For example for Oracle:

You use library:

Configures pooling with Oracle’s proprietary annotation:

import oracle.j2ee.ejb.StatelessDeployment;

minInstances = 100, maxInstances = 500, poolCacheTimeout = 120)
@Stateless(name = "BazaarAdmin")
public class BazaarAdminBean implements BazaarAdmin {

Or using element in Oracle’s proprietary
descriptor (orion-ejb-jar.xml) element as follows:

name = "BazaarAdmin"
tx-retry-wait = "60"
max-instances = "500"
min-instances = "100"
pool-cache-timeout = "120"
location = "BazaarAdmin">

And for example the weblogic-ejb-jar.xml deployment file contains
the WebLogic Server-specific deployment elements that determine the concurrency,
caching, and clustering behaviors of EJBs:


As recommended in the book:
"You remember to add proprietary annotations may be dangerous for goal of portability of applications."


In this case, the client is a bean session (may be component web: JSP,Servlet,JSF, etc....) and
the services are in other projects ejb.

Sessions bean can be accessed using:

- Through JNDI lookup.
- Through dependency injection.

Dependency injection is supported only managed classes whose lifecycle is managed
by the container.
If the client is a EJB then you can use @EJB annotation o JNDI lookup,
if the client is a component web then you must ensure that are managed classes for decide
access type.

The bussines components can be in different packages.

I recommend seeing:
EJB 3 in action:
12.2.1. Accessing session beans using dependency injection.


Thanks Rodrigo for information.

I add the following items:

- In EJB 3 in Action section 6.2.5 Transaction and exception handling.
- In Entreprise JavaBeans 3.0 (O´Relly) Section 16.6 Exceptions and Transactions.

Hello Niranjan:

As mentioned in previous forums, there is a big difference between the specifications 2.0 y 3.0
However, in the book "Mastering Enterprise JavaBeans 3.0" chapters 2 and 3 analyze the subject.
If you start with technology 2.0 Ideally the end of studying the industry because there applications
that still possess, "this is a value added".
I can recommend the documentation that I am using:

- Mastering Enterprise JavaBeans 3.0
- Enterprise JavaBeans 3.0, Fifth Edition

Obviously you should certainly check "SCBCD 5.0 Study Guide" de Mikalai Zaikin.

Hello Davide:

Post some links:



Davide Crudo wrote:Dear All,

I'm just starting with SCBCD preparation and got EJB3 in Action.

What kind of development environment did you set-up?
Anyone Using Jboss Developer Studio 2.1 ? or Jboss Tools under Eclipse?

Even though the theory on the book is quite clear, I would need to build
up some knowledge on setting up the server and, let's say, publish a simple
Hello World application to see how it works...

Any links?
thanks in advance!