Problem with overloading Bean Classes

For a default Save- & Rollback-Behavior I have defined a Save & Rollback Button in the template.jspx. The backing bean (GlobalOperationMBean|com.example.GlobalOperationHandler|sessionScope) for the 2 buttons is defined in the taskflow-template. If I want a different or extended behavior I declare the same Bean with a different class (GlobalOperationMBean|com.example.DifferentOperationHandler|sessionScope) in a bounded task flow (Taskflow1). Then I have a second task flow (Taskflow2) where I specified another class (GlobalOperationMBean|com.example.AnotherOperationHandler|sessionScope). DifferentBehaviorHandler and AnotherOperationHandler extend GlobalOperationHandler and override the methods for save and rollback. The overloading of the bean works perfecty in Taskflow 1.
In Taskflow1 I make a task flow call of Taskflow2. Anticipated behavoir for pressing the Rollback-Button would be the execution of the rollback-method in AnotherOperationHandler (Definition in Taskflow2), but the rollback-method in DifferentOperationHandler (Definition in Taskflow1) is called.
Do I have to make a special declaration in the taskflow to get it work or do I have to make it completely different?
Any help is appreciated!
Thanks,
Thomas

Hi Frank,
this is actually what I'm trying to achieve.
I'm just trying to understand why in my approach the bean in the second taskflow is not used? Do you have a hint?
Thanks,
Thomas

