2 Replies Latest reply on Aug 3, 2005 11:01 AM by chwang

    deploy and hibernate

      Hi Guys,

      I am a newer. I have a couple of questions to ask you guys. Please help me out.
      Question A:
      There are lots of jar files I create and need to use them. I found 2 ways to use in Jboss.
      1.) I can put all jar files in {jboss.deploy.dir}/server/default/lib.
      2.) I can jar all jars into one jar file, then put this jar files into
      {jboss.deploy.dir}/server/default/deploy.

      Looks like the second way is much better, but I wonder if it will affect the speed, or other side effects.

      Question B:

      Currently I use hibernate with JBoss. I jar data objects, their mapping files, and hibernate-service.xml into datasources.har file, then put this har file and mysql-ds.xml into {jboss.deploy.dir}/server/default/deploy. They work all right.

      But this {jboss.deploy.dir}/server/default/deploy directory looks like globe directory.
      my project is in {jboss.deploy.dir}/server/default/deploy/jbossweb-tomcat50.sar/myproject/WEB-INF. I wonder if some way we can put the above files into myproject folder and deploy.

      Thank you very much for your help in advance..

      Edgy

        • 1. Re: deploy and hibernate
          neelixx

          chwang,

          The deploy directory is meant for you to deploy all of your applications. Tomcat is used as an embedded service, so you should never deploy your applications in the Tomcat.sar folder. Also, I do not think the tomcat.sar folder is monitored for hot-deploy. So, if you ever replace your deployment, JBoss probably won't undeploy and re-deploy your application.

          Basically, do not deploy your apps in Tomcat, but rather, in the /server/default/deploy directory.

          In Tomcat, the context is based on the directory your application is in. I wonder if this is why you are deploying in Tomcat. If you want to set the context of your application when you deploy your app to the "deploy" directory, you'll have to add a "jboss-web.xml" file to your WEB-INF directory with the following:

          <jboss-web>
           <context-root>MyAppContext</context-root>
          </jboss-web>
          


          This will deploy your app to the //server/MyAppContext/ URL. You can verify this by watching your logs when you place your app in the deploy directory.

          • 2. Re: deploy and hibernate

            Neelixx,

            Thank you very much for your help!

            Edgy