Having trouble with program (value return)

getting this error msg when i compile
could someone help me out, im lost, thanks a bunch
Prog4.java:57: '.class' expected
                    double prem_bill = premium_bill(int day, int night);
^
Prog4.java:57: ')' expected
                    double prem_bill = premium_bill(int day, int night);
import javax.swing.JOptionPane;
import java.text.DecimalFormat;
import java.util.Scanner;
public class Prog4
     public static void main(String[] args)
          String name, input;
          char serv_code;
          int acct_num, day_mins, night_mins;
          for (int count = 1; count <= 5; count++)               //looping construct-will run 5 times
               //Get name
                    name = JOptionPane.showInputDialog("What is your name?");
               //Get acct_num
                   input = JOptionPane.showInputDialog("What is your account number?");
               //Convert input to integer
                    acct_num = Integer.parseInt(input);
               //Get serv_code                                                  
                    input = JOptionPane.showInputDialog("Service code? (R-Regular, P-Premium)");     
                    serv_code = input.charAt(0);          
               //Validate serv_code
                    while ((serv_code != 'R') && (serv_code != 'r') && (serv_code != 'P') && (serv_code != 'p'))
                         input = JOptionPane.showInputDialog("Error. (R-Regular, P-Premium)");     
                         serv_code = input.charAt(0);     
               //Get minutes
                    if (serv_code == 'R' || serv_code == 'r')
                         input = JOptionPane.showInputDialog("How many minutes were used in the day?");
                         day_mins = Integer.parseInt(input);               
                         regular_bill(day_mins);
                       double reg_bill = regular_bill(day_mins);
               //Display output(regular)
                         System.out.println("Hello " + name + ".");
                         System.out.println("Your account number is " +  acct_num + ".");
                         System.out.println("Your service type is " +  serv_code + ".");
                         System.out.println("Number of minutes used was " + day_mins + ".");
                         System.out.println("Your total is " + reg_bill + ".");
                    else
                         input = JOptionPane.showInputDialog("How many minutes were used in the day?");
                         day_mins = Integer.parseInt(input);
                         input = JOptionPane.showInputDialog("How many minutes were used in the night?");
                         night_mins = Integer.parseInt(input);
                         premium_bill(day_mins, night_mins);
                         int total_mins = day_mins + night_mins;
                       double prem_bill = premium_bill(int day, int night);
               //Display output (premium)
                         System.out.println("Hello " + name + ".");
                         System.out.println("Your account number is " +  acct_num + ".");
                         System.out.println("Your service type is " +  serv_code + ".");
                         System.out.println("Number of minutes used was " + total_mins + ".");
                         System.out.println("Your total is " + prem_bill + ".");
     public static double regular_bill(int day)
          double result;          //Local variable
               if (day > 50)
                    result = (((day - 50) * .2) + 10);
               else
                    result = 10;
               return result;
     public static double premium_bill(int day, int night)
          double result, day_total, night_total;          //Local variables
               if (day > 75)
                    day_total = (((day - 75) * .1) + 10);
               else
                    day_total = 25;
               if (night > 100)
                    night_total = (((night - 100) * .05) + 10);
               else
                    night_total = 25;
                    result = (day_total + night_total);
               return result;
}Edited by: dallasCowMavs on Mar 9, 2008 8:37 PM
Edited by: dallasCowMavs on Mar 9, 2008 8:42 PM

Your problem is that you cannot call a method by initializing variables.
the method call: double prem_bill = premium_bill(int day, int night); is wrong.
You should replace it with this one: double prem_bill = premium_bill(day_mins, night_mins); assuming this is how you want the program to run. Otherwise, just use other variables that have already been initialized.
In short, consider the following method: public void method(int a, int b);
incorrect method call: method(int c, int d).
correct method call: method(5,9);
correct method call:
int c = 5, d = 9;
method(c,d);
I hope that was helpful

