2010-11-03 7 views
0

J'essaie de mettre en œuvre un service web dans une application de ressort autonome existante.Webservice cxf en application de ressort autonome

configuré à ressort:

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:jaxws="http://cxf.apache.org/jaxws" 
     xmlns:util="http://www.springframework.org/schema/util" 
     xsi:schemaLocation=" 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd 
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 


    <import resource="classpath:beans/webservice.xml" /> 

....

webservice.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:jaxws="http://cxf.apache.org/jaxws" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
         http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 


<bean id="CheckService" class="test.ws.CheckService"> 
</bean> 

<jaxws:endpoint 
    id="checkService" 
    implementor="#CheckService" 
    address="http://localhost:9000/CheckService" /> 

J'ai fait la configuration selon la documentation officielle et des échantillons de livres . Je me exception:

03/11/2010 09:34:12 WARN Ignored XML validation warning 
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://cxf.apache.org/schemas/jaxws.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. 
     at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) 
     at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown Source) 

...

http://cxf.apache.org/schemas/jaxws.xsd est accessible à partir du navigateur et je pense qu'il est bien formé (xsd officiel).

Je suppose que le problème n'est pas lié à la configuration de cxf plutôt qu'à la configuration de swing.

Merci,

Hubidubi

+0

Peut-être un problème dans votre cache IDE. Exécutez-vous cela à partir d'un IDE? (Et si oui: Lequel?) – Tim

+0

Je l'exécute à partir d'Eclipse et de le construire avec maven – Hubidubi

Répondre

0

Cela signifie qu'il ne peut pas accéder à l'URL lorsque vous l'exécutez. Cela nous arrive quand nous commençons notre application Struts/tiles sans connexion internet en premier. Ce que vous pouvez faire comme alternative est de télécharger le fichier xsd et de le placer quelque part où vous pouvez le lire.

et remplacer http://cxf.apache.org/schemas/jaxws.xsd avec /path/to/file/jaxws.xsd

0

pourrait-il que vous êtes dans un environnement où vous devez configurer un proxy pour accéder au Web? Vous avez défini le proxy dans votre navigateur et pouvez donc accéder au fichier .xsd via le navigateur.

Vous devez configurer votre IDE de manière appropriée ou définir un proxy à l'échelle du système. J'espère avoir deviné: p

0

Enfin, j'ai trouvé la résolution. J'ai dû ajouter des dépendances appropriées à maven pom.xml.

+0

quelles sont les dépendances appropriées? @ Hubidubi – mel3kings

+0

Gee, je ne sais pas. C'était il y a trois ans. :( – Hubidubi

0
<dependency> 
     <groupId>joda-time</groupId> 
     <artifactId>joda-time</artifactId> 
     <version>2.2</version> 
    </dependency> 

pour moi fonctionne w/this.

0

L'effacement des fichiers du cache Eclipse a résolu ce problème pour moi.

Dans les préférences Eclipse, je suis allé à Général> Connexions réseau> Cache et supprimé les fichiers cxf à l'origine du problème. L'erreur est partie la prochaine fois que j'ai validé le fichier.

Questions connexes