4 Replies Latest reply on Oct 4, 2006 10:47 AM by jeffastorey

    Deploying a JAR with props file in it

    jeffastorey

      Hi everyone,

      I have a bunch of EJB stateful and stateless beans I would like to deploy on a JBoss server. These beans have methods in them that read from a props file (using the getResource method to find the props file). To avoid hard-coding the path of this props file, I want to include it in my JAR file that gets deployed. However, when I do that, JBoss throws exceptions during deployment that say things like:
      could not initialize deployment
      error parsing meta data jar

      When I take the props file out of the jar and hard code the path (which I obviously don't want to do), the error is gone and all runs smoothly. Does anyone know why this might be happening and how to fix this?

      Thanks!
      Jeff

        • 1. Re: Deploying a JAR with props file in it
          peterj

          I deploy jar, war and ear files with embedded properties files without any problems.

          What is the exact path and name of the properties file within the jar file?

          What is the exact error message and stack trace displayed on the console?

          • 2. Re: Deploying a JAR with props file in it
            jeffastorey

            Hi Peter,

            Thanks for the response. I just found out (actually a few minutes ago) that my network connection was weak and sometimes dropping. When it dropped in the middle of deploying my beans, that's when the problem happened. Now, my connection is stable again and all seems to be fine. Thanks.

            Jeff

            • 3. Re: Deploying a JAR with props file in it
              peterj

              So are you copying the war file across the network into the deploy directory? A safer mechanism would be to copy it to a temporary directory in the server system and then move it to the deploy directory. All sorts of fun ensues if JBoss decides to deploy your war and it is only partly copied.

              • 4. Re: Deploying a JAR with props file in it
                jeffastorey

                Peter,

                Thanks, your advice has been helpful. I have one other question that maybe you may be able to help with if you don't mind...I have a label that is a "status listener" - it gets registered with some process running on the server side and is notified whenever that process' status changes. The problem is when I try to register this client-side component with the server, I get errors about ClassNotFoundException (RMI classloader disabled). I guess it has something to do with the server not being able to resolve that class type - but I wouldn't think the server should need to know specifics about the client. Is there a way around this - I don't really want to include the client component in the server war file. That doesn't make much sense logically.

                Thanks,
                Jeff