Announcement Announcement Module
Collapse
No announcement yet.
problem with shared context and webApplicationcontext Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem with shared context and webApplicationcontext

    Hi I have this strange behavior.
    I'm using spring 1.2.9 in WAS 5.1 on windows.
    The application looks like this.
    An Ear called aocEar
    a jar file called aoc
    two war files called AOCWeb and AOC_JMX
    purpose of the war files are for AOCWeb to provide access to the application (aoc) for the users and for AOC_JMX to monitor and manage the application for the applicationprovider.

    What I've done is used a ContextSingletonBeanFactoryLocator for the Context in aoc so I've configured its use in AOCWeb and AOC_JMX using:

    Code:
    <context-param>
    		<param-name>locatorFactorySelector</param-name>
    		<param-value>classpath*:beanRefContext.xml</param-value>
    	</context-param>
    	<context-param>
    		<param-name>parentContextKey</param-name>
    		<param-value>ear.aoc</param-value>
    	</context-param>
    In AOCWeb I make use of HessianServiceExporter so I also have a aoc-servlet.xml
    Here I've configured the HessianServiceExporter which makes use of a service configured in the shared context.
    during statup of the container I got an IllegalArgumentException from the HessianServiceExporter stating that a Interface org.aoc.DataListener needs to be implemented by [email protected] of class org.aoc.DataListenerImpl.

    As far as I know this is the case. But as you know now my Web app is not correctly started.

    However when I remove the AOC_JMX war file from the EAR everything works.

    is this a bug or am I just missing something?

  • #2
    It's a classic classloading problem. Interface is loaded from one war, implementation from the other war, and they do not match. If there is only one war, both are loaded through one classloader so it works. To say how and why that happens you need to know exactly how that particular server version implements ear classloading.

    Comment


    • #3
      Ok,
      I get this.
      But why does only HessianExport a check for matching interfaces and classes.

      Comment


      • #4
        As I said, it very hard to say WHY it happens, it's sometimes not even deterministic in any obvious way. You may want to play with classloading options of your server, there should be quite a few. You could also try to separate common classes in a jar and deploy it in ear and not in wars.

        Comment

        Working...
        X