1 Reply Latest reply on Aug 20, 2004 4:38 AM by idriss abdou

    Beginner trying to understand the classloader system: please

    albert_steed Newbie

      Hello,
      Here is the problem: I am calling a method from a jsp as follows:

      <%
      com.mycompany.MyClass mc = new com.mycompany.MyClass();
      mc.print();
      %>
      


      1. First I tried dropping the jar into the %jboss_home%\lib directory and I get a package does not exist error. Why?
      2. Second I tried dropping the jar into the %jboss_home%\server\default\deploy\tomcat\jbossweb-tomcat50.sar\mywar.war(1)
      as well as in %jboss_home%\default\server\lib (2) and it appears to pick up the one in the (2) directory first. Is this normal behavior?
      Thanks in advance,
      Albert.
      FYI I use 4.0.0RC1

        • 1. Re: Beginner trying to understand the classloader system: pl
          idriss abdou Newbie

           

          "albert_steed" wrote:

          1. First I tried dropping the jar into the %jboss_home%\lib directory and
          I get a package does not exist error. Why?


          this directory is only for the jboss specific jar, you don't have to put any of your lib in this directory.

          "albert_steed" wrote:

          2. Second I tried dropping the jar into the %jboss_home%\server\default\deploy\tomcat\jbossweb-tomcat50.sar\mywar.war(1)
          as well as in %jboss_home%\default\server\lib (2) and it appears to pick up the one in the (2) directory first. Is this normal behavior?
          FYI I use 4.0.0RC1


          yes.
          Tomcat is deployed as a service in jboss, you don't have to put anything in the tomcat sar.
          All your jsp have to be put in a war.
          The lib directory from the server configuration you are runing is made for your application lib to be put. JBoss take into account all jar placed here at the start.

          If you want to have many application which will function with different version of a lib, you can put your jar in a lib directory in your jar, war or whathever. In this case you need to write a manifest.mf in your WEB-INF, META-INF to linjk to the jar you want to use.

          I have some problem with my english, so i hope i have been clear enough.