3 Replies Latest reply on Nov 21, 2011 2:45 PM by wdfink

    Read InitialContext from jndi.properties

    deryaaltuntas

      I modifed jndi.properties file and added file to application class path.

      I am getting connection refused exceptions.If I provide jndi properties in my code and do not provide

      java.naming.provider.url property in jndi.propertties, everything is ok.But now I am not able to deploy application

      In my mind I think that jndi properties must be specifed in HashTable or Properties classes

      Cose will be hard coded then.I do not want to change my code when I change my server network.

        • 1. Re: Read InitialContext from jndi.properties
          wdfink

          What kind of application it is and how do you pack and start it?

          • 2. Re: Read InitialContext from jndi.properties
            deryaaltuntas

            Actually my progress  is changed a little.

            I  did not change jndi properties under /jboss/server/default/conf.I copied file under my source code PROJECT/src and

            add url provider line to file.now I am able to run code only as such.

            But I did not understand that why application is not able to

            search jndi.properties under java_home. If I copy file to under my java home, I am not also able to run application.

            what is the correct way.I also tried to run application as jar file, copied jndi.properties same directory, it did not work also.

            • 3. Re: Read InitialContext from jndi.properties
              wdfink

              I normally include the jndi.properties in the JMV -cp path settings or pack it with the client's jar file.

              For clients with configuration files I also use the application configuration file and read the properties from here.