BufferedInputStream does not behave as expected in HP-UX

Hi !
I don't know if anybody experienced similar problem before.
I have this code:
try{
          BufferedInputStream     bis=new BufferedInputStream(ios,bufferSize*1024*1024);
          log.debug("The mark support val in retrieveFileRemote: "+bis.markSupported());
          //archive in source
          //mark as resetable
          bis.mark(0);
          archiveFile(filename,bis);
          bis.reset();
          if(!commandOK){
               //TODO: log some error here
               log.error("There is something wrong in the process of retrieving the file: "+filename+" in "+getHost());
               eAlert.setEmBody("There is something wrong in the process of retrieving the file: "+filename+" in"+getHost());
               eAlert.sendEmail();
               return bis;
          return bis;
          }catch(Exception e){
               log.error("something wrong in BufferedInputStream",e);
          }what it does is just initialize an InoutStream into BufferedInputStream to be able to be marked and reset for reuse. This is a part of my webapps and run under Tomcat 5.0.28. The code works well in Windows box, but when I deploy the exact same code in HP-UX it does not return the value to me. the 'bis' is just null and it doesn't return any error either.
The bufferSize was set to 50. So it is quite large. Would this be a problem in UNIX ? Do I need to chane the heap size setting ? I'm using default setting from Tomcat.
Thanks for any comment.

Need to see more of you program. Make sure you're not working against UNIX file permissions.

Similar Messages

  • Cache Management: Firefox does not behave as expected when setting cache preferences

    I presently play a game online and override my cache management. I Set in the preferences the following parameters.
    browser.cache.disk.max_entry_size = 2000:
    browser.cache.disk.smart_size.enabled = false
    However, when I check the properties of the cache folder it currently shows 2200.
    Here is a subset of the problem I am experiencing. There are alot of files stored in cache_001, 002 and 003 which do not get stored on disk. I use mozillacacheview to view the cache. Is there a way to remove these files without deleting the entire cache.

    no problem, i'm not sure if understand your follow-up question correctly. _cache_001_ 002, 003 contain a mix of index files, metadata and data of the cache itself, so it woudn't be safe to delete those whole files in windows when you want to keep the integrity of the cache intact. i don't know if mozillacacheview offers the option to selectively remove files from the cache, but i think this extension does: [https://addons.mozilla.org/firefox/addon/cacheviewer-continued/]

  • Silverlight 5 binding on a property with logic in its setter does not work as expected when debug is attached

    My problem is pretty easy to reproduce.
    I created a project from scratch with a view model.
    As you can see in the setter of "Age" property I have a simple logic.
        public class MainViewModel : INotifyPropertyChanged
                public event PropertyChangedEventHandler PropertyChanged;
                private int age;
                public int Age
                    get
                        return age;
                    set
                        /*Age has to be over 18* - a simple condition in the setter*/
                        age = value;
                        if(age <= 18)
                            age = 18;
                        OnPropertyChanged("Age");
                public MainViewModel(int age)
                    this.Age = age;
                private void OnPropertyChanged(string propertyName)
                    if (this.PropertyChanged != null)
                        PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    In the MainPage.xaml 
         <Grid x:Name="LayoutRoot" Background="White">
                <TextBox 
                    Text="{Binding Path=Age, Mode=TwoWay}" 
                    HorizontalAlignment="Left"
                    Width="100"
                    Height="25"/>
                <TextBlock
                    Text="{Binding Path=Age, Mode=OneWay}"
                    HorizontalAlignment="Right"
                    Width="100"
                    Height="25"/>
            </Grid>
    And MainPage.xaml.cs I simply instantiate the view model and set it as a DataContext.
        public partial class MainPage : UserControl
            private MainViewModel mvm;
            public MainPage()
                InitializeComponent();
                mvm = new MainViewModel(20);
                this.DataContext = mvm;
    I expect that this code will limit set the Age to 18 if the value entered in the TextBox is lower than 18.
    Scenario: Insert into TextBox the value "5" and press tab (for the binding the take effect, TextBox needs to lose the focus)
    Case 1: Debugger is attached =>
    TextBox value will be "5" and TextBlock value will be "18" as expected. - WRONG
    Case 2: Debugger is NOT attached => 
    TextBox value will be "18" and TextBlock value will be "18" - CORRECT
    It seems that when debugger is attached the binding does not work as expected on the object that triggered the update of the property value. This happens only if the property to which we are binding has some logic into the setter or getter.
    Has something changed in SL5 and logic in setters is not allowed anymore?
    Configuration:
    VisualStudio 2010 SP1
    SL 5 Tools 5.1.30214.0
    SL5 sdk 5.0.61118.0
    IE 10
    Thanks!                                       

    Inputting the value and changing it straight away is relatively rare.
    Very few people are now using Silverlight because it's kind of deprecated...
    This is why nobody has reported this.
    I certainly never noticed this problem and I have a number of live Silverlight systems out there.
    Some of which are huge.
    If you want a "fix":
    private void OnPropertyChanged(string propertyName)
    if (this.PropertyChanged != null)
    //PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    Storyboard sb = new Storyboard();
    sb.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 100));
    sb.Completed += delegate
    PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    sb.Begin();
    The fact this works is interesting because (I think ) it means the textbox can't be updated at the point the propertychanged is raised.
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • The declared package does not match the expected package

    I was given some Java code that I need to get working and then make some improvements on, but I'm still in the process of learning Java and the IDE Eclipse as well. There is a package called MyGUI and most of the files in that package had the error "The declared package MyGui does not match the expected package MyGUI" as a result of the inconsistent case, so I changed all of the first lines "package MyGui" to "package MyGUI" and this fixed all of those problems except for one.
    There is still one file where it gives this error message even though I changed the code the same way I did for the other files. I can't figure why this file is different. I saved it and I also refreshed everything, but it still gives me the error message "The declared package MyGui does not match the expected package MyGUI" although the package is clearly declared as "MyGUI".
    Does anyone have an idea of why this would be? I am very new to Eclipse and Java, so I don't really know how to go about solving errors yet.

    Forget the IDE until you get a handle on basic concepts like packages and classpath.
    The error you're talking about comes when a .java or .class file is not in a directory that matches its declared package.
    Let's say that CLASSPATH_ROOT is the only element in your classpath. If you have a class that is declared like so:
    package com.foo;
    class Bar {}Then, you must have CLASSPATH_ROOT/com/foo/Bar.java or CLASSPATH_ROOT/com/foo/Bar.class.
    The language rules for .java files are not as strict as those for .class files, but some compilers may expect them to be the same, and it's a good idea to do so even if it's not strictly necessary, for clarity's sake.
    Also, even though Windows' file system is not case sensitive--that is it considers FOO.class and foo.class the same file name--Java is. You probably can't directly rename FOO.java to Foo.java in Windows, as it will say it's the same name, so if you need to change the case, rename it to a different name, than back to Foo with the correct case.
    Edited by: jverd on Mar 29, 2009 12:07 PM

  • The publisher of the uploaded package does not match the expected publisher . The publisher for this app is expected

    I have a Windows Phone Silverlight 8.1 project that i am trying to publish
    The publisher in the uploaded package does not match the
    expected publisher. The expected publisher for this app is: "CN=00000000-8F5B-44B4-BFC6-F16FB18F2358"
    I have the same Publisher Id set in the WMAppManifest file
    help me 
    thank you 

    Hi kadir u,
    >>The publisher in the uploaded package does not match the expected publisher. The expected publisher for this app is: "CN=00000000-8F5B-44B4-BFC6-F16FB18F2358"
    Based on the error information, we can see that the publisher value does not have the correct one. So please try to open the Package.appxmanifest, then modify the Publisher as "CN=00000000-8F5B-44B4-BFC6-F16FB18F2358":
    <Identity Name="*******"
    Publisher="CN=00000000-8F5B-44B4-BFC6-F16FB18F2358"
    Version="1.0.0.0" />
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • The publisher in the uploaded package does not match the expected publisher.

    I have an existing Windows Phone 8 application in which I wish to release an update to. This update includes new features as well as targets the 8.1 platform. Because of an unknown problem with the original Visual Studio project
    where the app stopped being able to be deployed to test devices, it was faster to create a new Visual Studio project and copy over the existing code and assets than try and find the issue in the original project. This lead to the publisher GUIDs being different
    between the new and original projects.  
    Now when I try and submit the updated package within the Windows Phone Online dashboard I get the following error message "The publisher in the uploaded package does not match the expected publisher. The expected publisher
    for this app is: "CN=0745C81D-D1ED-49ED-A219-C546B5F31DE5"".
    I have updated both the WMAppManifest and Package.appxmanifest so that they have the following attributes and information:
    Package.appxmanifest (PhonePublisherId="0745C81D-D1ED-49ED-A219-C546B5F31DE5")
    And
    WMAppManifest (PublisherID="{0745C81D-D1ED-49ED-A219-C546B5F31DE5})
     I have then recompiled the app and uploaded and attempted to resubmit the update but I still get the error that the Publisher does not match. What have I missed??

    This sounds tricky... perhaps you can do a search in the entire app for the GUIDs and replace them.
    Also, you could build the appx package, rename the .appx to .zip, and open it up to see if you can find the wrong publisher id anywhere and it might give you a clue to where to make the change.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • Eclipse error : The declared package does not match the expected package

    I'm trying to setup an Eclipse project on some existing code but I can't get past this error. The source files are in the following directories:
    d:\mycompany\coolstuff
    d:\mycompany\neatstuff
    The source files in the coolstuff directory have a package statement:
    package mycompay.coolstuff
    The source files in the neatstuff directory have a package statement:
    package mycompany.neatstuff
    I create a new Eclipse Java project, specify the existing directoy of d:\mycompany. When Eclipse tries to build, it gives the following error:
    The declared package "mycompany.coolstuff" does not match the expected package "coolstuff"
    I've tried everything I can think of short of modifying every package statement since they seem correct based on the Java documentation. What am I missing?

    All the source builds just fine using a command
    nd line and a classpath=.\That's meaningless, since classpath=.\ is just setting the classpath to the current directory.
    d:\mycompany\coolstuff
    d:\mycompany\neatstuff
    The source files in the coolstuff directory have a
    package statement:
    package mycompay.coolstuff
    The source files in the neatstuff directory have a
    package statement:
    package mycompany.neatstuff
    I create a new Eclipse Java project, specify the
    existing directoy of d:\mycompany.When you use the package statement "package mycompay.coolstuff" Eclipse looks in the directory above mycompany for mycompay\coolstuff\<classname>, and that directory is d:\, not d:\mycompany.
    When Eclipse
    tries to build, it gives the following error:
    The declared package "mycompany.coolstuff" does not
    match the expected package "coolstuff"

  • DAQmxGetErrorString does not behave as documented

    First off information about my setup.
    NI-daq 8.1.0f1
    Windows XP SP2
    No National Instruments devices currently connected, for testing.
    The function DAQmxGetErrorString does not behave defined in the daqmxcfunc.chm file located in NI-DAQ\Docs folder.
    In the documentation it says for the return value:
    Name
    Type
    Description
    status
    int32
    The error code returned by the function in the event of an error
    or warning. A value of 0 indicates success. A negative value indicates an
    error.
    If you pass in a valid value for errorString and
    its bufferSize, this function returns as much of the available
    data as possible.
    If you pass NULL for errorString or 0
    for bufferSize, this function returns the number of bytes you
    need to allocate.
    However this is not what it returns.  Below I have example code to demonstrat this.
    #include <NIDAQmx.h>
    #include <iostream>
    int main(int argc, char *argv)
        int32 size;
        int32 error = -2147220712;
        char *msg = new char[100];
        char msg2[100];
        size = DAQmxGetErrorString(error, msg2, 100);
        std::cout << msg2 << std::endl;
        std::cout << size << std::endl;
        size = DAQmxGetErrorString(size, msg2, 100);
        std::cout << msg2 << std::endl;
        std::cout << size << std::endl;
        size = DAQmxGetErrorString(error, msg, 0);
        std::cout << size << std::endl;
        size = DAQmxGetErrorString(error, NULL, 100);
        std::cout << size << std::endl;
        size = DAQmxGetErrorString(error, NULL, 0);
        std::cout << size << std::endl;
        delete [] msg;
        return 0;
    Which when run prints out:
    Explanation could not be found for the requested status code.
    Verify that the requested status cod
    200026
    Requested string could not fit into the given buffer. Only the first part of the
     string was copied
    200026
    0
    0
    0
    Those zeros should be the size of the character array to properly recieve the message, not 0.

    Hello asdfwww,
    I was capable of reproducing the behavior you reported only when an invalid
    (unknown) error code was passed to the function.  If I pass error -200324
    I get a size returned of 586.  However, if I pass the error code you
    mentioned (-2147220712)
    I get 0 returned since it is not a valid DAQmx error code. 
    Sorry for the confusion.
    Jesse O.
    Applications Engineering
    National Instruments
    Jesse O. | National Instruments R&D

  • Compiles but does not execute as expected????

    Here is my code. I can compile and execute but does not perform as expected What do I need to change?
    import java.io.;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.NumberFormat;
    import java.math.*;
    public class CalcTest extends JFrame implements ActionListener, ItemListener
    public JMenuBar createMenuBar()
            JMenuBar mnuBar = new JMenuBar();
            setJMenuBar(mnuBar);
                //Create File & add Exit
            JMenu mnuFile = new JMenu("File", true);
            mnuFile.setMnemonic(KeyEvent.VK_F);
            mnuFile.setDisplayedMnemonicIndex(0);
            mnuBar.add(mnuFile);
            JMenuItem mnuFileExit = new JMenuItem("Exit");
            mnuFileExit.setMnemonic(KeyEvent.VK_F);
            mnuFileExit.setDisplayedMnemonicIndex(1);
            mnuFile.add(mnuFileExit);
            mnuFileExit.setActionCommand("Exit");
            mnuFileExit.addActionListener(this);
            JMenu mnuFunction = new JMenu("Function", true);
            mnuFunction.setMnemonic(KeyEvent.VK_F);
            mnuFunction.setDisplayedMnemonicIndex(0);
            mnuBar.add(mnuFunction);
           JMenuItem mnuFunctionClear = new JMenuItem("Clear");
           mnuFunctionClear.setMnemonic(KeyEvent.VK_F);
           mnuFunctionClear.setDisplayedMnemonicIndex(1);
           mnuFunction.add(mnuFunctionClear);
           mnuFunctionClear.setActionCommand("Clear");
           mnuFunctionClear.addActionListener(this);
            // Fields for Principle 
      JPanel row1 = new JPanel();
      JLabel dollar = new JLabel("How much are you borrowing?"); 
      JTextField money = new JTextField("", 15);
            // Fields for Term and Rate
       JPanel row2 = new JPanel();
       JLabel choice = new JLabel("Select Year & Rate:");
       JCheckBox altchoice = new JCheckBox("Alt. Method");
       JTextField YR = new JTextField("", 4);
       JTextField RT = new JTextField("", 4);
           //Jcombobox R=rate,Y=year
       String[] RY =  {   
            "7 years at 5.35%", "15 years at 5.5 %", "30 years at 5.75%", " "  
      JComboBox mortgage = new JComboBox(RY);
                // Fields for Payment   
        JPanel row3 = new JPanel(); 
        JLabel payment = new JLabel("Your monthly payment will be:");
        JTextField owe = new JTextField(" ", 15); 
              //Scroll Pane and Text Area
       JPanel row4 = new JPanel();
       JLabel amortization = new JLabel("Amortization:");
       JTextArea chart = new JTextArea(" ", 7, 22); 
       JScrollPane scroll = new JScrollPane(chart, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,  
                                               JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);  
        StringBuffer amt = new StringBuffer();
        Container pane = getContentPane(); 
        FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
        JButton Cal = new JButton("Calculate"); 
        NumberFormat currency = NumberFormat.getCurrencyInstance();  
      public CalcTest() 
               // Title and Exit of JFrame  
         super("Mortgage and Amortization Calculator"); 
         setSize(475, 328);  
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
                //JFrame layout      
         pane.setLayout(flow);     
               //Input output fields added to JFrame  
         row1.add(dollar);    
         row1.add(money);   
         pane.add(row1);    
         mortgage.setSelectedIndex(3);   
         mortgage.addActionListener(this);    
         mortgage.setActionCommand("mortgage");
         row2.add(altchoice);     
         altchoice.addItemListener(this);  
         row2.add(choice);     
         YR.setEditable(false);    
         RT.setEditable(false);     
         row2.add(YR);     
         row2.add(RT);      
         row2.add(mortgage);    
         pane.add(row2);     
         row3.add(payment);   
         row3.add(owe);       
         pane.add(row3);      
         owe.setEditable(false);  
                 //Scroll Pane added to JFrame     
          row4.add(amortization);      
          chart.setEditable(false); 
          row4.add(scroll);   
          pane.add(row4);     
                //Executable Button- Clear,Exit, Calculate 
          JPanel row5 = new JPanel();
          JButton clear = new JButton("Clear");  
          clear.addActionListener(this);     
          row5.add(clear); 
          pane.add(row5); 
          JButton exit = new JButton("Exit"); 
          exit.addActionListener(this);    
          row5.add(exit);      
          Cal.setEnabled(false);  
          Cal.addActionListener(this); 
          row5.add(Cal);       
          pane.add(row5);   
          setContentPane(pane);   
          setVisible(true); 
      }                    //End of constructor   
        private void calculate()
          String loanAmount = money.getText(); 
             if(loanAmount.equals(""))      
               return;      
               double P = Double.parseDouble(loanAmount);     
               int y;     
               double r;    
             if(altchoice.isSelected())   
              if(YR.getText().equals("") || RT.getText().equals(""))  
                 return;        
               y = Integer.parseInt(YR.getText());     
                r = Double.parseDouble(RT.getText());   
               else     
                  int index = mortgage.getSelectedIndex();  
                  if(index == 3)         
                  return;          
                  int[] terms = { 7, 15, 30 };     
                  double[] rates = { 5.5, 5.35, 5.75 }; 
                  y = terms[index];  
                  r = rates[index];  
                  double In = r / (100 * 12.0);  
                  double M = P * (In / (1 - Math.pow(In + 1, -12.0 * y)));
                  owe.setText(currency.format(M));      
                         //Column Titles for Text Area     
           chart.setText("Pmt#\tPrincipal\tInterest\tBalance\n");  
         for (int i = 0; i < y * 12; i++)     
      {            double interestAccrued = P * In;     
                   double principalPaid = M - interestAccrued;          
                   chart.append(i + 1 + "\t" + currency.format(principalPaid)           
                                    + "\t" + currency.format(interestAccrued)     
                                          + "\t" + currency.format(P) + "\n");      
                    P = P + interestAccrued - M;   
         public void itemStateChanged(ItemEvent ie) 
      {        int status = ie.getStateChange();    
           if (status == ItemEvent.SELECTED)     
               mortgage.setEnabled(false);  
               YR.setEditable(true); 
               RT.setEditable(true);   
               Cal.setEnabled(true);  
            else 
            mortgage.setEnabled(true); 
            YR.setEditable(false);    
            RT.setEditable(false);     
           Cal.setEnabled(false);     
      public void actionPerformed(ActionEvent ae)//Calculations and Button executions
          String command = ae.getActionCommand();  
                  // Exit program      
           if (command.equals("Exit"))   
            System.exit(0);
                  // Cal button 
          if (command.equals("Calculate") || command.equals("mortgage")) 
              calculate();      
                 // Clear fields  
          if (command.equals("Clear")) 
             money.setText(null);
             mortgage.setSelectedIndex(3); 
             owe.setText(null);   
             chart.setText(null); 
    }             //End actionPerformed 
       public static void main(String args[]) throws IOException
               new CalcTest();
    [/Code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Here is the code again
    import java.io.;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.NumberFormat;
    import java.math.*;
    public class CalcTest extends JFrame implements ActionListener, ItemListener
    public JMenuBar createMenuBar()
            JMenuBar mnuBar = new JMenuBar();
            setJMenuBar(mnuBar);
                //Create File & add Exit
            JMenu mnuFile = new JMenu("File", true);
            mnuFile.setMnemonic(KeyEvent.VK_F);
            mnuFile.setDisplayedMnemonicIndex(0);
            mnuBar.add(mnuFile);
            JMenuItem mnuFileExit = new JMenuItem("Exit");
            mnuFileExit.setMnemonic(KeyEvent.VK_F);
            mnuFileExit.setDisplayedMnemonicIndex(1);
            mnuFile.add(mnuFileExit);
            mnuFileExit.setActionCommand("Exit");
            mnuFileExit.addActionListener(this);
            JMenu mnuFunction = new JMenu("Function", true);
            mnuFunction.setMnemonic(KeyEvent.VK_F);
            mnuFunction.setDisplayedMnemonicIndex(0);
            mnuBar.add(mnuFunction);
           JMenuItem mnuFunctionClear = new JMenuItem("Clear");
           mnuFunctionClear.setMnemonic(KeyEvent.VK_F);
           mnuFunctionClear.setDisplayedMnemonicIndex(1);
           mnuFunction.add(mnuFunctionClear);
           mnuFunctionClear.setActionCommand("Clear");
           mnuFunctionClear.addActionListener(this);
            // Fields for Principle 
      JPanel row1 = new JPanel();
      JLabel dollar = new JLabel("How much are you borrowing?"); 
      JTextField money = new JTextField("", 15);
            // Fields for Term and Rate
       JPanel row2 = new JPanel();
       JLabel choice = new JLabel("Select Year & Rate:");
       JCheckBox altchoice = new JCheckBox("Alt. Method");
       JTextField YR = new JTextField("", 4);
       JTextField RT = new JTextField("", 4);
           //Jcombobox R=rate,Y=year
       String[] RY =  {   
            "7 years at 5.35%", "15 years at 5.5 %", "30 years at 5.75%", " "  
      JComboBox mortgage = new JComboBox(RY);
                // Fields for Payment   
        JPanel row3 = new JPanel(); 
        JLabel payment = new JLabel("Your monthly payment will be:");
        JTextField owe = new JTextField(" ", 15); 
              //Scroll Pane and Text Area
       JPanel row4 = new JPanel();
       JLabel amortization = new JLabel("Amortization:");
       JTextArea chart = new JTextArea(" ", 7, 22); 
       JScrollPane scroll = new JScrollPane(chart, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,  
                                               JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);  
        StringBuffer amt = new StringBuffer();
        Container pane = getContentPane(); 
        FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
        JButton Cal = new JButton("Calculate"); 
        NumberFormat currency = NumberFormat.getCurrencyInstance();  
      public CalcTest() 
               // Title and Exit of JFrame  
         super("Mortgage and Amortization Calculator"); 
         setSize(475, 328);  
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
                //JFrame layout      
         pane.setLayout(flow);     
               //Input output fields added to JFrame  
         row1.add(dollar);    
         row1.add(money);   
         pane.add(row1);    
         mortgage.setSelectedIndex(3);   
         mortgage.addActionListener(this);    
         mortgage.setActionCommand("mortgage");
         row2.add(altchoice);     
         altchoice.addItemListener(this);  
         row2.add(choice);     
         YR.setEditable(false);    
         RT.setEditable(false);     
         row2.add(YR);     
         row2.add(RT);      
         row2.add(mortgage);    
         pane.add(row2);     
         row3.add(payment);   
         row3.add(owe);       
         pane.add(row3);      
         owe.setEditable(false);  
                 //Scroll Pane added to JFrame     
          row4.add(amortization);      
          chart.setEditable(false); 
          row4.add(scroll);   
          pane.add(row4);     
                //Executable Button- Clear,Exit, Calculate 
          JPanel row5 = new JPanel();
          JButton clear = new JButton("Clear");  
          clear.addActionListener(this);     
          row5.add(clear); 
          pane.add(row5); 
          JButton exit = new JButton("Exit"); 
          exit.addActionListener(this);    
          row5.add(exit);      
          Cal.setEnabled(false);  
          Cal.addActionListener(this); 
          row5.add(Cal);       
          pane.add(row5);   
          setContentPane(pane);   
          setVisible(true); 
      }                    //End of constructor   
        private void calculate()
          String loanAmount = money.getText(); 
             if(loanAmount.equals(""))      
               return;      
               double P = Double.parseDouble(loanAmount);     
               int y;     
               double r;    
             if(altchoice.isSelected())   
              if(YR.getText().equals("") || RT.getText().equals(""))  
                 return;        
               y = Integer.parseInt(YR.getText());     
                r = Double.parseDouble(RT.getText());   
               else     
                  int index = mortgage.getSelectedIndex();  
                  if(index == 3)         
                  return;          
                  int[] terms = { 7, 15, 30 };     
                  double[] rates = { 5.5, 5.35, 5.75 }; 
                  y = terms[index];  
                  r = rates[index];  
                  double In = r / (100 * 12.0);  
                  double M = P * (In / (1 - Math.pow(In + 1, -12.0 * y)));
                  owe.setText(currency.format(M));      
                         //Column Titles for Text Area     
           chart.setText("Pmt#\tPrincipal\tInterest\tBalance\n");  
         for (int i = 0; i < y * 12; i++)     
      {            double interestAccrued = P * In;     
                   double principalPaid = M - interestAccrued;          
                   chart.append(i + 1 + "\t" + currency.format(principalPaid)           
                                    + "\t" + currency.format(interestAccrued)     
                                          + "\t" + currency.format(P) + "\n");      
                    P = P + interestAccrued - M;   
         public void itemStateChanged(ItemEvent ie) 
      {        int status = ie.getStateChange();    
           if (status == ItemEvent.SELECTED)     
               mortgage.setEnabled(false);  
               YR.setEditable(true); 
               RT.setEditable(true);   
               Cal.setEnabled(true);  
            else 
            mortgage.setEnabled(true); 
            YR.setEditable(false);    
            RT.setEditable(false);     
           Cal.setEnabled(false);     
      public void actionPerformed(ActionEvent ae)//Calculations and Button executions
          String command = ae.getActionCommand();  
                  // Exit program      
           if (command.equals("Exit"))   
            System.exit(0);
                  // Cal button 
          if (command.equals("Calculate") || command.equals("mortgage")) 
              calculate();      
                 // Clear fields  
          if (command.equals("Clear")) 
             money.setText(null);
             mortgage.setSelectedIndex(3); 
             owe.setText(null);   
             chart.setText(null); 
    }             //End actionPerformed 
       public static void main(String args[]) throws IOException
               new CalcTest();

  • PickList Update - Input values [...] does not match with expected class names

    Hi everybody!
    I try to update a picklist via b1if but I always get the following error-message:
    Exception : Input values '["3" , "3"]' does not match with expected class names '["com.sap.smb.sbo.api.ICompany" , "java.lang.Integer"]' for SBO object type '156'
    As you can see in the error-message I use object type 156 “PickLists”.
    Below you can see the message to the B1 Object – atom:
    <Payload id="atom1" Role="X">
        <System xmlns="">0010000100</System>
        <QueryParams xmlns="">
            <AbsoluteEntry>3</AbsoluteEntry>
        </QueryParams>
        <PickLists xmlns="">
            <row>
                <PickDate>20120914</PickDate>
            </row>
        </PickLists>
        <PickLists_Lines xmlns="">
            <row>
                <OrderEntry>248</OrderEntry>
                <OrderRowID>0</OrderRowID>
                <PickedQuantity>1</PickedQuantity>
            </row>
        </PickLists_Lines>
    </Payload>
    …and the result:
    <Payload status="success" id="atom2" Role="C" DImsg=" Exception :
    Input values '["3" , "3"]' does not match with expected class names
    '["com.sap.smb.sbo.api.ICompany" , "java.lang.Integer"]' for SBO object type '156'"
    DIresult="failure" keyvalue="3" keyname="AbsEntry" payload="atom1" objectid="156"
    method="Synchronous Update" b1login="Technical User" system="0010000100"/>
    I just can’t figure out meaning of the error-message…anyone can help?
    Thanks in advance!
    Best Regards
    Alex

    Hey Alex,
    I have a similar problem. I suppose you have solved your problem, because this post is very old. Perhaps you could share the solution?
    Best regards
    Benjamin

  • Integrations services error 4000 - integration services does not match the expected version

    I have a 2 node high availability cluster built on 2012r2 DataCentre. One VM continually fails to backup and gives the event log error
    "Hyper-V Volume Shadow Copy Requestor failed to connect to virtual machine 'QuadPro' because the version does not match the version expected by Hyper-V (Virtual machine ID 094B6B22-BBED-4D0B-8E47-D8D4D0D3F986). Framework version: Negotiated (0.0) -
    Expected (3.0); Message version: Negotiated (0.0) - Expected (5.0). To fix this problem, you must upgrade the integration services. To upgrade, connect to the virtual machine and select Insert Integration Services Setup Disk from the Action menu."
    When I do the suggested action I get a message stating
    "The computer is already running the current version of integration services (version 6.3.9600.16384)".
    This VM was built through the failover management console under 2012r2. The VM in question is a 2008r2 standard server running a single database application.
    Please advise.
    Matt

    Hi,
    I have run the command using both nodes and get the following error:
    PS C:\Users\*******> Get-VMIntegrationService -ComputerName node01 -VMName quadpro
    Get-VMIntegrationService : A parameter is invalid. Hyper-V was unable to find a virtual machine with name quadpro.
    At line:1 char:1
    + Get-VMIntegrationService -ComputerName node01 -VMName quadpro
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (quadpro:String) [Get-VMIntegrationService], VirtualizationInvalidArgum
       entException
        + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVMIntegrationServiceCommand
    However I tried one of the other VMs for testing purposes (and to check syntax etc) and got the following success message.
    PS C:\Users\******> Get-VMIntegrationService -ComputerName node02 -VMName appserver01
    VMName      Name                    Enabled PrimaryStatusDescription SecondaryStatusDescription
    Appserver01 Time Synchronization    True    OK
    Appserver01 Heartbeat               True    OK                      
    OK
    Appserver01 Key-Value Pair Exchange True    OK
    Appserver01 Shutdown                True    OK
    Appserver01 VSS                     True    OK
    Appserver01 Guest Service Interface False   OK

  • Trigger not behaving as expected

    I have the following trigger on my table. I want to log in records which fail to insert into my main table RTS_EXCEL_UPLOAD into my audit table RTS_EXCEL_UPLOAD_BK. However, when I try to insert a bad record into my main table it throws an exception but does not log the record into RTS_EXCEL_UPLOAD_BK.
    CREATE OR REPLACE TRIGGER TRG_RTS_EXCEL_UPLOAD_BF_I
    BEFORE INSERT ON RTS_EXCEL_UPLOAD
    FOR EACH ROW
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    INSERT INTO RTS_EXCEL_UPLOAD_BK
    (LG_NAME,LG_CODE,PRODUCT_CODE,RTS_PERCENTAGE,LAST_UPDATE_DATE,LAST_UPDATE_USER,COUNTRY_ID)
    VALUES
    (:new.LG_NAME,:new.LG_CODE,:new.PRODUCT_CODE,:new.RTS_PERCENTAGE,:new.LAST_UPDATE_DATE,:new.LAST_UPDATE_USER,:new.COUNTRY_ID)
    DBMS_OUTPUT.PUT_LINE('TRIGGER FIRED');
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('TRIGGER NOT FIRED');
    END;
    CREATE TABLE RTS_EXCEL_UPLOAD_BK
    (LG_NAME VARCHAR2(256)
    ,LG_CODE VARCHAR2(256)
    ,PRODUCT_CODE VARCHAR2(256)
    ,RTS_PERCENTAGE VARCHAR2(256)
    ,LAST_UPDATE_DATE VARCHAR2(256)
    ,LAST_UPDATE_USER VARCHAR2(256)
    ,COUNTRY_ID VARCHAR2(256));
    CREATE TABLE RTS_EXCEL_UPLOAD
    ((LG_NAME VARCHAR2(256)
    ,LG_CODE NUMBER
    ,PRODUCT_CODE VARCHAR2(256)
    ,RTS_PERCENTAGE VARCHAR2(256)
    ,LAST_UPDATE_DATE VARCHAR2(256)
    ,LAST_UPDATE_USER VARCHAR2(256)
    ,COUNTRY_ID VARCHAR2(256));
    INSERT INTO RTS_EXCEL_UPLOAD (LG_CODE)VALUES('A1');
    this is not inserting record into my audit table RTS_EXCEL_UPLOAD_BK as expected.

    Hi,
    You can use FORALL SAVE EXCEPTIONS to audit in your backup table.
    Let us see the example below :
    create table test_tab
    col1 number,
    col2 varchar2(20),
    constraint test_tab_ck check  ( col1 in (1,2,3))
    create table test_tab_bk
    col1 number,
    col2 varchar2(20)
    SET serveroutput ON
    DECLARE
         CURSOR cur_insert
         IS
         SELECT
              ROUND(dbms_random.value(1,4)) AS col1,
              '#######'                     AS col2
         FROM
              dual
         CONNECT BY level <= 10;
         TYPE rec_insert_tbl IS   TABLE OF cur_insert%ROWTYPE INDEX BY PLS_INTEGER;
         insert_tbl rec_insert_tbl;
         /* Exceptions */
         dml_errors EXCEPTION;
         PRAGMA EXCEPTION_INIT(dml_errors, -24381);
         /*Variables*/
         w_error_count NUMBER;
    BEGIN
         OPEN cur_insert;
         FETCH cur_insert bulk collect INTO insert_tbl;
         BEGIN
         FORALL idx IN insert_tbl.FIRST .. insert_tbl.LAST SAVE EXCEPTIONS
         INSERT
         INTO
           test_tab
              col1,
              col2
           VALUES
              insert_tbl(idx).col1,
              insert_tbl(idx).col2
         EXCEPTION
              WHEN dml_errors THEN
              w_error_count := SQL%BULK_EXCEPTIONS.count;
              FOR i  IN 1 .. w_error_count
              LOOP
                dbms_output.put_line ( 'Error: ' || i || ' Array Index: ' || SQL%BULK_EXCEPTIONS(i).error_index
                || ' Message: ' || SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE) ) ;
                  /* Again looping through the data which is to inserted */
                   FOR idx IN  insert_tbl.FIRST .. insert_tbl.LAST
                   LOOP
                        /* If the index of the cursor is same as error index, insert in the Backup table */
                        IF idx = SQL%BULK_EXCEPTIONS(i).error_index THEN
                             INSERT
                             INTO
                               test_tab_bk
                                  col1,
                                  col2
                               VALUES
                                  insert_tbl(idx).col1,
                                  insert_tbl(idx).col2
                          END IF;
                     END LOOP;
              END LOOP;
         END;
         CLOSE cur_insert;
      commit;
    END;
    select * from test_tab;
    select * from test_tab_bk;This will work, but not sure if it can be implemented in your code.
    This solution is also not great performance wise as for backup table we are inserting row by row.
    LOG ERRORS INTO is still the best solution(both in usability and performance wise) and if possible try to use it.

  • Mail Viewer window does not behave according to Apple User Guidelines

    I offer this up hoping that an Apple Mail engineer will see it.
    Why, oh why can we not click on an open, visible Mail Viewer window in the background and bring it up to the frontmost application unless that click happens in the Mail Viewer Toolbar???
    No other application misbehaves this way.
    Long overdue for a fix, imo.

    this does not need a fix as it doesn't behave like that (on my Mac).
    Any part of that window that sticks out behind the top view application is enough to bring that window forward.

  • SsIncludeXml does not return the expected output

    Hi
    In the context of SiteStudio 10gR4:
    I want to emulate a simple key-value-map using a static list. The purpose is enable authors to reference frequently-changed text-variables and maintain them in a single file.
    When I attempt to use the ssIncludeXml function to place the value on a page, I get no result outputted. I have checked (using the XML-features in Oracle JDeveloper 11g) that the XPath actually evaluates to the expected value (FLAF_VAL_1). When I call the ssGetXmlNodeCount function with the same arguments, I get the result "0".
    What am I doing wrong? Is there any limitations on the kinds of XPath expressions that ssIncludeXml will evaluate?
    Thanks!
    I use this snippet to include the value:
    [!--$ ssIncludeXml("KEYVAL_TEST", "//wcm:element[@name='Key'][text()='FLAF_KEY_1']/../wcm:element[@name='Value']/node()") --]And this is my test file in the document KEYVAL_TEST:
    <?xml version="1.0" encoding="UTF-8"?>
    <wcm:root xmlns:wcm="http://www.stellent.com/wcm-data/ns/8.0.0" version="8.0.0.0">
    <wcm:list name="KeyValuePairs">
        <wcm:row>
          <wcm:element name="Key">FLAF_KEY_1</wcm:element>
          <wcm:element name="Value">FLAF_VAL_1</wcm:element>
        </wcm:row>
        <wcm:row>
          <wcm:element name="Key">FLAF_KEY_2</wcm:element>
          <wcm:element name="Value">FLAF_VAL_2</wcm:element>
        </wcm:row>
      </wcm:list>
    </wcm:root>

    Thank you for your reply!! It is great getting some helpful input to help me move forward on this issue!
    2. What you are doing in the example is a bit simpler and not really sufficient to express the query, I need to perform.
    I need to select the contents of a Value-element based on the value in corresponding Key-element in the row.
    This can easily be formulated using XPath. I have already posted a few different XPath expressions that are equvalent for this XML-file. Each of the expressions works perfectly in JDeveloper when querying the XML-file, and yet fails in Site Studio.
    The [Technical Reference|http://download.oracle.com/docs/cd/E10316_01/ouc.htm] states:
    This script extension is a core Site Studio method that allows any element within managed XML file to be extracted and returned in an Idoc string variable, which be placed directly on a web page as an HTML snippet. The content of the XML node that is being extracted will be further evaluated in the scope of the current layout and therefore can include further server-side Idoc Script, if necessary.
    The parameters are:
    - dDocName of XML data file
    - XPath expression (to identify a specific node or nodes of the XML data file)
    Do you know what implementation of the XPath language is used in Site Studio?
    Is it a subset of the language (the Technical Reference does not mention this at all)? Which subset?
    Here is another XPath expression that works perfectly well in JDeveloper and fails in Site Studio:wcm:root/wcm:list/wcm:row[child::wcm:element[@name='Key']/text()[.='FLAF_KEY_1']]/wcm:element[@name='Value']/node()Any insights are appreciated! :-)

  • Comcast will not accept my spot because the  audio sampling value of 44100 does not match the expected rate of 48000. Any ideas how to fix?

    I am working with Final Cut Pro 10.1.4.  I created a 30 second spot with a music bed.  Comcast is rejecting the spot because the audio sampling rate does not match the actual audio values in the spot.  They expected 48000 and my spot is 44100.  This may be caused because I was forced to change the speed of the audio to work properly in the spot.  The audio was sped up to 101%.  First, is this what caused Comcast to reject and second, is there a way to restore the rate without slowing down the music bed?
    Thanks!

    FFirst check your project properties. The default is 48K.

Maybe you are looking for

  • Is iWatch compatible with my iPad mini?

    #already installed ios 8.2

  • Stock Transfer for Excisable Materials Using Movement Type 301

    Hi, We are having a Plant 1002 as excisable Materials. During GR we following the process like GR (Part -I), Capture Invoice, Post Invoice. Can we transfer the Material from Plant 1002 to other Plant, say 1001, using Movement Type 301? Or we need to

  • Changing Frame Size in MPEG2

    I'm using compressor to change less than stellar VHS video to MPEG2. I see that compressor has an option for frame size, but its ghosted out for MPEG2, can this be overridden in any manner? MPEG2 can be resized to LoRes MPEG2, with other programs, to

  • HT5527 iCloud Storage

    I am Mac OS X user and tried to find out my available iCloud storage following your instruction, but when I opened iCloud icon from System Reference in Apple Menu, it says "This is not your primary iCloud account" and no available storage indicated.

  • Identify Photos with Faces in List view

    I have duplicate photos in aperture, I'm trying to clean them up in the LIST view  Sometimes my duplicate photo has a Face or place where the other does not.  How can I quickly see if the photo has a Face assigned to it so I know which file to keep?