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

Portails Java Discussion :

Probleme lors de la creation du war d'un portail avec Maven [JBoss Portal]


Sujet :

Portails Java

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Novembre 2009
    Messages
    41
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2009
    Messages : 41
    Points : 39
    Points
    39
    Par défaut Probleme lors de la creation du war d'un portail avec Maven
    Bonjour,

    J'ai l'architecture de code suivante (voir miniature) et donc utilise PortletConsommateur.java comme client général de n'importe quel service dans
    PortletServiceALaDemande.java .

    Seul PortletServiceALaDemande est extends de GenericPortlet

    Voici la fonction me permettant de consommer un service dans PortletConsommateur.java :

    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
    public String consommer(String endPoint_ , String endpointUrl, String service_ , String portName_, String cutPortName_,String action_, String[][] Action_param){
     
    		URL wsdlLocation = null;
    		try {
    			wsdlLocation = new URL(endPoint_); // cxf
    		} 
    		catch (MalformedURLException e) {
    			e.printStackTrace();
    		}
     
    		QName serviceName = new QName(portName_, service_);
    		QName portName = new QName(portName_, service_+"Port");
    		Service service = Service.create(serviceName);
    		service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, endpointUrl);
     
     
    		/** Create a Dispatch instance from a service.**/
     
    		Dispatch<SOAPMessage> dispatch = service.createDispatch(portName,
    		SOAPMessage.class, Service.Mode.MESSAGE);
    		/** Create SOAPMessage request. **/
     
    		// compose a request message
     
    		MessageFactory mf;
    		try {
    		     mf = MessageFactory.newInstance();
    		     // Create a message.  This example works with the SOAPPART.
     
    			SOAPMessage request = mf.createMessage();
    			SOAPPart part = request.getSOAPPart();
    			// Obtain the SOAPEnvelope and header and body elements.
     
    			SOAPEnvelope env = part.getEnvelope();
     
    			SOAPHeader header = env.getHeader();
    			//env.setAttribute("xmlns:cal", "http://calcul/");      
    			SOAPBody body = env.getBody();
     
    			QName ns = new QName(portName_, action_, cutPortName_);
    			SOAPBodyElement el = body.addBodyElement(ns);
    			SOAPElement message;
     
    			for(int i=0;i<Action_param.length;i++){
     
    					message = el.addChildElement(Action_param[i][0]);
    					message.addTextNode(Action_param[i][1]);
    			}
     
    //			SOAPElement param =  body.addChildElement("AnalysisRequest", "cal","http://calcul/");
    //			
    //			SOAPElement idrequestnode = param.addChildElement("idRequest", "cal","http://calcul/");
     
    			request.saveChanges();
     
    			/** Invoke the service endpoint. **/
     
    			SOAPMessage response = dispatch.invoke(request);
    			String idrequest = response.getSOAPPart().getEnvelope().getBody().getFirstChild().getTextContent();
    			System.out.println("Response: "+idrequest);
     
    			return idrequest;
    			}
    			catch (Exception ex) {
    				ex.printStackTrace();
     
    			}
    		return "";
     
     
     
     
    	}
    Et lorsque je veux transformer tous ce beau petit monde en war,
    Maven me met cette erreur bizarre en m'indiquant que c'est la fonction précédemment montrée qui coince :

    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
     
    D:\Projets\Application\Servlet_Portail_Portlet_Service\Debut_Portail>mvn package
     
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Building
    [INFO]    task-segment: [package]
    [INFO] ------------------------------------------------------------------------
    [INFO] [resources:resources]
    [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
    i.e. build is platform dependent!
    [INFO] Copying 0 resource
    [INFO] [compiler:compile]
    [INFO] Compiling 6 source files to D:\Projets\Application\Servlet_Portail_Portle
    t_Service\Debut_Portail\target\classes
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Compilation failure
    D:\Projets\Application\Servlet_Portail_Portlet_Service\Debut_Portail\src\main\ja
    va\org\jboss\portal\portlet\services\PortletConsommateur.java:[40,10] generics a
    re not supported in -source 1.3
    (use -source 5 or higher to enable generics)
                    Dispatch<SOAPMessage> dispatch = service.createDispatch(portName
    ,
     
     
     
    D:\Projets\Application\Servlet_Portail_Portlet_Service\Debut_Portail\src\main\ja
    va\org\jboss\portal\portlet\services\PortletConsommateur.java:[40,10] generics a
    re not supported in -source 1.3
    (use -source 5 or higher to enable generics)
                    Dispatch<SOAPMessage> dispatch = service.createDispatch(portName
    ,
     
     
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3 seconds
    [INFO] Finished at: Mon Nov 16 16:45:56 CET 2009
    [INFO] Final Memory: 7M/13M
    [INFO] ------------------------------------------------------------------------
    Voilà,
    Je suis ouvert à toute demande de détail et question; et évidemment réponse ^^

    Merci d'avance.
    Mageni
    Images attachées Images attachées  

  2. #2
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Novembre 2009
    Messages
    41
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2009
    Messages : 41
    Points : 39
    Points
    39
    Par défaut
    J'ai trouvé la réponse ici :

    http://www.developpez.net/forums/d65...ion-jdk-1-5-a/

    Mais dans le pom.xml j'ai ajouté :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
         <build>
    	<plugins>
            	<plugin>
                 	     <groupId>org.apache.maven.plugins</groupId>
                 	     <artifactId>maven-compiler-plugin</artifactId>
                 	     <configuration>
                        	     <source>1.6</source>
                    	     <target>1.6</target>
                	      </configuration>
            	</plugin>
        	</plugins>
        </build>

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

Discussions similaires

  1. Réponses: 9
    Dernier message: 01/02/2012, 17h30
  2. [VBA-E]probleme lors de la creation de feuille
    Par lcoder dans le forum Macros et VBA Excel
    Réponses: 9
    Dernier message: 15/06/2006, 19h51
  3. Réponses: 2
    Dernier message: 21/04/2006, 15h08
  4. probleme lors de la creation de table
    Par perlgirl dans le forum Requêtes
    Réponses: 2
    Dernier message: 17/11/2005, 09h43
  5. probleme lors de la creation du device
    Par 180degrés dans le forum DirectX
    Réponses: 5
    Dernier message: 18/08/2005, 17h26

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