我正在运行服务器应用程序并访问数据库进行操作,尽管我已在项目中配置了 javax.comm.properties,但我还是收到了错误

javax.comm:  Can't find javax.comm.properties! 
 
java.io.IOException: javax.comm: platform driver class name = null 
                 (Check 'driver' property in javax.comm.properties) 
 
at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:244) 
at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:109) 
at com.rtc.actions.downloads.MySerialPort.openMyPort(MySerialPort.java:88) 
at com.rtc.actions.downloads.Downloads.<init>(Downloads.java:70) 
at com.rtc.actions.downloads.MasterDownloadAction.execute(MasterDownloadAction.java:37) 
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) 
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) 
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) 
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) 
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) 
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) 
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) 
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) 
at java.lang.Thread.run(Thread.java:619) 

请您参考如下方法:

javax.comm.properties 应放置在 JAVA_HOME/jre/lib/ext 中,请参阅 details .

The first step for using this package is placing the proper files in respective JAVA_HOME’s directory folders.

1) win32com.dll : keep it in JAVA_HOME’s bin directory. In my case I placed it here C:\Program Files\Java\jdk1.6.0_05\jre\bin

2)comm.jar : place it in JAVA_HOME’s lib\ext directory. Mine was in C:\Program Files\Java\jdk1.6.0_05\jre\lib\ext

3)javax.comm.properties : same as above. So this file goes in C:\Program Files\Java\jdk1.6.0_05\jre\lib\ext


评论关闭
IT源码网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!