10

Overview:

currently we have a web application with multiple module in it. We are using following technology stack

  1. JAX-WS
  2. Spring framework (except spring MVC)
  3. JSF
  4. Hibernate

Application Server: IBM Websphere 7.0 (Production), Apache Tomcat 7.0.X (Development) We are using JAX-WS annotations to mark a class as web service, beside this we don't use any JAXB annotation in Data Objects, we are leaving this task for ws runtime.

Problem statement:

Once we deploy application on Apache Tomcat, web service doesn't get published on AS. As a solution we need to add "org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter" property in spring context file and then web service starts working perfectly. But when we deploy the application on WAS, web service gets publish without setting fore mentioned property. When we make first request to web service it respond slowly, during R&D of this issue we found following things;

  1. IBM using AXIS2 Web service engine
  2. JAXB implementation load classes like className_used_in_web_service_method$JaxbAccessorM_getFieldName_setFieldName_java_util_Set from: <unknown> for all the classes in hierarchy. This only happen first time. We were trying to load these at application start-up time, but couldn't succeeded. Can anyone please help us to tackle this issue?
Community
  • 1
  • 1
kamigenius
  • 111
  • 1
  • 6

3 Answers3

0

try AxisServlet load-on-startup in web.xml

rykhan
  • 309
  • 4
  • 15
  • 3
    this is more a comment than an answer to the question. – slfan Jan 07 '13 at 07:43
  • 1
    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://stackoverflow.com/faq#reputation) you will be able to [comment on any post](http://stackoverflow.com/privileges/comment). – slfan Jan 07 '13 at 07:43
  • thanks slfan, it was infact a suggestion and question as well, but i didnot see any add comment option with post, so i added, but now i changed it, anyways thanks – rykhan Jan 19 '13 at 10:38
0

Did you try using SimpleHttpServerJaxWsServiceExporter instead of SimpleJaxWsServiceExporter?

It seems that SimpleHttpServerJaxWsServiceExporter startup the webservice as soon as endpoint configurantion is fulfilled.

Linus Caldwell
  • 10,908
  • 12
  • 46
  • 58
Eduardo Briguenti Vieira
  • 4,351
  • 3
  • 37
  • 49
0

You can create your own implementation of ServletContextListener

For example:

package kernel.flowcontrol;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class WsLifecycleListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {

    // some init work ...

    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {}
}

And add it into web.xml:

<listener>
    <listener-class>kernel.flowcontrol.WsLifecycleListener</listener-class>
</listener>
Oleg Poltoratskii
  • 667
  • 11
  • 10