Hi, i am trying to run some javaObject, but got and error
java.lang.RuntimeException: Method: sendudp not found in: net.nowyouseeme.nvr.client
that's the method is not found.
the class work great on eclipse. I really don't understand what's happened.
some advice,
Victor
I am using this to run the function.
this is the code ->
java.lang.RuntimeException: Method: sendudp not found in: net.nowyouseeme.nvr.client
that's the method is not found.
the class work great on eclipse. I really don't understand what's happened.
some advice,
Victor
I am using this to run the function.
B4X:
Dim J As JavaObject = Me
J.RunMethod("sendudp", Array As String ("172.31.3.150",data))
this is the code ->
B4X:
#If JAVA
import java.util.logging.*;
import com.cloudbees.syslog.*;
import com.cloudbees.syslog.sender.TcpSyslogMessageSender;
import com.cloudbees.syslog.sender.UdpSyslogMessageSender;
public class SyslogC {
private final SyslogMessage SyslogMessage = null;
public SyslogMessage msg = SyslogMessage;
public final Logger LOGGER = Logger.getLogger( Class.class.getName() );
public void send_udp(String host, String sms) {
try {
SyslogMessage msg = new SyslogMessage()
.withAppName("monitor")
.withFacility(Facility.SYSLOG)
.withHostname("my-hostname")
.withMsg(sms + Timestamp(System.currentTimeMillis()))
.withSeverity(Severity.CRITICAL)
.withTimestamp(System.currentTimeMillis());
UdpSyslogMessageSender messageSender = new UdpSyslogMessageSender();
messageSender.setSyslogServerHostname(host);
messageSender.setSyslogServerPort(514);
messageSender.setMessageFormat(MessageFormat.RFC_3164);
System.out.println(msg.toSyslogMessage(messageSender.getMessageFormat()));
messageSender.sendMessage(msg);
} catch (Exception e) {
}
}
public void send_tcp(String host, String sms) throws Exception {
try {
SyslogMessage msg = new SyslogMessage()
.withAppName("monitor")
.withFacility(Facility.SYSLOG)
.withHostname("my-hostname")
.withMsg(sms + Timestamp(System.currentTimeMillis()))
.withSeverity(Severity.CRITICAL)
.withTimestamp(System.currentTimeMillis());
TcpSyslogMessageSender messageSender = new TcpSyslogMessageSender();
messageSender.setSyslogServerHostname(host);
messageSender.setSyslogServerPort(514);
messageSender.setMessageFormat(MessageFormat.RFC_3164);
messageSender.setSsl(true);
messageSender.sendMessage(msg);
} catch (Exception e) {
}
}
private long Timestamp(long currentTimeMillis) {
return System.currentTimeMillis();
}
}
#End If