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

Spring Java Discussion :

[Spring-Xfire-JSR181] No adapter for handler ?


Sujet :

Spring Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    35
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France, Bas Rhin (Alsace)

    Informations forums :
    Inscription : Avril 2007
    Messages : 35
    Par défaut [Spring-Xfire-JSR181] Web services ?
    Bonjour,

    Voila, après 3 jours à chercher sur la toile sans succès, je me tourne vers vous pour ce qui est je suppose un erreur bête de ma part (je débute avec ces 3 technologies...)

    Ma config : Spring - Xfire - Hibernate - Tomcat 5.5.23 - netbeans 5.5

    Voici la trace de mon tomcat :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    javax.servlet.ServletException: No adapter for handler [org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping@147e0ba]: Does your handler implement a supported interface like Controller?
    	org.springframework.web.servlet.DispatcherServlet.getHandlerAdapter(DispatcherServlet.java:1026)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:818)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:754)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:399)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:354)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    D'ou provient elle ? Aurais-je oublié ou mal configuré quelque chose ? Est ce un problème de version entre mon tomcat et les librairies que j'essaye d'utiliser ?

    Je débute avec spring et j'avoue que je galère un peu pour comprendre clairement comment manager les fichiers xml et leurs paramètres. J'essaye de m'inspirer des différents tutos que je trouve par ci par la, mais c'est pas évident quand on découvre à la fois spring, Xfire les annotations et hibernate.

    Voici mes fichiers de config (du moins ceux qui me semblent impliqués)

    web.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
    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
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
     
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>
                /META-INF/context.xml
                /WEB-INF/conf/spring/applicationContext*.xml;
                /WEB-INF/conf/spring/xfire-servlet.xml;
                classpath:org/codehaus/xfire/spring/xfire.xml
            </param-value> 
        </context-param>
     
     
        <listener>
            <listener-class>
                org.springframework.web.context.ContextLoaderServlet
            </listener-class>
        </listener>
     
     
     
        <servlet> 
            <servlet-name>XFireServlet</servlet-name> 
            <servlet-class> 
                org.springframework.web.servlet.DispatcherServlet
            </servlet-class>
            <init-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>/WEB-INF/conf/spring/xfire-servlet.xml</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
     
     
     
        <servlet-mapping>  
            <servlet-name>XFireServlet</servlet-name>  
            <url-pattern>/servlet/XFireServlet/*</url-pattern> 
        </servlet-mapping>
        
        <servlet-mapping> 
            <servlet-name>XFireServlet</servlet-name> 
            <url-pattern>/services/*</url-pattern> 
        </servlet-mapping>
        
        
        
        <resource-ref>
            <description>Database Connection Pool</description>
            <res-ref-name>jdbc/catalyseur</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
        </resource-ref>
    </web-app>
    xfire-servlet.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
    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
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
     
     
    <beans>
        <import resource="classpath:org/codehaus/xfire/spring/xfire.xml"/>
     
        <bean id="xfireServiceTemplate"
              class="org.codehaus.xfire.spring.remoting.XFireExporter"
              abstract="true">
            <property name="serviceFactory" ref="xfire.serviceFactory" />
            <property name="xfire" ref="xfire" />
            <property name="style" value="document" />
            <property name="use" value="literal" />
        </bean> 
     
     
        <bean id="jaxbTypeMappingRegistry" class="org.codehaus.xfire.jaxb2.JaxbTypeRegistry" 
              init-method="createDefaultMappings" singleton="true"/>
     
        <bean id="webAnnotations" 
              class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations"/>
     
        <bean id="handlerMapping" 
              class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping"> 
            <property name="typeMappingRegistry">
                <ref bean="xfire.typeMappingRegistry"/>
            </property>
            <property name="xfire">
                <ref bean="xfire"/>
            </property>
            <property name="webAnnotations">
                <ref bean="webAnnotations"/>
            </property>    
        </bean>
     
    <!--NOTE : l erreur semble provenir de cette déclaration de bean -->
        <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 
            <property name="urlMap"> 
                <map> 
                    <entry key="/"> 
                        <ref bean="handlerMapping"/> 
                    </entry> 
                </map> 
            </property> 
        </bean>
     
        <bean id="metalWebService" 
              class ="catalyseur.web.ws.impl.MetalWebServiceImpl"/>
    applicationContext.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
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
     
    <beans>
        - <bean id="metalManager" class="catalyseur.service.impl.MetalManagerImpl">
            - <property name="metalDAO">
                <ref bean="metalDAO" /> 
            </property>
        </bean>
     
        - <bean id="metalWebService" class="catalyseur.web.ws.impl.MetalWebServiceImpl">
            - <property name="metalManager">
                <ref bean="metalManager" /> 
            </property>
        </bean>
     
    </beans>
    J'espère que j'ai été assez clair dans ma question, parce que ca fait maintenant une bonne semaine que j'essaye de publier un webservice avec cette combinaison de technologies et... je me retiens de jeter le portable par la fenêtre

    Une idée ? Une solution ? Une piste de reflexion ?

    merci d'avance pour vos réponses

  2. #2
    Membre averti
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    35
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France, Bas Rhin (Alsace)

    Informations forums :
    Inscription : Avril 2007
    Messages : 35
    Par défaut
    Personne n'a la moindre idée ?

    J'ai pensé que cela provenait d'un problème avec la version de tomcat que j'utilisais ( pas compatible j2ee 5).

    J'ai donc transférer le tout sur un glassfish... et j'ai maintenant strictement le meme message d'erreur.

    Je suis vraiment au bout de mon latin la...

    pitié, une idée, une piste


    Edit :

    Après un test tout bete d'un hello world... j'obitens ceci en trace :

    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
    Exceptions details : java.lang.RuntimeException: Cannot find the correct port class.
     
    javax.servlet.ServletException: java.lang.RuntimeException: Cannot find the correct port class. at 
    com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.initializePort(WebServiceTesterServlet.java:546) at 
    com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.doGet(WebServiceTesterServlet.java:158) at 
    com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:104) at 
    com.sun.enterprise.webservice.JAXWSServlet.doGet(JAXWSServlet.java:233) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at 
    org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397) at 
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278) at 
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) at 
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536) at 
    org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240) at 
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179) at 
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) at 
    com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73) at 
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182) at 
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120) at
     org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137) at 
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) at 
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239) at 
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667) at 
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574) at 
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844) at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287) at 
    com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212) at 
    com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252) at 
    com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75) Caused by: java.lang.RuntimeException: Cannot find the correct port class. at com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.initializePort(WebServiceTesterServlet.java:533) ... 29 more
    Il me manque une librairie ? une idée d'ou ca peut provenir ?

  3. #3
    Membre éclairé Avatar de dgouyette
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    75
    Détails du profil
    Informations personnelles :
    Âge : 48
    Localisation : France

    Informations forums :
    Inscription : Mai 2004
    Messages : 75
    Par défaut
    Je te conseiller d'aller faire un tour sur cette page afin de réaliser tes premiers "tests MVC".

    http://www.springframework.org/docs/...p-by-step.html

    Ton controller doit implémenter une des classes AbstractController http://www.springframework.org/docs/...ontroller.html
    du style Controller, SimpleFormController...

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

Discussions similaires

  1. No adapter for endpoint sprnig ws
    Par slimak dans le forum Services Web
    Réponses: 2
    Dernier message: 29/03/2017, 17h58
  2. Hibernate - Spring - Jboss : closing a connection for you
    Par Fennec. dans le forum Hibernate
    Réponses: 1
    Dernier message: 02/12/2009, 21h29
  3. [Web Services] XFire et spring
    Par nawal_ensias dans le forum Spring
    Réponses: 2
    Dernier message: 07/10/2007, 20h39
  4. Réponses: 1
    Dernier message: 02/10/2007, 18h19
  5. Xfire spring et jsp
    Par nawal_ensias dans le forum Services Web
    Réponses: 3
    Dernier message: 25/12/2006, 12h19

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