wood burning stoves 2.0*
The moose likes Websphere and the fly likes Problem in calling a method in an EJB from a WCS 5.1 command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Problem in calling a method in an EJB from a WCS 5.1 command " Watch "Problem in calling a method in an EJB from a WCS 5.1 command " New topic
Author

Problem in calling a method in an EJB from a WCS 5.1 command

Prasad Thirugnanam
Ranch Hand

Joined: Dec 19, 2001
Posts: 39
Hi,
I created a WCS5.1 command to have business logic.
An EJB method is called to retrieve set of records
and to be passed to JSP from this command. The EJB
is working fine when it is tested on WTE. The same
is throwing exception when i pass it to the JSP,
when i execute that command.
Can anyone help me in this problem. It is very
urgent!
Thanks in advance.
Rgds,
T.Prasad
prasad@lincsoftware.soft.net
prasad@lincsoftware.soft.net
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Give us enough information to work on (like the exception that's being thrown) and we might be able to help you.
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Prasad Thirugnanam
Ranch Hand

Joined: Dec 19, 2001
Posts: 39
Hi Kyle Brown,
Thanks for replying to my query. Here i have listed down my work and the problem.
Hope you will help us.
Objective: To create a new command in WCS5.1 and call a JSP

What i have done:
I have created a command called 'MyShopCmd' using the
ProgrammersGuide.pdf. I have created the DataBeanShopBean also.
To retrieve set of records i use my EJB, which is working fine
in WTE. In the performExecute of 'MyShopCmdImpl' class i have
my business logic, which calls a method from a EJB and the result
is passed to JSP using TypedProperty ty;
ty.put("", ""); method.
The resultant vector containing the set of records is passed to
jsp. When i call the command, it throws exception at the retrieval
step.
The Exceptin is
_ERR_REMOTE_EXCEPTION
omg.org.CORBA.TRANSACTION_ROLLBACK exception
with minor code 0 and completed: No
Prasad Thirugnanam
Ranch Hand

Joined: Dec 19, 2001
Posts: 39
Hi Kyle Brown ,
I have listed my problem with more details on the Exceptions. Here i have listed out the code, exception - everything u need to fix the problem. Try to help me, its very urgent. Shopping cart EJB is working fine individually in WTE.
Please go through Step #1, and Step #2.
# Step1:
1. checkParameters(){} - all code arecommented.
2.
public void performExecute() throws ECException
{
// perform server side parameter checking
super.performExecute();
// Create a new TypedProperties for output.
TypedProperty rspProp = new TypedProperty();

//////////////////////////////////////////////////////////////
// Shopping Cart
prvcDispShop=null;
try
{
System.out.println("Before instantiating.,,,");
this.probCtpsabShop = new CtpshpfavSesAccessBean();
System.out.println("After instantiating the bean ");
prvcDispShop = probCtpsabShop.retrieveShopFavoRecords(1, "C100", "S");
System.out.println("After retrieve method.,,,");
System.out.println("Vector infor: " + this.prvcDispShop);
if(prvcDispShop==null)
{
System.out.println("Vector infor: is NULL");
}
}
catch(Exception e)
{
System.out.println("Error in SHop command : " + e);
}

System.out.println("1.,,,");
if(prvcDispShop!=null)
{
rspProp.put("sevcShop", prvcDispShop);
}
rspProp.put("vector", "hi");
rspProp.put("ControllerParm1", "Hello world");
rspProp.put("ControllerParm2", "Have a nice day!");
rspProp.put("MyParam", "Vaishnav!");
System.out.println("2.,,,");
// see how controller command call a JSP
rspProp.put(ECConstants.EC_VIEWTASKNAME, "ShopSampleViewTask");
setResponseProperties(rspProp);
}
3. WHen i called the command
http://localhost:8080/webapp/wcs/stores/servlet/MyShopCmd in IE:
Output on the Browser:
IE:ERR_REMOTE_EXCEPTION
The following Remote Exception occurred during processing:
"CORBA TRANSACTION_ROLLEDBACK 0 No; nested exception is:
org.omg.CORBA.TRANSACTION_ROLLEDBACK: minor code: 0 completed: No".

----

WTE Servlet Engine Console Error:

*** Begin processing file : e:\WebSphere\WCS\instances\demo\xml\demo.xml
Before instantiating.,,,
After instantiating the bean
Error in SHop command : javax.transaction.TransactionRolledbackException:
CORBA TRANSACTION_ROLLEDBACK 0 No; nested exception is:
org.omg.CORBA.TRANSACTION_ROLLEDBACK: minor code: 0 completed: No
1.,,,
2.,,,
ErrorDataBean:
Originating command:
Message Type: 1
Message Key: _ERR_REMOTE_EXCEPTION
Message: CMN3101E The system is unavailable due to "CMN0412E".

#Step2:
When i comment the retrieve method of EJB, the output is coming perfectly.
Output on IE:
Shopping cart jsp

--------------------------------------------------------------------------------
Today's date is: Sat Jan 05 11:34:17 GMT+05:30 2002

--------------------------------------------------------------------------------
List of name value pairs in TypedProperties object
ControllerParm2=Have a nice day!
ControllerParm1=Hello world
vector=hi
docname[0]=CTP15_ShoppingCart.jsp
storeId[0]=0
MyParam=Vaishnav!
langId[0]=-1
Prasad Thirugnanam
Ranch Hand

Joined: Dec 19, 2001
Posts: 39
Hi,
Step: #5.
i uncommented the prvcDispShop=null;
the retrieve method of an EJB is coming and the resultant vector is not passed to jsp. it is giving the following exception: Hope you could help me. I am waiting for your response.
Thanks in advance.
T.Prasad
Output:
*** Begin processing file : e:\WebSphere\WCS\instances\demo\xml\demo.xml
Before instantiating.,,,
After instantiating the bean
After retrieve method.,,,
Vector infor: [ctp.wr.CtpshpfavAccessBean@4790, ctp.wr.CtpshpfavAccessBean@7969, ctp.wr.CtpshpfavAccessBean@7c5b, ctp.wr.CtpshpfavAccessBean@48d9, ctp.wr.CtpshpfavAccessBean@51c9]
1.,,,
2.,,,
ErrorDataBean:
Originating command:
Message Type: 1
Message Key: _ERR_REMOTE_EXCEPTION
Message: CMN3101E The system is unavailable due to "CMN0412E".
output on the IE:
_ERR_REMOTE_EXCEPTION
CMN3101E The system is unavailable due to "CMN0412E".
The following Remote Exception occurred during processing: "null".
prasad@lincsoftware.soft.net
Matthew X. Brown
Ranch Hand

Joined: Nov 08, 2000
Posts: 165
So are you using access beans or are you calling the ejb directly? This could be the issue. The other possible issue is deployment- how are you deploying to your WCS server?
Prasad Thirugnanam
Ranch Hand

Joined: Dec 19, 2001
Posts: 39
Not able to run a new command in WCS5.1 from VisualAge for Java WTE.
I followed the steps given in the ProgrammersGuide.pdf to create a new command.
It is working fine. I tested my Ctpshpfav bean, it is working well.
I added the code in the method performExecute of MyNewTaskCmdImpl class, and
called that command. Exception thrown at the retrieval method. The
exception is:
WTE Console message:
Before instantiating.,,,
After instantiating the bean
Error in SHop command : javax.transaction.TransactionRolledbackException:
CORBA TRANSACTION_ROLLEDBACK 0 No; nested exception is:
org.omg.CORBA.TRANSACTION_ROLLEDBACK: minor code: 0 completed: No
1.,,,
ErrorDataBean:
Originating command:
Message Type: 1
Message Key: _ERR_COMMAND_EXCEPTION
Message: CMN3101E The system is unavailable due to "CMN0420E".
When i read that redbook, it talks about creating a new entity bean.
Should my bean's super class be com.ibm.commerce.base.objects.ECEntityBean?
I created CMP Entity bean from VAJ which implements EntityBean.
Could you help me?
Thanks and Rgds,
T.Prasad
prasad@lincsoftware.soft.net
Prasad Thirugnanam
Ranch Hand

Joined: Dec 19, 2001
Posts: 39
Mathew,
I have Entity Access bean and session access bean for the shopping cart.
The Entity bean implements EntityBean. Is this an issue? or the entity
bean should have super class as com.ibm.commerce.base.objects.ECEntityBean.
and should i have to create a Task command for EJB. I am doing all these
in Websphere Test Environment (WTE).
Thanks.
T.Prasad
prasad@lincsoftware.soft.net
Prasad Thirugnanam
Ranch Hand

Joined: Dec 19, 2001
Posts: 39
Hi All,
This is regarding the problems that i faced in VAJ WTE when i execute a WCS5.1 command.
I have tried the ProgrammersGuide.pdf method to create a new command in WCS5.1 Its working fine.
So i learnt that i need to create an EJB the way he created. I have started my Shopping cart in the same line as given in the sample. Hope it will work.
Thanks.
T.Prasad

prasad@lincsoftware.soft.net
 
wood burning stoves
 
subject: Problem in calling a method in an EJB from a WCS 5.1 command
 
Similar Threads
VAJ - WTE Problem in WCS application
Very Urgent. Help Needed in calling a JSP from a command in WCS5.1
Test Client throws Exception when CMP EJB is tested
Very Urgent. Help Needed in calling a JSP from a command in WCS5.1
Urgent: AbstractMethodError - in Finder Methods...