简体   繁体   中英

Not able to connect Clamd server(Ubuntu) from java code

I'm trying to scan the Files for viruses using Clam Antivirus which is installed on Ubuntu on different machine from java code which is again on different machine. Below is my java code lines

//connect to Linux server
ClamScan clamScan = new ClamScan("127.0.0.1", 3310, 20);

// Scanning the test file 
ScanResult result = clamScan.scan(new FileInputStream("D:\\vcredist_x64.png"));

I have done the necessary changes in Clamd.conf files that is to add the Tcp Port and Address , but still getting below error description

ERROR com.philvarner.clamavj.ClamScan - could not connect to clamd server java.net.ConnectException: Connection refused: connect

So any body can help me to find out what is going wrong either in code or configuration .

Thanks in Advance. Ali

终于找到了解决方案,实际上clam守护程序没有启动并运行。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM