Java 如何使用SMSLib发送短信

Java 如何使用SMSLib发送短信,java,maven,sms,sms-gateway,smslib,Java,Maven,Sms,Sms Gateway,Smslib,我正在尝试使用SMSLib和USB GSM调制解调器发送短信。我在Maven项目中执行此操作,在pom.xml中有以下依赖项: <dependency> <groupId>org.smslib</groupId> <artifactId>smslib</artifactId> <version>dev-SNAPSHOT</versi

我正在尝试使用SMSLib和USB GSM调制解调器发送短信。我在Maven项目中执行此操作,在pom.xml中有以下依赖项:

        <dependency>
            <groupId>org.smslib</groupId>
            <artifactId>smslib</artifactId>
            <version>dev-SNAPSHOT</version>
        </dependency>

        <dependency>
            <groupId>org.rxtx</groupId>
            <artifactId>rxtx</artifactId>
            <version>2.1.7</version>
        </dependency>

        <dependency>
            <groupId>commons-net</groupId>
            <artifactId>commons-net</artifactId>
            <version>3.1</version>
        </dependency>

        <dependency>
            <groupId>com.googlecode.jsmpp</groupId>
            <artifactId>jsmpp</artifactId>
            <version>2.1.0</version>
        </dependency>
SMSlib的文档说明我需要定义一个网关,如

XYZ g = new XYZ("my-username", "my-password");
据我所知,我相信这应该是连接的调制解调器。我对此非常陌生,因此我无法真正理解“Modem”构造函数的参数在

Modem gateway = new Modem(gatewayId, address, port, simPin, simPin2, smscNumber,memoryLocations)

我如何知道参数gatewayId、address、simPin、simPin2和memroyLocations

目前,我在运行代码时遇到以下错误:

exception

java.lang.reflect.InvocationTargetException
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
......

root cause

java.lang.NoClassDefFoundError: Could not initialize class org.smslib.Service
    com.mail.utility.SendSmsUtility.sendSMS(SendSmsUtility.java:11)
    com.mail.action.SendSmsAction.sendSms(SendSmsAction.java:11)
......
Modem gateway = new Modem(gatewayId, parms)
exception

java.lang.reflect.InvocationTargetException
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
......

root cause

java.lang.NoClassDefFoundError: Could not initialize class org.smslib.Service
    com.mail.utility.SendSmsUtility.sendSMS(SendSmsUtility.java:11)
    com.mail.action.SendSmsAction.sendSms(SendSmsAction.java:11)
......