0 Replies Latest reply on Sep 23, 2010 11:46 AM by Matti Hansson

    Classloading trouble with EJB3 and EclipseLink

    Matti Hansson Newbie


      I'm working on a project that is using EclipseLink 2.1.1 for OR- and OX-mapping. When I try to deploy on JBoss 4.2.3.GA I get the following error:


      {code}java.lang.LinkageError: loader constraint violation: loader (instance of  org/jboss/web/tomcat/service/WebCtxLoader$ENCLoader) previously  initiated loading for a different type with name  "javax/persistence/LockModeType"{code}


      Turns out the EclipseLink jar, which is included in the project war file, has an enum javax.persistence.LockModeType, and another enum with the same name can be found in ejb3-persistence.jar in the JBoss' server lib. This is the jboss-web.xml:


      {code:xml}<?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 4.2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">



        <class-loading java2ClassLoadingCompliance="false">








      But it doesn't seem to do much good. Please help!