0 Replies Latest reply on Dec 7, 2005 2:00 AM by mroosendaal

    Classloader isolation with overriding does not work

      Hi,

      We have an application which uses Spring to expose a POJO as an MBean and that works fine. One method starts a new Thread in which a process is started were every now and than it looks in de Database using Hibernate. On the find method we get:
      at antlr.CharScanner.makeToken(CharScanner.java:175)
      at org.hibernate.hql.ast.HqlLexer.makeToken(HqlLexer.java:33)
      at org.hibernate.hql.antlr.HqlBaseLexer.mIDENT(HqlBaseLexer.java:632)
      ....

      This indicates that we have a Classloader problem. Our application works in a standalone environment and this problem only occurs when we use the MBean.

      I've tried isolation with overriding:
      <class-loading>
      <loader-repository>
      dot.com:loader=spg.war
      <loader-repository-config>java2ParentDelegaton=false</loader- repository-config>
      </loader-repository>
      </class-loading>

      It seems as if the call from the MBean uses a different Classloader when using antlr classes. The thing is that in a standalone env. (or when using the webapp) we do not provide the antlr.jar and there seems no need for it.

      So 3 questions:
      1. Why does the isolation not work?
      2. Why do we need the antlr.jar
      2. What is the main difference when starting a process from an MBean and starting the same process from our webapp or standalond env. in terms of Classloading.

      Hope someone can help.

      Thank,
      Maarten