Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002683 [Resin] minor always 05-19-08 16:44 06-05-08 15:59
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.1.6
Summary 0002683: ports available in servlet init
Description (rep by Vinod Mehra)


        ResinMXBean resinMXBean = Resin.getCurrent().getAdmin(); // perhaps mbean lookup will be better
        if (resinMXBean == null) throw new IllegalStateException("ResinMXBean not initialized yet");
 
        PortMXBean[] ports = serverMXBean.getPorts();
        if (ports == null || ports.length < 1) return -1;
 
        for (PortMXBean port : ports) {
            if (port.getProtocolName().equals("http")) return port.getPort();
        }
        return -1;
 
Also I moved the initialization to servlet-context listener. But it doesn't work. The reason is com.caucho.server.cluster.Server is initialized only after the listeners, filters and servlets etc are initialized. Is there anyother way I can find the port number?
 

Additional Information
Attached Files

- Relationships

- Notes
(0003145)
ferg
06-05-08 15:59

server/2793
 

- Issue History
Date Modified Username Field Change
05-19-08 16:44 ferg New Issue
06-05-08 15:59 ferg Note Added: 0003145
06-05-08 15:59 ferg Assigned To  => ferg
06-05-08 15:59 ferg Status new => closed
06-05-08 15:59 ferg Resolution open => fixed
06-05-08 15:59 ferg Fixed in Version  => 3.2.0


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
28 total queries executed.
25 unique queries executed.
Powered by Mantis Bugtracker