Problem importing classes and beans

Hey there. Im having one major fustrating problem! When I code supporting classes and beans for my JSPs I get a code 500 internal server error when trying to import (via <%@ page import="class" %> and <jsp:useBean/>) Im storing my classes and beans in the WEB-INF folder and the calling JSPs are located in /ROOT/tests/8/jsp.jsp. Im using the following to import a class or bean:
<%@ import="aClass" %>
Seen as tho its in the WEB-INF folder I won't have to explicitly refer to where the class is located, just the class name.
I never had this problem when I was using my hosting service. Its only on my localhost server in which I get the Internal Server error.
Help appreciated, thx.
PS: Im quite new to JSP/Java Servlet.

import (via <%@ page import="class" %> and
<jsp:useBean/>) Im storing my classes and beans in the
WEB-INF folder try put your class file in WEB-INF/classes.
or first put bean in the package, like WEB-INF/classes/packagename/beanclass
in jsp page:
<jsp:useBean id="Mybean" class="packagename.beanclass" scope="request" />
Question: is /ROOT a context entry in your server.xml?
Which JSP Container (version) you use? Maybe your localhost server's set up is different with your hosting.

Similar Messages

  • Difference b/w Java Class and Bean class

    hi,
    can anybody please tell me the clear difference between ordinary java class and java Bean class. i know that bean is also a java class but i donno the exact difference between the both.
    can anybody please do help me in understanding the concept behind the bean class.
    Thank u in advance.
    Regards,
    Fazlina

    While researching this question, I came across this answer by Kim Fowler. I think it explains it better than any other answer I have seen in the forum.
    Many thanks Kim
    Hi
    Luckily in the java world the definition of components is a little
    less severe than when using COM (I also have, and still occasionaly
    do, worked in the COM world)
    Firstly there are two definitions that need to be clarified and
    separated: JavaBean and EnterpriseJavaBean (EJB)
    EJB are the high end, enterprise level, support for distributed
    component architectures. They are roughly equivalent to the use of MTS
    components in the COM/ COM+ world. They can only run within an EJB
    server and provide support, via the server, for functionality such as
    object pooling, scalability, security, transactions etc. In order to
    hook into this ability EJB have sets of interfaces that they are
    required to support
    JavaBeans are standard Java Classes that follow a set of rules:
    a) Hava a public, no argument constructor
    b) follow a naming patterns such that all accessor and modifier
    functions begin with set/ get or is, e.g.
    public void setAge( int x)
    public int getAge()
    The system can then use a mechanism known as 'reflection/
    introspection' to determine the properties of a JavaBean, literally
    interacting with the class file to find its method and constructor
    signatures, in the example above the JavaBean would end with a single
    property named 'age' and of type 'int' The system simply drops the
    'set' 'get' or 'is' prefix, switches the first letter to lower case
    and deduces the property type via the method definition.
    Event support is handled in a similar manner, the system looks for
    methods similar to
    addFredListener(...)
    addXXXListener
    means the JavaBean supports Fred and XXX events, this information is
    particularly useful for Visual builder tools
    In addition there is the abiliity to define a "BeanInfo' class that
    explicitly defines the above information giving the capability to hide
    methods, change names etc. this can also be used in the case where you
    cannot, for one reason or another, use the naming patterns.
    Finally the JavaBean can optionally - though usually does - support
    the Serializable interface to allow persistence of state.
    As well as standard application programming, JavaBeans are regularly
    used in the interaction between Servlets and JSP giving the java
    developer the ability to ceate ojbect using standard java whilst the
    JSP developer can potentially use JSP markup tags to interact in a
    more property based mechanism. EJB are heaviliy used in Enterprise
    application to allow the robust distribution of process
    HTH.
    Kim

  • Problem with Class and Classpath

    Hello ME Windows Users, now before you place a wry smile on your face, I have a problem with path and classpath. Stop it, I can see you smiling!
    By visiting the the last 10 pages of the forum and reading Sun installation notes, some tooldocs and by given some answers by some nice people, I have become an expert in turning off my computer, about 10 times/hr. I still am trying to make my first cup of java.
    With the ME computer,
    I'm unable to right click on the desktop and go to properties, advanced,
    I'm unable to go go start, run, sysedit,
    I'm unable to change the ms-dos window of autoexec.bat, it just shuts down.
    Now before you tell me, I should of bought a different computer, the only place I can find to modify the path and classpath is in the environment which is in system configuration under tools. Here I have placed numerous configurations, like
    C:\java>set path=%path%;c:\j2sdk1.4.2\bin
    C:\java>set classpath=%classpath%;.;
    ;java_dir\bin where ;java_bin is c:\j2sdk1.4.2
    .; java_dir\bin; %path% where ;java_bin is c:\j2sdk1.4.2 and the list goes on.
    But, I know you are still smiling, the % signs comes up in a dialog box, saying too many, and will not convert the text to the environment to be saved when I close down for the tenth time in the last hour.
    Can someone help me before I make a real cup of coffee and accidentally drop it on the ME box.
    Have a laugh on me Mik.

    C:\java>set path=%path%;c:\j2sdk1.4.2\binGood
    But it is no good because it has to many % and a dialog box appears, saying you have too many parameters.
    Are you saying I have to shutdown again to answer your ?
    From the HELP menu-
    To confirm startup commands line by line
    Click Start, and then click Shut down.
    Click Restart, click OK, and then press and hold the CTRL key until the Windows Startup Menu appears.
    Enter the number for Step-by-step confirmation, and then press ENTER.
    For each command you want to run, press Y.
    If the command runs successfully, you are prompted with the next command.
    If the command does not run successfully, you receive an error message.
    To skip a command, press N.
    Mik

  • Problems importing photos and iTunes

    Have been using iMovie for years - current version 11. All of a sudden, I cannot import photos and music from iTunes into my project. It looks like it will (green plus sign and green bar) but then the perpetual beach ball starts and never stops. I have 22 GB hard drive left and should have plenty of RAM. Bad time for a snag - graduation videos coming up. Any suggestions ? Thanks in advance.

    You cannot actually sync photos to iTunes, it just accesses the folder you specified and copies the contents to your iPod. When it says it will replace all photos, it means the ones on the iPod, as you can only either sync (and mirror the contents of your photo folder, whatever it may contain) or not sync (and keep the photos on your iPod the way they are)
    Also, copying them to the iPod drive will save them there, but to view them on the iPod, you need to go through iTunes.
    Hope this helps.

  • Problem importing classes

    Hi, I've doing a simple program to read a file and output its content by using BufferedReader and readLine() methods. My executing program is "TestProgram.java" and it imports the class "InputFileReader" to use. I have all the files in the same directory C:\j2SDK1.4_0\bin.
    When I compile "TestProgram.java", it returns the error message : Cannot resolve symbol. Symbol : variable InputLineReader.
    Can someone help me with the problem? The 2 codes are provided below.
    // InputLineReader.java
    package bin;
    import java.io.*;
    import java.util.*;
    public class InputLineReader
         public static String lineRead (BufferedReader buff)
              String line = null;
              try {
              line = buff.readLine();
                   } catch(IOException e) {
              System.out.println("IO Error");
              return line;
    // TestProgram.java
    package bin;
    import java.io.*;
    import java.util.*;
    import bin.*;
    public final class TestProgram {
         public static void main (String[] args) {
              FileReader file = new FileReader ("strtestdata1.txt");
              BufferedReader buff = new BufferedReader(file);
              String output = null;
              output = InputLineReader.line;
              System.out.println(output);

    I Dont Know Exactly Why The Problem Is. .......
    Anyway here is class I have written that works ...
    It reads ffrom a while and writes to another file ..
    I hope you can get some useful info from it
    import java.io.*;
    // This class Attempts to read from a file containing text, line by line and
    // copy the contents to a new file ...................
    public class ReadAndWrite {
        // initialising variables
        private String textLine;
        int count;
        private LineNumberReader lineReader;
        private BufferedReader bReader;
        private BufferedWriter bWriter1, bWriter2;
        private File readFile, writeFile1, writeFile2;
        // constructor
        public ReadAndWrite(String pathRead, String pathWrite1, String pathWrite2) {
            try{
                readFile   = new File(pathRead);
                writeFile1 = new File(pathWrite1);
                writeFile2 = new File(pathWrite2);
                bReader    = new BufferedReader(new FileReader(readFile));
                lineReader = new LineNumberReader(bReader);
                bWriter1 = new BufferedWriter(new FileWriter(writeFile1));
                bWriter2 = new BufferedWriter(new FileWriter(writeFile2));
            }  catch (IOException e2) {
                // Catch any other IO exceptions.
                e2.printStackTrace();
        // method to read text line by line from a given file
        public String readFile()  {
            try{
                textLine = lineReader.readLine(); // reads one line and keeeps in buffer
            }  catch (FileNotFoundException e1) {
                // If this file does not exist
                System.err.println("File not found: " + readFile);
            } catch (IOException e2) {
                // Catch any other IO exceptions.
                e2.printStackTrace();
            return textLine;
        // method that writes the text to a new file line by line
        public void  writeFile(String textLine, int count1) {
            try{
                // prints the numbered text lines to the standard output
                System.out.println(count1 + "  " + textLine);
                // writes the numbered text lines to a new file
                bWriter1.write(lineReader.getLineNumber() + "  " + textLine); // text file
                bWriter1.newLine();
                bWriter2.write(lineReader.getLineNumber() + "  " + textLine); // word file
                bWriter2.newLine();
            } catch (IOException e2) {
                // Catch any other IO exceptions.
                e2.printStackTrace();
        // method calls readFile() and writeFile()
        public void process() {
            try{
                count = 1;
                // loop to call read and write methods
                // checks for text in the file = null
                do {
                    readFile();
                    if (textLine != null){
                        writeFile(textLine, count);
                        count ++;
                while (textLine != null);
                // closing all open streams when they are no longer needed
                lineReader.close();
                bWriter1.close();
                bWriter2.close();
            } catch (IOException e2) {
                // Catch any other IO exceptions.
                e2.printStackTrace();
    }

  • Problems importing class

    the code is fine.
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.swing.*;
    import java.TicTacDlg;
    Error i get is:
    TTacToe.java:12: '.' expected
    import TicTacDlg;
    ^
    1 error
    TicTacDlg.java is in DIR is in '/root/java' along with the rest of the classes.
    I have tried setting CLASSPATH to above path and '/usr/java/j2sdk1.4.0/lib/tlib/tools.jar'
    Is it correct to set CLASSPATH to tools.jar, as u do in windows?
    I'm using the beta version of java 2 SDK 1.4 standard addition
    I'm

    Sorry, the statement:
    import .java.TicTacDlg was actually a typo made when typing this message and is actually:
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.swing.*;
    import TicTacDlg;
    Also as i'm have not done any java since early 1999 in UNI. I have noticed newly introduced words i.e "package" please explain.
    Is a package just another word for classes, such as TicTacDlg.java as i have defined.
    In those days we were using JSDK 1.2 and did not use the word package. Please give example if can.
    Thanks

  • Importing classes, and what happened to my libraries in Flash?

    Good evening ladies and gents.
    How do I import existing classes from an old CS3 Flash project.  I have a few classes that I'd really rather not rewrite but when I attempt an import the .as files Flash Builder requires that I build a new project.  Additionally, since I downloaded the new builder, I haven't been able to import the fl.controls.* in my Flash applications.  It's fine for now because I'm ramping up on Flash Builder and need to work in the new dev environment for awhile but in 28 days, I can't really have my Flash software in limbo.  Any insight?  Also in the same thread as the first inquiry, I downloaded the google Flex components from the intro to FB4 links, a quick explanation on incorporating the new componenets would help too since I can't seem to recapture the page where I found the link.  Thanks.

    Hi James,
    I may be misunderstanding your situation but I think you need to create at least one new project in Flash Builder in order to use your AS classes.  After created your porject, you can either import your AS classes using Import -> General -> File System into your project, or set a class path to your classes by going Project properites -> Build Path then addind a parent folder of your classes to Source path.
    Thank you,
    -Yukari
    Flash Builder QE

  • Importing classes and performance

    Is there any difference in performance between importing all the package and importing only the needed classes. I am doing an applet project and as it first must download the classes I wonder if it may be faster to import just the needed classes instead of all of the package.

    Is there any difference in performance between
    importing all the package and importing only the
    needed classes. I am doing an applet project and as
    it first must download the classes I wonder if it may
    be faster to import just the needed classes instead
    of all of the package.Importing has zero effect at runtime. It does NOT cause any classes to be "downloaded" or loaded or anything like that. If you import everything.* or specific classes or nothing at all, the generated byte code will be identical, and the VM will do exactly the same thing.
    Importing only matters at compile time. It just lets you use, for example, List instead of java.util.List, and the compiler then figures out what you mean by List.
    Having said that, it's generally considered better form to import specific classes. This makes it easier for somebody reading your code later (including you) to see which classes came from where.

  • Problems Importing LPs and other recorded music to my iMac

    Hi All
    I am trying to import my vinyl LPs and other music to my iMac using my JVC MIDI System with a record dec attached. The only output connection is for a standard jackplug (headphone) socket, other than the cable connection point for stereo speakers (at the rear of the system). I was sold a standard cable with a jackplug at either end and told that by connecting this to the input side of my Mac it should work. This does not seem to regognise any form of imput from my MIDI system can anybody help please!
    Thanks in advance.

    Hi Martin
    Thanks for your response I have only used this forum once before and wasn't tosure what details where relevant. I am also not sure if I can provide answers to all your questions but will do my best;-
    It would help if you tell us the exact make & model of the equipment you are using.
    Your Mac? -IMac 11,1
    What JVC MIDI system? Unfortunately it is an old system now and I don't appear to have kept the manual. It is a JVC COMPACT COMPONENT MD SYSTEM MX-MD9R R-D-S EON.
    What "record dec?"   Actually, what do you mean by "record dec" in the first place?  Do you mean yourturntable? It is an AIWA PX-E800 turntable which i connect and play through the aux side of the JVC system
    Is your JVC MIDI system capable of providing the RIAA EQ for vinyl LP's? dont know
    What software are you using on your Mac to do the recordings? ITunes 11.0.2
    In general, I wouldn't use a MIDI device for recording analog audio.  They weren't intended for that purpose.
    Thanks for your help Paul

  • Problem Importing Sequence and Changing Speed

    Got a good one.  I imported 2 sequences into a new project, but when I try to change the speed to anything over 100%, the end of the clip is black.  If I try cutting this part out, what happens is the black screen increases, chopping off more of the clip/sequence!!!  I've tried everything, and I know it has to do with the sequence being imported, but is there a workaround for this??  I've even tried putting a title/image in another video track, and same thing happens - more black screen, that cuts off even more of the clip.  Help please!! 

    4) clicking on "speed/duration", and changing the speed to, let's say "125%",
    Ok, back to my question of post 1.  Where exactly are you doing this?  To the individual clips, or to the nested sequence?
    I suspect the former, given the results.  And this is perfectly normal.  When you speed up the footage, it takes less time and creates a shorter sequence, but the nest doesn't automatically shrink to compensate, so the last bit of it will be black.  It's no different than if you were to remove a couple of clips from the original sequence.  All you need do is trim the nested sequence back to the last frame of footage.
    Or you could make the speed changes first and then nest it afterwards.  Then there would be no black.  (And this is what you were seeing when you went back to the first project and changed it there.  The end result was that the speed changed before you nested.  The black only shows up when you shorten the original after nesting.)
    So, bottom line, everything is working normally.  You were just unaware of how it worked.

  • New problem importing photos videos

    since I upgraded my iphone 5 to ios7, I having a problem importing photos and videos to my pc? I have Windows 7. Has anyone else had this issue and been able to resolve it?

    Hi I have figured it out on my own just today coz what apple suggested didn't help much so I just have to do it by myself.
    This is what you need to do:
    open your computer and search for autoplay, it will open rightaway and then scroll down look for your device then change "ask everything" to "import photos and videos in windows" connect your ipad again then tthe import box will open.. and your good!
    i hope this will help you. Good luck! :-)

  • Continual problem importing CDs

    For years now I have had problems importing CDs, and I am at my wit's end. Many times when I import a CD, I finish, eject the CD, and find that my songs are no where to be found on itunes. Often time they will hang out in the "recently added" playlist, but even then, if I had gone through the trouble of "getting info" and changing the song descriptions and what not, those changes would surely not be shown there. Furthermore, I can't seem to get itunes to recognize the tunes even when they are in this recently added area.
    Please help.

    I have lost songs in the past and this is what I did to fix it. iTunes uses an on-line service called Gracenote to get the details like song titles, album title, artists, genre and so on. One of those bits of info is whether or not the CD in question is a compilation. This data was entered by people like you and me. If Gracenote doesn't have it in its database, it will prompt you to enter the info and the next person will have it ready to go.
    You can search under artist (CTL+B) to look for "Compilations" or you can also look under "Various Artists"
    iTunes files albums by ALBUM ARTIST when possible. Gracenote doesn't give that info so if there is a guest artist on one song, that song shows up as a separate album. I fix this by highlighting every song in that album and right-click to GET INFO (CTL+I) and fill in the blank for ALBUM ARTIST.
    A more basic check is to look in EDIT > PREFERENCES > ADVANCED to see where iTunes puts things by default. I have a pretty big library, so I installed a separate drive and made that my default. Right below the drive location is a couple of important check boxes.
    "Keep iTunes Media Folder Organized" means that iTunes will create folders by ALBUM ARTIST (or ARTIST if you didn't fill in the blanks) and each album as a sub-folder.
    "Copy Files To iTunes Media Folder when adding to Library" If you have music files in your computer (thumb drive, desktop, e-mail, MP3 disc, etc) and you add them to your iTunes Library, they stay right there if this box is not checked. iTunes knows where to find them (until you pull the thumb drive out) If you check this box, iTunes puts a copy in the Library: MUSIC > ALBUM ARTIST > ALBUM >
    There is another check box that helps find lost songs FILE > LIBRARY > ORGANIZE LIBRARY > CONSOLIDATE FILES

  • I have been getting java.lang.ClassNotFoundException: ZeroApplet.class and java.lang.ClassNotFoundException: JavaToJS.class crashes with JRE version 1.6.0_26-b03-384-10M3425 VM executing a Java Applet. Is Apple aware of this problem? No longer supported?

    My web page uses a Java Applet to allow my visitors to replay chess games; the Chess Viewer Deluxe applet was written by Nikolai Pilafov some time ago and has been working properly for some time (until recently). I don't monitor this part of my site regularly so I am not sure when it began to fail. On his web site [http://chesstuff.blogspot.com/2008/11/chess-viewer-deluxe.html] he has a link to check LiveConnect object functionality (which fails for OBJECT tags). His recommendation is to "seek platform specific support which might be available from the JRE developers for your platform".
    I have been getting java.lang.ClassNotFoundException: ZeroApplet.class and java.lang.ClassNotFoundException: JavaToJS.class crashes with JRE version 1.6.0_26-b03-384-10M3425 VM executing a Java Applet. Until I checked the LiveConnect object functionality, I was unable to identify the source of the console error messages. This does seem to be the smoking gun.
    Is Apple aware of this problem? Are these classes no longer supported? Has anyone else had this problem? You can attempt to recreate the problem locally by going to my web page: http://donsmallidge.com/DonSmallidgeChess.html
    Thanks in advance for any help you can provide!
    Abbreviated Java Console output:
    Java Plug-in 1.6.0_26
    Using JRE version 1.6.0_26-b03-384-10M3425 Java HotSpot(TM) 64-Bit Server VM
    load: class ZeroApplet.class not found.
    java.lang.ClassNotFoundException: ZeroApplet.class
        at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:662)
        at sun.applet.AppletPanel.createApplet(AppletPanel.java:807)
        at sun.plugin.AppletViewer.createApplet(AppletViewer.java:2389)
        at sun.applet.AppletPanel.runLoader(AppletPanel.java:714)
        at sun.applet.AppletPanel.run(AppletPanel.java:368)
        at java.lang.Thread.run(Thread.java:680)
    load: class JavaToJS.class not found.
    java.lang.ClassNotFoundException: JavaToJS.class
        at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:662)
        at sun.applet.AppletPanel.createApplet(AppletPanel.java:807)
        at sun.plugin.AppletViewer.createApplet(AppletViewer.java:2389)
        at sun.applet.AppletPanel.runLoader(AppletPanel.java:714)
        at sun.applet.AppletPanel.run(AppletPanel.java:368)
        at java.lang.Thread.run(Thread.java:680)

    I just went up to check the LiveConnect object functionality page AND IT WORKED THIS TIME! I must confess, this is very mysterious. I will do some more checking and reply here if I can determine why it is working now (and more importantly, why it didn't work before).

  • Problems with SwingWorker and classes in my new job, ;), can you help me?

    Hi all, ;)
    First of all, sorry about my poor English.
    I have a problem with Swing and Threads, I hope you help me (because I'm in the firsts two weeks in my new job)
    I have two classes:
    Form1: Its a JPanel class with JProgressBar and JLabel inside.
    FormularioApplet: (the main) Its a JPanel class with a form1 inside.
    I have to download a file from a server and show the progress of the download in the JProgressBar. To make it I do this:
    In Form1 I make a Thread that update the progress bar and gets the fole from the server.
    In FormularioApplet (the main) I call to the method getDownloadedFile from Form1 to get the File.
    THE PROBLEM:
    The execution of FormularioApplet finishes before the Thread of Form1 (with download the file) download the file. Then, when I call in FormularioApplet the variable with the file an Exception: Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException is generated.
    First main begins his execution, then call to Form1 (a thread) then continues his execution and when the execution is finished ends the execution os Form1 and his thread.
    How can I do for main class call the function and the Thread download his file after main class assign the file of return method?
    How can I pass information froma class include an a main class. Form1 can't send to main (because main class made a Form1 f1 = new Form1()) any information from his end of the execution. I think if Form1 can say to main class that he finishes is job, then main class can gets the file.
    I put in bold the important lines.
    Note: My level of JAVA, you can see, is not elevated.
    THANKS A LOT
    Form1 class:
    package es.cambrabcn.signer.gui;
    import java.awt.HeadlessException;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.util.StringTokenizer;
    import java.util.Vector;
    import javax.swing.SwingUtilities;
    public class Form1 extends javax.swing.JPanel {
        //Variables relacionadas con la clase original DownloadProgressBar
        private InputStream file;
        private int totalCicles;
        private int totalFiles;
        private int currentProgress;
        private SwingWorker worker;
        private ByteArrayOutputStream byteArray;
        private boolean done;
        /** Creates new form prueba */
        public Form1() {
            initComponents();
            this.byteArray = new ByteArrayOutputStream();
            progressBar.setStringPainted(true);
            //this.totalFiles = totalFiles;
            currentProgress = 0;
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" C�digo Generado ">                         
        private void initComponents() {
            label1 = new javax.swing.JLabel();
            progressBar = new javax.swing.JProgressBar();
            statusLabel = new javax.swing.JLabel();
            setBackground(new java.awt.Color(255, 255, 255));
            setMaximumSize(new java.awt.Dimension(300, 150));
            setMinimumSize(new java.awt.Dimension(300, 150));
            setPreferredSize(new java.awt.Dimension(300, 150));
            label1.setFont(new java.awt.Font("Arial", 1, 18));
            label1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
            label1.setText("Barra de progreso");
            statusLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
            statusLabel.setText("Cargando");
            org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
            this.setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                    .addContainerGap()
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, statusLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, progressBar, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, label1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE))
                    .addContainerGap())
            layout.setVerticalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .addContainerGap()
                    .add(label1)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(progressBar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(statusLabel)
                    .addContainerGap(73, Short.MAX_VALUE))
        }// </editor-fold>                       
        // Declaraci�n de variables - no modificar                    
        private javax.swing.JLabel label1;
        private javax.swing.JProgressBar progressBar;
        private javax.swing.JLabel statusLabel;
        // Fin de declaraci�n de variables                  
        public byte[] getDownloadedFile(String documentToSign){
             //Variables locales
             byte puente[] = null;
             try{
                //Leemos el documento a firmar
                StringTokenizer st = new StringTokenizer(documentToSign, ";");
                Vector<URL> fileURL = new Vector<URL>();
                HttpSender sender = new HttpSender(null);
                //Introducimos la lista de URLs de archivos a bajar en el objeto Vector
                for(; st.hasMoreTokens(); fileURL.add(new URL(st.nextToken())));
                //Para cada URL descargaremos un archivo
                for(int i = 0; i < fileURL.size(); i++) {
                    file = sender.getMethod((URL)fileURL.get(i));
                    if(file == null) {
                        Thread.sleep(1000L);
                        throw new RuntimeException("Error descarregant el document a signar.");
                    System.out.println("Form1 Dentro de getDownloadFile, Antes de startDownload()");
                    //Fijamos el valor del n�mero de ciclos que se har�n seg�n el tama�o del fichero
                    this.totalCicles = sender.returnCurrentContentLength() / 1024;
                    this.progressBar.setMaximum(totalCicles);
                    //Modificamos el texto del JLabel seg�n el n�mero de fichero que estemos descargando
                    this.statusLabel.setText((new StringBuilder("Descarregant document ")).append(i + 1).append(" de ").append(fileURL.size()).toString());
                    statusLabel.setAlignmentX(0.5F);
                    *//Iniciamos la descarga del fichero, este m�todo llama internamente a un Thread*
                    *this.startDownload();*
                    *System.out.println("Form1 Dentro de getDownloadFile, Despu�s de startDownload()");*
                    *//if (pane.showProgressDialog() == -1) {*
                    *while (!this.isDone()){*
                        *System.out.println("No est� acabada la descarga");*
                        *if (this.isDone()){*
                            *System.out.println("Thread ACABADO --> Enviamos a puente el archivo");*
                            *puente = this.byteArray.toByteArray();*
                            *System.out.println("Form1 getDownloadFile() tama�o puente: " + puente.length);*
                        *else{*
                            *Thread.sleep(5000L);*
    *//                        throw new RuntimeException("Proc�s de desc�rrega del document a signar cancel�lat.");*
            catch (HeadlessException e) {
                    //javascript("onSignError", new String[] {
                    //(new StringBuilder("UI: ")).append(e.getMessage()).toString()});
            e.printStackTrace();
            catch (MalformedURLException e) {
                    //javascript("onSignError", new String[] {
                    //(new StringBuilder("CMS: ")).append(e.getMessage()).toString()});
            e.printStackTrace();
            catch (HttpSenderException e) {
                    //javascript("onSignError", new String[] {
                    //(new StringBuilder("CMS: ")).append(e.getMessage()).toString()});
            e.printStackTrace();
            catch (InterruptedException e) {
                    //javascript("onSignError", new String[] {
                    //(new StringBuilder("CMS: ")).append(e.getMessage()).toString()});
            e.printStackTrace();
            //System.out.println("Form1 getDownloadFile() tama�o puente: " + puente.length);
            return puente;
        public void updateStatus(final int i){
            Runnable doSetProgressBarValue = new Runnable() {
                public void run() {
                    progressBar.setValue(i);
            SwingUtilities.invokeLater(doSetProgressBarValue);
        public void startDownload() {
            System.out.println("Form1 Inicio startDownload()");
            System.out.println("Form1 Dentro de startDownload, antes de definir la subclase SwingWorker");
            System.out.println(done);
            worker = new SwingWorker() {
                public Object construct() {
                    System.out.println("Form1 Dentro de startDownload, dentro de construct(), Antes de entrar en doWork()");
                    return doWork();
                public void finished() {
                    System.out.println("Form1 Dentro de startDownload, dentro de finished(), Antes de asignar done = true");
                    System.out.println(done);
                    done = true;
                    System.out.println("Form1 Dentro de startDownload, dentro de finished(), Despu�s de asignar done = true");
                    System.out.println(done);
                    statusLabel.setText("Completado, tama�o del archivo: " + (byteArray.size() / 1024) + "KB");
            System.out.println("Form1 Dentro de startDownload, antes de worker.start()");
            worker.start();
            System.out.println("Form1 Dentro de startDownload, antes de salir de startDownload");
            System.out.println(done);
            System.out.println("Form1 Dentro de startDownload, despu�s de worker.start()");
         * M�todo doWork()
         * Este m�todo descarga por partes el archivo que es necesario descargar, adem�s de actualizar
         * la barra de carga del proceso de carga de la GUI.
        public Object doWork() {
            System.out.println("Form1 doWork() this.byteArray.size(): " + this.byteArray.size());
            try {
                byte buffer[] = new byte[1024];
                for(int c = 0; (c = this.file.read(buffer)) > 0;) {
                    this.currentProgress++;
                    updateStatus(this.currentProgress);
                    this.byteArray.write(buffer, 0, c);
                this.byteArray.flush();
                this.file.close();
                this.currentProgress = totalCicles;
                updateStatus(this.currentProgress);
            } catch(IOException e) {
                e.printStackTrace();
            System.out.println("Form1 doWork() FINAL this.byteArray.size(): " + this.byteArray.size());
            //done = true;
            System.out.println("AHORA DONE = TRUE");
            return "Done";
        public boolean isDone() {
            return this.done;
    FormularioApplet class (main)
    package es.cambrabcn.signer.gui;
    import java.awt.Color;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.net.URL;
    import java.security.Security;
    import java.util.StringTokenizer;
    import java.util.Vector;
    import javax.swing.SwingUtilities;
    import netscape.javascript.JSObject;
    import org.bouncycastle.jce.provider.BouncyCastleProvider;
    import sun.security.provider.Sun;
    import be.cardon.cryptoapi.provider.CryptoAPIProvider;
    public class FormularioApplet extends java.applet.Applet {
        //Variables globales
        int paso = 0;
        private static final String JS_ONLOAD = "onLoad";
        private static final String JS_ONLOADERROR = "onLoadError";
        private static final int SIGNATURE_PDF = 1;
        private static final int SIGNATURE_XML = 2;
        //private String signButtonValue;
        private int signatureType;
        private String documentToSign;
        private String pdfSignatureField;
        private Vector<String> outputFilename;
        private Color appletBackground = new Color(255, 255, 255);
        private Vector<byte[]> ftbsigned;
         * Initializes the applet FormularioApplet
        public void init(){
            try {
                SwingUtilities.invokeLater(new Runnable() {
                //SwingUtilities.invokeAndWait(new Runnable() {
                //java.awt.EventQueue.invokeAndWait(new Runnable() {
                    public void run() {
                        try{
                            readParameters();
                            initComponents();
                        catch(FileNotFoundException e){
                            javascript(JS_ONLOADERROR, new String[] {
                                (new StringBuilder("Init: ")).append(e.getMessage()).toString()});
                            e.printStackTrace();                       
                        catch(IOException e) {
                            javascript(JS_ONLOADERROR, new String[] {
                                (new StringBuilder("Init: ")).append(e.getMessage()).toString()});
                            e.printStackTrace();
            catch (Exception e) {
                javascript(JS_ONLOADERROR, new String[] {
                    (new StringBuilder("Init: ")).append(e.getMessage()).toString()});
                e.printStackTrace();
            javascript(JS_ONLOAD, null);
        /** This method is called from within the init() method to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" C�digo Generado ">
        private void initComponents() {
            this.setSize(350, 450);
            appletPanel = new javax.swing.JPanel();
            jPanel1 = new javax.swing.JPanel();
            jTextField1 = new javax.swing.JLabel();
            jPanel2 = new javax.swing.JPanel();
            label = new javax.swing.JLabel();
            jPanel3 = new javax.swing.JPanel();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            setLayout(new java.awt.BorderLayout());
            appletPanel.setBackground(new java.awt.Color(255, 255, 255));
            appletPanel.setMaximumSize(new java.awt.Dimension(350, 430));
            appletPanel.setMinimumSize(new java.awt.Dimension(350, 430));
            appletPanel.setPreferredSize(new java.awt.Dimension(350, 430));
            jPanel1.setBackground(new java.awt.Color(255, 255, 255));
            jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 102, 204)));
            jTextField1.setFont(new java.awt.Font("Arial", 1, 18));
            jTextField1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
            jTextField1.setText("SIGNATURA ELECTRONICA");
            org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(jPanel1Layout.createSequentialGroup()
                    .addContainerGap()
                    .add(jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE)
                    .addContainerGap())
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(jPanel1Layout.createSequentialGroup()
                    .addContainerGap()
                    .add(jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE)
                    .addContainerGap())
            jPanel2.setBackground(new java.awt.Color(255, 255, 255));
            jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 102, 204)));
            label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
            label.setIcon(new javax.swing.ImageIcon("C:\\java\\workspaces\\cambrabcn\\firmasElectronicas\\logo.gif"));
            org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
            jPanel2.setLayout(jPanel2Layout);
            jPanel2Layout.setHorizontalGroup(
                jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .add(label, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE)
                    .addContainerGap())
            jPanel2Layout.setVerticalGroup(
                jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .add(label)
                    .addContainerGap(229, Short.MAX_VALUE))
            jPanel3.setBackground(new java.awt.Color(255, 255, 255));
            jPanel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 102, 204)));
            //this.jButton1.setVisible(false);
            //this.jButton2.setVisible(false);
            jButton1.setText("Seg\u00fcent");
            jButton1.setAlignmentX(0.5F);
            //Cargamos el primer formulario en el JPanel2
            loadFirstForm();
            //Modificamos el texto del bot�n y el contador de pasos.
            //this.jButton1.setText("Siguiente");
            //this.jButton1.setVisible(true);
            //this.jButton2.setVisible(true);
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            jButton2.setText("Cancel\u00b7lar");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton2ActionPerformed(evt);
            org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
            jPanel3.setLayout(jPanel3Layout);
            jPanel3Layout.setHorizontalGroup(
                jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel3Layout.createSequentialGroup()
                    .addContainerGap()
                    .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 94, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 112, Short.MAX_VALUE)
                    .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 102, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap())
            jPanel3Layout.setVerticalGroup(
                jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel3Layout.createSequentialGroup()
                    .addContainerGap()
                    .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                        .add(jButton2)
                        .add(jButton1))
                    .addContainerGap())
            org.jdesktop.layout.GroupLayout appletPanelLayout = new org.jdesktop.layout.GroupLayout(appletPanel);
            appletPanel.setLayout(appletPanelLayout);
            appletPanelLayout.setHorizontalGroup(
                appletPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.TRAILING, appletPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .add(appletPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap())
            appletPanelLayout.setVerticalGroup(
                appletPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(org.jdesktop.layout.GroupLayout.TRAILING, appletPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap())
            add(appletPanel, java.awt.BorderLayout.CENTER);
        }// </editor-fold>
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
            this.destroy();
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            changeForms(this.paso);
        // Declaraci�n de variables - no modificar
        private javax.swing.JPanel appletPanel;
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JPanel jPanel2;
        private javax.swing.JPanel jPanel3;
        private javax.swing.JLabel jTextField1;
        private javax.swing.JLabel label;
        // Fin de declaraci�n de variables
         * M�todo readParameters
         * M�todo que inicializa los valores de los par�metros internos, recibidos por par�metro.
        private void readParameters() throws FileNotFoundException, IOException {
             ???????????????? deleted for the forum
            addSecurityProviders();
         * M�tode loadFirstForm
         * Aquest m�tode carrega a jPanel2 el formulari que informa sobre la c�rrega dels arxius
        private void loadFirstForm(){
            //Form1 f1 = new Form1(stream, i + 1, fileURL.size(), sender.returnCurrentContentLength(), appletBackground);
            //Form1 f1 = new Form1(fileURL.size(), sender.returnCurrentContentLength());
            Form1 f1 = new Form1();
            //Lo dimensionamos y posicionamos
            f1.setSize(310, 150);
            f1.setLocation(10, 110);
            //A�adimos el formulario al JPanel que lo contendr�
            this.jPanel2.add(f1);
            //Validem i repintem el JPanel
            jPanel2.validate();
            jPanel2.repaint();
            //Descarreguem l'arxiu a signar
            *System.out.println("FormularioApplet Dentro de loadFirstForm(), antes de llamar a getDownloadFile()");*
            *byte obj[] = f1.getDownloadedFile(this.documentToSign);*
            if (obj == null){
                System.out.println("Lo que devuelve f1.getDownloadedFile(this.documentToSign) es NULL");
            else{
                System.out.println("Lo que devuelve f1.getDownloadedFile(this.documentToSign) NO es NULL");
                System.out.println("obj: " + obj.length);
            this.ftbsigned.add(obj);
            System.out.println("FormularioApplet Dentro de loadFirstForm(), despu�s de llamar a getDownloadFile()");
            //Indicamos que el primer paso ya se ha efectuado
            this.paso++;
         * M�tode changeForms
         * Aquest m�tode carrega a jPanel2 un formulari concret segons el valor de la variable global "paso"
        private void changeForms(int paso){
            /*A cada paso se cargar� en el JPanel y formulario diferente
             * Paso previo: Se realiza en la inicializaci�n, carga el formulario, descarga el archivo y muestra la barra de carga.
             * Case 1: Se carga el formulario de selecci�n de tipo de firma.
             * Case 2: Se carga el formulario de datos de la persona que firma.
            this.paso = paso;
            switch(paso){
                case 1:
                    //Creamos un objeto de formulario (seleccion de tipo de firma)
                    Form2 f2 = new Form2();
                    //Lo dimensionamos y posicionamos
                    f2.setSize(310, 185);
                    f2.setLocation(10, 110);
                    //Quitamos el formulario 1 y a�adimos el formulario 2 al JPanel
                    this.jPanel2.remove(1);
                    this.jPanel2.add(f2);
                    //Validem i repintem el JPanel
                    jPanel2.validate();
                    jPanel2.repaint();
                    //Modificamos el contador de pasos.
                    this.paso++;
                    break;
                case 2:
                    //Creamos un objeto de formulario (seleccion de tipo de firma)
                    Form3 f3 = new Form3();
                    //Lo dimensionamos y posicionamos
                    f3.setSize(310, 175);
                    f3.setLocation(15, 130);
                    //Quitamos el formulario 1 y a�adimos el formulario 3 al JPanel
                    this.jPanel2.remove(1);
                    this.jPanel2.add(f3);
                    //Validem i repintem el JPanel
                    jPanel2.validate();
                    jPanel2.repaint();
                    //Modificamos el texto del bot�n y el contador de pasos.
                    this.jButton1.setText("Finalizar");
                    this.paso++;
                    break;
                default:
                    //Finalizar el Applet
                    //C�digo que se encargue de guardar el archivo en el disco duro del usuario
                    break;
        private void addSecurityProviders() throws FileNotFoundException, IOException {
            Security.addProvider(new CryptoAPIProvider());
            if (signatureType == SIGNATURE_PDF) {
                Security.addProvider(new BouncyCastleProvider());
            else {
                Security.addProvider(new Sun());
        private File createOutputFile(String filename, int index) {
            return new File((String)outputFilename.get(index));
        protected Object javascript(String function, String args[]) throws RuntimeException {
            //Remove
            if (true) return null;
            try {
                Vector<String> list = new Vector<String>();
                if(args != null) {
                    for(int i = 0; i < args.length; i++) {
                        list.addElement(args);
    if(list.size() > 0) {
    Object objs[] = new Object[list.size()];
    list.copyInto(objs);
    return JSObject.getWindow(this).call(function, objs);
    } catch(UnsatisfiedLinkError e) {
    e.printStackTrace();
    throw new RuntimeException((new StringBuilder()).append(e).append("\nFunci�: ").append(function).toString());
    } catch(Throwable e) {
    e.printStackTrace();
    throw new RuntimeException((new StringBuilder()).append(e).append("\nFunci�: ").append(function).toString());
    return JSObject.getWindow(this).call(function, new Object[0]);
    Edited by: Kefalegereta on Oct 31, 2007 3:54 AM
    Edited by: Kefalegereta on Oct 31, 2007 4:00 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    Change the channel on your wireless router. Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    Another thing to try - Go into your router security settings and change from WEP to WPA with AES.
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • Intermittent problem in Coldfusion 9, BlazeDS with Java Service class and CFCProxy

    If that title doesn't scare you, you might be able to help.
    I believe there is a bug in Coldfusion 9's version of CFCProxy.
    Tech Stack:
    Flex Application
    BlazeDS (stock with CF9)
    Java Service class (java-amf BlazeDS endpoint)
    Coldfusion business tier, invoked by the Java Service class using CFCProxy
    Tomcat 6 on Java 1.6
    Linux or Windows servers, both exhibit same behavior
    SQL Server database
    Problem:
    When Flex calls a Java service method through BlazeDS that invokes a Coldfusion CFC through CFCProxy, and the method called in the Coldfusion CFC includes a large query (10 fields, 1000+ records returned), we intermittently (1 out of ~5 times) receive the following exception:
    java.lang.NullPointerException
        at coldfusion.runtime.NeoPageContext.popBody(NeoPageContext.java:1925)
        at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:57)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:437)
        at coldfusion.cfc.CFCProxyFilter.invoke(CFCProxyFilter.java:56)
        at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:381)
        at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
        at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
        at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
        at coldfusion.cfc.CFCProxy.doInvoke(CFCProxy.java:281)
        at coldfusion.cfc.CFCProxy.invoke(CFCProxy.java:193)
        at com.lampo.mapping.service.MapToolWebService.makeCfcProxyCall(MapToolWebService.java:1326)
        at com.lampo.mapping.service.MapToolWebService.getTerritoryList(MapToolWebService.java:609)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:418)
        at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
        at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1400)
        at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
        at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
        at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
        at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
        at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
        at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
        at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
        at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:353)
        at coldfusion.flex.ColdfusionMessageBrokerServlet.service(ColdfusionMessageBrokerServlet.jav a:114)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at coldfusion.filter.FlashRequestControlFilter.doFilter(FlashRequestControlFilter.java:71)
        at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        at java.lang.Thread.run(Thread.java:662)
    Attempts to diagnose:
    These things remove the problem:
    CF8 works perfectly with the identical code, never fails.
    Calling the same Coldfusion CFC method with the large query (10 fields, 1000+ records returned) from another CFC 100+ times never fails.
    Using a Coldfusion service class (a "my-cfamf" BlazeDS endpoint) never fails. However, we need to use a Java service class because we are using ~40 Java value objects (VOs) that correspond to ~40 auto-generated Actionscript VOs. BlazeDS won't correctly deserialize the Actionscript VOs into the Java VOs with a Coldfusion service class.
    If I replace the large query with a Sleep(5000) instead, it never fails.
    These things don't remove the problem:
    Using the latest Microsoft JDBC driver doesn't help.
    Even if the Coldfusion method returns an empty resultset (i.e., just calls the query and doesn't do any other work or return anything), the call still fails intermittently.
    If the Coldfusion CFC with the method in question is instantiated and stored in SERVER scope as a singleton across multiple requests with CFCProxy, doesn't help.
    Different large (1000+ record queries) all fail in the same way.
    Caching the query doesn't help
    Changes in the datasource configuration doesn't help
    Using the older version of BlazeDS doesn't help
    With all of these tests, I believe it comes down to a problem in the combination between CFCProxy and large queries. There may be more to it, but that is what we've narrowed it down to.
    Any insight would be very welcome.

    Hi Frank
    The page is ADF bound, I've added the page source and the adfc-config source below :
    Page
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:form id="f1">
            <af:commandButton text="commandButton 1" id="cb1"
                              actionListener="#{test.testws}"/>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>adfc-config
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <view id="view1">
        <page>/view1.jspx</page>
      </view>
      <managed-bean id="__4">
        <managed-bean-name id="__3">test</managed-bean-name>
        <managed-bean-class id="__2">ch.mit.test.test</managed-bean-class>
        <managed-bean-scope id="__1">request</managed-bean-scope>
      </managed-bean>
    </adfc-config>It seems to be the same sort of problem as in Re: Error in ADF Web Service Connection
    Regards
    Paul

Maybe you are looking for

  • Same apple id

    Help I make a mistake by using my wife's apple Id my wife has tried to great me an account but every time she put my email in in says email already in use what can I do so my wife and me have separate accounts

  • Multiple Digital Signatures on a form

    I need to get five signatures on a form but each time I sign it, it makes me save.  After two saves (and two signatures), I could no longer click on the signature fields.  I need to use this form to get a job entered for my building.  Please help.  T

  • Failed to create object.Help needed

    Hi, I have some program here, the BPDU class and also the RootBridge class. The BPDU class is just a simple class with all the getMethods and the setMethods. For the RootBridge class, it is suppose to connect to the JDBC ODBC database, and create arr

  • Can't uninstall an IE9 language pack (ERROR_SXS_ASSEMBLY_MISSING)

    I have looked through similar questions and can't find an answer. The problem is I have one IE9 language pack I can't remove (ES - spanish), and this is stopping the IE11 install. I have run SFC - no errors and installed SUR - no help. To try and rem

  • Table entries transport help

    Hi friends, I need to transport a selected entry from a table. how can i do that. could somebody help me. Thanks, Kiran