Similar Messages

  • Problems with managed beans on included JSPs

    I've got a problem with managed beans within an included JSP
    The included page looks as follows:
    <f:subview id="includedPage" binding="#{testBean.component}">
         <h:outputText value="Hallo from the included page"/>
         <h:outputText value="#{testBean.msg}" />
    </f:subview>The including page is also very simple
    <f:view>
         <html>
              <head>
                   <title>Test include</title>
              </head>
              <body>
                   <h:outputText value="Hello from the including page"/>               
                   <jsp:include page="included.jsp"/>
              </body>
         </html>
    </f:view>The testBean is a managed bean with page scope and looks as follows:
    public class TestBean {
        public UIComponent fComponent;
        public TestBean() {
            System.out.println("TestBean Constructor called " + toString() );
        public String getMsg() {
            return "Component = " + fComponent ;
        public void setComponent(UIComponent component) {
            System.out.println("setComponent called " + component);       
            fComponent = component;
        public UIComponent getComponent() {
            System.out.println("getComponent called " + fComponent);
            return fComponent;
    }The output to the console is:
    TestBean Constructor called de.kvb.athena.web.beans.TestBean@1bc16f0
    getComponent called null
    TestBean Constructor called de.kvb.athena.web.beans.TestBean@18622f3
    setComponent called javax.faces.component.UINamingContainer@160877b
    TestBean Constructor called de.kvb.athena.web.beans.TestBean@5eb489
    and the page displays
    Hello from the include page
    Hello from the included page Component = null
    Can anyone explain this behavior ? What's the reason that the page displays
    Component = null
    and is it possible to display the parent naming container (subview) this way ?
    how ?
    Thanks

    By "page scope" I assume you mean "none"? If so JSF creates a new bean for each place it's referenced. The closest to the behavior you want, once per "page", is really request scope.
    (I'm not sure why the constructor is being called thrice, though. I should look into this.)
    I assume you want a bean-per-subview scenario. This should be doable, and one way that allows a dynamic number of subviews would be as follows:
    --create a "manager" bean in request scope
    --give it get/set methods that retrieves a Map of "TestBean" instances; the idea is that each subview use a different key "s1", "s2", etc
    back the manager method with Map implementation that checks if there's already a TestBean associated with the key returns it if yes, else null.
    If that seems messy, the component solution is hairy :-) See http://forum.java.sun.com/thread.jspa?threadID=568937&messageID=2812561
    --A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problem with java beans and jsp on web logic 6.0 sp1

              HI ,
              I am using weblogic6.0 sp1.
              i have problem with jsp and java beans.
              i am using very simple java bean which stores name and email
              from a html form.
              but i am getting following errors:
              Full compiler error(s):
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              ^
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              ^
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:94:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              ud = (userbn) java.beans.Beans.instantiate(getClass().getClassLoader(),
              "userbn"); //[ /SaveName2.jsp; Line: 7]
              ^
              3 errors
              in which directory should i place java bean source file(.java file)
              here is my jsp file:
              <%@ page language = "java" contentType = "text/html" %>
              <html>
              <head>
              <title>bean2</title>
              </head>
              <body>
              <jsp:usebean id = "ud" class = "userbn" >
              <jsp:setProperty name = "ud" property = "*" />
              </jsp:usebean>
              <ul>
              <li> name: <jsp:getProperty name = "ud" property = "name" />
              <li> email : <jsp:getProperty name = "ud" property = "email" />
              </ul>
              </body>
              <html>
              here is my bean :
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              import java.io.*;
              public class userbn implements Serializable
                   private String name ;
                   private String email;
                   public void setName(String n)
                        name = n;
                   public void setEmail(String e)
                        email = e;
                   public String getName()
                        return name;
                   public String getEmail()
                        return email;
                   public userbn(){}
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              pls help me.
              Thanks
              sravana.
              

              You realy can do it like Xiang says, but the better way is to use packages. That's
              the way BEA is designed for. If you use packages you can but your bean classes
              in every subfolder beneath Classes. Here for example we have the subfolders test
              and beans:
              You have to declare the package on top of your Bean Source Code:
              package test.beans;
              In your JSP you don't need the import code of Xiang. You only have to refer the
              path of your bean class:
              <jsp:useBean id="testBean" scope="session" class="test.beans.TestBean" />
              There are some other AppServers that only can deploy Java Beans in packages. So
              if you use packages you are always on the right side.
              ciao bernd
              "sravana" <[email protected]> wrote:
              >
              >Thank you very much Xiang Rao, It worked fine.
              >Thanks again
              >sravana.
              >
              >"Xiang Rao" <[email protected]> wrote:
              >>
              >><%@ page import="userbn" language = "java" contentType = "text/html"
              >>%> should
              >>work for you.
              >>
              >>
              >>"sravana" <[email protected]> wrote:
              >>>
              >>>HI ,
              >>>
              >>>I am using weblogic6.0 sp1.
              >>>
              >>>i have problem with jsp and java beans.
              >>>
              >>>i am using very simple java bean which stores name and email
              >>>
              >>>from a html form.
              >>>
              >>>but i am getting following errors:
              >>>
              >>>________________________________________________________________
              >>>
              >>>Full compiler error(s):
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:94:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> ud = (userbn) java.beans.Beans.instantiate(getClass().getClassLoader(),
              >>>"userbn"); //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>3 errors
              >>>
              >>>____________________________________________________________
              >>>
              >>>in which directory should i place java bean source file(.java file)
              >>>
              >>>here is my jsp file:
              >>>--------------------------------------------------------
              >>>
              >>><%@ page language = "java" contentType = "text/html" %>
              >>><html>
              >>><head>
              >>><title>bean2</title>
              >>></head>
              >>><body>
              >>><jsp:usebean id = "ud" class = "userbn" >
              >>><jsp:setProperty name = "ud" property = "*" />
              >>></jsp:usebean>
              >>><ul>
              >>><li> name: <jsp:getProperty name = "ud" property = "name" />
              >>><li> email : <jsp:getProperty name = "ud" property = "email" />
              >>></ul>
              >>></body>
              >>><html>
              >>>
              >>>-------------------------------------------------------------
              >>>
              >>>here is my bean :
              >>>
              >>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              >>>
              >>>import java.io.*;
              >>>
              >>>public class userbn implements Serializable
              >>>{
              >>>
              >>>     private String name ;
              >>>
              >>>     private String email;
              >>>
              >>>     public void setName(String n)
              >>>     {
              >>>
              >>>          name = n;
              >>>     }
              >>>
              >>>     public void setEmail(String e)
              >>>     {
              >>>
              >>>          email = e;
              >>>     }
              >>>
              >>>     public String getName()
              >>>     {
              >>>
              >>>          return name;
              >>>     }
              >>>
              >>>     public String getEmail()
              >>>     {
              >>>
              >>>          return email;
              >>>     }
              >>>
              >>>     public userbn(){}
              >>>}
              >>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              >>>
              >>>pls help me.
              >>>Thanks
              >>>sravana.
              >>>
              >>
              >
              

  • A problem with struts -  DispatchAction class

    Hi,
    I am facing a problem with DispatchAction class in struts 1.1.
    Here is my senario:
    I have a two classes that extend DispatchAction - classA and classB.
    In classA, I have a start method. In classB, I have two methods - display and submit.
    When my application starts, my index.jsp does a logic:forward to the struts-config.xml file.
    e.g.:
    index.jsp<logic:forward name="startApp"/>
    struts-config.xml<form-beans>
         <form-bean name="testFormBean" type="package.testFormBean">
         </form-bean>
    </form-beans>
    <global-forwards>
         <forward name="startApp" path="/startApp.do?method=start"/>
    </global-forwards>
    <action-mappings>
         <action name="testFormBean"
    path="/startApp"
    parameter="method"
    validate="false"
    scope="request"
    type="package.StartAppActions">
         <forward name="successOneUser" path="/runSearch.do?method=display"/>
         </action>
         <action name="testBean"
    path="/runSearch"
    parameter="method"
    validate="false"
    scope="request"
    type="package.SearchActions">
                   <forward name="success" path="/html/jsps/success.jsp"/>
         </action>
    </action-mappings>
    when my application starts, the control goes to the index.jsp and then because of the logic forward goes to the start method of the /startApp action(i.e. the StartAppActions class). I return a ActionForward element with the value of "successOneUser".
    Uptill this point everything works fine.
    But now it should go the /runSearch element (i.e. SearchActions class) and the display method of it. But it is not going there. The error I am getting is action[runSearch] does not have a method named "start".
    I checked the value for the method parameter using the RAD/WSAD debugger, the value of parameter is "method" is still "start".
    I do not understand why it is not overiding the value of parameter "method" with display even though I am doing a
    <forward name="successOneUser" path="/runSearch.do?method=display"/> in the /startApp element, which should send the control to the display method of the [runSearch] element (i.e. in the startActions class).
    Can anyone tell me what the problem is ?
    Thanks in advance.
    kaushal

    Try this:
    Runtime.getRuntime().exec("your_batch_file.bat");
    where your_batch_file is:
    SET CLASSPATH=....(place all needed classes here)
    javac.exe filename
    must work,but there is some limitation...
    you must think to solve this problems.
    i hope that will help,
    Marius

  • Problems with Java-Beans-Connectivity

    Post Author: dweise
    CA Forum: JAVA
    I'm new in crystal reports and try to connect a sample bean class to the java beans conectivity. Problem is that i only get JavaServerType=JavaBeans|JavaBeanName= for selection. Can anyone tell me what the problem is with my configuration. I followed the steps of the POJOTutorial.doc and the Configuration-Infos of the java_beans_connectivity.My System is w2k professional and for Crystal Reports i use the developer installation with Product Version 11.5.0.313 Thanks by now

    Post Author: pabhijit
    CA Forum: JAVA
    Could you send me the detailed steps and what point you are stucked.? I recently did something simillar and may be I would be able to help.

  • Problem with reference and class

    I would like to transit a Data object in member function of another class with Labview 9.0 reference with "In place element structure". I use the reference for optimize allocation memory.
    When i use a dispatch static : Vi is executable  -> "TestRefAppExt Statique.vi"
    With Dispatch dynamic : Vi is not executable (because Read/Write a reference's data value : class's Object in a reference can't be replaced by another) -> "TestRefAppExt DynamiqueWithoutParent.vi"/"TestRefAppExt DynamiqueWityParent.vi"
    When i use Preserve Run-Time Class function the Vi becomes executable
    but it creates some allocations. Labview creates copy of data object
    when i'm running the vi. (increase size of data you'll see)
    The problem is that i can't recuparate the same object without copy in dispatch dynamic. Because LabView can't change the data object transited in a dispatch dynamic function of another class (child class).
    I compared in project labview Execution's performance with and without Reference in dynamic and static and for compare, with Message Box and a Reference of Data object's cluster.
    Without reference, i made three Vi : "TestAppExt Statique.vi", "TestAppExt DynamiqueWithParent.vi" and  "TestAppExt DynamiqueWithoutParent.vi"
    The static's function works well, but when Labview calls dispacth Dynamic functions, it works more slowly.
    With reference, i made three vi too : "TestRefAppExt Statique.vi", "TestRefAppExt DynamiqueWithParent.vi" and "TestRefAppExt DynamiqueWithoutParent.vi" with cast Preserve Run-Time Class.
    All This functions are more slowly than without reference.
    I tried for fun to test with the same class with Message Box : "TestRefAppExt Fifo.vi" and Cluster "TestRefAppExt DynamiqueCluster.vi" with the dynamic function. The result is better than with reference in dynamic.
    "TestRefAppExt StatiqueRef.vi" and "TestRefAppExt DynamiqueRef.vi" are a solution of this problem but it's better to work with In place element structure. And it doesn't resolve reference performance in execution.
    Why it's not possible to recuperate data object after a dispatch dynamic?
    Why the performance is not good with LabView reference 2009?
     I attached the project.
     Could you help me please
    thank you so much.
    Pascal
    Attachments:
    RefTest.zip ‏476 KB

    Yes, it helps but there is one thing that isn't being replicated which is the possibility to remove the link from the generated editor.
    My EMF looks like:
    @gmf.node(label="uri", figure="ellipse", label.edit.pattern="{0}", label.view.pattern="<<Class>> {0}", label.icon="false")
    class Class extends Resource {
    @gmf.link(target="subClassOf", target.decoration="arrow", label.text="subClassOf", label.readOnly="true")
    ref Class[*] subClassOf;
    And when I do the fix with self.subClassOf.remove(self) the link isn't removed (although now the model now passes the validation). Is there any easy way to do that?
    Regards

  • 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

  • Problems with java.lang.Class in JDK1.3

    Hi,
    I have 3 problems with the reflection in java.lang.Class:
    1) In the specification of method java.lang.Class.getDeclaredFields() is wrote:
    "Returns .... This includes public, protected, default (package) access, and private fields ..."
    This means, that all private fields should be return too. But some private methods are not given back. ????
    2) In java.lang.Class.getDeclaredMethods()
    some public methods are not return. ????
    3) In java.lang.Class.getDeclaredMethods()
    If Class is an interface. The same problem like 2) ????
    Are they errors of java.lang.Class in JDK1.3 ????
    Thanks & sincerely.

    Not sure it makes a difference, but you left off the last part of the quote:
    This includes public, protected, default (package) access, and private classes and interfaces declared by the class, but excludes inherited classes and interfaces.
    Are these missing methods from inherited classes, or are they declared in the class itself?

  • Problems with my new class

    Hi all,
    I had a small applet that included a control panel and an Animation Panel for display. The Animation Panel was a seperate class which just had a table display. (AnimationPanel class)
    When the user selected one of the buttons from the controls I could display text in the table. e.g in the main class...
    AnimationPanel anim = new AnimationPanel();
    anim.animationTable.setValueAt("Hello",2,i);
    The problem with this was that the table was editable (which I didnt want), so following the java tutuorial I modified my AnimationPanel to include another class which creats the JTable and extends AbstractTableModel.
    Now I have the problem that when the user clicks a button as above I am getting huge errors and does not write to the cell.
    Could someone please tell me how I would be able to write to my table if the user clicks a button in my main applet class.
    Here is the seperate class that sets up the table etc...
    class MyAnimationTable extends AbstractTableModel {
    Object[][] data = {
    {"Carry: "," "," ", " ",
    {"X: "," ","0", "0",
    "0", "0", "0", "0", "0", "0"},
    {"Y: "," ","0", "0",
    "0", "0", "0", "0", "0", "0"},
    {"Sum: "," "," ", " ",
    String[] columnNames = {" ",
    "-128",
    "64 ",
    "32 ",
    "16",
    "8",
    "4",
    "2",
    "U"};
    /*animationTable = new JTable(data, columnNames);
    JScrollPane scrollPane = new JScrollPane(animationTable);
    animationTable.setPreferredScrollableViewportSize(new Dimension(400, 210));
    add(scrollPane);*/
    public int getColumnCount() {
    return columnNames.length;
    public int getRowCount() {
    return data.length;
    public String getColumnName(int col) {
    return columnNames[col];
    public Object getValueAt(int row, int col) {
    return data[row][col];
    * JTable uses this method to determine the default renderer/
    * editor for each cell. If we didn't implement this method,
    * then the last column would contain text ("true"/"false"),
    * rather than a check box.
    public Class getColumnClass(int c) {
    return getValueAt(0, c).getClass();
    * Don't need to implement this method unless your table's
    * editable.
    public boolean isCellEditable(int row, int col) {
    //Note that the data/cell address is constant,
    //no matter where the cell appears onscreen.
    if (col < 2) {
    return false;
    } else {
    return true;
    * Don't need to implement this method unless your table's
    * data can change.
    //anim.animationTable.setValueAt(" ",5,i);
    public void setValueAt(Object value, int row, int col) {
    /*if (DEBUG) {
    System.out.println("Setting value at " + row + "," + col
    + " to " + value
    + " (an instance of "
    + value.getClass() + ")");
    data[row][col] = value;
    fireTableCellUpdated(row, col);
    //if (data[0][col] instanceof Integer
    // && !(value instanceof Integer)) {
    //With JFC/Swing 1.1 and JDK 1.2, we need to create
    //an Integer from the value; otherwise, the column
    //switches to contain Strings. Starting with v 1.3,
    //the table automatically converts value to an Integer,
    //so you only need the code in the 'else' part of this
    //'if' block.
    //XXX: See TableEditDemo.java for a better solution!!!
    /*try {
    data[row][col] = new Integer(value.toString());
    fireTableCellUpdated(row, col);
    } catch (NumberFormatException e) {
    JOptionPane.showMessageDialog(AnimationPanel.this,
    "The \"" + getColumnName(col)
    + "\" column accepts only integer values.");
    // } else {
    data[row][col] = value;
    fireTableCellUpdated(row, col);
    /*if (DEBUG) {
    System.out.println("New value of data:");
    //printDebugData();

    Thanks, that works when I do this from current dir (C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\servlets-example
    \WEB-INF\classes) :
    set CLASSPATH=.;%CLASSPATH%
    And I have to put the User.java file in the util directory that is located up one directory (C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\servlets-example
    \WEB-INF\classes\util).
    package util;
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import util.User;But it still wont work from the num directory that I had in my original question. I tried setting my classpath to point to the num package:
    Set CLASSPATH=%CLASSPATH%;C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\jsp-examples\WEB-INF\classes\num
    and it gave me same error.
    Please advise or should I just live with the servlet calling the class in the util directory and forget about the num directory?

  • ADF Faces and BC: Scope problem with managed bean

    Hi,
    I am using JDev 10.1.3 and ADF Faces with ADF BC.
    I have created a managed bean which needs to interact with the binding layer and also receive actions from the web pages. I have a managed property on the bean which is defined as follows:
    <managed-bean>
        <managed-bean-name>navigator</managed-bean-name>
        <managed-bean-class>ecu.ethics.view.managed.Navigator</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        <managed-property>
          <property-name>bindings</property-name>
          <value>#{bindings}</value>
        </managed-property>
      </managed-bean>I need the been to session scope because it needs to keep previous and next pages to navigate the user through their proposal. If i use session scope (as above) i get the following error when i click on a comand link which references a method in the above bean: #{navigator.forwardNext_action} which returns a global forward.
    this is the exception:
    javax.faces.FacesException: #{navigator.forwardNext_action}:
    javax.faces.el.EvaluationException: javax.faces.FacesException:
    javax.faces.FacesException: The scope of the referenced object: '#{bindings}' is shorter than the referring object     at
    com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)     at
    oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211) at
    javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)at
    javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)     at
    com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)     at
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)     
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)     at
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)how can i get around this?
    Brenden

    Hi pp,
    you need to create a managed (not backing) been set to session scope.
    You can call/reference the managed bean from your page.
    the backing bean is designed around a page lifecyle which is request oriented in it's design.
    This is a simple managed bean from faces-config.xml
    <managed-bean>
        <managed-bean-name>UserInfo</managed-bean-name>
        <managed-bean-class>ecu.ethics.admin.view.managed.UserInfo</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
          <managed-property>
          <property-name>bindings</property-name>
          <property-class>oracle.adf.model.BindingContext</property-class>
          <value>#{data}</value>
        </managed-property>
      </managed-bean>and the getters and setters for bindings in your session scope managed bean:
        public void setBindings(BindingContext bindings) {
            this._bindings = bindings;
        public BindingContext getBindings() {
            return _bindings;
        }you can access the model from the managed bean using the the BindingContext if needed.
    also have a look at JSFUtils from the ADF BC SRDemo application, there are methods in this class such as resolveExpression which demonstrate how to get the values of items on your page programatically using expression language. You can use this in your managed bean to get values from your pages.
    regards,
    Brenden

  • Problem with large option class during runtime 11.5.10

    It seems like our Oracle Configurator has a problem with loading multiple large option classes with about 10,000 items under it. We are running 11.5.10. My guess is that Oracle has to load everything in the option class and at some point the server just gives up after loading so much data.
    Basically the model looks like this and was set up by Oracle themselves in 04. Overtime the option classes grew.
    --Base model
    ----Model A instance 1
    --------option class
    ------------10000 items
    ----Model A instance 2
    --------option class
    ------------10000 items
    ----Model A instance 50
    --------option class
    ------------10000 items
    Is there an optimal amount for an option class? Is the model structure possibly outdated and we should break up the option classes into models to alleviate some of the pain? Or are we at the limitation that Oracle Configurator can do and should peruse a custom solution?

    Funny thing really because the Case study for Chapter 4 is from our company that Oracle put together for us and its not working in the sense that it seems the servers can't handle the current model structure. I wouldn't blame the UI for these crashes and we already hide stuff from the user (ie, having to sort through all 10,000 items and hiding the BOM structure). Quick story of why i want to try and fix it is becuase the way its set up now in the model document is that 3 people could kill the server by basically saying "ok i selected this item for this location" (which would load the 10,000 items into memory on the server and not to the UI upon selection of the model) and then they would say... "ok now copy this selection to all these 50 places" (which would load those items again for each place that the item had to copied to) and BOOM server dead. I think sandeeps diagram of the changes is a really good idea and could help out alot and I tossed out that idea a few times before around my work place to help with the server issues. I feel that it would work but is it also possible that maybe configurator can't support our model the way they are wanting it to work?

  • What is the problem with my bean?

    i have tried created a dbConnect javabean
    this is my code
    package connection;
    import java.util.*;
    import java.sql.*;
    public class dbConnection
    //variable declaration
    private String dbUrl =null;
    private String dbUser =null;
    private String dbPasswd =null;
    private String jdbcDriver = null;
    public Connection conn = null;
    public ResultSet selectRs = null;
    public int updateRs;
    public Statement stmt = null;
    public boolean driverLoaded = false;
    public boolean connected = false;
    public boolean statementCreated = false;
    public dbConnection()
    //Getter and setting for variable
    public void setdbUrl(String dbUrl)
    this.dbUrl = dbUrl;
    public String getdbUrl()
    return this.dbUrl;
    public void setdbUser(String dbUser)
    this.dbUser = dbUser;
    public String getdbUser()
    return this.dbUser;
    public void setdbPasswd(String dbPasswd)
    this.dbPasswd = dbPasswd;
    public String getdbPasswd()
    return this.dbPasswd;
    public void setjdbcDriver(String jdbcDriver)
    this.jdbcDriver = jdbcDriver;
    public String getjdbcDriver()
    return this.jdbcDriver;
    public void loadDriver() throws Exception
    Class.forName(jdbcDriver).newInstance();
    public void getDbConnect() throws Exception
    if (!driverLoaded)
    loadDriver();
    driverLoaded = true;
    conn = DriverManager.getConnection(dbUrl, dbUser, dbPasswd);
    connected = true;
    public void createDBStatment() throws Exception
    if (!connected)
    getDbConnect();
    stmt = conn.createStatement();
    public Statement getdbStatement()
    return this.stmt;
    public void cleanConnect() throws Exception
    try {
    conn.close();
    catch(SQLException e) {
    System.err.println("destroy: " + e);
    and a login java bean.
    package db;
    import connection.*;
    import java.util.*;
    import java.sql.*;
    public class dbLogin
    //variable declaration
    private int loginMemId;
    private String loginPassword = null;
    private String loginEmail = null;
    private int loginMemType;
    public ResultSet selectRs = null;
    public int updateRs;
    public Statement stmt = null;
    dbConnection dbCon;
    public dbLogin()
    //Getter and setting for variable
    public void setLoginMemId(int loginMemId)
    this.loginMemId = loginMemId;
    public int getLoginMemId()
    return this.loginMemId;
    public void setLoginPassword(String loginPass)
    this.loginPassword = loginPass;
    public String getLoginPassword()
    return this.loginPassword;
    public void setLoginEmail(String loginEmail)
    this.loginEmail = loginEmail;
    public String getLoginEmail()
    return this.loginEmail;
    public void setLoginMemType(int loginMemType)
    this.loginMemType = loginMemType;
    public int getLoginMemType()
    return this.loginMemType;
    public void insertLogin() throws Exception
    dbCon.loadDriver();
    dbCon.getDbConnect();
    dbCon.createDBStatment();
    String insertSqlStr = "insert into Login (login_memid, login_password, login_email, login_memtype) values ('1000','aVE23Gse','[email protected]','0')";
    updateRs = stmt.executeUpdate(insertSqlStr);
    and test them using a simple jsp
    <html>
    <head>
    <title>
    Testing of Connection Bean
    </title>
    </head>
    <body>
    <jsp:useBean class="db.dbLogin" id="bean0" scope="page"/>
    <% bean0.insertLogin();%>
    <br>
    <br>
    <%out.println("hohoho");%>
    </body>
    </html>
    But my beans are not working.
    i have encounter this error
    java.lang.NullPointerException
    may i know what are the things that i have done wrongly?
    is the problem lies on my classes, or my jsp?
    and what if i want to use a select instead of insert for my login?
    Please help!
    thanks

    sorry.
    this should be my jsp
    <html>
    <head>
    <title>
    Testing of Connection Bean
    </title>
    </head>
    <body>
    <jsp:useBean class="connection.dbConnection" id="bean1" scope="page"/>
    <jsp:useBean class="db.dbLogin" id="bean0" scope="page"/>
    <%bean1.setdbPasswd("pass");
    bean1.setdbUrl("jdbc:mysql://localhost:3306/deconexion");
    bean1.setdbUser("admin");
    bean1.setjdbcDriver("org.gjt.mm.mysql.Driver");%>
    <% bean0.insertLogin();%>
    <br>
    <br>
    <%out.println("hohoho");%>
    </body>
    </html>

  • Problems with generating persistent classes

    I've been following the tutorial for generating persistent classes from a
    DB. I'm not having much luck:
    First, with rd-schemagen, how do you tell it to only work on a specific
    schema? I run "rd-schemagen -file schema.xml NBS_ODS_101", but it still
    generates the schema file for all schemas in the DB. Is there a usage
    option for the tool (I haven't been able to find it yet)?
    Second, I have the following tables in my DB: ACT, ACT_ID, ENTITY,
    ENTITY_ID. When rd-reversemappingtool runs on these tables, it creates an
    ID class for ACT (ActId) which conflicts with the class generated for
    ACT_ID (ActId). Since renaming the tables is not an option and I really
    don't want to have to rename classes and change the mapping file every
    time I regenerate, what is a solution for this problem?
    Third, if I do the latter above so I can run the importtool and then I
    run "rd-importtool test\test.mapping", it runs successfully for a bit
    while spitting out information until I get this:
    Exception in thread "main" java.lang.NullPointerException
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.mapForeignKe
    y(ImportTool.java:336)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.mapField(Imp
    ortTool.java:207)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.importMappin
    gs(ImportTool.java:78)
    at com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.run
    (ImportTo
    ol.java:408)
    at com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.main
    (ImportT
    ool.java:385)

    Abe White <[email protected]> wrote in
    news:[email protected]:
    First, with rd-schemagen, how do you tell it to only work on a specific
    schema? I run "rd-schemagen -file schema.xml NBS_ODS_101", but it still
    generates the schema file for all schemas in the DB. Is there a usage
    option for the tool (I haven't been able to find it yet)?Try using -schemas <comma-separated list of schema names>
    I apologize for the documentation in this area. We're going to upgrade
    the tool and the documentation to a more recent version from our internal
    R&D codebase when our 2.5 release comes out in the next couple of weeks.
    This release will also include a system for customizing the tool's output
    in many more ways.This works:
    rd-schemagen -file schema.xml -indexes false -schemas NBS_ODS_101
    but this does not:
    rd-schemagen -file schema.xml -indexes false -schemas NBS_ODS_101,NBS_SRT_
    101
    Exception in thread "main" java.lang.IllegalArgumentException:
    com.solarmetric.r
    [email protected] = NBS_ODS_
    101,NBS_SRT_10
    1: java.lang.ArrayIndexOutOfBoundsException: 1
    at serp.util.Options.setInto(Options.java:206)
    at serp.util.Options.setInto(Options.java:168)
    at com.solarmetric.rd.conf.Configurations.populateConfiguration
    (Configur
    ations.java:144)
    at com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGenerator.main
    (SchemaG
    enerator.java:690)
    Second, I have the following tables in my DB: ACT, ACT_ID, ENTITY,
    ENTITY_ID. When rd-reversemappingtool runs on these tables, it creates
    an ID class for ACT (ActId) which conflicts with the class generated for
    ACT_ID (ActId)This is a bug, and will also be fixed with 2.5. I can't even think of a
    good way to tell you to work around it for now, unfortunately.I renamed the ID classes to ActOid and EntityOid and changed the .jdo file
    to reflect that. Do you see any problems with this strategy?
    Third, if I do the latter above so I can run the importtool and then I
    run "rd-importtool test\test.mapping", it runs successfully for a bit
    while spitting out information until I get this:
    Exception in thread "main" java.lang.NullPointerExceptionCan you please send the generated .mapping, .jdo, and .java files?
    Unless you want to wait until the 2.5 improvements to debug.I will send you all the files in a zip file by email.

  • Problem with importing a class

    When I compile my class, I get an error pointing to the import statement saying that it expects a period. Below is my code followed by the error I get:
    import Entry;
    public class Dictionary2 extends Entry
      protected Entry entries[];
      public Dictionary2(String puzzle)  // constructor
        entries = new Entry[5];
        if (puzzle == "unscramble")
          entries[0].setEntry("stupid", "Insult");
          entries[1].setEntry("monkey", "Zoo animal");
          entries[2].setEntry("meerkat", "Cute furry African animal that stands 12 inches high on its hind legs");
          entries[3].setEntry("burrow", "Where meerkats sleep and raise their pups");
          entries[4].setEntry("boogers", "Gross things");
    }C:\Program Files\Java\jdk1.6.0_01\bin>javac Dictionary2.java
    Dictionary2.java:1: '.' expected
    import Entry;
    ^
    1 error
    There is nothing wrong with my Entry class. It's where it's supposed to be, and it's compiled correctly. Why is it wanting a period? Your help will be greatly appreciated.

    SysterTara wrote:
    What I'm talking about is this: When you use a package, you have to create a directory path on your hard drive, like com\mydomain\project\Entry. When you want to upload it to a website, what do you do? Will it not work anymore? Will you have to create com/mydomain/project/Entry on the website? Please forgive my lack of knowledge. I am very inexperienced.You're confusing the classpath with your package structure.
    Packages are used to organize Java classes. You import classes based on their fully-qualified name, including the package they belong to. Packages are location-independent.
    The classpath is how the Java VM finds all the classes you're using. When you run a java program, you supply a list of paths to package roots and jar files, which the VM will use as a starting point to find the classes you've imported.

  • Problem with Container.getListeners(Class T )

    After coding for a while in CodeGuide, I switch to eclipse and converted my java 1.5 enums into a form compatible with java 1.4. Now in unrelated files (that I have not touched) I am getting:
    The return type is incompatible with Container.getListeners(Class<T>), Window.getListeners(Class<T>)
    These files are extentions of JDialogs and JTreeTables (for which its JComponent.getListeners).
    I have no idea why this would be and what this even means. Can anyone help?
    --Aaron                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    oddly enough, it seems that when importing everything from cvs and doing its inital build, it will complain. if i make type a character, delete it, then save (forcing a new compile) it works. i have no idea why.
    --aaron                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • Firefox is blocking one of my facebook favorite pages due to false certificate so what can I do?

    When I try to look at the "Celebrity Cruises" Facebook page a Firefox yellow box is there and says it is an invalid certificate and to "get me out of here". Celebrity has not blocked me because I can see the page on my mobile devices. I can also see

  • IPhone not showing in Maps app on Mac

    I am using an iPhone 5 with the latest 7.0.3 update. My mid 2009 Macbook Pro is running the latest OSX Mavericks. When I use the directions option in the Maps App, my iPhone does not show up as an option to share the directions. What setting do I nee

  • Synchronous XI Scenario in Real Time

    Hi, We are having a scenario in which PDA devices would communicate to SAP systems through XI. PDA devicves would send a request and SAP responds back. This is a Synchronous scenario. The interface is designed for operating personnel in warehouse who

  • Good EJB project

    I want to delve myself into EJBs and want to do so with a good yet not too complicated project. I know there are many sites that have projects posted but with school I don't want to do something overly complex, at the same time I don't want a simple

  • Printing letters to customers of marketing target group or campaign

    Hello everyone, We have a need to print letters to customers from a marketing target group or campaign.  (SAP CRM 7) The problem is that we can only see an option in application to send a Mail/SMS/Fax to the customer (with an already prepared mail fo