AM Validation Exception - Deadline looming - Please help!

Gurus,
I am trying to perform validation in AM against data already existing in underlying table. Since my EOImpl is utilizing API calls for insert/update/delete with OAPlsqlEntityImpl ... I cannot enforce uniqueness in EO attributes. Therefore, I am performing validation in AM and need to throw an exception message when duplication occurs.
I have documented my code and Null Pointer Exception message. The bolded code in PFR represents line "307" which is reference in the Null Pointer Exception. Any help would be greatly appreciated and rewarded.
Thanks!
PFR code:
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
// Pressing the "Apply" button means the transaction should be validated
// and committed.
if (pageContext.getParameter("Apply") != null)
OAViewObject vo = (OAViewObject)am.findViewObject("DesigFullVO1");
String DesignatorCode = (String)vo.getCurrentRow().getAttribute("DispCode");
*Serializable[] params = { DesignatorCode };*
am.invokeMethod("ValDesig",params);
am.invokeMethod("apply");
MessageToken[] tokens = { new MessageToken("DESIGNATOR",DesignatorCode)};
OAException confirmMessage = new OAException("AK", "SPL_CREATE_DESIGNATOR_W", tokens, OAException.CONFIRMATION, null);
OADialogPage dialogPage = new OADialogPage(OAException.CONFIRMATION,
confirmMessage,
null,
APPLICATION_JSP + "?page=/designator/oracle/apps/spl/hdrdef/webui/DesigSearchPG",
null);
dialogPage.setReusePageLayout(true);
pageContext.releaseRootApplicationModule();
pageContext.redirectToDialogPage(dialogPage);
pageContext.putDialogMessage(confirmMessage);
VO query:
select disp_code DISP_CODE
from spldat.spl_dispositions
AM code:
public void ValDesig(String dispCode)
DesigValidationVOImpl vo = getDesigValidationVO1();
DesigValidationVORowImpl Row = null;
String a = "disp_code = '"+dispCode+"'";
vo.setWhereClauseParams(null);
vo.setWhereClause(a);
vo.executeQuery();
String l_desig = Row.getDispCode();
if (l_desig != null)
*MessageToken[] errTokens = { new MessageToken("OBJECT_NAME", "DesigValidationVO1")};*
throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
} // end ValDesig()
NullPointerException
oracle.apps.fnd.framework.OAException: java.lang.NullPointerException
     at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
     at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:865)
     at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:988)
     at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:211)
     at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:153)
     at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:749)
     at designator.oracle.apps.spl.hdrdef.webui.DesigCreateCO.processFormRequest(DesigCreateCO.java:307)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:804)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
     at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1156)
     at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)

I'm getting a compilation error against the following code for the bolded line:
What is the best way to fix this type mismatch? I need to make sure that the result assigned to l_desig is the value returned from the VO.
AM Code:
public void ValDesig(String dispCode)
DesigValidationVOImpl vo = getDesigValidationVO1();
if (vo == null)
MessageToken[] errTokens = { new MessageToken("OBJECT_NAME", "DesigValidationVO1")};
throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
String a = "disp_code = '"+dispCode;
vo.setWhereClauseParams(null);
vo.setWhereClause(a);
vo.executeQuery();
Row DesigValidationRow = getDesigValidationVO1().first();
String l_desig  = DesigValidationRow.getAttribute("DispCode");
if (l_desig != null)
MessageToken[] errTokens = { new MessageToken("OBJECT_NAME", "DesigValidationVO1")};
throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
} // end ValDesig()
Error:
incompatible types; found java.lang.Object; required: java.lang.String
Edited by: sreese on Dec 1, 2010 11:04 AM

