1 Reply Latest reply on May 11, 2003 10:54 AM by Steve Zheng

    Got a "loader constraints violated" exception,please help

    Steve Zheng Newbie


      I am going to migrate a web application running on WebSphere 4.0 to JBoss. This application includes two ear file. One is EJB tier, the other is web tier.
      In JBoss, I have to change Web tier ear file to war file since there is some classer loader issue. In the ejb.ear and web.war files, I specified the unique class loader for each of them.
      When the web tier call the Stateless session bean to do the authentication. I got such an error:

      com.dhltd.base.exception.BaseApplicationProcessingException: loader constraints violated when linking com/dhltd/base/cmd/ICarrier class

      The ICarrier class is a kind of data transfer object, it is included in both Web tier and EJB tier.

      Following is the source code Authentication EJB:

      public interface AuthenticationServiceSession extends javax.ejb.EJBObject {

      boolean authenticate(com.dhltd.base.cmd.ICarrier aCarrier) throws com.dhltd.base.security.AuthenticationException, java.rmi.RemoteException;

      com.dhltd.base.domain.user.User getUser(com.dhltd.base.cmd.ICarrier aCarrier) throws com.dhltd.base.security.AuthenticationException, java.rmi.RemoteException;

      I have to specified the unique class loader for each ear file, otherwise the application will get confused since some classes are included in both tiers.
      But when the client call the EJB, how can they tell which class should be used?