Error Handling and message display issue
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Commerce suite > Error Handling and message display issue




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Error Handling and message display issue  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-10-06 10:58 PM

Hi

I am trying to display custom message in my shopping cart page during cleari
ng shopping cart. The clear cart code is customized and I wanted to display 
error when the application fails to clear the cart.

here is my sample code:
try{
application code..
}catch (CustomException ce) {
log fatal...
throw new ECApplicationException(
MyMessages._MY_ERROR,
CLASSNAME,
METHODNAME,
ECMessageHelper.generateMsgParms(ce.getMessage(),"param1", "param2")
);
}

Here is MyMessage code:
public static final ECMessage _MY_ERROR =
new ECMessage (ECMessageSeverity.ERROR, ECMessageType.USER, "_MY_ERROR", "My
Bundle");

Here is MyBundle.properties:
_MY_ERROR=This is my custom message. {0}, {1}, {2}

At some of the custom ControllerCommands the message is displayed correct on
 the source jsp but from one of custom taskCommand the message is displayed 
in a GenericError page and I see following error at the console:

[3/10/06 11:22:04:984 CST] 5e315e31 SystemOut     O 2006.03.10 11:22:04.
863 ECMessageHelper  getCorrectiveActionMessageFromUserBundle

CMN0410E: Failed to retrieve from "Missing reource exception" the message wi
th key "{1}".

How do I make this message display on the shopping cart page instead? I have
 tried most of permetutions and combinations but no avail.  What am I missin
g?

Commersoul..





[ Post a follow-up to this message ]



    Re: Error Handling and message display issue  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-03-06 01:04 AM

I've seen this before and if I remember correctly you must make sure that WC
 is able to locate the ResourceBundle you've associated.  If its a store spe
cific ResourceBundle ensure that you've built the correct path at the time t
he ECException is thrown.
Also when passing your exception parameters try just using an Object[] a
rray instead of the ECMessageHelper to generate the message params.  I'm wil
ling to bet you'll be able to get the results you want by doing the followin
g.

//Build message at runtime, not as a stored message.  This is just to test t
hat
//the message is being recognized.
ECMessage ecm = new ECMessage(ECMessageSeverity.ERROR,ECMessageType.USER,"MY
_MESSAGE_ID",myResourceBundlePath,classname));
//Now throw the ECApplicationException with runtime Object[]
throw new  ECApplicationException(ecm,classname,mn,
new Object[]{myPa
ram1,myParam2,myParam3},false);
//If you want this message logged remove the last parameter

Try it this way and I'll bet your message shows up.  I think what happens is
 that the WC message handler either ignores custom bundles or it fails to fi
nd the custom bundle if its store or locale specific, which then causes it t
o attempt to locate the
SystemMessages.  I'm not sure about that, but it seems that something along 
those lines is taking place.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:38 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register