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

Maven Java Discussion :

[Maven2] utilisation de jaxb (jwsdp)


Sujet :

Maven Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre chevronné Avatar de xixi31
    Inscrit en
    Juin 2005
    Messages
    423
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2005
    Messages : 423
    Par défaut [Maven2] utilisation de jaxb (jwsdp)
    Bonjour à tous,

    j'ai quelques problèmes d'utilisation de jaxb de sun avec maven.
    j'utilise netbeans 5.0. l'intégration du plugin maven s'est fait sans gros problème.
    J'utilisais jusqu'alors la version 1.0.5-b16-fcs de xjc via le script ant de mon projet.

    j'ai rajouté cette partie de code à mon pom :

    dans la partie <build> :
    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
     
                <plugin>
                    <groupId>com.sun.tools.xjc.maven2</groupId>
                    <artifactId>maven-jaxb-plugin</artifactId>
                    <version>1.0</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
    <generatePackage>org.siberia.xml.schema.properties</generatePackage>
                        <includeSchemas>
                            <includeSchema>**/Properties.xsd</includeSchema>
                        </includeSchemas>
                    </configuration>
                </plugin>
    La génération a été effectuée mais la version de xjc assez 'ancienne' ( pas de jaxb.properties etc.. ).

    J'ai alors essayé d'autre version tel que :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
                    <groupId>javax.xml</groupId>
                    <artifactId>jaxb-xjc</artifactId>
                    <version>2.0EA3</version>
     
                    <groupId>xfire</groupId>
                    <artifactId>jaxb-xjc</artifactId>
                    <version>1.0.5</version>
    Outre les problèmes de téléchargement de librairies à installer à la main, je n'arrive pas à installer une version compatible maven.
    en effet, lors de tentative de compilation, je me retrouve avec une erreurs assez obscures :
    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
     
    build:
    + Error stacktraces are turned on.
    [INFO] Scanning for projects...
    [INFO] ----------------------------------------------------------------------------
    [INFO] Building Siberia platform
    [INFO]    task-segment: [package]
    [INFO] ----------------------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [ERROR] FATAL ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] null
    [INFO] ------------------------------------------------------------------------
    [INFO] Trace
    java.lang.NullPointerException
            at org.apache.maven.plugin.DefaultPluginManager.addPlugin(DefaultPluginManager.java:292)
            at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:198)
            at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:163)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1252)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindPluginToLifecycle(DefaultLifecycleExecutor.java:1216)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycleMappings(DefaultLifecycleExecutor.java:982)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:453)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
            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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
            at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
            at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
            at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1 second
    [INFO] Finished at: Sat Jul 15 15:47:23 CEST 2006
    [INFO] Final Memory: 2M/6M
    [INFO] ------------------------------------------------------------------------
    Result: 1
    BUILD SUCCESSFUL (total time: 2 seconds)
    Voila, si quelqu'un utilisant jaxb sous maven pouvait m'aiguiller un peu sur la procédure à suivre??

    serait-il mieux que j'utilise jaxme d'apache??

    xi

  2. #2
    Membre Expert

    Profil pro
    Inscrit en
    Mai 2006
    Messages
    1 172
    Détails du profil
    Informations personnelles :
    Âge : 50
    Localisation : France, Yvelines (Île de France)

    Informations forums :
    Inscription : Mai 2006
    Messages : 1 172
    Par défaut
    As-tu essayé celui du projet mojo? http://mojo.codehaus.org/jaxb2-maven-plugin/

  3. #3
    Membre chevronné Avatar de xixi31
    Inscrit en
    Juin 2005
    Messages
    423
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2005
    Messages : 423
    Par défaut
    merci pour ta réponse, evenisse.

    la récupération de tout l'attirail jaxb semble correctement se dérouler et apparemment, pas besoin d'installer des plugin à la mano dans maven.
    de ce coté là, pas de problème... mais...

    je viens de faire quelques petits essais.

    voici l'appel que j'obtiens dans le pom.xml :

    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
     
     
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>jaxb2-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <goals>
                                <goal>xjc</goal>
                            </goals>
                        </execution>
                   </executions>
                   <configuration>
                        <verbose>true</verbose>
                        <packageName>org.siberia.xml.schema.properties</packageName>
                        <schemaFiles>Properties.xsd</schemaFiles>
                   </configuration>
               </plugin>
    le schéma que je référence ( Properties.xsd ) a été placé dans le répertoire src/main/xsd ( apparemment, la tâche le trouve bien ).

    j'arrive à l'erreur suivante :
    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
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    build:
    + Error stacktraces are turned on.
    [INFO] Scanning for projects...
    [INFO] ----------------------------------------------------------------------------
    [INFO] Building Siberia platform
    [INFO]    task-segment: [package]
    [INFO] ----------------------------------------------------------------------------
    Downloading: https://maven-repository.dev.java.net/nonav/repository/jpf/poms/jpf-tools-0.9.pom
    [WARNING] Unable to get resource from repository java.net (https://maven-repository.dev.java.net/nonav/repository)
    Downloading: http://www.ibiblio.org/maven2//jpf/poms/jpf-tools-0.9.pom
    [WARNING] Unable to get resource from repository ibiblio (http://www.ibiblio.org/maven2/)
    Downloading: http://repo1.maven.org/maven2/jpf/jpf-tools/0.9/jpf-tools-0.9.pom
    [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
    Downloading: https://maven-repository.dev.java.net/nonav/repository/jpf/poms/jpf-0.9.pom
    [WARNING] Unable to get resource from repository java.net (https://maven-repository.dev.java.net/nonav/repository)
    Downloading: http://www.ibiblio.org/maven2//jpf/poms/jpf-0.9.pom
    [WARNING] Unable to get resource from repository ibiblio (http://www.ibiblio.org/maven2/)
    Downloading: http://repo1.maven.org/maven2/jpf/jpf/0.9/jpf-0.9.pom
    [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
    [WARNING] While downloading bsh:bsh:2.0b4
      This artifact has been relocated to org.beanshell:bsh:2.0b4.
     
     
    Downloading: https://maven-repository.dev.java.net/nonav/repository/jpf/poms/jpf-boot-0.9.pom
    [WARNING] Unable to get resource from repository java.net (https://maven-repository.dev.java.net/nonav/repository)
    Downloading: http://www.ibiblio.org/maven2//jpf/poms/jpf-boot-0.9.pom
    [WARNING] Unable to get resource from repository ibiblio (http://www.ibiblio.org/maven2/)
    Downloading: http://repo1.maven.org/maven2/jpf/jpf-boot/0.9/jpf-boot-0.9.pom
    [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
    [INFO] [jaxb2:xjc {execution: default}]
    [INFO] Generating source...
    [INFO] parsing a schema...
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] null
     
    [INFO] ------------------------------------------------------------------------
    [INFO] Trace
    org.apache.maven.lifecycle.LifecycleExecutionException
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
            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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
            at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
            at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
            at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    Caused by: org.apache.maven.plugin.MojoExecutionException
            at org.codehaus.mojo.jaxb2.XjcMojo.execute(XjcMojo.java:269)
            at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
            ... 16 more
    Caused by: java.lang.NullPointerException
            at com.sun.xml.xsom.impl.parser.state.AttributesImpl.getIndex(AttributesImpl.java:204)
            at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.getAttributeIndex(NGCCRuntime.java:293)
            at com.sun.xml.xsom.impl.parser.state.Schema.enterElement(Schema.java:444)
            at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.startElement(NGCCRuntime.java:219)
            at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
            at com.sun.tools.xjc.reader.ExtensionBindingChecker.startElement(ExtensionBindingChecker.java:271)
            at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
            at com.sun.tools.xjc.reader.xmlschema.parser.IncorrectNamespaceURIChecker.startElement(IncorrectNamespaceURIChecker.java:97)
            at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
            at com.sun.tools.xjc.reader.xmlschema.parser.CustomizationContextChecker.startElement(CustomizationContextChecker.java:172)
            at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
            at com.sun.tools.xjc.ModelLoader$SpeculationChecker.startElement(ModelLoader.java:406)
            at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
            at com.sun.tools.xjc.reader.internalizer.VersionChecker.startElement(VersionChecker.java:78)
            at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
            at org.gjt.xpp.sax2.Driver.parseSubTree(Driver.java:362)
            at org.gjt.xpp.sax2.Driver.parse(Driver.java:310)
            at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
            at com.sun.xml.xsom.parser.JAXPParser.parse(JAXPParser.java:79)
            at com.sun.tools.xjc.ModelLoader$1.parse(ModelLoader.java:430)
            at com.sun.tools.xjc.ModelLoader$XMLSchemaParser.parse(ModelLoader.java:237)
            at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:254)
            at com.sun.xml.xsom.impl.parser.ParserContext.parse(ParserContext.java:118)
            at com.sun.xml.xsom.impl.parser.ParserContext.<init>(ParserContext.java:90)
            at com.sun.xml.xsom.parser.XSOMParser.<init>(XSOMParser.java:87)
            at com.sun.tools.xjc.ModelLoader.createXSOMParser(ModelLoader.java:388)
            at com.sun.tools.xjc.ModelLoader.createXSOMSpeculative(ModelLoader.java:443)
            at com.sun.tools.xjc.ModelLoader.loadXMLSchema(ModelLoader.java:333)
            at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:145)
            at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:91)
            at com.sun.tools.xjc.Driver.run(Driver.java:263)
            at org.codehaus.mojo.jaxb2.XjcMojo.execute(XjcMojo.java:240)
            ... 18 more
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 10 seconds
    [INFO] Finished at: Tue Jul 18 13:21:20 CEST 2006
    [INFO] Final Memory: 4M/8M
    [INFO] ------------------------------------------------------------------------
    Result: 1
    BUILD SUCCESSFUL (total time: 11 seconds)
    J'ai un sale doute .... comment se déroule l'appel au xjc ? faut-il que le jwsdp 2 soit installé ???!!!

  4. #4
    Membre Expert

    Profil pro
    Inscrit en
    Mai 2006
    Messages
    1 172
    Détails du profil
    Informations personnelles :
    Âge : 50
    Localisation : France, Yvelines (Île de France)

    Informations forums :
    Inscription : Mai 2006
    Messages : 1 172
    Par défaut
    Je suis désolé, mais je ne peux pas te répondre davantage. Le mieux serait d'envoyé un mail sur la mailing list du projet mojo

  5. #5
    Membre chevronné Avatar de xixi31
    Inscrit en
    Juin 2005
    Messages
    423
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2005
    Messages : 423
    Par défaut
    merci du coup de main evenisse

  6. #6
    Membre chevronné Avatar de xixi31
    Inscrit en
    Juin 2005
    Messages
    423
    Détails du profil
    Informations personnelles :
    Âge : 44

    Informations forums :
    Inscription : Juin 2005
    Messages : 423
    Par défaut
    effectivement, le plugin disponible sur : http://mojo.codehaus.org/jaxb2-maven-plugin/

    fonctionne correctement, merci.

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

Discussions similaires

  1. Utilisation de JAXB
    Par man84 dans le forum Eclipse Java
    Réponses: 1
    Dernier message: 13/05/2012, 12h46
  2. [Camel] Pb d'utilisation de JAXB avec Camel
    Par sekaijin dans le forum API standards et tierces
    Réponses: 0
    Dernier message: 21/10/2011, 17h05
  3. [CruiseControl] [maven2] utilisation de plugin propre au server d'intégration
    Par j0hnmerrick dans le forum Intégration Continue
    Réponses: 2
    Dernier message: 28/08/2008, 01h56
  4. [MAVEN2] utilisation build.xml par maven
    Par DanielW33 dans le forum Maven
    Réponses: 1
    Dernier message: 21/12/2006, 08h34
  5. utilisation de JAXB.
    Par LESOLEIL dans le forum Persistance des données
    Réponses: 1
    Dernier message: 23/03/2006, 12h30

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