Bonjour,

Malgré le fait que ce soit un probléme basique soulevé un bon nombre de fois, je sollicite votre aide et vos conseils sur mon probléme :

Actuellement, j'essaye de signer un fichier avec la librairie XADES.

Alors voici mon code déclenché à partir d'un boutton pour récupérer mes fichiers à partir d'une JTable :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
          SignerCTest signerCTest = new SignerCTest();
          SignerEPESTest signerEPESTest = new SignerEPESTest();
          SignerTTest signerTTest = new SignerTTest();
          
          try {
          [I]   java.util.ArrayList<java.io.File> allFile = new java.util.ArrayList();
             System.out.println("allFile : " + allFile );   
             
                int[] rows = jTable.getSelectedRows();
                System.out.println("rows :" + rows);
                int rowCount = rows.length;
                System.out.println("rowCount : " + rowCount);
                for (int i = 0; i < rowCount; i++) {
                    DocFile docFile = model.getDataAt(rows, 0);
                    System.out.println("docFile : " + docFile);
                    
                    java.io.File file = docFile.getFile();
                    
                    System.out.println("file : " + file);
                    
                    if (file != null) {
                        allFile.add(file);
                    }
                    
                    
                    
                    
                    System.out.println("allFile : " + allFile);
                    System.out.println("====================================");
                    
                    
                    
                }
            //signBES
            //mars 18, 2013 6:05:45 PM com.adesium.mysign.gui.SignPanel jButton1ActionPerformed
            //Grave: null
            //java.lang.IllegalArgumentException: File does not exist or it does not refer to a normal file: .\src\test\cert\my\LG.pfx
            signerBESTest.testSignBES(allFile);
                
                
            //signBES
            //mars 18, 2013 5:48:31 PM com.adesium.mysign.gui.SignPanel jButton1ActionPerformed
            //Grave: null
            //java.io.FileNotFoundException: .\src\test\xml\document.xml (Le chemin d’accès spécifié est introuvable)
           // signerBESTest.testSignBES();
            
            
          } catch (Exception ex) {
            Logger.getLogger(SignPanel.class.getName()).log(Level.SEVERE, null, ex);
          }
        
    }
et j'obtiens ceci comme trace :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

allFile : []
rows :[I@80e3277
rowCount : 1
mars 20, 2013 12:52:16 PM com.adesium.mysign.gui.SignPanel jButton1ActionPerformed
Grave: null
docFile : com.adesium.mysign.domain.DocFile[profile: com.adesium.mysign.domain.Profile[id: 5c7ecd03-b6a2-42ce-af89-c41cc63089fc, type: 2] , file: C:\a.xml] 
java.io.FileNotFoundException: null (Le fichier spécifié est introuvable)
file : C:\a.xml
	at java.io.FileInputStream.open(Native Method)
allFile : [C:\a.xml]
====================================
signBES
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at java.io.FileInputStream.<init>(FileInputStream.java:97)
	at xadestest.SignatureServicesTestBase.getDocument(SignatureServicesTestBase.java:85)
	at xadestest.SignerTestBase.getTestDocument(SignerTestBase.java:60)
	at xadestest.SignerBESTest.testSignBES(SignerBESTest.java:34)
	at com.adesium.mysign.gui.SignPanel.jButton1ActionPerformed(SignPanel.java:917)
	at com.adesium.mysign.gui.SignPanel.access$2000(SignPanel.java:44)
	at com.adesium.mysign.gui.SignPanel$21.actionPerformed(SignPanel.java:771)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.Component.processMouseEvent(Component.java:6504)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
	at java.awt.Component.processEvent(Component.java:6269)
	at java.awt.Container.processEvent(Container.java:2229)
	at java.awt.Component.dispatchEventImpl(Component.java:4860)
	at java.awt.Container.dispatchEventImpl(Container.java:2287)
	at java.awt.Component.dispatchEvent(Component.java:4686)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
	at java.awt.Container.dispatchEventImpl(Container.java:2273)
	at java.awt.Window.dispatchEventImpl(Window.java:2713)
	at java.awt.Component.dispatchEvent(Component.java:4686)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
	at java.awt.EventQueue.access$000(EventQueue.java:101)
	at java.awt.EventQueue$3.run(EventQueue.java:666)
	at java.awt.EventQueue$3.run(EventQueue.java:664)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:680)
	at java.awt.EventQueue$4.run(EventQueue.java:678)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
mon fichier sur lequel je fais des tests est sur C:\b.xml

Pourriez-vous me donner des conseils, SVP ?

Clio