0 Replies Latest reply on May 11, 2012 3:43 AM by damienp

    JBossws-cxf with spring : JNDI lookup

    damienp

      Hi,

       

      I'm trying to deploy a web services web application using jbossws-cxf and Spring managed beans. To do that, I've installed the Spring module using snowdrop, in order to bind my web services implementor to Spring managed beans.

       

      The jboss-cxf.xml :

       

      {code}

      <import resource="classpath:prevoyance-wsfront.xml" />

      ...

      <jaxws:endpoint id="ispAccesEndPoint" implementor="#oteli" address="/prevoyance">

           <jaxws:invoker>

                          <bean class='org.jboss.wsf.stack.cxf.InvokerJSE' />

              </jaxws:invoker>

      </jaxws:endpoint>

      {code}

       

      The implementor bean is defined in prevoyance-wsfront.xml and is rightly injected by Spring. So all things work fine ; except that I need for some beans to retrieve values from JNDI lookup.

       

      In web.xml, I define an env-entry :

       

      {code}

                <env-entry>

                          <env-entry-name>sourceoWsdlUrl</env-entry-name>

                          <env-entry-type>java.lang.String</env-entry-type>

                          <env-entry-value>http://...</env-entry-value>

                 </env-entry>

      {code}

       

      And in prevoyance-wsfront.xml, I want to retrieve the associated value via a JNDI lookup :

       

      {code}

                     <bean id="invokerTarget" class="Invoker">

                          <constructor-arg>

                                    <bean id="wsdlUrl" class="org.springframework.jndi.JndiObjectFactoryBean">

                                              <property name="jndiName" value="java:comp/env/sourceoWsdlUrl" />

                                    </bean>

                          </constructor-arg>

                     </bean>

      {code}

       

      But Spring is not able to find this entry :

       

      {code}

      nested exception is javax.naming.NameNotFoundException: java:comp/env/sourceoWsdlUrl

      {code}

       

      I think that when JBossws instantiate the web services, using Spring, the web.xml hasn't been parsed so JNDI entries don't exist. And i'm looking for another way to define such entries, or a manier to parse the web.xml before JBossws instantiate web services implementors.

       

      Thank you.