CFMX7 Installation and Web Server Configuration Tool fails with JNDI ports blocked
ColdFusion 9 Comments »This is a problem I have had a few times in the past, but last night was probably the most drastic action I have had to take so far to get it working. So I thought I would document the procedure, this is the cut down version as it actually took me 4+ hours to resolve the problem.
Client had ColdFusion MX 7 running fine for 2 weeks, then mysteriously it stopped working. Turns out the CFIDE folder had gone, so had all the JRUN connector files (<cfroot>/runtime/lib/wsconfig/1).
On attempting to re-install, the installer could not complete, reporting that ports may be blocked by a firewall or some other 3rd party application. This was of course not the case, as there was no firewall on the server.
The only part of the installation left to complete is the final part where the connectors are created and you open the CFADMIN, the ODBC services are created, and the final CF site of the setup occurs.
So I tried to create the connectors using WSCONFIG, and got this error (the same one showing in the logs as well)
Could not connect to any Jrun/ColdFusion servers on host localhost.
Possible causes:
Server not running
-Start Macromedia JRun4 or ColdFusion MX server
Server running
-JNDI listen port in jndi.properties blocked by TCP/IP filtering or firewall on server
-host restriction in security.properties blocking communications with server
So I use "netstat -an" command to see what ports are open and listening.
The JNDI port 2920 was there, but the proxyservice port 51011 was not, indicating that it is not open and listening.
So I opened the <cf-root>\runtime\servers\coldfusion\SERVER-INF\web.xml file and changed the default proxyservice port. See code below.
Change "deactivated" to false
Change "port" to a new value of your choice
<service class="jrun.servlet.jrpp.JRunProxyService" name="ProxyService">
<attribute name="activeHandlerThreads">8</attribute>
<attribute name="minHandlerThreads">1</attribute>
<attribute name="maxHandlerThreads">1000</attribute>
<attribute name="mapCheck">0</attribute>
<attribute name="threadWaitTimeout">300</attribute>
<attribute name="backlog">500</attribute>
<attribute name="deactivated">true</attribute>
<attribute name="interface">*</attribute>
<attribute name="port">51011</attribute>
<attribute name="timeout">300</attribute>
<!-- set this to false for multi-hosted sites -->
<attribute name="cacheRealPath">false</attribute>
<!--
<attribute name="keyStore">{jrun.rootdir}/lib/keystore</attribute>
<attribute name="keyStorePassword">changeit</attribute>
<attribute name="trustStore">{jrun.rootdir}/lib/trustStore</attribute>
<attribute name="socketFactoryName">jrun.servlet.jrpp.JRunProxySSLServerSocketFactory</attribute>
-->
</service>
The new port I had entered now showed up in netstat so I knew it was listening and not blocked.
WSCONFIG would still however not locate JRUN and connect to it. Then I found the below info over at brandon Purcell's blog , which I have slightly modified here to apply to a standard CFMX7 installation.
When wsconfig first runs it does a port scan from 2900-3000 to list any JRun servers that are running. In some cases it will hang when the port scan occurs. In the GUI this occurs when you click the add button. In the command line version it occurs when it searches for the servers and the prompt never returns. To test if this is the problem try the following commandwsconfig -host localhost -list (using the executable version)
C:\CFusionMX7\runtime\jre\bin\java -jar C:\CFusionMX\runtime\lib\wsconfig.jar -host localhost -list
This command should provide a listing of all running servers if it does not return to the command prompt and hangs then you can follow the procedure below
By narrowing the ports that are scanned by wsconfig you can prevent the hang. By default CFMX7 uses port 2920 for the jndi port. This port can be found in C:\CFusionMX7\runtime\servers\coldfusion\SERVER-INF\jndi.properties under the entry java.naming.provider.url=localhost:2920. If you are running multiple instances of JRun then you can look in each servers SERVER-INF\jndi.properties file for the range of jndi ports to scan.
To reduce the ports that are scanned use the following java arguments
-DWSConfig.PortScanStartPort=startport -DWSConfig.PortScanCount=portrange
So If I had 1 instance and the JNDI ports are 2920 then I would use the following command to list the jrun instances.
C:\CfusionMX7\runtime\jre\bin\java -DWSConfig.PortScanStartPort=2920 -DWSConfig.PortScanCount=1 -jar C:\JCFusionMX7\runtime\lib\wsconfig.jar -host localhost -list
To run the GUI and only scan those ports enter the following command:
C:\CFusionMX\runtime\jre\bin\java -DWSConfig.PortScanStartPort=2920 -DWSConfig.PortScanCount=1 -jar C:\CfusionMX7\runtime\lib\wsconfig.jar
Modify the ports to your range of JNDI ports and the GUI should work without hanging.
Here are a few other articles that can help with wsconfig debugging
http://www.macromedia.com/support/jrun/ts/documents/tn18287.htm
http://www.macromedia.com/support/coldfusion/ts/documents/connector_install_faq.htm
Recent Comments