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

Java Discussion :

exceptions de java web start


Sujet :

Java

  1. #1
    Nouveau membre du Club
    Inscrit en
    Mars 2008
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 64
    Points : 28
    Points
    28
    Par défaut exceptions de java web start
    je veux déployer une application en utilisant le java web start mais quand je veux lancer mon programme via une page web j'aurai les exceptions suivantes:
    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
     
    com.sun.deploy.net.FailedDownloadException: Impossible de charger la ressource : <a href="http://localhost:8080/starjavapos.jnlp" target="_blank">http://localhost:8080/starjavapos.jnlp</a>
    	at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
    	at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
    	at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
    	at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
    	at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
    	at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
    	at com.sun.javaws.Launcher.updateFinalLaunchDesc(Unknown Source)
    	at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
    	at com.sun.javaws.Launcher.launch(Unknown Source)
    	at com.sun.javaws.Main.launchApp(Unknown Source)
    	at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    	at com.sun.javaws.Main$1.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    voici mon fichier .jnlp:
    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
     
    <?xml version="1.0" encoding="UTF-8"?>
     
    <jnlp spec="1.0+" codebase="http://localhost:8080" href="starjavapos.jnlp">
    <!-- jnlp tag comment : change the codebase attribute to point to your server and the href attribute to point to your jnlp file -->
     
        <information>
        <!-- information tag comment - change the below information to describe your application, anything is OK -->
     
            <title>StarJavaPOS</title>
            <vendor>Star Micronics</vendor>
            <homepage href="starjavapos-jnlp.html"/>
            <description>StarJavaPOS - Java Web Start Example</description>
            <description kind="short">StarJavaPOS-JWS</description>
     
            <offline-allowed/>
            <!-- offline tag comment : if this tag is present then this application is allowed to be executed from the local cache without an internet connection -->
     
        </information>
     
        <security>
        <!-- security tag comment : this tag is required because StarJavaPOS needs communications port access  -->
     
            <all-permissions/>
        </security>
     
        <resources>
            <!-- resources tag comment : list all JAR files required for your application here (the ones listed below are required for StarJavaPOS) -->
     
            <j2se version="1.4+"/>
            <!--j2se tag comment : specify the J2SE version required for your application -->
     
            <jar href="javapos-registry_signed.jar"/>
    		<jar href="jcl_signed.jar"/>
    		<jar href="jpos17-controls_signed.jar"/>
    		<jar href="jpos1122_signed.jar"/>
    		<jar href="jpos1122-controls_signed.jar"/>
    		<jar href="jpos_signed.jar"/>
    		<jar href="POSPrinterService_signed.jar"/>
    		<jar href="starjavapos_signed.jar"/>    
            <jar href="xercesimpl_signed.jar"/>
            <jar href="xml-apis_signed.jar"/>
     
     
     
     
     
        </resources>
     
        <resources os="Windows">
        <!-- resources tag comment : this tag specifies those additional JAR files required when this application is run on a Windows computer (primarily DLLs) -->
     
            <nativelib href="star-windows-libs_signed"/>
        </resources>
     
        <resources os="Linux" arch="i386">
        <!-- resources tag comment : this tag specifies those additional JAR files required when this application is run on a Linux computer (primarily SOs) -->
     
            <nativelib href="star-linux-libs_signed"/>
        </resources>
     
        <resources os="Mac OS X" arch="ppc">
        <!-- resources tag comment : this tag specifies those additional JAR files required when this application is run on a Mac computer (primarily JNILIBs) -->
     
            <nativelib href="star-mac-libs_signed"/>
        </resources>
     
        <application-desc main-class="fr.application.impression.jpos.StarReceiptTest"/>
        <!-- application desc tag comment : this tag specifies the package and class name of your application's Main Class  -->
     
    </jnlp>
    merci pour votre aide

  2. #2
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    La page "http://localhost:8080/starjavapos.jnlp" n'existe pas. Tu n'aurais pas fait un faute de frappe dans le nom de fichier?

  3. #3
    Nouveau membre du Club
    Inscrit en
    Mars 2008
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 64
    Points : 28
    Points
    28
    Par défaut exception de java web start
    si le chemin du fichier .jnlp est correct

  4. #4
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    Quand tu clique sur le lien dance forum, ca fonctionne? http://localhost:8080/starjavapos.jnlp

    En général mettre 'localhost' dans le codebase est une mauvaise idée, tes clients auraont du mal à ce connecter avec cette adresse. Met plutot au minimum l'ip/le nom de la machine concernée.

  5. #5
    Nouveau membre du Club
    Inscrit en
    Mars 2008
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 64
    Points : 28
    Points
    28
    Par défaut
    vous avez raison le lien ça marche pas j'ai corrigé le chemin dans le fichier .jnlp comme suit :
    <jnlp spec="1.0+" codebase="http://localhost:8080/jpos_signed" href="starjavapos.jnlp"> et voici l'erreur que j'ai maintenant : impossible de vérifier la signature dans la ressource //localhost:8080/jpos_signed/javapos-registry_signed

  6. #6
    Nouveau membre du Club
    Inscrit en
    Mars 2008
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 64
    Points : 28
    Points
    28
    Par défaut
    en fait j'ai intéret à signer mes fichiers jars parce que l'application accède à des ressources(ports de communication..) mais je suis pas sûr que la signature a été correctement faite

  7. #7
    Nouveau membre du Club
    Inscrit en
    Mars 2008
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 64
    Points : 28
    Points
    28
    Par défaut
    voici un exemple de signature du fichier jcl.jar:
    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
     
    C:\jarjar>keytool -genkey -keystore jcl_signed -alias jcl.jar
    Tapez le mot de passe du Keystore :
    Ressaisissez le nouveau mot de passe :
    Quels sont vos prÚnom et nom ?
      [Unknown] :  rizki rizki
    Quel est le nom de votre unitÚ organisationnelle ?
      [Unknown] :  rizki
    Quelle est le nom de votre organisation ?
      [Unknown] :  rizki
    Quel est le nom de votre ville de rÚsidence ?
      [Unknown] :  rizki
    Quel est le nom de votre Útat ou province ?
      [Unknown] :  maroc
    Quel est le code de pays Ó deux lettres pour cette unitÚ ?
      [Unknown] :  ma
    Est-ce CN=rizki rizki, OU=rizki, O=rizki, L=rizki, ST=maroc, C=ma ?
      [non] :  oui
     
    SpÚcifiez le mot de passe de la clÚ pour <jcl.jar>
            (appuyez sur EntrÚe s'il s'agit du mot de passe du Keystore) :
     
    C:\jarjar>keytool -selfcert -alias jcl.jar -keystore jcl_signed
    Tapez le mot de passe du Keystore :
     
    C:\jarjar>keytool -list -keystore jcl_signed
    Tapez le mot de passe du Keystore :
     
    Type Keystore : JKS
    Fournisseur Keystore : SUN
     
    Votre Keystore contient 1 entrÚe(s)
     
    jcl.jar, 8 ao¹t 2009, PrivateKeyEntry,
    Empreinte du certificat (MD5) : 69:90:2A:14:C7:B8:2F:EB:90:A8:EA:82:43:0A:02:B4

  8. #8
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    Le keystore sert uniquement à stocker des certificats. Pour signer des jar il faut utiliser jarsigner.

  9. #9
    Nouveau membre du Club
    Inscrit en
    Mars 2008
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 64
    Points : 28
    Points
    28
    Par défaut
    j'ai trouvé cela sur le net merci de me vérifier la syntaxe

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    keytool -genkey -alias jcl_signature -keystore monStore
     
    jarsigner -keystore monStore -signedjar jcl_signed.jar Jcl.jar jcl_signature

  10. #10
    Nouveau membre du Club
    Inscrit en
    Mars 2008
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 64
    Points : 28
    Points
    28
    Par défaut
    j'ai signé les fichiers .jar et j'arrive à lancer Jws mais il y a une erreur :
    impossible de trouver la classe principale com.starmicronis.javapos.POSPrinterExerciser dans http://localhost:8080/projet/jpos-registry_signed.jar sachant que c la même class main dans mon fichier .jnlp merci bcp pour votre aide

  11. #11
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    on peux voir ton jnlp actuel? ainsi que la sortie de la commande
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    jar tf jpos-registry_signed.jar

  12. #12
    Nouveau membre du Club
    Inscrit en
    Mars 2008
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 64
    Points : 28
    Points
    28
    Par défaut
    comment ajouter ma class main dans mon fichier .xml de configuration associé au fichier javapos-registry_signed.jar?
    merci pour votre aide

  13. #13
    Nouveau membre du Club
    Inscrit en
    Mars 2008
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 64
    Points : 28
    Points
    28
    Par défaut
    voici mon fichier .jnlp actuel:
    Code xml : 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
    <?xml version="1.0" encoding="UTF-8"?>
     
    <jnlp spec="1.0+" codebase="http://localhost:8080/projet" href="starjavapos.jnlp">
    <!-- jnlp tag comment : change the codebase attribute to point to your server and the href attribute to point to your jnlp file -->
     
        <information>
        <!-- information tag comment - change the below information to describe your application, anything is OK -->
     
            <title>StarJavaPOS</title>
            <vendor>Star Micronics</vendor>
            <homepage href="starjavapos-jnlp.html"/>
            <description>StarJavaPOS - Java Web Start Example</description>
            <description kind="short">StarJavaPOS-JWS</description>
     
            <offline-allowed/>
            <!-- offline tag comment : if this tag is present then this application is allowed to be executed from the local cache without an internet connection -->
     
        </information>
     
        <security>
        <!-- security tag comment : this tag is required because StarJavaPOS needs communications port access  -->
     
            <all-permissions/>
        </security>
     
        <resources>
            <!-- resources tag comment : list all JAR files required for your application here (the ones listed below are required for StarJavaPOS) -->
     
            <j2se version="1.4+"/>
            <!--j2se tag comment : specify the J2SE version required for your application -->
     
            <jar href="javapos-registry_signed.jar"/>
    		<jar href="jcl_signed.jar"/>
    		<jar href="jpos17-controls_signed.jar"/>
    		<jar href="jpos1122_signed.jar"/>
    		<jar href="jpos1122-controls_signed.jar"/>
    		<jar href="jpos_signed.jar"/>
    		<jar href="POSPrinterService_signed.jar"/>
    		<jar href="starjavapos_signed.jar"/>
            <jar href="xercesImpl-2.7.1_signed.jar"/>     
            <jar href="xercesimpl_signed.jar"/>
            <jar href="xml-apis_signed.jar"/>
        </resources>
     
        <resources os="Windows">
        <!-- resources tag comment : this tag specifies those additional JAR files required when this application is run on a Windows computer (primarily DLLs) -->
     
            <nativelib href="star-windows-libs_signed.jar"/>
        </resources>
     
        <resources os="Linux" arch="i386">
        <!-- resources tag comment : this tag specifies those additional JAR files required when this application is run on a Linux computer (primarily SOs) -->
     
            <nativelib href="star-linux-libs_signed.jar"/>
        </resources>
     
        <resources os="Mac OS X" arch="ppc">
        <!-- resources tag comment : this tag specifies those additional JAR files required when this application is run on a Mac computer (primarily JNILIBs) -->
     
            <nativelib href="star-mac-libs_signed.jar"/>
        </resources>
     
        <application-desc main-class="fr.application.impression.jpos.StarReceiptTest"/>
        <!-- application desc tag comment : this tag specifies the package and class name of your application's Main Class  -->
     
    </jnlp>
    pour la sortie de la commande voici le resultat:

    META-INF/MANIFEST.MF
    META-INF/SIGNATUR.SF
    META-INF/SIGNATUR.DSA
    META-INF/
    jpos.xml

  14. #14
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    tu peux faire le même avec le jar censé contenir ton main? Je pensais que c'était celui là :p

    Edit: Est-ce normal que tu parle de com.starmicronis.javapos.POSPrinterExerciser alors que ton jnlp mentionne fr.application.impression.jpos.StarReceiptTest?

  15. #15
    Nouveau membre du Club
    Inscrit en
    Mars 2008
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 64
    Points : 28
    Points
    28
    Par défaut
    comment ajouter ma class main dans mon fichier .xml de configuration associé au fichier javapos-registry_signed.jar?
    merci pour votre aide

  16. #16
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 804
    Points
    48 804
    Par défaut
    j'ai pas trop compris ta question là. Ta classe main, t l'a déjà définie dans le jnlp. Maintenant, il faut que toutes tes classes soient présentes dans tes jar, sinon java webstart il aura un peu du mal à fonctionner si il manque des classes. Ton main que tu référence dans ton jnlp, tu l'a mis dans quel jar?

  17. #17
    Nouveau membre du Club
    Inscrit en
    Mars 2008
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 64
    Points : 28
    Points
    28
    Par défaut
    désolé je vous ai montré la 1ère version de mon fichier.jnlp dans lequel la classe main est:fr.application.impression.jpos.StarReceiptTest mais la dernière version diffère seulement au niveau de la classe main "com.starmicronis.javapos.POSPrinterExerciser "même si ma classe main est "fr.application.impression.jpos.StarReceiptTest "

    voici la sortie de commande jar tf sur mon fichier d'application
    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
    C:\Documents and Settings\amine\Bureau\jpos-registry sans modifier .xml>cd C:\P
    ogram Files\Apache Software Foundation\Tomcat 5.5\webapps\projet
     
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\projet>jar tf jp
    s_signed.jar
    META-INF/MANIFEST.MF
    META-INF/SIGNATUR.SF
    META-INF/SIGNATUR.DSA
    fr/application/impression/jpos/StarReceiptTest.class
    fr/application/impression/jpos/StarCashDrawerTest.class
    fr/application/impression/jpos/PINPadRead.class
    fr/application/impression/jpos/StarDirectIOTest.class
    fr/application/impression/jpos/ClientSocketTest.class
    fr/application/impression/jpos/SimpleAppLauncher$1.class
    fr/application/impression/jpos/SimpleAppLauncher.class
    fr/application/impression/jpos/POSPrinterService.class
    fr/application/impression/jpos/DebugFrame.class
    fr/application/impression/jpos/SimplePOSPrinterApp.class
    fr/application/impression/jpos/jpos.xml
    .classpath
    .project
    RXTXcomm.jar
    build/classes/.netbeans_automatic_build
    build/classes/fr/application/impression/jpos/ClientSocketTest.class
    build/classes/fr/application/impression/jpos/DebugFrame.class
    build/classes/fr/application/impression/jpos/PINPadRead.class
    build/classes/fr/application/impression/jpos/POSPrinterService.class
    build/classes/fr/application/impression/jpos/SimpleAppLauncher$1.class
    build/classes/fr/application/impression/jpos/SimpleAppLauncher.class
    build/classes/fr/application/impression/jpos/SimplePOSPrinterApp.class
    build/classes/fr/application/impression/jpos/StarCashDrawerTest.class
    build/classes/fr/application/impression/jpos/StarDirectIOTest.class
    build/classes/fr/application/impression/jpos/StarReceiptTest.class
    build.xml
    comm.jar
    javapos-registry.jar
    jpos.xml
    jpos1122-controls.jar
    jpos1122.jar
    jpos17-controls.jar
    jps.jar
    nbproject/build-impl.xml
    nbproject/genfiles.properties
    nbproject/private/private.properties
    nbproject/project.properties
    nbproject/project.xml
    star-linux-libs.jar
    star-mac-libs.jar
    star-windows-libs.jar
    star.gif
    starjavapos.jar
    starjavapos.jnlp
    merci bcp pour votre aide

  18. #18
    Nouveau membre du Club
    Inscrit en
    Mars 2008
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 64
    Points : 28
    Points
    28
    Par défaut
    bonjour, ça marche bien maintenant le problème c'était dans la déclaration des fichiers .jar je devais seulement déclarer le fichier jpos_signed.jar contenant ma classe main au début merci beaucoup pour votre aide

Discussions similaires

  1. exception lors du lancement avec java web start
    Par isoman dans le forum Glassfish et Payara
    Réponses: 7
    Dernier message: 18/05/2009, 23h01
  2. Exception sur Java Web Start
    Par Le Bressan dans le forum JWS
    Réponses: 5
    Dernier message: 01/02/2005, 10h52
  3. [Info]Développement Java Web Start
    Par szdavid dans le forum Interfaces Graphiques en Java
    Réponses: 5
    Dernier message: 26/01/2005, 16h59
  4. java web start qui veut pas se lancer
    Par calvin dans le forum JWS
    Réponses: 4
    Dernier message: 30/06/2004, 11h42
  5. [JNDI] Equivalent avec Java Web Start ?
    Par cameleon2002 dans le forum Java EE
    Réponses: 8
    Dernier message: 18/09/2003, 18h55

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