IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Jasper Discussion :

[WebServices] gestion des dossier


Sujet :

Jasper

  1. #1
    Membre habitué Avatar de anayathefirst
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    326
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Décembre 2006
    Messages : 326
    Points : 182
    Points
    182
    Par défaut [WebServices] gestion des dossier
    Salut,
    je voudrait manipuler les fichiers et les dossiers du repository dans mon application JAVA en utilisant les webServices. la création de fichiers se passe très bien, avec la fonction server.getWSClient().addOrModifyResource(resourceDescripto, monFichier)
    par contre, quand je fait ça avec un dossier, ça me génère une exception.
    voici le code utilisé :
    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
    File folder = new File("./temp/folder");
            JServer outserver = new JServer();
            outserver.setUsername("jasperadmin");
            outserver.setPassword("jasper");
            outserver.setUrl("http://localhost:8080/jasperserver-pro/services/repository");
            ResourceDescriptor folderdesc = new ResourceDescriptor();
            folderdesc.setUriString("/reports/heroesReports");
            try {
                folderdesc = outserver.getWSClient().get(folderdesc, folder);
            } catch (Exception ex) {
                System.err.println("oups"+ex);
            }
            ResourceDescriptor newCopy = new ResourceDescriptor();
            newCopy.setName("folderTest");
            newCopy.setResourceType(ResourceDescriptor.TYPE_FOLDER);
            newCopy.setLabel("folderTestLabel");
            newCopy.setDescription("folderTestLabel");
            newCopy.setParentFolder("/");
            newCopy.setUriString(newCopy.getParentFolder() + "/" + newCopy.getName());
            newCopy.setWsType(ResourceDescriptor.TYPE_FOLDER);
            newCopy.setHasData(true);
            newCopy.setIsNew(true);
     
            JServer server = new JServer();
            server.setUsername("jasperadmin");
            server.setPassword("jasper");
            server.setUrl("http://localhost:8081/jasperserver-pro/services/repository");
            try {
                ResourceDescriptor result = server.getWSClient().addOrModifyResource(newCopy, folder);
            } catch (Exception ex) {
                System.err.println("oups 2"+ex);
            }
    et voici l'exception levée :
    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
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    java.lang.Exception: Attachment not present!
            at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.get(WSClient.java:282)
            at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.get(WSClient.java:226)
            at jaspermigration.Main.main(Main.java:69)
    oupsjava.lang.Exception: Attachment not present!
    25 mars 2008 16:51:26 org.apache.axis.Message writeTo
    GRAVE: Exception:
    AxisFault
     faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
     faultSubcode: 
     faultString: java.io.FileNotFoundException: .\temp\folder (Accès refusé)
     faultActor: 
     faultNode: 
     faultDetail: 
            {http://xml.apache.org/axis/}stackTrace:java.io.FileNotFoundException: .\temp\folder (Accès refusé)
            at java.io.FileInputStream.open(Native Method)
            at java.io.FileInputStream.<init>(FileInputStream.java:106)
            at javax.activation.FileDataSource.getInputStream(FileDataSource.java:82)
            at javax.activation.DataHandler.getInputStream(DataHandler.java:222)
            at org.apache.axis.attachments.DimeBodyPart.send(DimeBodyPart.java:323)
            at org.apache.axis.attachments.DimeBodyPart.write(DimeBodyPart.java:233)
            at org.apache.axis.attachments.DimeMultiPart.write(DimeMultiPart.java:46)
            at org.apache.axis.attachments.AttachmentsImpl.writeContentToStream(AttachmentsImpl.java:511)
            at org.apache.axis.Message.writeTo(Message.java:545)
            at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:511)
            at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
            at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
            at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
            at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
            at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
            at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
            at org.apache.axis.client.Call.invoke(Call.java:2767)
            at org.apache.axis.client.Call.invoke(Call.java:2443)
            at org.apache.axis.client.Call.invoke(Call.java:2366)
            at org.apache.axis.client.Call.invoke(Call.java:1812)
            at com.jaspersoft.jasperserver.irplugin.wsclient.RepositorySoapBindingStub.put(RepositorySoapBindingStub.java:202)
            at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.modifyReportUnitResource(WSClient.java:498)
            at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.addOrModifyResource(WSClient.java:442)
            at jaspermigration.Main.main(Main.java:89)
     
            {http://xml.apache.org/axis/}hostname:bull-prjjspr01
     
    java.io.FileNotFoundException: .\temp\folder (Accès refusé)
            at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
            at org.apache.axis.attachments.AttachmentsImpl.writeContentToStream(AttachmentsImpl.java:512)
            at org.apache.axis.Message.writeTo(Message.java:545)
            at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:511)
            at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
            at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
            at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
            at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
            at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
            at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
            at org.apache.axis.client.Call.invoke(Call.java:2767)
            at org.apache.axis.client.Call.invoke(Call.java:2443)
            at org.apache.axis.client.Call.invoke(Call.java:2366)
            at org.apache.axis.client.Call.invoke(Call.java:1812)
            at com.jaspersoft.jasperserver.irplugin.wsclient.RepositorySoapBindingStub.put(RepositorySoapBindingStub.java:202)
            at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.modifyReportUnitResource(WSClient.java:498)
            at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.addOrModifyResource(WSClient.java:442)
            at jaspermigration.Main.main(Main.java:89)
    Caused by: java.io.FileNotFoundException: .\temp\folder (Accès refusé)
            at java.io.FileInputStream.open(Native Method)
            at java.io.FileInputStream.<init>(FileInputStream.java:106)
            at javax.activation.FileDataSource.getInputStream(FileDataSource.java:82)
            at javax.activation.DataHandler.getInputStream(DataHandler.java:222)
            at org.apache.axis.attachments.DimeBodyPart.send(DimeBodyPart.java:323)
            at org.apache.axis.attachments.DimeBodyPart.write(DimeBodyPart.java:233)
            at org.apache.axis.attachments.DimeMultiPart.write(DimeMultiPart.java:46)
            at org.apache.axis.attachments.AttachmentsImpl.writeContentToStream(AttachmentsImpl.java:511)
            ... 16 more
    java.lang.Exception: 1 - Access is denied
            at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.modifyReportUnitResource(WSClient.java:502)
            at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.addOrModifyResource(WSClient.java:442)
            at jaspermigration.Main.main(Main.java:89)
    oups 2java.lang.Exception: 1 - Access is denied
    je ne sais pas pourquoi il me dit FileNotFoundException, j'ai la même erreur que j'utilise un dossier d'un autre repository ou un dossier dans mon système de fichier.
    des idées ?

  2. #2
    Membre régulier
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    158
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Mars 2008
    Messages : 158
    Points : 119
    Points
    119
    Par défaut
    C'est quoi ce paramètre "folder" que tu passe au addormodify ?


    moi je passe le ResouceDescriptor, et null.

  3. #3
    Membre habitué Avatar de anayathefirst
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    326
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Décembre 2006
    Messages : 326
    Points : 182
    Points
    182
    Par défaut
    En effet, il faut mettre null comme paramètre. folder représentait un dossier de mon système de fichier : je voulais créer un nouveau dossier contenant d'autres fichiers et dossiers, mais je viens de découvrir qu'on ne peut pas joindre des dossier, mais uniquement des fichier lors de la création de resources. en tout cas, c'est ce qu'ils disent sur le forum de jasperforge.org
    Merci pour ta réponse.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Gestion des dossiers sun solaris depuis Windows
    Par Thomf dans le forum Solaris
    Réponses: 2
    Dernier message: 10/11/2011, 14h16
  2. Réponses: 15
    Dernier message: 31/08/2008, 21h06
  3. Problème de gestion des dossier
    Par trecks dans le forum Code::Blocks
    Réponses: 1
    Dernier message: 23/11/2007, 08h43
  4. [Upload] Upload et gestion des dossier !
    Par phoeniix07 dans le forum Langage
    Réponses: 4
    Dernier message: 24/05/2006, 11h24

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo