User: starksm
Date: 01/04/09 00:01:05
Modified: src/main/org/jboss/naming NamingService.java
Log:
The java:comp context cannot be bound during initService with the latest
jnp release as the NamingContext.localServer value is not initialized
util the service has been started.
Revision Changes Path
1.7 +6 -7 jboss/src/main/org/jboss/naming/NamingService.java
Index: NamingService.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/naming/NamingService.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- NamingService.java 2000/12/12 10:55:59 1.6
+++ NamingService.java 2001/04/09 07:01:05 1.7
@@ -19,7 +19,7 @@
*
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
public class NamingService
extends ServiceMBeanSupport
@@ -87,18 +87,17 @@
// RO: this is necessary because some components (=Tomcat servlets) use a
// buggy classloader that disallows finding the resource properly
System.getProperties().load(Thread.currentThread().getContextClassLoader().getResourceAsStream("jndi.properties"));
-
- // Create "java:comp/env"
- RefAddr refAddr = new StringRefAddr("nns", "ENC");
- Reference envRef = new Reference("javax.naming.Context", refAddr,
ENCFactory.class.getName(), null);
- Context ctx = (Context)new InitialContext().lookup("java:");
- ctx.rebind("comp", envRef);
}
public void startService()
throws Exception
{
naming.start();
+ // Create "java:comp/env"
+ RefAddr refAddr = new StringRefAddr("nns", "ENC");
+ Reference envRef = new Reference("javax.naming.Context", refAddr,
ENCFactory.class.getName(), null);
+ Context ctx = (Context)new InitialContext().lookup("java:");
+ ctx.rebind("comp", envRef);
log.log("Naming started on port "+naming.getPort());
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development