on 11-21-2007 2:33 PM
Hi All,
I want to do locking of a single row for table in databse using JDBC connection.
I am Using Stateless session bean for connection.
I am using following code for locking
Context initialContext = new InitialContext();
TableLocking locking = (TableLocking) initialContext.lookup(TableLocking.JNDI_NAME);
And Follwoing code for
public void lock(byte lifetime,
Connection connection,
String tableName,
Map primaryKeys,
char mode)
throws LockException,
TechnicalLockException,
IllegalArgumentException;
I have added <b>applocking service</b> in my USED component of EJB project.
I am not getting any error at build time.
But at Runtime it is not able to find TableLocking class.
<b>java.lang.NoClassDefFoundError: com/sap/engine/services/applocking/TableLocking</b>
Do i need to add the dependency at some other place also ??
Or how do i access that class ??
Can any one give some input about this problem??
Thanks and Regards,
Shruti.
Shruti,
You don't have build errors, bcz you added used component to the EJB.
There could be two reason for your error. <b>java.lang.NoClassDefFoundError: com/sap/engine/services/applocking/TableLocking</b>
1) Have you deployed your EJB?
2) Check for the JNDI Name? Name should match what you have given in EJB - ejb-j2ee-engine.xml file.
Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sridhar,
1)I have deployed EJB properly, My EAR is also deployed successfully.
2)I the method
TableLocking locking = (TableLocking) initialContext.lookup(TableLocking.JNDI_NAME);
JNDI name of the Table Locking class is to be used, and in tutorial it is given that JNDI name is contained in the constant <b>TableLocking.JNDI_NAME</b>
So i don have to use JNDI name of the MyBean in any of the method, as i am exposing bean as WS and running the WS.
So i am not able to figure to out the Problem.
Thanks and Regards,
Shruti.
Hi Shruthi,
How did add the applocking service? If you add it as an external jar it should be available in build time or as an usedDC it should be available in runtime.
regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Siva,
I have added applocking services into my used dc from Software component <b>SAP_J2EE_1</b> and checked runtime dependency also.
I have also tried to add these jars into my project, by adding them into one External Library Project and then using dependency from that Library project.
But still giving the same problem.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.