Similar Messages

  • I'm having trouble with the purchase of currency in the game Castle Clash locks! In order status says "Back" returns so what? Money at stake so I have not returned!

    I'm having trouble with the purchase of currency in the game Casyle Clash locks! In order status says "Back" returns so what? Money at stake so I have not returned!

    You need to contact the developer of the game, or, the iTunes store support.  iTunes store "MIGHT" issue a 1 time refund.  If you want the credits for the game, talk to the game creator.

  • I'm having trouble with My adobe Creative Suite 4 Design Standard programs opening. They will bounce to open but won't open up and eventually I will need to force quit as they aren't responding.  I'm thinking it may be a font issue but need some support A

    I'm having trouble with My adobe Creative Suite 4 Design Standard programs opening. They will bounce to open but won't open up and eventually I will need to force quit as they aren't responding.  I'm thinking it may be a font issue but need some support ASAP!

    Nobody can tell you anything without proper system info or other technical details like the crash logs.
    Mylenium

  • I am having trouble with the "numbers" app on my MacBook Air. I go to print my document and that works just fine. I cannot however return to the document after printing. What do I have to do?

    I am having trouble with the "numbers" app on my MacBook Air. I go to print my document and that works just fine. I cannot however return to the document after printing. What do I have to do?

    RR,
    Not to worry, you're not the first to expect Print to finish by returning you to the edit mode. The thing is that Printing is so hit and miss with this version of the app, you will probably want to stay in the Print window for more than one attempt.
    Jerry

  • I need to un-install then re-install my Adobe Creative Suite 6. I am having troubles with the programs.

    I need to un-install then re-install my Adobe Creative Suite 6. I am having troubles with the programs.

    Hi legates1,
    You can uninstall the software by going to Control Panel > Programs
    You can also use the Creative Suite Cleaner tool ( Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6 ) to remove the software completely.
    Regards,
    Rave

  • I am having trouble with a form, won't tab to 2nd page...

    I am having trouble with a form I created in Acrobat Pro 10. I created tabs etc, they all work wonderfully in Adobe, but once I uploaded it onto the web-based program for other users, the tabs only work  on page 1, I have to click on page 2 to keep tabbing through.  It won't tab into it.  Any advise?  Also, when the users open it it opens in the web.

    1. The library is separate from the application, so re-installing shouldn't cause an issue with the actual photos. But it would be foolhardy in the extreme to do anything without first backing up.
    2. Often these issues are caused by a damaged Library, so reinstalling doesn't change much.
    FWIW
    To re-install iPhoto
    1. Put the iPhoto.app in the trash (Drag it from your Applications Folder to the trash)
    2a: On 10.5:  Go to HD/Library/Receipts and remove any pkg file there with iPhoto in the name.
    2b: On 10.6: Those receipts may be found as follows:  In the Finder use the Go menu and select Go To Folder. In the resulting window type
    /var/db/receipts/
    A Finder Window will open at that location and you can remove the iPhoto pkg files.
    3. Re-install.
    If you purchased an iLife Disk, then iPhoto is on it.
    If iPhoto was installed on your Mac when you go it then it’s on the System Restore disks that came with your Mac. Insert the first one and opt to ‘Install Bundled Applications Only.
    If you purchased it on the App Store you can find it in your Purchases List.
    Alternative approach:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Having trouble with throws...

    Hey there.
    I'm fairly new to java so bear with me here.
    I'm having trouble with a program that, in short, reads from a file.
    Let me shorten a show the code to you...
    //main opens up and in a bit we get to...
    if (loginVerify())
    //and the if continues.
    fileIn.close();
    //main ends
    public boolean loginVerify() throws IOException
         openIn(); //Checks for validity - It's a long story why I //didn't just put the code in loginVerify(). I //don't think it should matter.
    String str = verifyLog(); //Does the actual reading
         str = str.substring(1);
         if (str == placeHold) //Don't worry about not making placeHold,
    //I made it global for testing reasons.
              return true;
         else
              return false;
    private String verifyLog() throws IOException
         String str;
         while (true)
              str = fileIn.readLine();
              if (str == null)
                   break;
              else if (str.charAt(0) == 1)
                   return str;
              //ADDITION OF OTHER NUMBERS
              else
                   return str = "invalid";
    private void readIn() throws IOException
         BufferedReader console =
    new BufferedReader(new InputStreamReader(System.in));
    openInputFile(fileName);
    if (fileIn == null)
    System.out.println("*** Can't open " + fileName + " ***");
    return;
    private static void openInputFile(String fileName)
    try
    fileIn = new BufferedReader(new FileReader(fileName));
    catch (FileNotFoundException e)
    So it's fairly simple. It checks for validity and then reads lines until it finds one with the first char as '1' when it finds it, it reads the rest of the line off.
    The error I'm getting is as follows: Exception java.io.IOException must be caught, or it must be declared in the throws clause of this method.
    I've added throws IOException to them in attempts to fix the error but to no avail. I've tryed putting the catch in different spots... again, doesn't work.
    I'm using codewarrior IDE version 5. I'm fairly sure it's the newest. I installed Java SDK 1.3 with codewarrior originally but I installed 1.4.1 recently.
    If you need to see anything else about it, please tell me. I'd be more than happy to post a little more if it'll help.
    Thanks

    Ok. I worked through a bunch of throws and now I've found one I can't seem to conquer.
    private String verifyLog()
           String str = "";
           while (true)
                try {
                str = fileIn.readLine();
                catch (FileNotFoundException g) {
                if (str == null)
                     break;
                else if (str.charAt(0) == 1)
                     return str;
                //ADDITION OF OTHER PEOPLE
                else
                     return str = "invalid";
           return str = "invalid";
      }This time the error is at the reference to readLine() and it tells me the same error as before. I have a catch set up there, don't I?
    readLine() is something I didn't create so I don't know how I'd tell it to throw an exception if I had to...
    Thanks

  • Having trouble with my signed applet(if it's properly signed that is)

    hi
    I'm having trouble with my supposedly signed applet. I'm trying to execute a specific program in this case trilian from my browser. i'm using firefox
    first my java code
    package applet;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class RunApplet extends JApplet {
        JButton jButton = new JButton();
        FlowLayout flowLayout1 = new FlowLayout();
        public RunApplet() {
            try {
                init();
            } catch (Exception ex) {
                ex.printStackTrace();
        private void init() throws Exception {
            try {
                this.getContentPane().setLayout(flowLayout1);
                this.setSize(new Dimension(100, 200));
                jButton.setText("Trillian");
                jButton.addActionListener(new RunApplet_jButton_actionAdapter(this,
                        "\"C:\\Program Files\\Trillian\\trillian.exe\""));
                this.getContentPane().add(jButton, null);
            } catch (Exception e) {
                e.printStackTrace();
    class RunApplet_jButton_actionAdapter implements ActionListener {
        private RunApplet adaptee;
        private String programPath;
        RunApplet_jButton_actionAdapter(RunApplet adaptee, String programPath) {
            this.adaptee = adaptee;
            this.programPath = programPath;
        public void actionPerformed(ActionEvent e) {
            try {
                Runtime.getRuntime().exec(this.programPath);
            } catch (IOException ex) {
    }And my applet code
    <html>
    <body>
    <!--"CONVERTED_APPLET"-->
    <!-- HTML CONVERTER -->
    <object
        classid = "clsid:CAFEEFAC-0015-0000-0005-ABCDEFFEDCBA"
        codebase = "http://java.sun.com/update/1.5.0/jinstall-1_5_0_05-windows-i586.cab#Version=5,0,50,5"
        >
        <PARAM NAME = CODE VALUE = "applet.RunApplet.class" >
        <PARAM NAME = ARCHIVE VALUE = "myfile.jar" >
        <param name = "type" value = "application/x-java-applet;jpi-version=1.5.0_05">
        <param name = "scriptable" value = "false">
        <comment>
         <embed
                type = "application/x-java-applet;jpi-version=1.5.0_05" \
                CODE = "applet.RunApplet.class" \
                ARCHIVE = "myfile.jar"
             scriptable = false
             pluginspage = "http://java.sun.com/products/plugin/index.html#download">
             <noembed>
                </noembed>
         </embed>
        </comment>
    </object>
    <!--
    <applet CODE = "applet.RunApplet.class" ARCHIVE = "myfile.jar">
    </applet>
    -->
    <!--"END_CONVERTED_APPLET"-->
    </body>
    </html>Creating my key:
    keytool -genkey -alias sitekey -keystore "C:\Program Files\Java\jdk1.5.0_05\jre\lib\security\cacerts"Now the process of creating the jar file and signing it:
    1. jar cf myfile.jar *.class
    2. jarsigner -keystore "C:\Program Files\Java\
    jdk1.5.0_05\jre\lib\security\cacerts" myfile.jar sitekeyNow this is the way i've been using then and the first time i get the "do you want to trust" screen but still i get a security exception.
    Exception in thread "AWT-EventQueue-10" java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkExec(Unknown Source)
         at java.lang.ProcessBuilder.start(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at applet.RunApplet_jButton_actionAdapter.actionPerformed(RunApplet.java:73)
         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 Source)
         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.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)Is there anybody who have an idea what can be wrong?
    regards
    thallish

    ok i solved i myself. i assigned a different and thereby correct keystore and now it works like it should
    regards
    thallish

  • I am having trouble with my IMac 27 2006

    I am having trouble with my IMac 27 2006 start up OK will run however picture stops, scattered all over screen shutters and then sometimes freezes. Can I reinstall OSX? Or is there a program that dose Fixes?

    How to Perform an Archive and Install
    An Archive and Install will NOT erase your hard drive, but you must have sufficient free space for a second OS X installation which could be from 3-9 GBs depending upon the version of OS X and selected installation options. The free space requirement is over and above normal free space requirements which should be at least 6-10 GBs. Read all the linked references carefully before proceeding.
    1. Be sure to use Disk Utility first to repair the disk before performing the Archive and Install.
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger, Leopard or Snow Leopard.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer. Now restart normally.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Do not proceed with an Archive and Install if DU reports errors it cannot fix. In that case use Disk Warrior and/or TechTool Pro to repair the hard drive. If neither can repair the drive, then you will have to erase the drive and reinstall from scratch.
    3. Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When you reach the screen to select a destination drive click once on the destination drive then click on the Option button. Select the Archive and Install option. You have an option to preserve users and network preferences. Only select this option if you are sure you have no corrupted files in your user accounts. Otherwise leave this option unchecked. Click on the OK button and continue with the OS X Installation.
    4. Upon completion of the Archive and Install you will have a Previous System Folder in the root directory. You should retain the PSF until you are sure you do not need to manually transfer any items from the PSF to your newly installed system.
    5. After moving any items you want to keep from the PSF you should delete it. You can back it up if you prefer, but you must delete it from the hard drive.
    6. You can now download a Combo Updater directly from Apple's download site to update your new system to the desired version as well as install any security or other updates. You can also do this using Software Update.

  • Having trouble with FileUploader

    I am having trouble with the FileUploader control.   The use case is to upload a picture for a user to display on a user profile page.
    The first thing I did was take the code from the SAPUI5 DemoKit and modify the uploadUrl to a local directory in my project. This works on the DemoKit and I can see that my file gets uploaded to the ../../../../../uploads directory on the sapui5.ondemand site.   But when I try it locally on my project, it fails to post to the directory.
    I figured I would skinny it down to the least amount of code to test it.
    var layout = new sap.ui.commons.layout.MatrixLayout();
      layout.setLayoutFixed(false);
    var oUpload = new sap.ui.commons.FileUploader( {
      mimeType: "image,text",
      fileType: "jpg,png,gif",
      uploadUrl:      "../images/devices",
      name:           "Uploader",
      width:      '500px',
      buttonText:   "..",
      tooltip:    "File Name",
      value:          '',
      uploadOnChange: true
      layout.createRow( oUpload );
    return layout;
    When it does the POST, I get a 405 Method Not Allowed error on my local server.   Is there something that needs to be configured on the server-side?
    I tried putting in an .xsaccess file in the upload folder and parent folder(s) but it does not seem to help.
    I have seen some of the other posts on SCN:
    This one claims we need a server-side servlet to handle the file.   FileUploader 
    This post has a similar 405 error down in the comments: Import text file from JS to XSJS
    So the questions are:
    1) Can someone confirm if I can simply write an image to the folder like in the DemoKit?  What is needed to make this work?
    2) If I cannot write to the folder directly, can someone share their "FileUpload.xsjs" code logic to help me get jumpstarted?
    3) What have I missed with the FileUploader?
    Thank you,
    Jim Giffin
    Edit - my current environment is HANA DB 1.00.70.386119, SAPUI5 points to the sapui5.hana.ondemand.com version which is currently 1.20.6, but I have checked out openUI5 1.20.8.
    Message was edited by: Jim Giffin
    I also failed to mention this is a Developer instance on AWS.

    Hi Jim,
    answer from discussion you mentioned is correct. You need some server-side handler that will take care of the file and uploads it to directory.
    Demokit example does not point to directory "upload", but it is a relative url address.
    If you type sapui5.hana.ondemand.com/sdk/test-resources/sap/ui/commons/demokit/../../../../../upload
    you will see that it is actually url address sapui5.hana.ondemand.com/sdk/upload which points to some server-side handler.
    For you second question, this could be what you are looking for - Upload data to HANA table with SAPUI5 FileLoader and HANA Extended Services
    Best regards,
    Peter

  • Having trouble with email reviews

    Hi all, I am testing Acrobat X for my company and I am having trouble with testing for "send for email review/merge comments". In my last test I made a PDF from InDesing as usual and on my "test" Mac using Acrobat X I opened the PDf and sent it to 3 people for email review. One of the people was using a PC and Acrobat 9 Reader, the other two were using Acrobat X to make comments and send back. I should note that I am using one test machine (iMac) for all three of the Mac reviews, but each individual is logging on with their ID for the network and the email program (entourage).
    All three reviewers were able to get the PDF in the email, make comments and then use the "send comments" button to send back to me.
    My problem is that when I got all three emails back, and when I logged into the test machine as myself, opened the returned PDFs, I was only able to "merge comments" from one reviewer (from Mac) to my original PDF. With the email from the PC and one email from the iMac, I was UNABLE to merge these two sets of comments. The merge comments button was unavailable, I never got the message about if I wanted to "merge comments" or "No, open this copy only." And when I tried to go through "comments>merge comments onto master PDF" I was not able to see that option anywhere, either.
    Sorry for the long explanation, but I want to include as much info as possible to try to get the proper feedback from you all.
    Thanks in advance for any input you can provide.

    Just to be clear here, when you say that " I should note that I am using one test machine (iMac) for all three of the Mac reviews, but each individual is logging on with their ID for the network and the email program (entourage). " you mean that you have created 3 different users on your mac machine and configured entourage for each of them. If not then please explain this.
    Have you tried using any of these:
    a) 2-3 Mac partitions for the different users
    b) 2-3 different mac machines for the same
    c) maybe 2-3 Mac Virtual machines on a Mac main machine
    If it is possible can you please try that scenario on any of the above mentioned combinations and let us know the results. This will help us a lot in narrowing down the issue.
    Thanks,
    Abhilasha

  • I'm having trouble with something that redirects Google search results when I use Firefox on my PC. It's called the 'going on earth' virus. Do you have a fix that could rectify the vulnerability in your software?

    I'm having trouble with a virus or something which affects Google search results when I use Firefox on my PC ...
    When I search a topic gives me pages of links as normal, but when I click on a link, the page is hijacked to a site called 'www.goingonearth.com' ...
    I've done a separate search and found that other users are affected, but there doesn't seem to be a clear-cut solution ... (Norton, McAfee and Kaspersky don't seem to be able to detect/fix it).
    I'd like to continue using the Firefox/Google combination (nb: the hijack virus also affects IE but not Safari) - do you have a patch/fix that could rectify the vulnerability in your software?
    thanks

    ''' "... vulnerability in your software?" ''' <br />
    And it affects IE, too? Ya probably picked up some malware and you blame it on Firefox.
    Install, update, and run these programs in this order. They are listed in order of efficacy.<br />'''''(Not all programs detect the same Malware, so you may need to run them all to solve your problem.)''''' <br />These programs are all free for personal use, but some have limited functionality in the "free mode" - but those are features you really don't need to find and remove the problem that you have.<br />
    ''Note: If your Malware infection is bad enough and you are mis-directed to URL's other than what is posted, you may have to use a different PC to download these programs and use a USB stick to transfer them to the afflicted PC.''
    Malwarebytes' Anti-Malware - [http://www.malwarebytes.org/mbam.php] <br />
    SuperAntispyware - [http://www.superantispyware.com/] <br />
    AdAware - [http://www.lavasoftusa.com/software/adaware/] <br />
    Spybot Search & Destroy - [http://www.safer-networking.org/en/index.html] <br />
    Windows Defender: Home Page - [http://www.microsoft.com/windows/products/winfamily/defender/default.mspx]<br />
    Also, if you have a search engine re-direct problem, see this:<br />
    http://deletemalware.blogspot.com/2010/02/remove-google-redirect-virus.html
    If these don't find it or can't clear it, post in one of these forums for specialized malware removal help: <br />
    [http://www.spywarewarrior.com/index.php] <br />
    [http://forum.aumha.org/] <br />
    [http://www.spywareinfoforum.com/] <br />
    [http://bleepingcomputer.com]

  • Having trouble with persist

    I have created a simple application where a user can order items and then i'm saving the order and all the items (details of order) to the dataBase.
    i'm using jdk1.5 with jboss and mySql (also hibernate).
    i'm having troubles with saving the details of the order, the relevant code is-
    order entity -
    @Entity
    public class Orders implements Serializable
        @Id @GeneratedValue
        private long orderId;                    //generated in db
        private String name;
       public Orders(String userName)
            this.userName=userName;
        public long getOrderId() { return orderId; }
        //getters and setters...
    detailsOfOrder entity -
    @Entity
    public class DetailsOfOrders implements Serializable
    @Id
    private long orderId;
    @Id
    private int productId;
    private int quantity;
    public DetailsOfOrders(long orderId,int productId)
         this.productId=productId;
         this.orderId=orderId;
    public long getOrderId() { return orderId; }
    public int getProductId() { return productId; }
    //getters and setters...
    }session bean (order method) -
            List<SCItem> listOfItems;                         //SCItem is a regular class
            Orders order=new Orders(userName);
            manager.persist(order);
            long orderId=order.getOrderId();   //get order id after persisting
            for(SCItem item : listOfItems)    //save details of order
             DetailsOfOrders detail=new DetailsOfOrders(orderId,"1");
             manager.persist(detail);                                                   //exception occures here
           }when i'm trying to make an order i'm getting the exception-
    javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
    what is the problem?
    thanks in advanced.

    yes, the entity classes have no-arg constructors (i just tried to write it shortly here...)
    about the other thing , well i'm sorry , the right code is-
    session bean (order method) -
       List<SCItem> listOfItems;                         //SCItem is a regular class
       Orders order=new Orders(userName);
       manager.persist(order);
       long orderId=order.getOrderId();   //get order id after persisting
       for(SCItem item : listOfItems)    //save details of order
         DetailsOfOrders detail=new DetailsOfOrders(orderId,item.getProductId());
         manager.persist(detail);                                                   //exception occures here
         }what else could it be?

  • Having Trouble With E-mails That Involve Animation

    This is too weird. When I receive an e-mail that has animation in it it comes through freeze framed in Mail. It does not matter if it is in my .Mac account or Verizon account. Just for the heck of it I forwarded it to myself using the Verizon account and opened it in Safari. I also did the same thing with my .mac account. I opened it on the web. Bingo, I had animation. I am also having trouble with WMV's. Why can I not get any animation in Mail? Is there something I am doing wrong? any way to correct this?

    OK, from the sound of your post, you have a limited knowledge about email. Let me see if I can help. I would guess that you have a Windows machine that you have used in the past. Your email address must be a "pop" address. That means that your internet service provider has a server where your mail is sent. This is different than a web mail address, that is accessed remotely with a web browser, such as Internet Explorer, Firefox, or Safari. You must then be using an email program, such as Outlook Express, to go get the email onto your local machine. Any email program can do this. Open up the accounts tab in Outlook Express, and write down the settings. There will be one for the incoming server, and one for the outgoing server. Now, on your Mac, you can use the email program provided, such as Mac Mail, and put the settings in there. You can now send and receive to your Mac using your supplied email address. You can use another program such as Thunderbird to do this if you want. You don't have to use Mac Mail.
    Getting your old email off of the Windows computer is a bit harder, so hopefully you don't need to do that. But if you do, I can direct you on how to do that also.

  • Having trouble with my PHP code. Appers to get stuck on a white page.

    HI all,
    I have just began having trouble with my PHP code. Was working before and haven't made any changes to the code since last time it worked.
    What happens is after the form is submitted it goes to a white page (no text just all white page) and in the address bar it has the path for my php page. what supposed to happen is either it goes to a success page or a error page.
    I've had a problem where the info entered is correct but was directed to the error page. i managed to fix that issue but i am puzzled what is happening to my php page now.
    Mind you that i didn't write this code i just took over the responsiblities of this website and i am hopping that its a quick fix.
    I appreciate any help you could give me. Thank you.
    CODE:
    <?php
       $to = '[email protected]';
          $from = '[email protected]';
            //Make sure we have some info posted from the form...
            if (isset($HTTP_POST_VARS)){
                //Clear the body of the message to be sent
                $body = '';
                //go through all POSTed variables sent
                while (list($key, $value) = each($HTTP_POST_VARS)){
        if($key <> "Submit" && $key <> "submit") {
         $body .= $key . ' = ' . $value . "\r\n"; 
                //Now building mail headers.....
                $headers = "From: ".$from."\r\n";
                //Mail message
                $success = mail($to, "Email Club" . date("m/d/Y"), $body, $headers);
       // CURL stuff.....
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_FAILONERROR, 1);
       curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
       curl_setopt($ch, CURLOPT_TIMEOUT, 4); //times out after 4s
       curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
                 if ($success){
        //readfile('http://www.lvpaiutegolf.com/thankyou.html');
        curl_setopt($ch, CURLOPT_URL,"http://www.lvpaiutegolf.com/thankyou.html");
        header("Location:http://www.lvpaiutegolf.com/thankyou.html");
                else{
                 // readfile('http://www.lvpaiutegolf.com/error.html');
         curl_setopt($ch, CURLOPT_URL,"http://www.lvpaiutegolf.com/error.html");
         header("Location:http://www.lvpaiutegolf.com/error.html");
       // Output
       //$result=curl_exec ($ch);
       //curl_close ($ch);
       //echo $result'";
    ?>

    Insert the install disk and boot from it. Use disk utitlity to repair your drive and check for errors (report any errors back here) then reinstall the os. This should not erase your data.

Maybe you are looking for

  • IP Phone SSL VPN to ASA using AnyConnect

    I have a CUCM 7.1.5. We are using Phone proxy today. I wanted to upgrade to IP phone SSL VPN. I know in 8.x and 9.x the Proxy phone is not supported and Cisco supports SSL VPN. However, The question is: if CUCM 7.1.5 supports Phone SSL VPN. Lastly, I

  • Goods Receipt Output

    Hi Experts, I want to print the Goods Receipt for Purchase Orders. In MN21 I  set output Z123 and Z124 for plant XXXX. Despite that, I did not succeed in printing the goods receipt. If I select MB02 the output message in GO TO-ADDITIONAL FUNCTION is

  • Can't Build a PDF Portfolio

    The HELP function suggests building a PDF Portfolio, which would be helpful for me when doing serches on PDF documents.  But when I go to the File drop-down menu, no option appears for PDF portfolio, as the HELP instructions says there should occur. 

  • Bought iTunes by iPod won't synch b/c "you are not authorized to play it.."

    I bought iTunes using my daughter's computer and am trying to synch those songs to her iPod. The songs show up as "purchased" and they show in the Music library. When I synch her iPod, all of the songs I bought are not copied and each song shows an e

  • Migration from G5 iMac

    I just purchased a new iMac. I used the migration assistant to move my info. I now have an application folder in my application folder with my applications from the G5. Some are duplicates, some are older versions of the same app, and some are exclus