用线程做了个读取XML自动入库数据库的程序!程序里是两个线程,由一个主线程控制
,这次想要加个线程,来监控程序!用java调用.NET的webservice。用单独的一个类试了试
这个webservice方法(有main方法的类)是可以得到返回的值的!
但是,当我放到程序一个线程中去控制的时候就出错了(这个线程是没隔3分钟循环的)
出错情况如下:
xisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (404)Not Found
faultActor:
faultNode:
faultDetail:
{}:return code: 404
<html>
<head>
<title>The resource cannot be found.</title>
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
</style>
</head>
<body bgcolor="white">
<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>The resource cannot be found.</i> </h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
<b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
<br><br>
<b> Requested URL: </b>/Monitor.asmx<br><br>
</body>
</html>
{http://xml.apache.org/axis/}HttpErrorCode:404
(404)Not Found
等待解决!
但是我用单独的类去调用webservice是可以调用的!返回值也很正常!但是在线程里调用就不行!这个线程是被另一个主线程控制start()的。这个主线程同时还控制了分析数据,并且入库的那个线程。
我想应该是线程方面的问题了!是不是线程安全方面的?