java开发 实现发送短信的功能,报错信息 javax.comm.NoSuchPortException 哪位高手帮我解决解决。谢谢!急
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java开发 实现发送短信的功能,报错信息 javax.comm.NoSuchPortException 哪位高手帮我解决解决。谢谢!急相关的知识,希望对你有一定的参考价值。
at javax.comm.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:105)
at org.smslib.CSerialDriver.open(CSerialDriver.java:106)
at org.smslib.CService.connect(CService.java:599)
at com.beauty.hair.Action.SendMessageAction.execute(SendMessageAction.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
Java演示手机发送短信验证码功能实现
我们这里采用阿里大于的短信API
第一步:登陆阿里大于,下载阿里大于的SDK
a、在阿里大于上创建自己的应用
b、点击配置管理中的验证码,先添加签名,再配置短信模板
第二步:解压相关SDK,第一个为jar包,第二个为源码
第三步:引入到项目中
第四步:代码测试短信是否成功
第五步:Java Application 运行
最终结果:如下图为成功发送一条短信
以上是关于java开发 实现发送短信的功能,报错信息 javax.comm.NoSuchPortException 哪位高手帮我解决解决。谢谢!急的主要内容,如果未能解决你的问题,请参考以下文章