进口无法解决的java月食
问题描述 投票:0回答:1
错误弹出是“进口不可能解决”只进口“org.apache.log4j.Logger;” ....这是Main.java和其他Java类是具有相同的错误...任何一个可以解决或帮助?这是发送短信
package com.dbs.epodsms;
import com.dbs.epodsms.business.logic.ConfigureModem;
import com.dbs.epodsms.business.logic.SmsProcessor;
import com.dbs.epodsms.business.object.Log;
import com.dbs.epodsms.business.object.Outgoing;
import com.dbs.epodsms.misc.Network;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
public class Main
{
private static Logger logger = Logger.getLogger(Main.class);
public static void main(String[] args)
{
logger.info("Application started.");
List outgoingList = new ArrayList();
SmsProcessor smsProcessor = new SmsProcessor();
try
{
ConfigureModem cfgModem = ConfigureModem.getInstance();
if (!cfgModem.configure())
{
logger.error(cfgModem.getMessage());
logger.error("An error occured while configuring your modem. Please check that your modem is properly installed and that the hw is not defective.");
logger.info("The application will now exit.");
System.exit(0);
}
List oldOutgoingList = smsProcessor.getOutgoingList(Network.GLOBE);
if (oldOutgoingList.size() > 0)
{
outgoingList.addAll(oldOutgoingList);
}
outgoingList.addAll(smsProcessor.getNewSMS(cfgModem.getGateway()));
logger.info("Processing a total of " + outgoingList.size() + " sms...");
for (Outgoing o : outgoingList)
{
if (o.getRetries() > 3)
{
smsProcessor.sendEmail(o);
}
else if (smsProcessor.sendSMS(o))
{
logger.info("SMS was sent successfully.");
Log log = new Log();
log.setRemarks("REPLY SENT");
log.setSenderNumber(o.getRecipient());
log.setSms(o.getMessage());
smsProcessor.saveToLog(log);
smsProcessor.deleteOutging(o.getId());
}
else
{
logger.error("Error sending message to " + o.getRecipient());
o.setRetries(o.getRetries() + 1);
smsProcessor.addOrUpdateOutgoing(o);
}
}
logger.info("Stopping service...");
cfgModem.stopService();
smsProcessor.closeDBConnection();
System.exit(0);
}
catch (Exception e)
{
logger.error(e.toString());
}
}
}
java
eclipse
import
1个回答
0
投票
请确保您有log4j的JAR文件类路径中。在你的Java项目中,右键单击并选择“构建路径 - >配置构建路径”,并在库选项卡中添加的Jar文件。
热门问题