12 Replies Latest reply on Oct 11, 2005 9:57 AM by darranl

    How to change Context.PROVIDER_URL ?

    mohan_sm

      I am trying to run multiple instances of JBoss in a single machine. I have configured an instances to run on 1199 (jnp). during the startup of this instance , jnp service is listening on 1199, but NamingContext is still looked up on 1099. so server fails to start up. why is this happening ? is there any configuration i missed out?


      Rgds,
      S. Mohan

        • 1. Re: How to change Context.PROVIDER_URL ?
          darranl

          What is the error? Exception, message and stack trace?

          • 2. Re: How to change Context.PROVIDER_URL ?
            mohan_sm

            Hi this the stack trace

            14:36:11,030 INFO [NamingService] Starting jnp server
            14:36:11,821 INFO [NamingService] Started jnpPort=1199, rmiPort=1198, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
            14:36:12,021 WARN [NamingService] Context.PROVIDER_URL in server jndi.properties, url=localhost:1099
            14:36:12,072 INFO [NamingService] Listening on port 1199
            14:36:12,212 INFO [NamingService] Started jboss:service=Naming
            14:36:12,212 INFO [JNDIView] Started jboss:service=JNDIView
            14:36:12,242 INFO [SecurityConfig] Started jboss.security:service=SecurityConfig
            14:36:12,542 INFO [XMLLoginConfig] Started jboss.security:service=XMLLoginConfig
            14:36:12,602 INFO [JaasSecurityManagerService] Started jboss.security:service=JaasSecurityManager
            14:36:12,763 INFO [TransactionManagerService] Started jboss:service=TransactionManager
            14:36:13,994 WARN [NamingContext] Failed to connect to localhost:1099
            javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
            at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:215)
            at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1181)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
            at javax.naming.InitialContext.lookup(InitialContext.java:347)


            Even i tried changing the jndi.properties..but still i am get this exception


            Rgds,
            S. Mohan

            • 3. Re: How to change Context.PROVIDER_URL ?
              darranl

              I am assuming you are talking about the jndi.properties in the conf folder, this should never be edited by you - what does this file contain at the moment? Does it contain a provider URL?

              • 4. Re: How to change Context.PROVIDER_URL ?
                darranl

                Also how have you made this change? What files have you changed?

                Are you using the binding service? The JNP port is only one of the ports you are going to have a conflict with.

                I have just changed the port for a 4.0.2 installation and it starts without any problems, there is nothing trying to use the original port. Which version of JBoss are you using?

                • 5. Re: How to change Context.PROVIDER_URL ?
                  mohan_sm

                  I am using JBoss 3.2.3..by default there is no such PROVIDER_URL in that jndi.properties file. Yes i am using binding services to map the port detail.


                  Rgds,
                  S. Mohan

                  • 6. Re: How to change Context.PROVIDER_URL ?
                    darranl

                    I have just tried to reproduce your problem but JBoss is starting fine for me: -

                    I have installed j2sdk1.4.2_08 and set the JAVA_HOME variable as appropriate.

                    I have extracted JBoss 3.2.3

                    In the folder 'jboss-3.2.3\server\default\conf' I have edited the file 'jboss-service.xml' and removed the comment around the 'ServiceBindingManager' MBean.

                    Apart from that I have not made any changes and I can start JBoss by running the run.bat script.

                    Using 'netstat -an' I can see JBoss is listening on the correct set of ports as adjusted by the binding manager.

                    Are you sure that your JDK installation is clean and that no other changes have been made to the JBoss installation? Do you have any environment variables set that may contain the PROVIDER_URL?

                    • 7. Re: How to change Context.PROVIDER_URL ?

                      have the same problem but not during deployment but at my first request. (jboss 3.2.2). Is there a specific configuration for this 1099 port to be change in 1199 in jbossweb-tomcat or something else?
                      thanx


                      • 8. Re: How to change Context.PROVIDER_URL ?
                        darranl

                        As you can see from my last post I went to quite a bit of trouble to reproduce the problem installing a JDK version I do not normally use and downloading a JBoss version I stopped using a long time ago.

                        Would it be possible for you in return to describe what steps you have taken to get the error you are seeing, from the tests I performed it works 'out of the box' so it is likely that it is something else causing the problems.

                        • 9. Re: How to change Context.PROVIDER_URL ?

                          I copy default config to default1. I modify default1/conf the jboss-service.xml to put service binding to ports-01. in conf, i modify jndi.properties to put localhost:1199. I modify mysql-ds.xml to mapping to another database (on the same SGBD mysql). I modify jbosswebtomcat to put in jboss-service another http port (like 81).
                          When i launch jboss with default1 config, it works fine (launching 1199 port). But, when i execute my first request (first call to an EJB), jboss explains that it failed to connect to localhost:1099.
                          thanx for help

                          • 10. Re: How to change Context.PROVIDER_URL ?
                            darranl

                            Which jndi.properties are you editing?

                            If it is the one in the conf folder you should not be changing the contents, the default settings allow the local JNDI server to be found by default.

                            [I can't remember what comment is in the jndi.properties from 3.2.3 but the only people that should edit it are experienced JBoss developers, everyone else should leave it alone].

                            • 11. Re: How to change Context.PROVIDER_URL ?

                              ok,
                              i edited the conf/jndi.properties but doesn't matter because it generate nothing better. I think my problem is with the tomcat call to jboss where it try to use 1099, whereas during deployment it seems to use 1199.
                              thanx

                              • 12. Re: How to change Context.PROVIDER_URL ?
                                darranl

                                What does the jndi.properties look like now?

                                What does your code look like that is failing?

                                How do you construct the initial context?

                                Have you packaged any jndi.properties files within your deployment?