Similar Messages

  • BitmapData.Draw() not working, deadline looming, please help!

    Hi, I'm working on a project where I'm trying to get a snapshot of a dynamically created Sprite.
    I've made a Sprite that contains a few pictures and text fields (with fonts embedded etc).
    while this Sprite is very large (25,196 by 1,832) I am only taking a relatively small slice of it (2,000 by 1,856) using bitmap.draw()
    however it doesn't work. once I've used draw I'm placing it on the stage and I dont see anything. Also I am looking at the bitmap data using getColorBoundsRect and its coming up as being empty.
    I realise there are limits on what draw() can handle but surely if I'm using a clipRect thats under 2,880 pixels wide/high I should be fine, no?
    Strangely if I feed the Sprite into papervision as a MovieMaterial (which is what the bitmap will be used for after I've altered it) and specify the same clipping rectange it works so it must be possible, but I cant see how.
    one other bit of info (if it matters) all the content of the sprite are in the negative y area (which is why the clipRect starts at -height).
    Code included below, would be very very grateful for any help!
    private function makeTexture(W:Number, H:Number, S:String, A:Number=1, B:Number=0):MaterialObject3D{
                var container:Sprite    = makeFields(W, H, S, A);// returns Sprite.
                container.alpha          = A;
                trace("_w=" + container.width + "_h=" + container.height); //traces:   _w=25196.65_h=1832.05
                var bData:BitmapData     = new BitmapData(W, container.height, true, 0)//0xffffffff)
                bData.draw(container,new Matrix(),new ColorTransform(),BlendMode.NORMAL, new Rectangle(0, -container.height, W, container.height));
                var re:Rectangle=bData.getColorBoundsRect(0xffffffff, 0x00000000, false);
                trace(re.width); // traces: 0
                trace(re.height);// traces: 0

    Okay as the cropping and converting to bitmap appeared to work fine in the papervision MovieMaterial class I extended it and added my applyFilter to blur it there. guess there was something wrong with my code somewhere! Thanks for reading tho.

  • After trying many times with two different debit cards still does not allows me to buy a game from the app store gives error "YOUR PAYMENT METHOD WAS DECLINE.PLEASE ENTER VALID PAYMENT METHOD INFORMATION"  Please help me out

    I WANT TO PURCHASE NFS MOST WANTED GAME FROM APP STORE BUT IT DOESN'T ALLOW ME TO PROCEED FURTHER
    after trying many times with two different debit cards still does not allows me to buy a game from the app store gives error "YOUR PAYMENT METHOD WAS DECLINE.PLEASE ENTER VALID PAYMENT METHOD INFORMATION"  Please help me out

    In most cases, you can't use a Debit card anymore. So, either redeem an iTunes gift card or use a credit card.

  • Error in schema validation in XI. Please help!

    Hi Experts,
       I have a FILE to proxy scenario. In the sender agreement I have selected schema validation by Adapter. (Other option is by Integration Engine). Now when the file I get an error in sender file communication channel monitoring:
    Error: com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: Schema DataIn.xsd not found in D:\usr\XXXXXXXXX\validation\schema\31f7c36098e411deadcae4d30a13c639\httptraining-00EIM_POC\DataIn_Async_Out\httptraining-00EIM_POC\DataIn.xsd  (validation\schema)
    Do I need to keep the schema file in some server location?  Do I need to setup this path anywhere? Where do I need to place the schema file?
    What is the difference between validation by adapter and by integration engine?
    Please help!
    Thanks
    Gopal

    >What is the difference between validation by adapter and by integration engine?
    Both are same. One in Java engine and the other in the abap engine.  If you set at one place that is good enough.  In 7.1+  this becomes one of the pipeline steps.
    >Do I need to keep the schema file in some server location? Do I need to setup this path anywhere? Where do I need to place the schema file
    Yes you have to place schema in the server location.
    Refer the Rajasekar document for the placing this file in the server location.

  • Exception from httpclusterservlet - please help

    Hi,
              We are getting the following exception under one scenario. We are using jsps
              on wls 451 sp9 on Solaris 2.7. This happens with jdk1.2.2 but goes away with
              jdk 1.1.7. We are desperate to use jdk 122 for performance reasons. Please
              help. BTW how safe it is to use 451 with jdk 122 ? We tried using 51 but
              had to fall back to 451 because 51 is simply not robust enough to support
              our application.
              Here is what we see in the log file. Why would this happen in
              HttpClusterServlet ?
              Fri Jun 30 14:53:54 EDT 2000:<I> <ListenThread> Listening on port: 80
              Fri Jun 30 14:53:54 EDT 2000:<I> <PosixSocketMux> system has file descriptor
              limits: soft=1024 hard=8192
              Fri Jun 30 14:53:54 EDT 2000:<I> <PosixSocketMux> using effective file
              descriptor limit of 8192 open sockets/files.
              Fri Jun 30 14:53:57 EDT 2000:<S> <WebLogicServer> Switched to user nobody
              Fri Jun 30 14:53:57 EDT 2000:<I> <SSLListenThread> Listening on port: 443
              Fri Jun 30 14:53:58 EDT 2000:<I> <WebLogicServer> WebLogic Server started
              Fri Jun 30 14:53:59 EDT 2000:<I> <PosixSocketMux> allocating 3 Posix reader
              threads
              Fri Jun 30 14:53:59 EDT 2000:<I> <ServletContext-Servlets>
              weblogic.servlet.internal.HttpClusterServlet: init
              Fri Jun 30 14:54:00 EDT 2000:<I> <ServletContext-Servlets>
              weblogic.servlet.FileServlet: init
              Fri Jun 30 14:54:01 EDT 2000:<I> <ServletContext-Servlets>
              weblogic.servlet.FileServlet: init
              Fri Jun 30 14:54:02 EDT 2000:<E> <PosixSocketMux> connection reset on HTTP
              Fri Jun 30 14:54:06 EDT 2000:<I> <PosixSocketMux> EOF on socket type HTTP
              Fri Jun 30 14:54:06 EDT 2000:<I> <PosixSocketMux> EOF on socket type HTTP
              Fri Jun 30 14:54:06 EDT 2000:<I> <PosixSocketMux> EOF on socket type HTTP
              Fri Jun 30 14:54:06 EDT 2000:<E> <PosixSocketMux> connection reset on HTTPs
              Fri Jun 30 14:54:06 EDT 2000:<E> <PosixSocketMux> connection reset on HTTPs
              Fri Jun 30 14:54:12 EDT 2000:<E> <ServletContext-Servlets> Servlet failed
              with RuntimeException
              Fri Jun 30 14:54:12 EDT 2000:<E> <ServletContext-Servlets>
              java.lang.ArrayIndexOutOfBoundsException
              at java.io.BufferedOutputStream.write(Compiled Code)
              at
              weblogic.servlet.internal.HttpClusterServlet$Server.writePostData(Compiled
              Code)
              at
              weblogic.servlet.internal.HttpClusterServlet$Server.proxy(Compiled Code)
              at weblogic.servlet.internal.HttpClusterServlet.service(Compiled
              Code)
              at javax.servlet.http.HttpServlet.service(Compiled Code)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled
              Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
              at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
              at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
              Fri Jun 30 14:54:13 EDT 2000:<I> <ServletContext-Servlets>
              weblogic.servlet.internal.InternalImageServlet: init
              Thanks in advance.
              

    Please do not cross post.
              Atish Ray wrote:
              > Hi,
              >
              > We are getting the following exception under one scenario. We are using jsps
              > on wls 451 sp9 on Solaris 2.7. This happens with jdk1.2.2 but goes away with
              > jdk 1.1.7. We are desperate to use jdk 122 for performance reasons. Please
              > help. BTW how safe it is to use 451 with jdk 122 ? We tried using 51 but
              > had to fall back to 451 because 51 is simply not robust enough to support
              > our application.
              >
              > Here is what we see in the log file. Why would this happen in
              > HttpClusterServlet ?
              >
              > Fri Jun 30 14:53:54 EDT 2000:<I> <ListenThread> Listening on port: 80
              > Fri Jun 30 14:53:54 EDT 2000:<I> <PosixSocketMux> system has file descriptor
              > limits: soft=1024 hard=8192
              > Fri Jun 30 14:53:54 EDT 2000:<I> <PosixSocketMux> using effective file
              > descriptor limit of 8192 open sockets/files.
              > Fri Jun 30 14:53:57 EDT 2000:<S> <WebLogicServer> Switched to user nobody
              > Fri Jun 30 14:53:57 EDT 2000:<I> <SSLListenThread> Listening on port: 443
              > Fri Jun 30 14:53:58 EDT 2000:<I> <WebLogicServer> WebLogic Server started
              > Fri Jun 30 14:53:59 EDT 2000:<I> <PosixSocketMux> allocating 3 Posix reader
              > threads
              > Fri Jun 30 14:53:59 EDT 2000:<I> <ServletContext-Servlets>
              > weblogic.servlet.internal.HttpClusterServlet: init
              > Fri Jun 30 14:54:00 EDT 2000:<I> <ServletContext-Servlets>
              > weblogic.servlet.FileServlet: init
              > Fri Jun 30 14:54:01 EDT 2000:<I> <ServletContext-Servlets>
              > weblogic.servlet.FileServlet: init
              > Fri Jun 30 14:54:02 EDT 2000:<E> <PosixSocketMux> connection reset on HTTP
              > Fri Jun 30 14:54:06 EDT 2000:<I> <PosixSocketMux> EOF on socket type HTTP
              > Fri Jun 30 14:54:06 EDT 2000:<I> <PosixSocketMux> EOF on socket type HTTP
              > Fri Jun 30 14:54:06 EDT 2000:<I> <PosixSocketMux> EOF on socket type HTTP
              > Fri Jun 30 14:54:06 EDT 2000:<E> <PosixSocketMux> connection reset on HTTPs
              > Fri Jun 30 14:54:06 EDT 2000:<E> <PosixSocketMux> connection reset on HTTPs
              > Fri Jun 30 14:54:12 EDT 2000:<E> <ServletContext-Servlets> Servlet failed
              > with RuntimeException
              > Fri Jun 30 14:54:12 EDT 2000:<E> <ServletContext-Servlets>
              > java.lang.ArrayIndexOutOfBoundsException
              > at java.io.BufferedOutputStream.write(Compiled Code)
              > at
              > weblogic.servlet.internal.HttpClusterServlet$Server.writePostData(Compiled
              > Code)
              > at
              > weblogic.servlet.internal.HttpClusterServlet$Server.proxy(Compiled Code)
              > at weblogic.servlet.internal.HttpClusterServlet.service(Compiled
              > Code)
              > at javax.servlet.http.HttpServlet.service(Compiled Code)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled
              > Code)
              > at
              > weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
              > at
              > weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
              > at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
              > at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
              > at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
              > Fri Jun 30 14:54:13 EDT 2000:<I> <ServletContext-Servlets>
              > weblogic.servlet.internal.InternalImageServlet: init
              >
              > Thanks in advance.
              Cheers
              - Prasad
              

  • HT1338 trouble logging into my imac desktop, why wont it accept my valid password?? Please help I need to retrieve important files. Thanks.

    trouble logging into my imac desktop, why wont it accept my valid password?? I was using it fine last night... Please help I need to retrieve important files. Many Thanks.

    Do #5 and #6 here others as needed
    ..Step by Step to fix your Mac
    Most commonly used backup methods

  • When i try to download the new itunes my computer says it is not a valid win32 or something, please help?

    When i try to download the new version of iTunes to use with my iPhone 5 on IOS7 I recieve an error saying:  'iTunes: Windows reports that iTunesSetup.exe is not a "valid Win32 application" I have tried the recommended help on the iTunes support in which I was told to try different browsers or to clear my cache and try again, neither of which work.
    Someone please help!

    when i connected my ipod, iTunes pop a new window, that said that i needed to download the new software, I can't downloaded it cuz, the window said that there was an error and it was because the internet and other stuff,
    In the course of your troubleshooting to date, have you worked through the following document?
    iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server

  • Iphone6+ iOS 8.2 is not validating my Valid Account Payment Type - Please HELP !!

    When i am navigating to 'App store' and trying to install the App in my Iphone6 plus then it is asking me to check the Verification Account Payment type, here while i'm entering my Card details, then it is not accepting Valid Credit card or Debit card details. These same card details i have been used before while downloading from App Store, but all of the sudden from few weeks onwards it is not taking my valid Card details - VISA.
    Can you please help me out - Where am going wrong ??
    Appreiciate your attention and valuable time,
    Thank you,
    Sree.

    You should contact iTunes Support/Account Management by using this link:
    https://getsupport.apple.com/Issues.action

  • For some reason firefox aint even starting up all the other browsers i have start up except for Firefox please help

    for some reason Firefox wont start up i also have Google chrome and that works fine firefox is the only one not working please help.

    The contacts that belong to your exchange accounts and your Google account will not sync with iCloud.  If you want to sync these contacts with iCloud, you would need to copy them to the iCloud account and then disable contact syncing with these other accounts.  (If you didn't disable contacts syncing with these accounts, you would see duplicates of these contacts on your phone -- one from the external account, and one from iCloud.)  If you want to do this, do the following:
    Go to Settings>iCloud, turn Contacts to Off, choose Delete from My iPhone when prompted (any iCloud contacts will still be in iCloud).
    Download the app My Contacts Backup.  (If you have more than 500 contacts to transfer from your other accounts you will need the “Pro” version.)  Use the app to back up the remaining contacts on your phone (from the other accounts) as a vCard attachment to an email that you send to yourself.  Confirm that you have received the email before proceeding to step 3.
    Go to Settings>iCloud and turn Contacts back to On.
    Go to Settings>Mail,Contacts,Calendars>Default Account (in the Contacts section), and confirm that this is set to iCloud.
    Go to Settings>Mail,Contacts,Calendars…tap your each of your exchange accounts (if you have more than one listed) as well as your Gmail/Google account and turn off contacts syncing with these accounts.  This will remove the contacts from these accounts from your phone.
    Open the My Contacts Backup email and tap the attachment to import the contacts from these accounts back to your phone, and to iCloud.  All your contacts should now be in iCloud and be visible on icloud.com.

  • Exception error !Please help me!

    Exception in thread "AWT-EventQueue-0" java.lang.ArithmeticException: / by zero
    at rational.<init>(rational.java:32)
    at rationalnumber$ButtonHandler.actionPerformed(rationalnumber.java:86)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
    ce)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Source Code: Class rationalnumber
    import java.awt.FlowLayout;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import javax.swing.JFrame;
    import javax.swing.JButton;
    import javax.swing.JOptionPane;
    public class rationalnumber extends JFrame {
         private JLabel numerator1;
         private JLabel denominator1;
         private JLabel numerator2;
         private JLabel denominator2;
         private JLabel precision;
         private JTextField numerator_value1;
         private JTextField denominator_value1;
         private JTextField numerator_value2;
         private JTextField denominator_value2;
         private JTextField precision_value;
         private JButton add_value;
         private JButton subtract_value;
         private JButton multiply_value;
         private JButton divide_value;
         int number1;
         int number2;
         int number3;
         int number4;
         int number5;
              public rationalnumber() {
         super("Applet Viewer:Rational Number's Calculation");
         setLayout(new FlowLayout());
         numerator1=new JLabel("Enter numerator 1:");
         add(numerator1);
         numerator_value1=new JTextField("Enter Number");
         add(numerator_value1);
         denominator1=new JLabel("Enter denominator 1:");
         add(denominator1);
         denominator_value1=new JTextField("Enter Number");
         add(denominator_value1);
         numerator2=new JLabel("Enter numerator 2:");
         add(numerator2);
         numerator_value2=new JTextField("Enter Number");
         add(numerator_value2);
         denominator2=new JLabel("Enter denominator 2:");
         add(denominator2);
         denominator_value2=new JTextField("Enter Number");
         add(denominator_value2);
         precision=new JLabel("Enter precision:");
         add(precision);
         precision_value=new JTextField("Enter number");
         add(precision_value);
         add_value=new JButton("Add");
         add(add_value);
         subtract_value=new JButton("Subtract");
         add(subtract_value);
         multiply_value=new JButton("Multiply");
         add(multiply_value);
         divide_value=new JButton("Divide");
         add(divide_value);
         ButtonHandler handler=new ButtonHandler();
         numerator_value1.addActionListener(handler);
         denominator_value1.addActionListener(handler);
         numerator_value2.addActionListener(handler);
         denominator_value2.addActionListener(handler);
         add_value.addActionListener(handler);
         subtract_value.addActionListener(handler);
         multiply_value.addActionListener(handler);
         divide_value.addActionListener(handler);
         private class ButtonHandler implements ActionListener {
    public void actionPerformed(ActionEvent event) {
         if(event.getSource()==numerator_value1) {
         number1=Integer.parseInt(event.getActionCommand());
         else if(event.getSource()==denominator_value1) {
         number2=Integer.parseInt(event.getActionCommand());
         else if(event.getSource()==numerator_value2) {
         number3=Integer.parseInt(event.getActionCommand());
         else if(event.getSource()==denominator_value2) {
         number4=Integer.parseInt(event.getActionCommand());
         else if(event.getSource()==add_value) {
    rational calculation=new rational(number1,number2,number3,number4);
    JOptionPane.showMessageDialog(rationalnumber.this,String.format("a+b= %d",calculation.getAddResult()));
    else if(event.getSource()==subtract_value) {
    rational calculation=new rational(number1,number2,number3,number4);
    JOptionPane.showMessageDialog(rationalnumber.this,String.format("a-b= %f",calculation.getSubtractResult()));
    else if(event.getSource()==multiply_value) {
    rational calculation=new rational(number1,number2,number3,number4);
    JOptionPane.showMessageDialog(rationalnumber.this,String.format("a*b= %f",calculation.getMultiplyResult()));
    else if(event.getSource()==divide_value) {
    ational calculation=new rational(number1,number2,number3,number4);
    JOptionPane.showMessageDialog(rationalnumber.this,String.format("a/b= %f",calculation.getDivideResult()));
    Related source code: class rational
    class rational {
    private int numerator;
    private int denominator;
    private int numerator3;
    private int denominator3;
    float rationalnum1;
    float rationalnum2;
    private int number[]={2,3,4,5,6,7,8,9,11,13,17,19,21,23,27,29,31,33,37,39,41,43,47,49,51,53,57,59,61,63,67,69,71,73,77,79,81,83,87,89,91,93,97,99};
    public rational(int numerator1,int denominator1,int numerator2,int denominator2) {
         if(numerator1%denominator1==0) {
              rationalnum1=numerator1/denominator1;
         else if(numerator1%denominator1!=0) {
              for(int i=0;i<number.length;i++) {
                   for(;(numerator1%number==0)&&(denominator1%number[i]==0);) {
                        numerator=numerator1/number[i];
                        denominator=denominator1/number[i];
         rationalnum1=numerator/denominator;
         if(numerator2%denominator2==0) {
              rationalnum2=numerator2/denominator2;
         else if(numerator2%denominator2!=0) {
              for(int i=0;i<number.length;i++) {
                   for(;(numerator2%number[i]==0)&&(denominator2%number[i]==0);) {
                        numerator3=numerator2/number[i];
                        denominator3=denominator2/number[i];
         rationalnum2=numerator3/denominator3;
    public rational() {
         numerator=12;
         denominator=3;
         rationalnum1=numerator/denominator;
         numerator3=34;
         denominator3=5;
         rationalnum2=numerator3/denominator3;
    public float getAddResult() {
         return rationalnum1+rationalnum2;
    public float getSubtractResult() {
         return rationalnum1-rationalnum2;
    public float getMultiplyResult() {
         return rationalnum1*rationalnum2;
    public float getDivideResult() {
         return rationalnum1/rationalnum2;
    Related Source Code: class ButtonTest
    import javax.swing.JFrame;
    public class ButtonTest {
         public static void main(String args[]) {
              rationalnumber buttonframe=new rationalnumber();
              buttonframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              buttonframe.setSize(120,320);
              buttonframe.setVisible(true);

    Please use [co[/b]de] and [co[/b]de] tags when pasting code. There's a code button when you enter your message. Also, It will make it easier for you to get help if you follow Java conventions for naming classes. Class names should start with a captial letter.
    Exception in thread "AWT-EventQueue-0"
    java.lang.ArithmeticException: / by zero at rational.<init>(rational.java:32)This part of the error tells you that the error is divide by zero, that the error occurred in the rational class constructor (that's what <init> means) and that the error occurred on line number 32 of the rational.java file.
    So your task is to find line number 32 and see why there is a divide by zero. I am guessing that line number 32 is rationalnum2=numerator3/denominator3;Here's a hint. In almost any computer language, if you divide an int by an int, the result is an int and the fractional part of the result is thrown away. So dividing 8 by 3 results in the number 2.

  • SOAP Runtime Exception: CSoapExceptionTransport :(100101) please help me!

    Hi,
    there is not any problem to test the connection of ADS in SM59 but i have a problem when activating interactive forms.
    An error during activate the form 'SOAP Runtime Exception: CSoapExceptionTransport :(100101)'
    How can i solve this problem? Can somebody help me please?
    Thanks.

    Hello,
      Have a look at this thread
    adobe document services communication problem
    Regards

  • Spry email validation not working [was: Please help!]

    When visitors contact me via the contact form on my website ( http://clockdoctors.co.uk/Contact%20me.html) the 'email spry validation field' is not working. The message that i receive in my inbox from this form doesnt show their email address and so i have no way of getting back to them.
    Please can anyone help!?
    Here is the form-to-mail.php
    <?php
    $name = $_POST['name'];
    $visitor_email = $_POST['email'];
    $message = $_POST['message'];
    //Validate first
    if(empty($name)||empty($visitor_email))
        echo "Name and email are mandatory!";
        exit;
    if(IsInjected($visitor_email))
        echo "Bad email value!";
        exit;
    $email_from = '$visitor_email \r\n';//<== update the email address
    $email_subject = "New Form submission";
    $email_body = "You have received a new message from the user $name.\n".
        "Here is the message:\n $message".
    $to = "[email protected],[email protected]";//<== update the email address
    $headers = "From: $email_from \r\n";
    $headers .= "Reply-To: $visitor_email \r\n";
    //Send the email!
    mail($to,$email_subject,$email_body,$headers);
    //done. redirect to thank-you page.
    header('Location: http://clockdoctors.co.uk/Thanks20%.html');
    // Function to validate against any email injection attempts
    function IsInjected($str)
      $injections = array('(\n+)',
                  '(\r+)',
                  '(\t+)',
                  '(%0A+)',
                  '(%0D+)',
                  '(%08+)',
                  '(%09+)'
      $inject = join('|', $injections);
      $inject = "/$inject/i";
      if(preg_match($inject,$str))
        return true;
      else
        return false;
    ?>
    [Subject line edited by moderator to indicate nature of problem]

    Ok this is my, form-to-mail.php. Is this what you need to view or is there something else?
    <?php
    $name = $_POST['name'];
    $visitor_email = $_POST['email'];
    $message = $_POST['message'];
    //Validate first
    if(empty($name)||empty($visitor_email))
        echo "Name and email are mandatory!";
        exit;
    if(IsInjected($visitor_email))
        echo "Bad email value!";
        exit;
    $email_from = "$visitor_email \r\n";//<== update the email address
    $email_subject = "New Form submission";
    $email_body = "You have received a new message from the user $name.\n".
        "Here is the message:\n $message".
    $to = "[email protected],[email protected]";//<== update the email address
    $headers = "From: $email_from \r\n";
    $headers .= "Reply-To: $visitor_email \r\n";
    //Send the email!
    mail($to,$email_subject,$email_body,$headers);
    //done. redirect to thank-you page.
    header('Location: http://clockdoctors.co.uk/Thanks20%.html');
    // Function to validate against any email injection attempts
    function IsInjected($str)
      $injections = array('(\n+)',
                  '(\r+)',
                  '(\t+)',
                  '(%0A+)',
                  '(%0D+)',
                  '(%08+)',
                  '(%09+)'
      $inject = join('|', $injections);
      $inject = "/$inject/i";
      if(preg_match($inject,$str))
        return true;
      else
        return false;
    ?>

  • Encountering Exception!!please help

    what should i do if i get this exception
    Exception in thread "main" java.lang.UnsupportedClassVersionError: org/jdesktop/
    jdic/desktop/Message (Unsupported major.minor version 48.0)

    Asking in the JDIC forum would probably help, I'm assuming this has nothing to do with JavaMail.
    http://forums.java.net/jive/forum.jspa?forumID=72

  • NESTED EXCEPTION:ABORT. ----please help....

    Hi Experts,
    I've created a VC Model as below.
    Input form(vaue help)-->data service--
    >output table
    (to enter fiscal year period)                        (A query with no variables)             (tabular output)
    After deployment when i click on the value help,I get selection options but when i select an option(say lesser than and a relevent value) and then click 'SUBMIT' button on the input form,I get the following error message:
    "Application error : Nested exception.Failure to excute native function.Nested Exception.ABORT'
    The main need is to be able to display the results w.r.t the range of the fiscal year periods selected.
    Any help on tackling this problem will be appreciated,
    Regards,
    Sai.

    Hi Sai
    i think there is some problem with the selection of data service or input
    go through following links
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9326072e-0c01-0010-bc97-f72e93338101
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/63f2052e-0c01-0010-b9a2-e1f7457a7fbe
    https://wiki.sdn.sap.com/wiki/display/VC
    may helpful, if not solved list it
    Regards
    Pradeep P N

  • ITunes Library is not valid??  Someone please help!

    My computer froze up last night and I had to restart it. Just now I tried to open up iTunes since it froze last night and now I got a popup that says my iTunes Library is not valid and that it needs to create a new one that says "iTunes Library (Damaged)".
    When iTunes opened up none of my songs were there and neither were any of my playlists. It's as if I am using iTunes again for the first time and I have no songs or anything.
    How do I get those songs and my playlists back exactly the way they were before? If anyone can help me out here it would be greatly appreciated. Thanks.
    Dual 1.8GHz G5   Mac OS X (10.4.1)  

    Did you try a permissions repair using your old library file? That may solve the problem without a lot of trouble.
    You can re-import all of your song files back into iTunes, but you will lose all your settings and playlists. I would do that only as a last resort.
    You can find out which files are different between the backup and main Music folders. If you have the OS X Developer Tools installed you can use the "File Merge" utility to compare the two folders. It can be found in Developer/Applications/Utilities. It can tell you what files are identical, unique to one folder or the other, and files that have been added or deleted to either. Depending on how big the folders are it can take a very long time to run the comparison. You might want to run it when you are not using the computer, like overnight.
    After you find out which files are different in the newer Music Folder you can then just re-import them only without affecting things since the last backup.
    Also, iTunes will use whatever library file was last used until you change it by holding down the option key add selecting a new one when you start iTunes. So any files that are added will be added to the current library file in use.
    Hope this helps. Let me know.

Maybe you are looking for