Skip to Content

ejb call exception

Hi,

I deployed a bean managed entity bean on the WAS 6.40. I can lookup at the bean, call a find method that returns a collection of "Employee" objects. But when I try to call a method of that object I get a :

java.rmi.RemoteException: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Transaction system failure in method de.saarstahl.was.beans.EmployeeObjectImpl10.getFirstName().

; nested exception is:

javax.transaction.RollbackException: com.sap.engine.services.ts.exceptions.BaseRollbackException: Transaction ( SAP J2EE Engine JTA Transaction : 0ffffff8d4bffffffae0007d ) marked for rollback.

Here is the client:

Employee emp;

try {

Properties p = new Properties();

p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");

p.put(Context.PROVIDER_URL, "pc1396:50004");

p.put(Context.SECURITY_PRINCIPAL, "Administrator");

p.put(Context.SECURITY_CREDENTIALS, "pass");

Context jndiCtx = new InitialContext(p);

Object ref =jndiCtx.lookup ("sap.com/DepBean/EmployeeBean");

EmployeeHome home = (EmployeeHome) javax.rmi.PortableRemoteObject.narrow(ref,EmployeeHome.class);

Collection c = home.findByName("becker");

Object o = c.iterator().next();

emp = (Employee)javax.rmi.PortableRemoteObject.narrow(o, Employee.class);

String a = em.getFirstName();

} catch (Exception e) {

e.printStackTrace();

}

I get the exception when I call the "getFirstName" method.

What is wrong with my code.

Best regards,

Werner

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 14, 2004 at 12:23 PM

    Maybe you can change the transaction context to TX_NOT_SUPPORTED....after all, there seems to be no reason to commit or rollback when you are retrieving data.

    With this TX level, the container suspends the transaction for that ejb method call.

    Just an idea...

    Mark

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.