Who can help solve this XML/Servlet mystery?

Hi,
I'm developing a servlet that accepts an HTTP request, contacts a database, processes the request and return an XML document back to the browser. The XML document returned is dependent on which selection a user makes.
The problem is that on first request, say user selects "choice one", the correct XML document is returned. However, when the browser's back button is used to go back and make the same choice as previous(ie "choice one"), Explorer 4.5 displays an empty page while netscape 4.5 return a document contains no data error.
I used oracle xmlclassgenerator to generate the classes that create the XML document to be returned. The problem certainly lies in the method of my servlet that uses these classes to generate the XML document because when I replace the whole method with println statement every thing works fine(but of course without the XML document).
The content of the method is as follows.
ACCOUNT acc = new ACCOUNT(id);
//Create a child and add child to root node
NUM_OF_RESIDENTS nr = new NUM_OF_RESIDENTS(num);
acc.addNode(nr);
//Create another child and add to root node
FIXED_COST fc = new FIXED_COST();
ELECTRICITY el = new ELECTRICITY(elec);
GAS g = new GAS(gas);
WASH_MACHINE wm = new WASH_MACHINE(wash);
WATER wat = new WATER(water);
OTHER oth = new OTHER(other);
fc.addNode(el);
fc.addNode(g);
fc.addNode(wm);
fc.addNode(wat);
fc.addNode(oth);
//finally add to root node
acc.addNode(fc);
//Create another child
TELEPHONE tl = new TELEPHONE();
SUBSCRIPTION sub = new SUBSCRIPTION(tel);
COST_PER_TICK cpt = new COST_PER_TICK(tick);
tl.addNode(sub);
tl.addNode(cpt);
acc.addNode(tl);
//Create another child
// PREVIOUS_ACCOUNT pacc = new PREVIOUS_ACCOUNT();
for(int i=0; i<previous_details.size(); i++){
//Create another child
PREVIOUS_ACCOUNT pacc = new PREVIOUS_ACCOUNT();
PreviousDetails pd = (PreviousDetails)previous_details.elementAt(i);
String name = pd.getName();
String credit = pd.getCredit();
String debit = pd.getDebit();
NAME n = new NAME(name);
LAST_CREDIT lc = new LAST_CREDIT(credit);
LAST_DEBIT ld = new LAST_DEBIT(debit);
pacc.addNode(n);
pacc.addNode(lc);
pacc.addNode(ld);
acc.addNode(pacc);
for(int i=0; i<acc_dates.size(); i++){
String str = (String)acc_dates.elementAt(i);
ACCOUNT_DATE ad = new ACCOUNT_DATE(str);
acc.addNode(ad);
acc.validateContent();
ByteArrayOutputStream out1 = new ByteArrayOutputStream(1024);
acc.print(out1);
res.setContentType("text/plain");
ServletOutputStream os = res.getOutputStream();
PrintWriter out = new PrintWriter(os);
out.println(out1.toString());
out.close();
catch(Exception e){}
Am I doing somthing wrong here?
Thanks.
null

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
If you paste your code that's in the servlet into a file with a static main() method, and if you wrap the code with a for loop in Java that makes it execute 3 times in a row, does it work properly each of the the 3 times in this scenario?<HR></BLOCKQUOTE>
I have done as you requested. For your convenience I have pasted both the code and its output below.
import oracle.xml.classgen.*;
import oracle.xml.parser.*;
import java.io.*;
import java.util.*;
import java.sql.*;
import java.math.*;
public class CreateTest{
static String id = "10212";
public static void main (String args[]){
for(int i=0; i<3; i++){
System.out.println("Request started!");
testLoop();
static void testLoop(){
try{
System.out.println("Start DB contact");
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn =
DriverManager.getConnection ("jdbc:oracle:thin:@my_ip:sid","username", "passwd");
ResultSet rset;
Vector acc_dates = new Vector();
Vector previous_details = new Vector();
String elec = null;
String gas = null;
String wash = null;
String water = null;
String other = null;
String tel = null;
String tick = null;
String num = null;
Statement stmt = conn.createStatement();
rset = stmt.executeQuery("select NUM_OF_RESIDENTS from MEMBER WHERE ID="+id);
while(rset.next()){
num = String.valueOf(rset.getInt(1));
rset = stmt.executeQuery("select ELECTRICITY,GAS,WASH_MACHINE,WATER,OTHER from FIXED_COST where ID="+id);
while(rset.next()){
elec = String.valueOf(rset.getFloat(1));
gas = String.valueOf(rset.getFloat(2));
wash = String.valueOf(rset.getFloat(3));
water = String.valueOf(rset.getFloat(4));
other = String.valueOf(rset.getFloat(5));
rset = stmt.executeQuery("select SUBSCRIPTION,COST_PER_TICK from TELEPHONE WHERE id="+id);
while(rset.next()){
tel = String.valueOf(rset.getFloat(1));
tick = String.valueOf(rset.getFloat(2));
rset = stmt.executeQuery("select NICK_NAME, CREDIT, DEBIT from PREVIOUS_ACCOUNT WHERE LAST_ACCOUNT='yes' AND id="+id);
while(rset.next()){
String name = rset.getString(1);
String credit = String.valueOf(rset.getFloat(2));
String debit = String.valueOf(rset.getFloat(3));
PreviousDetails pd = new PreviousDetails(name,credit,debit);
previous_details.addElement(pd);
rset = stmt.executeQuery("select ACCOUNT_DATE from ACCOUNT_RESULT WHERE ID="+id);
while(rset.next()){
acc_dates.addElement(rset.getString(1));
rset.close();
stmt.close();
conn.close();
System.out.println("End DB contact");
generateXMLDocument(num,elec,gas,wash,water,other,tel,tick,previous_details,acc_dates);
catch(Exception e){e.printStackTrace();}
public static void generateXMLDocument(String num, String elec, String gas, String wash, String water, String other, String tel, String tick, Vector previous_details, Vector acc_dates){
try{
//Create the document root node
ACCOUNT acc = new ACCOUNT(id);
//Create a child and add child to root node
NUM_OF_RESIDENTS nr = new NUM_OF_RESIDENTS(num);
acc.addNode(nr);
//Create another child and add to root node
FIXED_COST fc = new FIXED_COST();
ELECTRICITY el = new ELECTRICITY(elec);
GAS g = new GAS(gas);
WASH_MACHINE wm = new WASH_MACHINE(wash);
WATER wat = new WATER(water);
OTHER oth = new OTHER(other);
fc.addNode(el);
fc.addNode(g);
fc.addNode(wm);
fc.addNode(wat);
fc.addNode(oth);
//finally add to root node
acc.addNode(fc);
//Create another child
TELEPHONE tl = new TELEPHONE();
SUBSCRIPTION sub = new SUBSCRIPTION(tel);
COST_PER_TICK cpt = new COST_PER_TICK(tick);
tl.addNode(sub);
tl.addNode(cpt);
acc.addNode(tl);
//Create another child
// PREVIOUS_ACCOUNT pacc = new PREVIOUS_ACCOUNT();
for(int i=0; i<previous_details.size(); i++){
//Create another child
PREVIOUS_ACCOUNT pacc = new PREVIOUS_ACCOUNT();
PreviousDetails pd = (Previou sDetails)previous_details.elementAt(i);
String name = pd.getName();
String credit = pd.getCredit();
String debit = pd.getDebit();
NAME n = new NAME(name);
LAST_CREDIT lc = new LAST_CREDIT(credit);
LAST_DEBIT ld = new LAST_DEBIT(debit);
pacc.addNode(n);
pacc.addNode(lc);
pacc.addNode(ld);
acc.addNode(pacc);
for(int i=0; i<acc_dates.size(); i++){
String str = (String)acc_dates.elementAt(i);
ACCOUNT_DATE ad = new ACCOUNT_DATE(str);
acc.addNode(ad);
acc.validateContent();
ByteArrayOutputStream out1 = new ByteArrayOutputStream(1024);
acc.print(out1);
System.out.println("The result is:");
System.out.println(out1.toString());
catch(Exception e){}
The output is:
Request started!
Start DB contact
End DB contact
The result is:
<!DOCTYPE ACCOUNT SYSTEM "file:/home/httpd/html/tydex/dtd/ACCOUNT_dtd.txt">
<ACCOUNT ID="10212">
<NUM_OF_RESIDENTS>3</NUM_OF_RESIDENTS>
<FIXED_COST>
<ELECTRICITY>0.0</ELECTRICITY>
<GAS>0.0</GAS>
<WASH_MACHINE>0.0</WASH_MACHINE>
<WATER>0.0</WATER>
<OTHER>0.0</OTHER>
</FIXED_COST>
<TELEPHONE>
<SUBSCRIPTION>0.0</SUBSCRIPTION>
<COST_PER_TICK>0.0</COST_PER_TICK>
</TELEPHONE>
<PREVIOUS_ACCOUNT>
<NAME>dsffd</NAME>
<LAST_CREDIT>0.0</LAST_CREDIT>
<LAST_DEBIT>0.0</LAST_DEBIT>
</PREVIOUS_ACCOUNT>
<PREVIOUS_ACCOUNT>
<NAME>dsfd</NAME>
<LAST_CREDIT>0.0</LAST_CREDIT>
<LAST_DEBIT>0.0</LAST_DEBIT>
</PREVIOUS_ACCOUNT>
<PREVIOUS_ACCOUNT>
<NAME>dsfdfs</NAME>
<LAST_CREDIT>0.0</LAST_CREDIT>
<LAST_DEBIT>0.0</LAST_DEBIT>
</PREVIOUS_ACCOUNT>
</ACCOUNT>
Request started!
Start DB contact
End DB contact
Request started!
Start DB contact
End DB contact
Thanks.
null

Similar Messages

  • How do I copy files onto a hard drive (device) from Mac 2 7 pc. I'm able to transfer files from device but cannot transfer files to device. Anyone had same problem or can help solve this problem? Help pls

    how do I copy files onto a hard drive (device) from Mac 2 7 pc. I'm able to transfer files from device but cannot transfer files to device. Anyone had same problem or can help solve this problem? Help pls

    Welcome to Apple Support Communities
    When you try to copy data to the external drive, what happens? If you don't see any error, the external drive is formatted in NTFS, and OS X can't write in it.
    To be able to write on this external drive, you have to use an app like Paragon NTFS. Another solution would be to format the external drive in FAT32 or exFAT with Disk Utility > http://pondini.org/OSX/DU1.html Make sure you copied all the files of the external disk to the internal disk before doing it

  • I'm using iphone 3gs ios4.1 when I leasing 3-5 songs continuously it get restarted. who can I solve this problem

    I’m using iphone 3gs ios4.1 when I leasing 3-5 songs continuously it get restarted. who can I solve this problem

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these steps in order.

  • I have a report from WhatisHang which (in theory) tells my why my firefox constantly hangs up. But I need someone who can help figure this out.

    I hope this section will work, i couldnt find a place for Hang ups, and this problem doesnt usually cause a full crash, which is why it was hard to figure it out.
    I finally used the program WhatisHang to try to get an idea of what is causing the seemingly random hanging, but have been unable to find anyone who can help me with it.
    I have posted the Troubleshooting Information, though i dont think it would be of much help.
    I have the report available but dont know where i can post it.

    I must admit I seem possibly to be suffering from hangs also, although as I am often not in a hurry when using firefox on this machine it has little impact. I am using a legacy computer and tend to blame this on the computer or maybe background tasks such as from security software or indexing.
    '''Do you still get the hangs in safe mode with all''' (or maybe all but one essential plugin if you think a plugin is involved in the hangs) '''plugins disabled ?
    Have you tried to rule out
    * background tasks are the problem, <br/>(at least monitor what else is running using Task Manager or sysinternals process explorer)
    * [[is my firefox problem a result of malware|malware]]. <br/>( consider full system scans with multiple tools/software)
    * any other interacting programs or plugins <br/>(some may not be listed in firefox, you may need to check / uninstall from the OS {Windows Control Panel})
    **it may also be an idea to check hangs still occur when WhatIsHangs is not in use.
    * have you tried logging the cc & gc times in the error console, <br/>(if for instance you see times in 1000s of milliseconds appearing you may have then identified one reason for firefox being unresponsive, even if the cause is not yet identified. - a symptom the memshrink firefox developers will no doubt be eager to investigate)
    * if you can get hangs in safe mode, on at least the Aurora channel releases I suggest you immediately go ahead and file a bug yourself. (I will try to find time if not today then next weekend to look more closely at my own system to see if it is showing hangs in firefox use)
    ** ideally try with all default preferences
    ** As you have changed preferences, I suggest you include as a attachment in the bug your list of user modified preferences (use ''about:support'' or Troubleshooting Information option)
    ** State what security software is in use, it could be an important factor.<br/> (I imagine the majority of users have security software, or if not have security vulnerabilities and potentially an undetected malware problem)
    I will try to find and download a copy of WhatIsHang, see if it works on my system and what results it then shows.
    I realise I have not said anything terribly helpful I solving your problem, but I suspect you are not alone in having hangs, if you are able to spare the time to investigate and report I am sure it will help others.
    Firefox has had a few problems recently that would have been solved sooner if they were investigated when first reported, but unfortunatly an advantage of firefox is how easy it is to customise, but the downside is differentiating between a firefox fault and customisation problems.

  • Oh boy, nothing so far has worked, who can help on this one

    Here is the deal...
    Apple logo would not dissapear from the screen of my 4 year old ipod (dockstation version, 15GB),
    I reformatted (FAT32 as per this forum) and restored my ipod in itunes. When this was done (multiple times now) I was asked to connect my ipod to the power supply.
    Doing that right now but the 'Disk Mode' and 'OK to disconnect' screen simply continue to show on the display and the battery icon is charging continously.
    This has been for about 2 hours now..
    Oh yeah, never had a problem before and I am a mild/medium user..
    Any suggestions appreciated as I do not have the money to buy a new Ipod or go to the Apple fixers..
      Windows XP  

    thanks for your comments but I have tried all of that.
    Apple logo appears and I can even get fase 1 of the restore program in itunes to run.
    After part1 of the restore program I am asked to unplug the ipod from itunes and hook it up to power. Then supposedly fase 2 or restoring is tarting but unfortunately nothing happens..
    I just listened closely and the ipod makes ticking noises when the apple logo is showing..
    Is that bad?

  • I need another person Who Can help with this iphone it will not restore on will not completely turn on

    i can't turn on the phone or even restore the phone completely it will not turn on at all !!

    iOS: How to backup - http://support.apple.com/kb/HT1766
    iOS: Unable to update or restore - http://support.apple.com/kb/HT1808

  • Purchased 3 subscriptions for Adobe Acrobat On colleague never received her link . . who can help me this site just sends you around and around

    Please see above, I can't seem to find any support for the above issue.  We just need a link resent to us for our recent purchase.

    What link do you need?  Subscriptions are activated by signing-in with the appropriate Adobe ID.
    You can download the trial from http://www.adobe.com/products/acrobatpro.html

  • Let's see who can help with this applet

    Hello. I am new in Java and confused with this assignment.
    I have to write an applet for a store that sells 8 products
    whose retails prices are Product 1 - $2.98, Product 2 - $4.50, Product 3 - $9.98, Product 4 - $ 4.49, Product 5 - $ 6.87,
    Product 6 � $ 12.37, Product 7 - $ 14.30 and Product 8 - $ 11.40.
    The applet: 1) Has an intro message to a store named for you, where you describe what products they have, 2) Reads a series of pairs of numbers: Product Number and Quantity Number.
    Use a switch structure to determine the retail prices for each product. Use "TextField" to obtain the product number from the user. Use a �sentinel controlled� loop to determine when the program should stop looping to display the final result (I used number -1 as sentinel). Display the total value of all products sold.
    This is the program I wrote:
    //java core packages
    import java.awt.*;
    import java.awt.event.*;
    import java.text.NumberFormat;
    import java.util.Locale;
    // Java extension packages
    import javax.swing.*;
    public class MYSHOP extends JApplet implements ActionListener {
    // GUI componentes
    JLabel productNumLabel, quantityNumLabel;
    JTextField productNumField, quantityNumField;
    // variables
    double subtotal = 0;
    double total = 0;
    public void init()
    // display intro message
    JOptionPane.showMessageDialog( null, "Welcome toablabla.\nWe
    offer you blablabla\nClick OK to start shoping",
    "Company information", JOptionPane.PLAIN_MESSAGE );
    // obtain content pane and set its layout to FlowLayout
    Container container = getContentPane();
    container.setLayout( new FlowLayout() );
    // create productNumLabel, productNumField and attach them to
    // content pane
    productNumLabel = new JLabel( "Enter Product Number (-1 to
    quit):" );
    productNumField = new JTextField( 4 );
    productNumField.addActionListener( this );
    container.add( productNumLabel );
    container.add( productNumField );
    // create productNumLabel, productNumField and attach them to
    // content pane
    quantityNumLabel = new JLabel("Enter Quantity:");
    quantityNumField = new JTextField( 4 );
    quantityNumField.addActionListener( this );
    container.add( quantityNumLabel );
    container.add( quantityNumField );
    } // end method init
    public void actionPerformed( ActionEvent actionEvent )
    int index = Integer.parseInt( productNumField.getText() );
    int ammount = 0;
    while ( index != -1 )
    NumberFormat moneyFormat =
    NumberFormat.getCurrencyInstance( Locale.US );
    if( actionEvent == quantityNumField.getText() )
    ammount = Integer.parseInt( quantityNumField.getText() );
    switch (index)
    case 1:
    subtotal += ( 2.98 * ammount );
    break;
    case 2:
    subtotal += ( 4.5 * ammount );
    break;
    case 3:
    subtotal += ( 9.98 * ammount );
    break;
    case 4:
    subtotal += ( 4.49 * ammount );
    break;
    case 5:
    subtotal += ( 6.87 * ammount );
    break;
    case 6:
    subtotal += ( 12.37 * ammount );
    break;
    case 7:
    subtotal += ( 14.30 * ammount );
    break;
    case 8:
    subtotal += ( 11.40 * ammount );
    break;
    case -1:showStatus( "The Total is: " + subtotal );
    System.exit(0);
    break;
    default:
    JOptionPane.showMessageDialog( null,"There is no
    such product", "ERROR",
    JOptionPane.ERROR_MESSAGE);
    } // end switch structure
    } // end while structure
    productNumField.setText(""); // clear productNum field
    quantityNumField.setText(""); // clear quantityNum field
    } // end method actionPerformed
    } // end class MYSHOP
    When I try to compile it, the error I get is "incomparable types: java.awt.event.ActionEvent and java.lang.String", in the line:
    if( actionEvent == quantityNumField.getText() )
    The error pointer points to "==" in that line
    What should I write in that line instead?
    Also, if someone realizes that some part of the code is in the wrong place, please tell me.
    Thanks in advance.

    Instead of
    if( actionEvent == quantityNumField.getText() ) I think you want
    if( actionEvent.getSource() == quantityNumField )HTH,
    Radish21

  • Error Message:"Cannot find or create the font 'WP-MathA'. Some characters may not display or print correctly."  Who can help me solve this problem?

    Some of the pdf files I work with (receive) come up with a comment: “Cannot find or create the font ‘WP-MathA’. Some characters may not display or print correctly.”  Who can help me solve this problem?
    Thank you in advance for  your time.
    Marlen

    Hello Anubha,
    I am having a similar problem on my machine.  I was using Word 2008 and I created a PDF inside Word.
    I am opening the file on the system itself and I am running Windows 8.1.  I am using Version 11 of Reader.
    When the PDF I created (my resume) attempts to open, it says:  cannot find or create the file Times, Bold.  Some characters may not display or print correctly. 
    However, the entire Reader keeps freezing and will not allow me to open or test print the document.  Also, it is not displaying any of the Bold Times New Roman Print.  Can you please help?  Thanks.

  • Since Ios 7 Update of my iPhone 5 I can not log into any WLAN any more - who can help to solve this major problem

    Hi all,
    I updated my iPhone 5 recently to IOS 7 - Since then I do not get any access to my home WLAN / WIFI with the iphone 5.
    At same time the iphone 3S and IPAD 1 of my wife (both IOS 5.x) still work fine in our homes WLAN / WIFI.
    Who can help to get my Iphone 5 with IOS 7 back to work in the home WIFI ?
    Thanks in advance for any possible solution.
    Best regards
    Dirk from Hamburg Germany

    Try this first.
    On the iPhone go to Settings > General > Reset and select Reset Network Settings.
    This will erase all saved wi-fi networks and settings.
    If no change after this, try resetting your modem and wireless router. Disconnect the router from the power source followed by disconnecting the modem from the power source. Wait a few minutes followed by powering your modem back on allowing it to completely reset before powering your wireless router back on allowing it to completely reset with the modem.

  • I've installed CS6 and web Premium on a Mac running 10.9.5, and Dreamweaver,Flash and Illustrator wont launch.  All other components work normally.  In Activity monitor it says Adobe switchboard failed to respond.  Can anyone help solve this issue?

    I've installed CS6 and web Premium on a Mac running 10.9.5, and Dreamweaver,Flash and Illustrator wont launch.  All other components work normally.  In Activity monitor it says Adobe switchboard failed to respond.  Can anyone help solve this issue?

    Release: 4/25/2012
    http://support.amd.com/us/gpudownload/windows/Pages/radeonmob_win7-64.aspx

  • HT5622 my apple id is not working when i sign in from my laptop it works but when i sign in from my iphone4 then its not working it gives the message of "your aapleid or password is incorrect"? how can i solve this problem please help

    my apple id is not working when i sign in from my laptop it works but when i sign in from my iphone4 then its not working it gives the message of "your aapleid or password is incorrect"? how can i solve this problem please help

    Hey nocillado,
    Thanks for using Apple Support Communities.
    It sounds like you have 2 things you want to address. These articles can help you use iCloud with your existing Apple ID.
    Get help activating your iPhone
    http://support.apple.com/kb/ts3424
    Using your Apple ID for Apple services
    http://support.apple.com/kb/ht4895
    Using the same Apple ID for Store purchases and iCloud (recommended)
    Have a nice day,
    Mario

  • TS3899 In my iPad 2 with IO6 today I can not send emails from my gmail account, they go to the outbox directly...why? How can i solve this problem? ..I restarted the IPad but the problem was not solved. Please help.

    In my iPad 2 with IO6 today I can not send emails from my gmail account, they go to the outbox directly...why? How can i solve this problem? ..I restarted the IPad but the problem was not solved. Please help.

    Greetings,
    Questions:
    1. What version of the Mac OS are you running (Apple > About this Mac)?
    2. What version of the iOS are you running (Settings > About)?
    3. Do you use MobileMe/ iCloud or another server based sync solution like Google or Yahoo?
    4. Do other changes to synced information like Address Book content sync successfully back and forth?
    Based on your description it sounds like you have a 1 way sync issue.  Events sync fine between the iOS devices and fine from the computer to the iOS devices but not from the iOS devices to the computer.
    Try:
    Backup your computer and iOS devices before doing anything else:
    http://support.apple.com/kb/HT1427
    http://support.apple.com/kb/ht1766
    Ensure all the devices in use are fully up to date: Apple > Software Update / Settings > General > Software Update
    Make separate backups of critical data:
    Backup your computer Addressbook: http://docs.info.apple.com/article.html?path=AddressBook/4.0/en/ad961.html
    Backup your computer iCal: http://support.apple.com/kb/HT2966
    Reset syncing on your Mac: http://support.apple.com/kb/TS1627
    Reply back if that does not resolve your issue.
    Hope that helps.

  • I hope someone gets this who can help me. i don't find anything helpful in the help section of icloud. i'm using my 4th generation itouch for about 3 weeks with the ical. but today when i tried to edit an event or d an event a window would pop up and sa

    i hope someone gets this who can help me. i don't find anything helpful in the help section of icloud. i'm using my 4th generation itouch for about 3 weeks with the ical. but today when i tried to edit an event or add an event a window would pop up and say "event can't be saved" or "no calendar chosen" or something like "this event doesn't belong with this calendar" and stuff like that.
    can you please help me fix this?

    You could repartition your drive to have a different OS X with the older iTunes there, and the newer iTunes on the existing partition. Back up everything beforehand. See Kappy's advice in this thread. Partitioning my Hard Drive

  • I will pay for who can help me with this applet

    Hi!, sorry for my english, im spanish.
    I have a big problem with an applet:
    I�ve make an applet that sends files to a FTP Server with a progress bar.
    Its works fine on my IDE (JBuilder 9), but when I load into Internet Explorer (signed applet) it crash. The applet seems like blocked: it show the screen of java loading and dont show the progress bar, but it send the archives to the FTP server while shows the java loading screen.
    I will pay with a domain or with paypal to anyone who can help me with this problematic applet. I will give my code and the goal is only repair the applet. Only that.
    My email: [email protected]
    thanks in advance.
    adios!

    thaks for yours anwswers..
    harmmeijer: the applet is signed ok, I dont think that is the problem...
    itchyscratchy: the server calls are made from start() method. The applet is crashed during its sending files to FTP server, when finish, the applet look ok.
    The class I use is FtpBean: http://www.geocities.com/SiliconValley/Code/9129/javabean/ftpbean/
    (I test too with apache commons-net, and the same effect...)
    The ftp is Filezilla in localhost.
    This is the code, I explain a little:
    The start() method calls iniciar() method where its is defined the array of files to upload, and connect to ftp server. The for loop on every element of array and uploads a file on subirFichero() method.
    Basicaly its this.
    The HTML code is:
    <applet
           codebase = "."
           code     = "revelado.Upload.class"
           archive  = "revelado.jar"
           name     = "Revelado"
           width    = "750"
           height   = "415"
           hspace   = "0"
           vspace   = "0"
           align    = "middle"
         >
         <PARAM NAME="usern" VALUE="username">
         </applet>
    package revelado;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    import java.io.*;
    import javax.swing.border.*;
    import java.net.*;
    import ftp.*;
    public class Upload
        extends Applet {
      private boolean isStandalone = false;
      JPanel jPanel1 = new JPanel();
      JLabel jLabel1 = new JLabel();
      JLabel jlmensaje = new JLabel();
      JLabel jlarchivo = new JLabel();
      TitledBorder titledBorder1;
      TitledBorder titledBorder2;
      //mis variables
      String DIRECTORIOHOME = System.getProperty("user.home");
      String[] fotos_sel = new String[1000]; //array of selected images
      int[] indice_tamano = new int[1000]; //array of sizes
      int[] indice_cantidad = new int[1000]; //array of quantitys
      int num_fotos_sel = 0; //number of selected images
      double importe = 0; //total prize
      double[] precios_tam = {
          0.12, 0.39, 0.60, 1.50};
      //prizes
      String server = "localhost";
      String username = "pepe";
      String password = "pepe01";
      String nombreusuario = null;
      JProgressBar jProgreso = new JProgressBar();
      //Obtener el valor de un par�metro
      public String getParameter(String key, String def) {
        return isStandalone ? System.getProperty(key, def) :
            (getParameter(key) != null ? getParameter(key) : def);
      //Construir el applet
      public Upload() {
      //Inicializar el applet
      public void init() {
        try {
          jbInit();
        catch (Exception e) {
          e.printStackTrace();
      //Inicializaci�n de componentes
      private void jbInit() throws Exception {
        titledBorder1 = new TitledBorder("");
        titledBorder2 = new TitledBorder("");
        this.setLayout(null);
        jPanel1.setBackground(Color.lightGray);
        jPanel1.setBorder(BorderFactory.createEtchedBorder());
        jPanel1.setBounds(new Rectangle(113, 70, 541, 151));
        jPanel1.setLayout(null);
        jLabel1.setFont(new java.awt.Font("Dialog", 1, 16));
        jLabel1.setText("Subiendo archivos al servidor");
        jLabel1.setBounds(new Rectangle(150, 26, 242, 15));
        jlmensaje.setFont(new java.awt.Font("Dialog", 0, 10));
        jlmensaje.setForeground(Color.red);
        jlmensaje.setHorizontalAlignment(SwingConstants.CENTER);
        jlmensaje.setText(
            "Por favor, no cierre esta ventana hasta que termine de subir todas " +
            "las fotos");
        jlmensaje.setBounds(new Rectangle(59, 49, 422, 30));
        jlarchivo.setBackground(Color.white);
        jlarchivo.setBorder(titledBorder2);
        jlarchivo.setHorizontalAlignment(SwingConstants.CENTER);
        jlarchivo.setBounds(new Rectangle(16, 85, 508, 24));
        jProgreso.setForeground(new Color(49, 226, 197));
        jProgreso.setBounds(new Rectangle(130, 121, 281, 18));
        jPanel1.add(jlmensaje, null);
        jPanel1.add(jlarchivo, null);
        jPanel1.add(jProgreso, null);
        jPanel1.add(jLabel1, null);
        this.add(jPanel1, null);
        nombreusuario = getParameter("usern");
      //Iniciar el applet
      public void start() {
        jlarchivo.setText("Start() method...");
        iniciar();
      public void iniciar() {
        //init images selected array
        fotos_sel[0] = "C:/fotos/05160009.JPG";
        fotos_sel[1] = "C:/fotos/05160010.JPG";
        fotos_sel[2] = "C:/fotos/05160011.JPG";
         // etc...
         num_fotos_sel=3; //number of selected images
        //conectar al ftp (instanciar clase FtpExample)
        FtpExample miftp = new FtpExample();
        miftp.connect();
        //make the directory
         subirpedido(miftp); 
        jProgreso.setMinimum(0);
        jProgreso.setMaximum(num_fotos_sel);
        for (int i = 0; i < num_fotos_sel; i++) {
          jlarchivo.setText(fotos_sel);
    jProgreso.setValue(i);
    subirFichero(miftp, fotos_sel[i]);
    try {
    Thread.sleep(1000);
    catch (InterruptedException ex) {
    //salida(ex.toString());
    jlarchivo.setText("Proceso finalizado correctamente");
    jProgreso.setValue(num_fotos_sel);
    miftp.close();
    //Detener el applet
    public void stop() {
    //Destruir el applet
    public void destroy() {
    //Obtener informaci�n del applet
    public String getAppletInfo() {
    return "Subir ficheros al server";
    //Obtener informaci�n del par�metro
    public String[][] getParameterInfo() {
    return null;
    //sube al ftp (a la carpeta del usuario) el archivo
    //pedido.txt que tiene las lineas del pedido
    public void subirpedido(FtpExample miftp) {
    jlarchivo.setText("Iniciando la conexi�n...");
    //make folder of user
    miftp.directorio("www/usuarios/" + nombreusuario);
    //uploads a file
    public void subirFichero(FtpExample miftp, String nombre) {
    //remote name:
    String nremoto = "";
    int lr = nombre.lastIndexOf("\\");
    if (lr<0){
    lr = nombre.lastIndexOf("/");
    nremoto = nombre.substring(lr + 1);
    String archivoremoto = "www/usuarios/" + nombreusuario + "/" + nremoto;
    //upload file
    miftp.subir(nombre, archivoremoto);
    class FtpExample
    implements FtpObserver {
    FtpBean ftp;
    long num_of_bytes = 0;
    public FtpExample() {
    // Create a new FtpBean object.
    ftp = new FtpBean();
    // Connect to a ftp server.
    public void connect() {
    try {
    ftp.ftpConnect("localhost", "pepe", "pepe01");
    catch (Exception e) {
    System.out.println(e);
    // Close connection
    public void close() {
    try {
    ftp.close();
    catch (Exception e) {
    System.out.println(e);
    // Go to directory pub and list its content.
    public void listDirectory() {
    FtpListResult ftplrs = null;
    try {
    // Go to directory
    ftp.setDirectory("/");
    // Get its directory content.
    ftplrs = ftp.getDirectoryContent();
    catch (Exception e) {
    System.out.println(e);
    // Print out the type and file name of each row.
    while (ftplrs.next()) {
    int type = ftplrs.getType();
    if (type == FtpListResult.DIRECTORY) {
    System.out.print("DIR\t");
    else if (type == FtpListResult.FILE) {
    System.out.print("FILE\t");
    else if (type == FtpListResult.LINK) {
    System.out.print("LINK\t");
    else if (type == FtpListResult.OTHERS) {
    System.out.print("OTHER\t");
    System.out.println(ftplrs.getName());
    // Implemented for FtpObserver interface.
    // To monitor download progress.
    public void byteRead(int bytes) {
    num_of_bytes += bytes;
    System.out.println(num_of_bytes + " of bytes read already.");
    // Needed to implements by FtpObserver interface.
    public void byteWrite(int bytes) {
    //crea un directorio
    public void directorio(String nombre) {
    try {
    ftp.makeDirectory(nombre);
    catch (Exception e) {
    System.out.println(e);
    public void subir(String local, String remoto) {
    try {
    ftp.putBinaryFile(local, remoto);
    catch (Exception e) {
    System.out.println(e);
    // Main
    public static void main(String[] args) {
    FtpExample example = new FtpExample();
    example.connect();
    example.directorio("raul");
    example.listDirectory();
    example.subir("C:/fotos/05160009.JPG", "/raul/foto1.jpg");
    //example.getFile();
    example.close();

Maybe you are looking for