spring + axis, access to bean

Discussion in 'Java' started by rafalak, Oct 6, 2009.

  1. rafalak

    rafalak Guest

    hello !
    how i get access to bean from axis to spring context ?

    in WebService I use
    String[] configFiles = new String[] {"/WEB-INF/dispatcher-
    servlet.xml"};
    BeanFactory spring = new ClassPathXmlApplicationContext(configFiles);
    Object obj = spring.getBean("sessionFactory");

    but get FileNotFound Exception

    my appContext.xml
    ....
    <jaxws:endpoint id="helloWorld" implementor="test.ws.test" address="/
    x" />
    ....

    my web.xml
    <servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-
    class>org.springframework.web.servlet.DispatcherServlet</servlet-
    class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/appContext.xml</param-value>
    </context-param>
    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener>
    <servlet>
    <servlet-name>CXFServlet</servlet-name>
    <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</
    servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>*.html</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>CXFServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
    </servlet-mapping>
     
    rafalak, Oct 6, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    994
  2. Replies:
    0
    Views:
    452
  3. rmn190
    Replies:
    2
    Views:
    2,468
    Arne Vajhøj
    Jan 10, 2008
  4. Goldfish
    Replies:
    1
    Views:
    823
    Goldfish
    Nov 6, 2008
  5. pramodr
    Replies:
    1
    Views:
    2,172
    pramodr
    May 5, 2010
Loading...

Share This Page