Problem with JPA @Embeddable class field in  @Embedded

I have a Embeddable class and Embadded in all of my JPA Entities, the version(in DBUniqueId) field is mandatory for some JPA Entities and for others it should not be present.
My DBUser.java JPA Entity shouldn't have version field(DBUser table doesn't have one) and so I didn't include it in @AttributeOverrides of DBUser.java. when I try to run the JPA query it results in exception
Query:
List<DBUser> userList = (List<DBUser>)entityManager.createQuery(SELECT u FROM DBUser u WHERE u.userId.root=?1 AND u.userId.extension=?2).setParameter(1,"root1").setParameter(2,"ext1").getResultList ();
And The Exception is:
---- Begin backtrace for Nested Throwables
java.sql.SQLException: ORA-00904: "T0"."VERSION": invalid identifier
     at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
     at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
How do I inform to JPA Entity to ignore only the version field of the Embeddable in my JPA Entity @Embedded place.
So the above query can successful. Thank You!
Please guide me to solve this problem.
@Embeddable
@MappedSuperclass
public class DBUniqueId implements Serializable {
* serialVersionUID.
private static final long serialVersionUID = 8903598739796209331L;
* root.
private String root;
* extension.
private String extension;
* version.
private String version;
     //Getters & Setters
@Entity
@Table(name = "MyTable", schema = "MySchema")
public class DBUser implements Serializable {
* unique user id.
private DBUniqueId uniqueUserId;
* Get the unique user id.
* @return <code>DBUniqueId</code> - unique person id
@Embedded
@AttributeOverrides( {
@AttributeOverride(name = "root", column = @Column(name = "LUSR02_ID_ROOT", nullable = true, length = 50)),
@AttributeOverride(name = "extension", column = @Column(name = "LUSR02_ID_EXT", nullable = true, length = 50))
public DBUniqueId getUserId () {
return uniqueUserId;
* set user unique id.
* @param uniqueId - unique id of the person
public void setUserId (final DBUniqueId uniqueId) {
this.uniqueUserId = uniqueId;
}

Sudeep Naidu wrote:
Hello gimbal2,
Thanks for your response...
In my project I have created a class with name DBVersionUniqueId but my lead said no to it.
Only DBUniqueId should be used and make it work with or with out version fields.
I tried experimenting around, but didn't succeed.
Please Suggest some solution to make it work with DBUniqueId class.
Thank You.No, let your lead write the code. He/she seems to be the expert. I certainly have no clue how to do it and honestly I also cannot find any reason why it should be possible. Let me put what is required in other words:
- you have an entity with three properties, all of which are not transient. This means these properties map to three columns in the database according to the JPA specs.
- you have a table with only two properties
- you must and you shall use the object with three properties but at the same time one of the fields must all of a sudden be ignored by the persistence provider
It makes no sense to want to do that.
Correct answer: create a new object with only the two fields so the database and the object model match exactly
Wrong answer: try to create workarounds that in six months time nobody is going to understand why the hell it was done that way

Similar Messages

  • Problem with flow of expandable fields

    Hi everyone,
    I have important problem with flow of expandable fields in table in dynamic PDF form. The issue I am talking about you can see at the top of column 3 on page 2 in PDF in link below.
    Here is uploaded PDF form and sample XML data (form has import button and is ReaderExtended that you can easily test it and see my problem):
    http://www.speedyshare.com/718224676.html
    Generally I have created table with 3 columns using Table object (each field has allow multiple lines selected and expand to fit).  It is closed in FormBody subform which is flowed subform.
    Row in table is repeatable and has “is allow to break page” setting set on.
    Sometimes when there is a lot of text and row page break there is problem with flow.
    For example text from one rows overlaps on text from next row.
    I tried to solve this problem by changing row height, indents, font size, line spacing but always when I thought that I have fixed it  I got another data which generated the same flow problem.
    Did anyone met this problem earlier and found solution to this issue? This is really important for me and I am really in dead end so any hints would be really helpful.
    I am using Adobe Livecycle Designer 8.1 and PDF form target is 8.
    I really appreciate any help in this problem.
    Thanks,
    Kamil Dłutowski

    I posted link to my form in my first post.
    Here it is: http://www.speedyshare.com/718224676.html

  • Problem with JPA Implementations and SQL BIGINT in primary keys

    I have a general Question about the mapping of the SQL datatype BIGINT. I discovered, that there are some different behaviour depending on the JPA implementation. I tested with TopLink Essentials (working) and with Hibernate (not working).
    Here is the case:
    Table definition:
    /*==============================================================*/
    /* Table: CmdQueueIn */
    /*==============================================================*/
    create table MTRACKER.CmdQueueIn
    CmdQueueInId bigint not null global autoincrement,
    Type int,
    Cmd varchar(2048),
    CmdState int,
    MLUser bigint not null,
    ExecutionTime timestamp,
    FinishTime timestamp,
    ExecutionServer varchar(64),
    ScheduleString varchar(64),
    RetryCount int,
    ResultMessage varchar(256),
    RecordState int not null default 1,
    CDate timestamp not null default current timestamp,
    MDate timestamp not null default current timestamp,
    constraint PK_CMDQUEUEIN primary key (CmdQueueInId)
    The java class for this table has the following annotation for the primary key field:
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "CmdQueueInId", nullable = false)
    private BigInteger cmdQueueInId;
    When using hibernate 3.2.1 as JPA provider I get the following exception:
    avax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:218)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:176)
    at $Proxy16.persist(Unknown Source)
    at com.trixpert.dao.CmdQueueInDAO.save(CmdQueueInDAO.java:46)
    at com.trixpert.test.dao.CmdQueueInDAOTest.testCreateNewCmd(CmdQueueInDAOTest.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at
    Caused by: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
    at org.hibernate.id.IdentifierGeneratorFactory.get(IdentifierGeneratorFactory.java:59)
    at org.hibernate.id.IdentifierGeneratorFactory.getGeneratedIdentity(IdentifierGeneratorFactory.java:35)
    at org.hibernate.id.IdentityGenerator$BasicDelegate.getResult(IdentityGenerator.java:157)
    at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2108)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2588)
    at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
    at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
    at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180)
    at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108)
    at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
    at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:212)
    ... 34 more
    This means, that their ID generator does not support java.math.BigInteger as datatype.
    But the code works if I take TopLink essentials as JPA Provider.
    Looking at the spec shows the following:
    In chapter 2.1.4 "If generated primary keys are used, only integral types will be portable." Integral datatypes are byte, short, int, long and char. This would mean, that the Hibernate implementation fits the spec but there seem to be a problem in general with BIGINT datatypes.
    I use a SYBASE database. There it is possible to declare a UNSIGNED BIGINT. The range of numbers is therefore 0 - 2^64 - 1. Since in Java a long is always signed it would mean its range is from -2^63 -1 to 2^63 -1. So a mapping of BIGINT to java.lang.long could result in an overflow.
    The interesting thing is, that I used NetBeans to reverse engineer an existing database schema. It generated for all Primary Keys of Type BIGINT automatically a java.math.BigInteger. But for other fields (not being keys) it mapped BIGINTs to java.lang.long.
    It looks like there are some problems with either the spec itself or the implementation of it. While TopLink seems to handle the problem correctly, Hibernate doesn't. But Hibernate seems to fulfill the spec.
    Is anybody familiar with the Spec reading this and can elaborate a little about this situation?
    Many thanks for your input and feedback.
    Tom

    Not sure if I clearly understand your issue, would be good if you can explain it a bit more clearly.
    "I select a value from LOV and this value don't refresh in the view"
    If you mean ViewObject, check if autoSubmit property is set to true.
    Amit

  • 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?

  • Problem with JPA + Hibernate Validator when performing update

    When I try to insert an new entity with a validation problem, Hibernate Validator works normally, but when I try to update an entity the InvalidStateException is not thrown when persist() is called, so when commit() is called a RollbackException is thrown.
    I'm using the latest versions of the hibernate libraries. The problem happened with JSF(NetBeans 6 VWP) and Java SE.
    Sample code:
          EntityManagerFactory emf = Persistence.createEntityManagerFactory("HibernateValidatorTest");        
          EntityManager em = emf.createEntityManager ();       
          ScfaqAssunto assunto = em.find(ScfaqAssunto.class, 2); // new ScfaqAssunto() works normally
          assunto.setAssunto(""); // the property assunto is with @NotEmpty              
          try
             em.getTransaction().begin();
             em.persist(assunto);
             em.getTransaction().commit();
          catch(InvalidStateException e)
             if( em.getTransaction().isActive())
                em.getTransaction().rollback();
             for(InvalidValue invalidValue : e.getInvalidValues())
                System.out.println (invalidValue.getMessage());
          catch(Exception e)
             if(em.getTransaction().isActive())
                em.getTransaction().rollback();
             System.out.println(e.getMessage());
          finally
             em.close();
          } Thanks for any help,
    Felipe

    Hi Thomas
    I loose hours with this problem
    there is a problem with toplink lib version
    just download toplink librairies at http://www.oracle.com/technology/products/ias/toplink/jpa/index.html
    replace oldest in $Glassfishdir\lib
    It have to works
    tested on postGres and Derby
    Can netbeans update center fix this problem?

  • 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

  • Problem with characters in text field

    hi all
    i am missing a few characters, once i load text into a dynamic text field. chars are not missing per say; they are being replaced with empty squares.
    characters like the euro sign and accentuated german a letter.
    whats is weird is that other accentuated german letters do appear. so only a few selected are missing.
    How ive set up the fla:
    1) i've added 4 text fields to the stage in the font im using, Arial, one for each font style: normal, italic, bold and bold italic, and in all 4 fields ive embedded all latin characters (to include the german accentuaded characters and im guessing it's in the punctuation group that holds the euro sign, so that one is also embedded), besides lowercase, uppercase, numerical, and all the default groupd to include basic text.
    2) i've got a dynamic text field, created with createTextField, and setup the following ActionScript (2):
    this.createTextField("T_text",1,0,10,Stage.width-60,50);
    var myFmt = new TextFormat();
    myFmt.size = 12;
    myFmt.leading = 3;
    myFmt.font = "Arial";
    T_text.html = true;
    T_text.autoSize = "left";
    T_text.multiline = true;
    T_text.wordWrap = true;
    T_text.selectable = false;
    T_text.embedFonts = false;
    T_text.textColor = "0x666666";
    T_text.htmlText = _global.gallery_1_image_text_1; // this holds the text im displayed, called in from a database.
    T_text.setNewTextFormat(myFmt);
    now, im calling text from a database.
    when calling the text from the browser  url bar, there's no chars missing.
    its just when i make this call from flash and load the text into the dynamic text field, that characters go missing.
    below is a link to a print screen of the faulty text that is displayed in flash's dynamic text field.
    http://img210.imageshack.us/img210/340/utf8.png
    any ideas? i mean, it seems that the arial font is missing a few accentuated characters! because the code i have setup loads other accentuated characters.
    anyone has seen this issue before and know how to solve it?
    regards

    no.
    you assigned your embedFonts property to be false.
    look, you can test if you've embedded fonts correctly by using:
    T_text._rotation=3;
    if you see no text, you're not embedding fonts correctly.
    so, use:
    T_text.embedFonts=true;
    and then test.  if you see no text, use:
    click on the upper right of your library panel > new Font > select Arial and tick the symbols you need to embed > tick export for actionscript and assign a linkage id (eg, ArialID). click ok.  then use:
    this.createTextField("T_text",1,0,10,Stage.width-60,50);
    var myFmt = new TextFormat();
    myFmt.size = 12;
    myFmt.leading = 3;
    myFmt.font = "ArialID";
    T_text.html = true;
    T_text.autoSize = "left";
    T_text.multiline = true;
    T_text.wordWrap = true;
    T_text.selectable = false;
    T_text.embedFonts = true;
    T_text.textColor = 0x666666;  // no quotes here.  this is a number
    T_text.htmlText = _global.gallery_1_image_text_1; // this holds the text im displayed, called in from a database.
    T_text.setTextFormat(myFmt);  // to format the above text, use setTextFormat().  if you want to format text added after this line, use setNewTextFormat()

  • Problem with Math In Calculated Fields

    I am calculating a group incident rate for data returned from
    a query. The formula is Number of cases multiplied by 200000
    divided by number of hours worked. Cases in my report is the
    calculated field: calc.CaseSum (the sum of cases for the group)
    Hours is calc.SumHours (the sum of hours for the group). The actual
    values for these variables (for the first group are 48 and 29427171
    respectively. When I create the following calculated field called
    rate using the formula: (calc.CaseSum * 200000) / calc.SumHours,
    Cold Fusion Generates a Runtime Error:
    Invalid ColdFusion expression in report. If the expression is
    a string, ensure that it is within quotes. Error: (calc.CaseSum *
    200000) / calc.SumHours is not a valid ColdFusion expression.
    If I use the constant value "29427171" as the divisor, the
    report works albeit only for the first group. Any ideas; is this a
    bug, or am I misusing the product?
    Addition: I forgot to mention I am using CF8. Also this
    formula worked fine as a Report Total before I introduced grouping
    and modified the calculated fields to reset on the change of a
    group.

    Sorry, I've been on another project for awhile. This problem
    will certainly be a "show stopper" for me if I cannot resolve it.
    As I mentioned in my original post, I used a constant in the
    formula in lieu of the variable and the calculation worked. This
    would suggest that CF does not have a problem with a large number.
    In spite of that reasoning, I tried Tony's suggested (thanks
    by the way!) with the identical outcome, only difference is the new
    formula is displayed in the error message.
    Tony, you also suggested that I set the variables using
    CFSET... How would I do this within the report writer environment.
    I had tried a similar approach: to perform half the calculation
    i.e. that within the parenthesis, and assign that value to a
    separate "calculated field: and then perform the rest of the
    calculation on that variable with the same outcome.
    I think that I may be dealing with a CF bug here, I'd like to
    find a workaround... I've noticed that CF8 has a new patch, perhaps
    after I apply it, I may be able to get this thing to work. I'm on
    another project right now so it will be a few days before I can
    test this theory, I report the result.
    Should this fail, and no one can come up with a workaround, I
    will report this to Adobe.

  • 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

  • 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

  • Adhoc query-Problem with Personnel no output field

    Hi Gurus,
    We are trying to run an adhoc query using a customized Info set(PNPCE logical database).
    While running the query,we had selected Personnel no(from Payroll status P0003 table) as output field and Company code(from Org assignment P0001) as input field in the selection.
    Problem is in the output field we are seeing the Personnel name details in place of Personnel no.Could anyone please suggest what could be the reason behind this and how to fix it.
    Your help will be highly appreciated.
    Warm Rgds
    Sushil

    Hi Sushil,
    The default output for fields with a text and a value (Name = text, PERNR = value) is the text.  You can change this by right clicking on the output box in Ad Hoc and selecting "Value".  If you want both name and number, select "Value and Text". 
    You can also change this default to Value from Text if in Ad Hoc, you go to Edit --> Settings.  On the last tab, change the radio buttion for output default to Value from Text.  This will change it for all fields so you would see the eight digit number rather than the name of the position or org unit.  Thus, you may want to keep it at Text and use the right click to change specific fields as needed.
    By the way, it is usually best to utilize the personnel number field from IT0000-Actions, although it can be obtained from any infotype if you include that field in the field group when creating your infoset. 
    Paul

  • Import Manager - Problem with 0..n field in Import Manager

    Iu2019m having problems with XMLs that contain multiple or single tags in MDIS process. For example: I did the map using a XML with multiple tags for Address:
    <address>
    <item>
    u2026
    </item>
    <item>
    u2026
    </item>
    </address>
    When I send two address or more Address, the Import Server work fine, but when I send only one Address, the address is not imported.
    <address>
    <item>
    </item>
    <item>
    </item>
    </address>
    Opening the xml file with only one Address in Import Manager, I saw that the fields isnu2019t mapped, but when I open a xml file with multiple Address itu2019s open correctly.
    The XSD cardinality for the Address\Item is 0..n

    Hi Evandro ,
    If it is processing the input file correctly through the Manul Import manager process then update your latest Map by using SAVE As option or else save this correct map with a new name altogether and use this new map in the port for automatic importing.
    If your file is able to process correctly through the Import manager without showing any errors till the Import step in the Import manager then this map must be correct and shoul automate the importing correctly.
    Provided you are using the similar file for automatic importing as well.The file name and the fields as well as the value mapping as saved in this corrected map must not differ with the input file else this saved map will not be able to import correctly.
    Check to see if you have made correct setting for automatic importing by refering the below link:
    http://help.sap.com/saphelp_mdm550/helpdata/en/43/12036df94c3e92e10000000a1553f6/frameset.htm  (Automatic importing MDIS - Import manager ref guide>MDM import server(MDIS)>MDIS Consfiguration)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8973bcaf-0801-0010-b7a7-f6af6b1df00e(mdm import and syndication server)
    Also check the exception folders if your import is not taking place automatically:
    http://help.sap.com/saphelp_mdm550/helpdata/en/43/12036df94c3e92e10000000a1553f6/frameset.htm (Exceptions- MDM Import Manager MDIS-Exception handling)
    Hope It Helped
    Thanks & Regards
    Simona Pinto

  • 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?

  • Problem with "Insufficient data for image" and embedded JPEG 2000 Images

    I frequently download pdf from the http://www.glorecords.blm.gov web site.  They are reporting a problem with Reader Reader 10.1.4 and the pdf files they have.
    "("Insufficient data for image" and embedded JPEG 2000 Images)"
    I am experiencing the same "Insufficient data for image" error when opening their downloaded pdf and viewing in ACROBAT X 10.1.4.
    Can someone address this please?
    Win 7 sp1

    Read this:
    http://blogs.adobe.com/dmcmahon/2012/08/21/acrobat-insufficient-data-for-an-image-error-af ter-updating-to-10-1-4-or-9-5-2/

  • 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?

Maybe you are looking for

  • HT4914 My wife uses a different apple ID than I do.  Can she share my music?

    We use multiple devices on iTunes and are interested in iTunes match.  Can my wife use her own Apple ID and share the music I upload for iTunes match?

  • Exchange rate message in PO

    Dear experts, I receive a warning message "exchange rate deviates by 7%" when changing the exchange rate during PO creation. I would like to change it to an error message. In " IMG > MM > Purchasing > Environment data > Define attributes of system me

  • My iphone4s wont sync i have tried recharging it and have updated itunes

    My i phone4s wont sync to itunes i feel like i have tried everything, i have turned my phone on and off, its fully charged and the newest version of itunes is upgraded. my computer detects my phone as a camera. Does anyone know what i can do ?

  • Date Stamp

    Is there a way to add a date stamp to a Lumia 820 photo? If not can Nokia include such functionality in the next update?

  • Isight Video Camera

    It seems that my Macbook does not recognize anymore my isight build Video Camera. I thought it was a virus and formated my hard disk but still have the same message of error when opening photo booth "cannot open because no camera is attached or the c