1 Reply Latest reply on Apr 1, 2008 1:14 AM by zach.mabe

    Overriding InvocationHandlerFactory

    zach.mabe

      Particulars: Jboss AS 4.2.2.GA, JBossWS native 2.0.3.GA with JSE endpoints.


      I am trying to implement my own InvocationHandlerFactory so that I can implement my own InvocationHandler instead of the DefaultInvocationHandlerJAXWS.

      To do so, I've created my implementations of the factory and the handler. These classes are in WEB-INF/classes directory of the WAR file.

      In the base dir of the WAR. I've created the file

      META-INF\services\org.jboss.wsf.spi.invocation.InvocationHandlerFactory

      with the name of my factory class as the only line.

      I also have this same file in the classes directory of the WEB-INF directory so its path looks like
      WEB-INF/classes/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory



      Regardless, the ServiceLoader keeps finding service file in jboss-4.2.2.GA-Cox-AS/server/default/lib/jbossws-jboss42.jar.

      So the question is...am I supposed to be able to override that service definition? If so, can I configure the classloader to find the service file in my war before looking in the lib directory without screwing stuff up?

      Thanks
      Zach





        • 1. Re: Overriding InvocationHandlerFactory
          zach.mabe

          Hoping I can entice some feedback with some more information.

          I have created my handlers/factory and have successfully deployed them by placing them in a jar along with the meta-inf/services file in the server's lib directory (server/default/lib). As long as my jar is alphabetically less than the jbossws-jboss42.jar, it works. However, that strikes me as an odd requirement (the naming issue)

          Placing it in jboss_home lib or lib.endorsed results a lot of NoClassDefFound Exceptions. So the server/default/lib seems to be the only the way to force the override.

          What I am trying to accomplish with this new handler/factory is the ability to (optionally) use spring managed beans for service impls. Everything is working fine, better than fine because Spring lets my JSE endpoints use resource and persistencecontext annotations without my own interceptors. I'm just having a hard time selling concept of putting a jar named 1_myhandlers.jar (or something like that) in the server lib dir. Is there a better way?

          Thanks
          Zach