4 Replies Latest reply on Dec 23, 2005 1:53 PM by xijia_chen

    violates loader constraints

    xijia_chen

      I am new in JBOSS. evaluating it. while I am developing/testing a prototype. I got the follwong error:
      {
      19:48:54,032 INFO [AFacadeSessionBean] AFacadeSessionBean.getTestTO() done, tto=userid=, pwd=,
      lastName=WebLogic Application Server fundamentals, firstName=, middleInitial=, contactInfoId=
      19:48:54,042 ERROR [[A Dispatcher]] Servlet.service() for servlet A Dispatcher threw exception
      java.lang.LinkageError: Class com/acom/app/common/bean/TestTO violates loader constraints

      }

      basically a sessionbean get data from db correctly and set it to a TO(transfer object) correctly, but somehow, whe a dispatcher servlet try to get the TO, jboss throw the above error....

      Could some JBOSS SR./expert give some help on this issue?
      Thank you in advance!
      FC.

        • 1. Re: violates loader constraints
          • 2. Re: violates loader constraints
            xijia_chen

            Thanks, Adrian.
            Sorry for posting the question to the wrong forum.
            New to the community also, learning...:).

            I will certainly ensure to post question to the rgith forum next time.

            FYI...
            I have identified the cause of the issue I posted and found a solution to it.

            Hope this post will close the topic in this forum(I know it is wrong forum for the topic....just try to close it.)

            • 3. Re: violates loader constraints
              sudhakaratbits

              We are facing similar kinda problem. Can you please post your solution?

              • 4. Re: violates loader constraints
                xijia_chen


                Basically, the error caused by unsafed java type if both of war and ejb-jar in your application try to access some "shared" java classes/objects, but the "shared" java classes are duplicated in war and ejb-jar.

                To fix the problem, you should try to reorganize the application structure and configuration file correctly, so that the shared java classes(by war and ejb-jar) have only one apperance in the application/file structure.

                There are two ways to fix the problem.
                1) you may put all files shared by war and ejb-jar to a libraby developed and built by yourself, say common.jar, and added the following to your jboss applicaiton.xml.

                common.jar


                OR,
                2) you may put the shared files in ejb-jar only, which can also be accessed by war.

                either of the above approach should work(I tested both of them, works well).

                Sorry for the late response. Was busy at a project work.

                Happy Christmas and New Year !

                Frank
                Sun Certified Enterrpised Architect
                xchen@xcresource.com

                12/23/2005