1. First, let's configure a file, SFS/Server/CONF/wrapper. conf.
Find these lines of code,
# Java additional parameters
Wrapper. java. additional.1 =-Server
Wrapper. java. additional.2 =-dfile. Encoding = UTF-8
Wrapper. java. additional.3 =-djava. util. Logging. config. File = logging. Properties
Add the following code after the Code:
# Runtimedebug
Wrapper. java. additional.4 =-xdebug
Wrapper. java. additional.5 =-xnoagent
Wrapper. java. additional.5 =-xrunjdwp: Transport = dt_socket, address = 8787, Server = Y, suspend = N
Save and exit.
2. Create a deubg batch file that can start smartfoxserver (that is, create a batch file ).
The name is SFs. bat. The content is as follows:
D:/developments/smartfoxserverpro_1.6.6/Server/wrapper.exe-c "D:/developments/smartfoxserverpro_1.6.6/Server/CONF/wrapper. conf"
Save and exit. The path is modified according to the installed directory.
3. Next, let's configure debug in eclipse. Open debug configurations, double-click Remote Java application, and fill in the following information in the column on the right:
Name: You can select
Project: Specify the Java Extension Project to debug smartfoxserver.
Connection Type: Standard (socket attach)
HOST: 127.0.0.1 server address. (If the server is local, enter the local address .)
Port: 8787 this is the port number specified in the wrapper. conf file above.
Click Apply.
Note that you must first start the server and then start the debugging just created under debug in eclipse. Call your as code again to call the Java extension or modify the server's own example to call the Java extension. When you call a Java extension, your eclipse will be triggered to enter the debugging interface.