VS2008 addin程序中调用EnvDTE的Documents.Open方法总报异常 [问题点数:20分,结帖人XPR]

XPR
Bbs1
本版专家分:31
结帖率 100%
XPR
Bbs1
本版专家分:31
XPR
Bbs1
本版专家分:31
为什么总报异常呢??
rnrn rnrnrnrnrn总是出<em>异常</em>(出错)rn哪里有点问题呢?
wince中数据库同步总报异常
在ce中用sqlmobile连接pc中sqlserver2005时,在产生new SqlCeRemoteDataAccess这个类的时候总报<em>异常</em>,说 rn“在 System.Data.SqlServerCe.SqlCeException 中第一次偶然出现的“System.Data.SqlServerCe.dll”类型的<em>异常</em> rn”,哪位大侠帮忙解决一下,先谢谢各位拉 rn SqlCeRemoteDataAccess rda = null; rn //SQL Server所在的主机的IP rn string remoteIP = "LUCENE"; rn //SQL Server中的数据库,名为Test rn string remoteDB = "Test"; rn //数据库Test的用户和密码 rn string user = "sa"; rn string pwd = "123"; rn //本地sqlce数据库的路径和名字,该数据库存在于win CE系统下. rn string dbPathName= @"\rda.sdf"; rn string localDB = dbPathName; rn //本地sqlce数据库密码 rn string localPwd = ""; rn //要同步的数据表名 rn string table = "Test1"; rn //用于连接SQL Server数据库的字符串 rn string rdaOleDbConnectString = @"Provider=SQLOLEDB;Data Source=" + remoteIP +";Initial Catalog=" + remoteDB + ";User Id=" + user + ";Password =" + pwd; rn //连接本地sqlce数据库的字符串,作为SqlCeRemoteDataAccess对象的一个参数 rn string localConnectString = @"Data Source=" + localDB + ";Password=" + localPwd; rn try rn rn rda = new SqlCeRemoteDataAccess("http://" + remoteIP + "/Test2/sqlcesa30.dll", "", "", localConnectString); rn //由于虚拟目录sqlce3设置的访问方式为匿名,所以登陆名和密码可以忽略 rn // rda.InternetLogin = ""; rn // rda.InternetPassword = ""; rn //rda.InternetUrl = "http://" + remoteIP + "/Test2/sqlcesa30.dll"; rn //rda.LocalConnectionString = localConnectString; rn //执行同步,SQL SERVER同步到sqlce rn //参数RdaTrackOption.TrackingOn指示SQL Server Mobile 跟踪对所提取表的所有更改。 rn rda.Pull(table, "Select * from " + table, rdaOleDbConnectString, RdaTrackOption.TrackingOn); rn rn catch (SqlCeException ) rn rn
Visual SVN - VS2008 Addin
VisualSVN is a Visual Studio plug-in that integrates Subversion and TortoiseSVN seamlessly with Visual Studio. VisualSVN virtually eliminates the management of your project source code files within Subversion. Program, design, debug and deploy with VisualSVN as your silent partner that safeguards your source code.
VS2008 AddIn - Workspace
VS2008 AddIn Workspace 不知道你有没有遇到这种情况: 当要找一些以前做的代码做参考的时候,总是在文件夹里翻来翻去,光看项目名字也还是想不起来重要的代码究竟在哪个工程里。因此,自己开发个AddIn来方便进行本地的代码管理,通过添加本地的某个文件夹管理下面的所有的Solution。在AddIn里,可以快速切换Solution,不用在资源浏览器里费劲找,同时通过Tag管理可以快速过滤,方便定位想要的代码。
调用WebService报异常
AxisFaultrn faultCode: http://schemas.xmlsoap.org/soap/envelope/Server.userExceptionrn faultSubcode: rn faultString: java.lang.reflect.InvocationTargetExceptionrn faultActor: rn faultNode: rn faultDetail: rn http://xml.apache.org/axis/hostname:server4rnrnjava.lang.reflect.InvocationTargetExceptionrn at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)rn at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)rn at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)rn at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)rn at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)rn at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)rn at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)rn at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)rn at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)rn at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)rn at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)rn at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)rn at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)rn at org.apache.axis.client.Call.invokeEngine(Call.java:2784)rn at org.apache.axis.client.Call.invoke(Call.java:2767)rn at org.apache.axis.client.Call.invoke(Call.java:2443)rn at org.apache.axis.client.Call.invoke(Call.java:2366)rn at org.apache.axis.client.Call.invoke(Call.java:1812)rn at cn.com.hnisi.viointerface.demo.EPODemo.main(EPODemo.java:105)rn
频繁调用WCF服务端方法 程序异常
我开一个线程 不停的<em>调用</em>服务端<em>方法</em>。<em>调用</em>300~400次左右就会报<em>异常</em>。rnrnrn[color=#FF0000]无法连接到 net.tcp://IP:端口/Service。连接尝试持续了00:00:01.1220642 时间跨度。TCP 错误代码 10061: 由于目标计算机积极拒绝,无法连接。rnrnrnSystem.ServiceModel.EndpointNotFoundException: 无法连接到 net.tcp://192.168.0.25:9588/PServices。连接尝试持续了 00:00:01.1220642 时间跨度。TCP 错误代码 10061: 由于目标计算机积极拒绝,无法连接。 192.168.0.25:9588。 - System.Net.Sockets.SocketException: 由于目标计算机积极拒绝,无法连接。 192.168.0.25:9588rn 在 System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)rn 在 System.Net.Sockets.Socket.Connect(EndPoint remoteEP)rn 在 System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)rn --- 内部<em>异常</em>堆栈跟踪的结尾 ---rnrnrn[/color]rnrnrnrnrn求WCF高手解答,谢谢。。
如何使用EnvDTE的IsFileOpen方法
在MSDN中看到这段代码,但执行有错误,怎么改正。rnrnrnImports EnvDTErnrnPublic Class Form1rnrn Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clickrn Dim soln As Solution = DTE.Solutionrn Dim prj As Projectrn Dim prjItem As ProjectItemrn Dim ItemOp As ItemOperationsrn Dim savePath As Stringrnrnrnrn ' Create a new text document.rn ItemOp = DTE.ItemOperationsrn ItemOp.NewFile("General\Text File", "Some name", _rn EnvDTE.Constants.vsViewKindTextView)rnrn ' Set variables for proj and proj item names.rn prj = soln.Item(1)rn prjItem = prj.ProjectItems.Item(1)rn savePath = "C:\UserFiles\KempB\" & prjItem.Namern MsgBox(savePath)rnrn If ItemOp.IsFileOpen(savePath) = True Thenrn MsgBox("The saved document is open.")rn Elsern MsgBox("The saved document is not open.")rn End Ifrnrn prjItem.Save(savePath)rnrn If ItemOp.IsFileOpen(savePath) = True Thenrn MsgBox("The saved document is open.")rn Elsern MsgBox("The saved document is not open.")rn End Ifrn End SubrnEnd Classrnrn提示的错误是Dim soln As Solution = DTE.Solution 和 ItemOp = DTE.ItemOperations,错误信息对非共享成员的引用要求对象引用。rnrnrn以上怎么解决,如果用c#,该怎么写。rn
关联数据表删除总报异常
关联表 AllocIn配送单表, AllocInDet配送明细表,其中明细表中保存着配送单表的主键AllocInID作为外键。rn删除的配送表时,理应一并删除这个配送单下所有的明细数据。rnrn前台是一个删除的按钮,如下:rn[code=text][/code]rnrn后台代码中,rn[code=csharp]protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)rn rn int id = Convert.ToInt32(Grid1.DataKeys[e.RowIndex][0]);rnrn if (e.CommandName == "Delete")rn rnrn tryrn rn /* 这里删除时,一并删除明细表的内容 */rn DataSet ds1;rn //TSM.Model.CK_AllocInDet modelCK_AllocInDet = m_bllCK_AllocInDet.GetModel(id);rnrn //string searchText = modelCK_AllocInDet.CK_AllocInID.ToString();rn string strWhere = "CK_AllocInID = " + id;rnrn ds1 = m_bllCK_AllocInDet.GetList(strWhere);rn ds1.Tables[0].Clear();rn rn m_bllCK_AllocIn.Delete(id);rnrn BindGrid();rn [/code] rnrn报错如下:rnSystem.Data.SqlClient.SqlException: DELETE 语句与 REFERENCE 约束"FK__CK_AllocI__CK_Al__5B0E7E4A"冲突。该冲突发生于数据库"testDP",表"dbo.CK_AllocInDet", column 'CK_AllocInID'。 rn
rda同步时总报异常
在ce中用sqlmobile连接pc中sqlserver2005时,在产生new SqlCeRemoteDataAccess这个类的时候总报<em>异常</em>,说rn“在 System.Data.SqlServerCe.SqlCeException 中第一次偶然出现的“System.Data.SqlServerCe.dll”类型的<em>异常</em>rn”,哪位大侠帮忙解决一下,先谢谢各位拉rn SqlCeRemoteDataAccess rda = null;rn //SQL Server所在的主机的IP rn string remoteIP = "LUCENE";rn //SQL Server中的数据库,名为Test rn string remoteDB = "Test"; rn //数据库Test的用户和密码 rn string user = "sa"; rn string pwd = "123"; rn //本地sqlce数据库的路径和名字,该数据库存在于win CE系统下.rn string dbPathName= @"\rda.sdf"; rn string localDB = dbPathName; rn //本地sqlce数据库密码 rn string localPwd = ""; rn //要同步的数据表名 rn string table = "Test1"; rn //用于连接SQL Server数据库的字符串 rn string rdaOleDbConnectString = @"Provider=SQLOLEDB;Data Source=" + remoteIP +";Initial Catalog=" + remoteDB + ";User Id=" + user + ";Password =" + pwd; rn //连接本地sqlce数据库的字符串,作为SqlCeRemoteDataAccess对象的一个参数 rn string localConnectString = @"Data Source=" + localDB + ";Password=" + localPwd;rn tryrn rn rda = new SqlCeRemoteDataAccess("http://" + remoteIP + "/Test2/sqlcesa30.dll", "", "", localConnectString);rn //由于虚拟目录sqlce3设置的访问方式为匿名,所以登陆名和密码可以忽略 rn // rda.InternetLogin = "";rn // rda.InternetPassword = "";rn //rda.InternetUrl = "http://" + remoteIP + "/Test2/sqlcesa30.dll";rn //rda.LocalConnectionString = localConnectString;rn //执行同步,SQL SERVER同步到sqlce rn //参数RdaTrackOption.TrackingOn指示SQL Server Mobile 跟踪对所提取表的所有更改。rn rda.Pull(table, "Select * from " + table, rdaOleDbConnectString, RdaTrackOption.TrackingOn);rn rn catch (SqlCeException ) rn rn
java调用asmx报异常
下列是 SOAP 1.1 要求與回應的範例。預留位置顯示之處必須代入實際的值。rnrnPOST /MyGameMemberApp/MemberGetData.asmx HTTP/1.1rnHost: b2b.mygame.com.twrnContent-Type: text/xml; charset=utf-8rnContent-Length: lengthrnSOAPAction: "http://tempuri.org/GetMyCardMemberAuth"rnrnrnrn rn rn stringrn stringrn stringrn stringrn rn rnrnrnHTTP/1.1 200 OKrnContent-Type: text/xml; charset=utf-8rnContent-Length: lengthrnrnrnrn rn rn rn intrn stringrn stringrn rn rn rnrnrn以下是我的测试代码rnpackage hk.egame.port2.util;rnimport javax.xml.namespace.QName;rnimport org.apache.axis.client.Call;rnimport org.apache.axis.client.Service;rnpublic class HttpTest rn /**rn * @param argsrn */rn public static void main(String[] args) throws Exceptionrn // TODO Auto-generated method stubrn String service_url="http://************/MyGameMemberApp/MemberGetData.asmx";rn String method="GetMyCardMemberAuth";rn String factoryReturnUrl="www.baidu.com"; rn Service service = new Service();rn Call call = (Call) service.createCall();rn call.setTargetEndpointAddress(new java.net.URL(service_url));rn // 设置要<em>调用</em>的<em>方法</em>rn //We have to figure our the namespace. The java doesn't know where is the namespace rn call.setOperationName(new QName("http://tempuri.org/",method)); rn rn // 该<em>方法</em>需要的参数rn call.addParameter(new QName("http://tempuri.org/","FactoryId"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);rn call.addParameter(new QName("http://tempuri.org/","GameId"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);rn call.addParameter(new QName("http://tempuri.org/","FactoryServiceId"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);rn call.addParameter(new QName("http://tempuri.org/","FactoryReturnUrl"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);rn rn // <em>方法</em>的返回值类型rn call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);rn call.setUseSOAPAction(true);rn call.setSOAPActionURI("http://tempuri.org/GetMyCardMemberAuth");rn //call.setSOAPActionURI(service_url);rn rn // <em>调用</em>该<em>方法</em>, new Object[] CustNo, passwd, Jobno为参数列表rn rn String xmlStr = call.invoke(new Object[] "xiaonei", "smzt", "MFSD000310","www.baidu.com").toString();rn rn System.out.println(xmlStr);rn rnrnrnrnrn以下是返回的<em>异常</em>rnhttp://xml.apache.org/axis/stackTrace:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.rn at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)rn at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)rn at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)rn at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)rn at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)rn at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)rn at org.apache.axis.client.Call.invoke(Call.java:2467)rn at org.apache.axis.client.Call.invoke(Call.java:2366)rn at org.apache.axis.client.Call.invoke(Call.java:1812)rn at hk.egame.port2.util.HttpTest.main(HttpTest.java:56)rnrn http://xml.apache.org/axis/hostname:Srnrn请问谁做过这方面的<em>调用</em>,求帮忙rnrnrnrnrnrnrnrnrnrn
Java调用Oracle数据库报异常
<em>调用</em>代码如下:rnimport java.sql.*;rnclass MyOracle rnpublic static void main(String args[]) rntry rnDriverManager.registerDriver( new oracle.jdbc.driver.OracleDriver()); rnString url="jdbc: oracle:thin: @127.0.0.1:5500: orcl"; rnConnection conn=DriverManager.getConnection(url,"user1","pass1"); rnCallableStatement c= conn.prepareCall("call sumeng(?,?)");rnc.setString(1,"13");rnc.setString(2, "xiaomao");rnc.execute();rnconn.close(); rncatch(Exception ex)rnSystem.out.println(ex); rnSystem.exit(0); rn rn rn报的<em>异常</em>为java.sql.SQLException: Io <em>异常</em>: Bad packet typern不知道是什么原因,想高手请教~~
求助,replaceAll方法异常
在使用replaceAll<em>方法</em>时,如果替换字符串中存在$符号时会报<em>异常</em>,那位大虾能告诉我如何解决啊?小弟先谢谢了。
android程序中执行shell命令报异常
我通过android<em>程序</em>执行一些shell命令,比如: chmod 777 mFilePath, su, ls等命令时,会报<em>异常</em>.rnjava.io.IOException: Error running exec(). Command: [chmod, 777, /data/data/com.zltd.uniossupgrde/cache] Working Directory: null Environment: null. rn若debug运行到Runtime.getRuntime().exec(cmd),停顿一会的话,会报这个<em>异常</em>如下,rnjava.lang.OutOfMemoryError: thread creation failed。rn请知道的给个解决方案,多谢。。。
请问可不可以在自己的程序调用EXCEL的ADDIN的?
比如统计分析那些XLA、XLL,还是要自己改写?
序列化失败,程序异常
是视图类对指针操作导致的。rnrnrnrn<em>程序</em>序列化失败,报“非预期的文件格式”,说明文档类创建失败了。这是<em>程序</em>应该销毁创建的视图类和文档类才对,但是<em>程序</em>没有处理。rnrn如果遇到这种问题,应该怎么将视图类和文档类销毁掉。BOOL C***Doc::OnOpenDocument(LPCTSTR lpszPathName)返回值用于判断文档创建失败,应该如何利用这个返回值。rnrn
vs2008程序打包方法
<em>vs2008</em><em>程序</em>打包<em>方法</em>,里面介绍得很详细了,适合新手打包自己的小<em>程序</em>
describe方法读取数据窗口语法总报“!”
我用DESCRIBE读取数据窗口中对象的属性时总是报“!”出来,得不到具体值,是什么缘故?象下面的语法是否有错误rn dw_1.describe("DataWindow.Header.Height")
请问,调用getHibernateTemplate()方法异常java.lang.NullPointerException是怎么回事啊?
<em>调用</em>getHibernateTemplate()<em>方法</em>报<em>异常</em>java.lang.NullPointerException??
jquery html()方法 总报参数无效
代码如下:rn $.post('url',,function(data) rn $("#id").empty();rn $("#id").html(data);rn )rn就在$("#id").html(data);这一行报的参数无效<em>异常</em>,在ie下报这个<em>异常</em>,ff下没有这个<em>异常</em>!
WPF调用RSA加密的方法异常XamlParseException
[img=https://img-bbs.csdn.net/upload/201403/18/1395151488_864020.png][/img]rn单步调试到这里时 出现<em>异常</em>rn[code=csharp]public byte[] Encrypt(string data, string publicKey)rn rn _RSAprovider.FromXmlString(publicKey);rn return _RSAprovider.Encrypt(_byteConverter.GetBytes(data), false);rn [/code]rn请问是什么问题?谢谢
vs2008运行程序总弹出调试
一些常用软件在运行时,总会弹出<em>vs2008</em>的调试窗口。rn能不能设置外部<em>程序</em>(非自己编的)不<em>调用</em>调试?
按键映射的addin程序
我想为VC6建立一个按键映射的<em>addin</em>,比如功能是按ESC键后,按j键光标便左移,按o键后,那么在按j键就正常打入j,这个该如何做?我在Customize--keyboard自己定义了许多按键,可是如何用这个ADDIN能映射出来呢?rn
MFC调用Flash CallFunction总执行异常
VC<em>调用</em>flash控件的callfunction函数,每次执行到<em>调用</em>callfunction,都会产生<em>异常</em>,捕获<em>异常</em>的倒的ex->m_scError为:-2147467259。这是怎么回事,哪儿不对,求各位大神、前辈指点迷津。rnint CDlgAD::InitData(BOOL* allowAd,BOOL autoPlay,int dataOverTime,int dataRetry,int fileOverTime,int fileRetry)rnrnCString xml,tmp;rnxml=L"";rnxml+=" ";rnfor(int i=0;iGetErrorMessage(szCause, 255);rn strFormatted = _T("The program exited because of this error: ");rn strFormatted += szCause;rn AfxMessageBox(strFormatted);rn return -1;rn rnreturn 0;rnrn
VS2008 开发 Excel2007 AddIn 启动速度慢
插件本身没什么内容,就放了几个button测试。rn把插件删除的时候Excel启动速度很快。rn有插件的时候Excel启动速度慢很多,起码10秒钟。rnrn请问谁知道为什么,谢谢!rnrnrn
vs2008调用matlab2010b生成的dll初始化异常
我在<em>vs2008</em>下的部分代码是这样子的,这个是<em>程序</em>的入口函数rnBOOL CvideoApp::InitInstance()rnrn INITCOMMONCONTROLSEX InitCtrls;rn InitCtrls.dwSize = sizeof(InitCtrls);rn InitCtrls.dwICC = ICC_WIN95_CLASSES;rn InitCommonControlsEx(&InitCtrls);rn CWinApp::InitInstance();rn const char* a = "F:\\10.txt";rn int preP = 0;rn if(!libnet1Initialize())rn TRACE("%d",libnet1Initialize());rn AfxMessageBox("MesError!",MB_OK,NULL); rn exit(-1);rn rn CvideoDlg dlg;rn m_pMainWnd =&dlg;rn INT_PTR nResponse = dlg.DoModal();rn if (nResponse == IDOK)rn rn // TODO: 在此放置处理何时用rn // “确定”来关闭对话框的代码rn return FALSE;rn rn else if (nResponse == IDCANCEL)rn rn // TODO: 在此放置处理何时用rn // “取消”来关闭对话框的代码rn /*if (AfxMessageBox(_T("是否退出<em>程序</em>?"),MB_OKCANCEL,0)==IDCANCEL)rn rnrn */rn rn rnrn // 由于对话框已关闭,所以将返回 FALSE 以便退出应用<em>程序</em>,rn // 而不是启动应用<em>程序</em>的消息泵。rn return FALSE;rnrnrn编译可以通过,可是运行时进入了初始化失败的函数里,且提示<em>异常</em>:video.exe 中的 0x7c812a6b 处最可能的<em>异常</em>: Microsoft C++ <em>异常</em>: 内存位置 0x0012fa60 处的 apiException。求指教。
在netbeans中新建项目报异常
在netbeans6.1中新建项目后出现这个freemarker.core.ParseException:Unexpected end of file reached.Unclosed if directive.rn请问怎么回事?
RandomAccessFile中的readUTF()报异常
在用到<em>方法</em>readUTF()是为什么老是出现EOFException<em>异常</em>,而且也设置了seek(0)rn谁能解决一下,在网上搜罗多了,不能解决,帮助帮助
jbuilder中方法重复调用异常
jsp中<em>调用</em>javabean中的查询<em>方法</em>,第一次正常,rn第二次出现空指针,信息框报错:No operations allowed after statement closedrn都三天了,我都及死了。那位高手快帮帮忙,谢谢啦!
TFS的二次开发中,调用VersionControlServer.ArtifactProvider.GetChangeset()方法异常
对TFS进行二次开发,想做一个通过输入WorkItem列表,然后得到这些WorkItem的ChangeSet列表。rnUI如下:rn[img=https://img-bbs.csdn.net/upload/201508/14/1439519691_401587.jpg][/img]rn但在<em>调用</em>TFS的函数的过程中,发现在<em>调用</em>VersionControlServer.ArtifactProvider.GetChangeset()时,rn如果WorkItem数量比较多,特别是某个WorkItem的ChangeSet又很多的时候,经常都会出现<em>异常</em>,<em>异常</em>信息如下:rn[b]Team Foundation Server vstfs:///VersionControl/Changeset/135900 does not exist or is not accessible at this time.rnTechnical information (for administrator):rn The operation has timed out[/b]rn不知道哪位有没有遇到类似的问题,怎么解啊?rn出现这种<em>异常</em>的原因有可能是哪种原因造成的?rn期待有大婶帮忙,这个问题,困扰了我好几个月了。rnrn环境:rnTFS Server为TFS2008rn现在程式引用的TFS DLL的版本为11.rnrn关键代码如下:rn[code=csharp]rn private void btnAddWI_Click(object sender, EventArgs e)rn rn tryrn rn Boolean ReBindCS = false;rn ReBindCS = (lstWorkItem.Items.Count > 0 ? false : true);rn if (txtWorkItems.Text.Trim() != "")rn rn TfsTeamProjectCollection tfsTPC = new TfsTeamProjectCollection(new Uri(appContext.ServerURL), new TfsClientCredentials(new SimpleWebTokenCredential(appContext.UserName, appContext.Password)));rn WorkItemStore wis = tfsTPC.GetService();rn VersionControlServer vcs = tfsTPC.GetService();rn txtWorkItems.Text = txtWorkItems.Text.Trim().Replace(",", ",");rn string[] strWIs = txtWorkItems.Text.Trim().Split(',');rn string strMsg = string.Empty;rn foreach (string strWI in strWIs)rn rn //TfsTeamProjectCollection tfsTPC = new TfsTeamProjectCollection(new Uri(appContext.ServerURL), new TfsClientCredentials(new SimpleWebTokenCredential(appContext.UserName, appContext.Password)));rn //WorkItemStore wis = tfsTPC.GetService();rn //VersionControlServer vcs = tfsTPC.GetService();rn int intWI = 0;rn string strSA = string.Empty;rn string strHasSQL = string.Empty;rn if (int.TryParse(strWI, out intWI))rn rn tryrn rn WorkItem wi = wis.GetWorkItem(intWI);rn if (wi != null)rn rn if (wi.Fields.Contains("Include SQL Script"))rn strHasSQL = wi.Fields["Include SQL Script"].Value.ToString();rn elsern strHasSQL = "No";rn if (wi.Fields.Contains("SA"))rn strSA = wi.Fields["SA"].Value.ToString();rn elsern strSA = "N/A";rn BSWorkItem bsWI = new BSWorkItem();rn bsWI.WorkItemID = strWI;rn bsWI.Description = wi.Title;rn bsWI.HasSQL = strHasSQL;rn bsWI.SA = strSA;rn if (appContext.BuildWorkItems == null)rn rn appContext.BuildWorkItems = new List();rn rn ListViewItem lvi = lstWorkItem.Items.Add(strWI);rn lvi.SubItems.Add(strHasSQL);rn lvi.SubItems.Add(wi.Title);rn lvi.SubItems.Add(strSA);rn lvi.EnsureVisible();rnrn if (bsWI.Changesets == null)rn rn bsWI.Changesets = new List();rn rn Common.WriteLog("---------------------------------------------------");rn Common.WriteLog("[WI:" + wi.Id + "]");rn foreach (Link lnk in wi.Links)rn rn Common.WriteLog(" ----------------------------------------------");rn Common.WriteLog(" [LK:" + lnk.Comment + "]");rn ExternalLink elk = (ExternalLink)lnk;rn Common.WriteLog(" [URL:" + elk.LinkedArtifactUri + "]");rn Stopwatch sw = new Stopwatch();rn sw.Start();rn //TfsTeamProjectCollection tfsTPC2 = new TfsTeamProjectCollection(new Uri(appContext.ServerURL), new TfsClientCredentials(new SimpleWebTokenCredential(appContext.UserName, appContext.Password)));rn //VersionControlServer vcs2 = tfsTPC2.GetService();rn Changeset cs = vcs.ArtifactProvider.GetChangeset(new Uri(elk.LinkedArtifactUri));rn sw.Stop();rn Common.WriteLog(" [TM:" + sw.Elapsed.ToString() + "]");rn Common.WriteLog(" [CS:" + cs.ChangesetId.ToString() + "]");rn foreach (Change cg in cs.Changes)rn rn Common.WriteLog(" ----------------------------------------------");rn Common.WriteLog(" [File:" + cg.Item.ArtifactUri + "]");rn BSChangeset bcs = new BSChangeset();rn bcs.ChangesetID = cs.ChangesetId.ToString();rn bcs.FileName = cg.Item.ServerItem.ToString();rn bcs.FileSaveMode = cg.ChangeType;rn bsWI.Changesets.Add(bcs);rn rn rn //foreach (var changeset in wi.Links.OfType().Select(link => vcs.ArtifactProvider.GetChangeset(new Uri(link.LinkedArtifactUri))))rn //rnrn // Common.WriteLog(" [CS:" + changeset.ChangesetId.ToString() + "]");rn // foreach (Change cg in changeset.Changes)rn // rn // Common.WriteLog(" [File:" + cg.Item.ArtifactUri + "]");rn // BSChangeset cs = new BSChangeset();rn // cs.ChangesetID = changeset.ChangesetId.ToString();rn // cs.FileName = cg.Item.ServerItem.ToString();rn // cs.FileSaveMode = cg.ChangeType;rn // bsWI.Changesets.Add(cs);rn // rn //rn appContext.BuildWorkItems.Add(bsWI);rn rn elsern rn strMsg += (strMsg == "" ? "" : ",") + strWI;rn rn rn catch (Exception exWI)rn rn MessageBox.Show(exWI.Message);rn strMsg += (strMsg == "" ? "" : ",") + strWI;rn //throw;rn rn rn rn if (ReBindCS)rn lstWorkItem.Items[0].Selected = true;rn //if (ReBindCS)rn // lstWorkItem_SelectedIndexChanged(sender, e);rn txtWorkItems.Text = "";rn //TF26198: The work item does not exist, or you do not have permission to access it.rn if (strMsg != "")rn rn MessageBox.Show("The work item:" + strMsg + " does not exist, or you do not have permission to access it.");rn rn rn rn catch (Exception exAll)rn rnrn MessageBox.Show(exAll.Message);rn rnrn rn[/code]
Java中重复调用异常方法
此场景是在公司的一个远程更新的项目中发现的,当客户端接收到更新的请求后,需要下载最新的包,所以封装了一个下载的<em>方法</em>,在此<em>方法</em>中会进行远程的http连接然后下载,由于网络不稳定,会抛出超时<em>异常</em>,就会导致下载失败。所以需要重复执行下载<em>方法</em>,直到该<em>方法</em>成功执行完方可。 下面给出此场景下的伪代码,仅仅展现标题所表示的“Java中在<em>调用</em>某<em>方法</em>发生<em>异常</em>时,想达到重复<em>调用</em>此<em>方法</em>直到此<em>方法</em>能正常执行的效果”。 ...
求助 C#调用快车报异常
经理要求,要用<em>程序</em><em>调用</em>软件下载客户端<em>程序</em>包,我在网上找了几种<em>调用</em>下载工具下载的<em>方法</em>,其中在<em>调用</em>网际快车时,遇到一个问题,总报<em>异常</em>,不知道该如何解决。rnrn <em>方法</em>:rn public static void DownloadByFlashGet(string url)rn rn Type FlashGet;rn object objFlashGet;rn object[] parameter = new object[5];rn if (url != null && url.Length > 0)rn rn FlashGet = Type.GetTypeFromProgID("BHO.IFlashGetNetscapeEx");rn objFlashGet = Activator.CreateInstance(FlashGet);rn parameter[0] = url;rn parameter[1] = "TelemedicineSystem";rn parameter[2] = url;rn parameter[3] = "FlashGet";rn parameter[4] = 0;rn FlashGet.InvokeMember("AddUrlEx", BindingFlags.InvokeMethod, null, objFlashGet, parameter);rn rn rn 添加引用时,我选择的是FlashGetBHO 1.0 Type Libraryrn 但是不知道为什么总报<em>异常</em>rnrn <em>异常</em>信息如下:rn 检索 COM 类工厂中 CLSID 为 116BA71C-8187-4F15-9A1F-C9D6289155D1 的组件时失败,原因是出现以下错误: 80070005。rnrn 我在网上查了一下,说要在DCom配置中为网际快车添加权限,我按照着资料,给FlashGetBHO和FlashgetHook添加了,ASP.NET账户和IUSER_计算机名权限,但还是会报错rnrn 请教各位大哥们,这到底是什么原因啊,是不是因为我引用的DLL不对?谁能告诉一下,在线等,非常着急,谢谢!rn
Tomcat 调用 jboss上的 Ejb 报异常
刚学Ejb 从Tomcat 的index.jsp 中<em>调用</em>本机 jboss 服务器上的Ejb 时报<em>异常</em> 。奇怪的是,在同一工程下我写了一个用来测试的main<em>方法</em>,代码与index.jsp中的脚本代码一模一样,但在main里面运行时可以正常得到结果。我实在不解,请前辈帮我看看是什么原因。代码和<em>异常</em>信息如下。rn~~~ rn~~~rnrn<em>异常</em>信息rn~~~javax.servlet.ServletExceptionrn org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)rn org.apache.jsp.index_jsp._jspService(index_jsp.java:75)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnroot causernrnjavax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: rn java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: rn java.net.MalformedURLException: no protocol: Files/Apache]rn org.jnp.interfaces.NamingContext.lookup(NamingContext.java:780)rn org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)rn javax.naming.InitialContext.lookup(InitialContext.java:409)rn org.apache.jsp.index_jsp._jspService(index_jsp.java:63)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnroot causernrnjava.rmi.ServerException: RemoteException occurred in server thread; nested exception is: rn java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: rn java.net.MalformedURLException: no protocol: Files/Apachern sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)rn sun.rmi.transport.Transport$1.run(Unknown Source)rn java.security.AccessController.doPrivileged(Native Method)rn sun.rmi.transport.Transport.serviceCall(Unknown Source)rn sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)rn sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)rn java.lang.Thread.run(Unknown Source)rn sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)rn sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)rn sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160)rn org.jnp.server.NamingServer_Stub.lookup(Unknown Source)rn org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)rn org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)rn javax.naming.InitialContext.lookup(InitialContext.java:409)rn org.apache.jsp.index_jsp._jspService(index_jsp.java:63)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrn~~~~rn
WinCE环境下调用WebService速度慢,报异常··
在WINCE下写了一客户端,功能很简单目,就是将从串口中获取到的数据在数据库中进行校验然后返回,这中间是通过WEBSERVICE进行的<em>调用</em>,在这个简单的过程中遇到了这样两个问题:rn 其一:就是<em>调用</em>WEBSERVICE速度很慢,除了第一次速度很慢很慢之外,后面的每一次<em>调用</em>都在耗时240毫秒至400毫秒之间,如果不通过WEBSERVICE来<em>调用</em>而是直接对着数据库操作,每次<em>调用</em>的速度在100毫秒左右 (PS:在PC机上测试两种<em>调用</em>方式时间都很短,均在16毫秒左右),我想知道这种差异是什么造成的?有没有解决办法。rn rn 其二:在WINCE上<em>调用</em>WEBSERVICE的时候常常会捕捉到一个<em>异常</em>信息:rnexception: There were not enough free threads in the ThreadPool object to complete the operation 通过查找MSDN知道是应用<em>程序</em>池中的可用线程已满,新的链接请求不能被执行造成的,但根据MSDN上提供的方式试过之后还是会出现这个问题,不知道是不是我更改的位置或者信息不对,请大侠给予指点,非常感谢rnrn现附上MSDN中处理该<em>异常</em>的链接:http://support.microsoft.com/kb/821268rnrn期待你指点迷津···
CreateProcess()调用失败,报有异常
PROCESS_INFORMATION piProcInfo;rnZeroMemory( &piProcInfo, sizeof(PROCESS_INFORMATION));rnbsuccess = ::CreateProcess(NULL, rn TEXT("Client.exe"), // command line rn NULL, // process security attributes rn NULL, // primary thread security attributes rn TRUE, // handles are inherited rn 0, // creation flags rn NULL, // use parent's environment rn NULL, // use parent's current directory rn &siStartInfo, // STARTUPINFO pointer rn &piProcInfo); // receives PROCESS_INFORMATIONrn当断点走到最后一行时,报有未处理<em>异常</em>,是怎么回事呢?
*****************客户端调用webservice 报javax.xml.bind.UnmarshalException异常
javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element (uri:"http://common.web.topsoft.com", local:"return"). Expected elements are (none) rn at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)rn at $Proxy77.caseSourceInfoForOtherSystem(Unknown Source)rn at com.topnet.stag.service.SuspectIllegalProcessServiceTest.testSuspectIlleal(SuspectIllegalProcessServiceTest.java:70)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)rn at java.lang.reflect.Method.invoke(Method.java:599)rn at junit.framework.TestCase.runTest(TestCase.java:154)rn at junit.framework.TestCase.runBare(TestCase.java:127)rn at junit.framework.TestResult$1.protect(TestResult.java:106)rn at junit.framework.TestResult.runProtected(TestResult.java:124)rn at junit.framework.TestResult.run(TestResult.java:109)rn at junit.framework.TestCase.run(TestCase.java:118)rn at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)rnCaused by: javax.xml.bind.UnmarshalExceptionrn - with linked exception:rn[javax.xml.bind.UnmarshalException: unexpected element (uri:"http://common.web.topsoft.com", local:"return"). Expected elements are (none)]rn at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:421)rn at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)rn at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:330)rn at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:768)rn at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:632)rn at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:156)rn at org.apache.cxf.interceptor.DocLiteralInInterceptor.getPara(DocLiteralInInterceptor.java:260)rn at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:127)rn at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)rn at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:785)rn at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2375)rn at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2233)rn at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2076)rn at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)rn at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:724)rn at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)rn at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)rn at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:546)rn at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:343)rn at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:295)rn at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)rn at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)rn ... 18 morernCaused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://common.web.topsoft.com", local:"return"). Expected elements are (none)rn at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:603)rn at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:244)rn at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:239)rn at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:116)rn at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1009)rn at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:446)rn at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:427)rn at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:275)rn at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:209)rn at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:358)rn ... 38 morernCaused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://common.web.topsoft.com", local:"return"). Expected elements are (none)rn ... 48 morernrn
java调用oracle存储过程,报连接池异常
没有用什么框架,就是用基本的jdbcrnrn1、rnClass.forName("oracle.jdbc.driver.OracleDriver");rnString url = "";rnconn = DriverManager.getConnection(url, "", "");rn如上面的写法不会出错,<em>调用</em>存储过程正常执行。rnrn2、rnds = (DataSource) ic.lookup(strDataSource);rnconn = ds.getConnection();rn但是用连接池的数据源就会报<em>异常</em>。rnrnrntomcat下<em>异常</em>:rnjava.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapperrnwebsphere下<em>异常</em>:rncom.ibm.ws.rsadapter.jdbc.WSJdbcConnectionrnrn请指导一下该修改什么地方可以正常的<em>调用</em>连接池中的数据源?
调用webservicce 报operation timed out 异常
请问这个<em>异常</em>应该怎么处理呢
android客户端调用webservice报异常,是怎么回事
[code=java]package Telephone.test;rnrnimport org.ksoap2.SoapEnvelope;rnimport org.ksoap2.serialization.SoapObject;rnimport org.ksoap2.serialization.SoapSerializationEnvelope;rnimport org.ksoap2.transport.HttpTransportSE;rnrnimport android.app.Activity;rnimport android.os.Bundle;rnimport android.view.View;rnimport android.view.View.OnClickListener;rnimport android.widget.Button;rnimport android.widget.EditText;rnimport android.widget.TextView;rnpublic class TelephoneActivity extends Activity rn /** Called when the activity is first created. */rn private EditText phoneSecEditText;rn private TextView resultView;rn private Button queryButton;rn public void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.main);rn queryButton = (Button) findViewById(R.id.query_btn);rn queryButton.setOnClickListener(new OnClickListener() rn public void onClick(View v) rn rn String username = phoneSecEditText.getText().toString().trim();rn getRemoteInfo(username);rn rn );rn rn rn public void getRemoteInfo(String username) rn // 命名空间rn String nameSpace="http://tempuri.org/";rn // <em>调用</em>的<em>方法</em>名称rn String methodName="GetUserList";rn // EndPointrn String endPoint="http://192.168.0.100:8081/WebService.asmx";rn // SOAP Actionrn String soapAction="http://tempuri.org/GetUserList";rnrn // 指定WebService的命名空间和<em>调用</em>的<em>方法</em>名rn SoapObject rpc = new SoapObject(nameSpace, methodName);rnrn // 设置需<em>调用</em>WebService接口需要传入的两个参数mobileCode、userIdrn rpc.addProperty("username", username);rn rnrn // 生成<em>调用</em>WebService<em>方法</em>的SOAP请求信息,并指定SOAP的版本rn SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);rnrn envelope.bodyOut = rpc;rn // 设置是否<em>调用</em>的是dotNet开发的WebServicern envelope.dotNet = true;rn // 等价于envelope.bodyOut = rpc;rn envelope.setOutputSoapObject(rpc);rnrn HttpTransportSE transport = new HttpTransportSE(endPoint);rn try rn // <em>调用</em>WebServicern transport.call(soapAction, envelope);rn catch (Exception e) rn e.printStackTrace();rn rnrn // 获取返回的数据rn SoapObject object = (SoapObject) envelope.bodyIn;rn // 获取返回的结果rn String result = object.getProperty(0).toString();rn //String result = "lijian";rnrn // 将WebService返回的结果显示在TextView中rn resultView.setText(result);rn rn[/code]rnrn
调用web service服务的时候报异常。。
javax.servlet.ServletException: com.biaoqi.ibs.exception.SystemException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Couldn't send message.rn org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn com.biaoqi.ibs.base.IBSActionServlet.process(IBSActionServlet.java:27)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)rn com.biaoqi.ibs.filter.EncodingFilter.doFilter(EncodingFilter.java:28)rnrnrn完全不能理解者到底是哪里有问题 蛋疼死了 rn[code=java] public void doFilter(ServletRequest srequest, ServletResponse sresponse,rn FilterChain chain) throws IOException, ServletException rn HttpServletRequest request = (HttpServletRequest) srequest;rn request.setCharacterEncoding(targetEncoding);rn config.toString();rn chain.doFilter(srequest, sresponse);rn [/code]rn上面说的EncodingFilter.doFilter报的错 但是这里什么也没做 就掉了一个封装好了的<em>方法</em>。
C#调用C++的DL报未知异常
[code=C/C++]rn//DLL中的函数声明rn//app传入rn//buffer 传出rnISO8583DLL_API int Pack_Ex (application* app,unsigned char * buffer );rn[/code]rnrn[code=C#]rn//机构体定义rn [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]rn internal struct Application_Exrn rn public static Application_Ex InitShuZu()rn rn Application_Ex obj = new Application_Ex();rn obj.process_code = new byte[5];rn obj.trans_type = new byte[3];rn obj.park_id = new byte[PARK_ID_LENGTH + 1];rn obj.terminal_id = new byte[TERMINAL_ID_LENGTH + 1];rn //............. rn //内容太多,没有贴完rn rn // packagern rn public byte[] source_tpdu ; rn public byte[] target_tpdu ; rnrn public byte itrans_type; rn public byte[] trans_type ; rn //............. rn //内容太多,没有贴完rn rn//DLL函数导出rn [DllImport("ISO8583Dll.dll", EntryPoint = "Pack_Ex")]rn private static extern int Pack_Ex(Application_Ex app_ex, byte[] buff);rnrn//函数<em>调用</em>rn unsafe public static void jgtdy()rn rn Application_Ex m_txd = new Application_Ex();rn m_txd = Application_Ex.InitShuZu();rn rn tryrn rn //赋值rn m_txd.process_code[0] = (byte)'0';rn m_txd.process_code[1] = (byte)'0';rn m_txd.process_code[2] = (byte)'0';rn m_txd.process_code[3] = (byte)'6';rnrn m_txd.trans_type[0] = (byte)'8';rn m_txd.trans_type[1] = (byte)'1';rn //010101009001rn m_txd.park_id[0] = (byte)'0';rn m_txd.park_id[1] = (byte)'1';rn m_txd.park_id[2] = (byte)'0';rn m_txd.park_id[3] = (byte)'1';rn m_txd.park_id[4] = (byte)'0';rn m_txd.park_id[5] = (byte)'1';rn m_txd.park_id[6] = (byte)'0';rn m_txd.park_id[7] = (byte)'0';rn m_txd.park_id[8] = (byte)'9';rn m_txd.park_id[9] = (byte)'0';rn m_txd.park_id[10] = (byte)'0';rn m_txd.park_id[11] = (byte)'1';rnrn //02010001rn m_txd.terminal_id[0] = (byte)'0';rn m_txd.terminal_id[1] = (byte)'2';rn m_txd.terminal_id[2] = (byte)'0';rn m_txd.terminal_id[3] = (byte)'1';rn m_txd.terminal_id[4] = (byte)'0';rn m_txd.terminal_id[5] = (byte)'0';rn m_txd.terminal_id[6] = (byte)'0';rn m_txd.terminal_id[7] = (byte)'1';rnrn //20120420rn m_txd.trans_date[0] = (byte)'2';rn m_txd.trans_date[1] = (byte)'0';rn m_txd.trans_date[2] = (byte)'1';rn m_txd.trans_date[3] = (byte)'2';rn m_txd.trans_date[4] = (byte)'0';rn m_txd.trans_date[5] = (byte)'4';rn m_txd.trans_date[6] = (byte)'2';rn m_txd.trans_date[7] = (byte)'0';rnrn //005006rn m_txd.trans_time[0] = (byte)'0';rn m_txd.trans_time[1] = (byte)'0';rn m_txd.trans_time[2] = (byte)'5';rn m_txd.trans_time[3] = (byte)'0';rn m_txd.trans_time[4] = (byte)'0';rn m_txd.trans_time[5] = (byte)'6';rn //000100rn m_txd.lsh = 000100;rnrn m_txd.host_lsh = 000000000000;rn //000101rn m_txd.batch_no = 000101;rnrn m_txd.amount = 000000000000;rnrn //0033rn m_txd.para_ver = 0033;rnrn //2012040400rn m_txd.fee_id[0] = (byte)'2';rn m_txd.fee_id[1] = (byte)'0';rn m_txd.fee_id[2] = (byte)'1';rn m_txd.fee_id[3] = (byte)'2';rn m_txd.fee_id[4] = (byte)'0';rn m_txd.fee_id[5] = (byte)'4';rn m_txd.fee_id[6] = (byte)'0';rn m_txd.fee_id[7] = (byte)'4';rn m_txd.fee_id[8] = (byte)'4';rn m_txd.fee_id[9] = (byte)'0';rn m_txd.fee_id[10] = (byte)'0';rnrn m_txd.prog_ver = 0000;rn //01080001rn m_txd.oper_id[0] = (byte)'0';rn m_txd.oper_id[1] = (byte)'1';rn m_txd.oper_id[2] = (byte)'0';rn m_txd.oper_id[3] = (byte)'8';rn m_txd.oper_id[4] = (byte)'0';rn m_txd.oper_id[5] = (byte)'0';rn m_txd.oper_id[6] = (byte)'0';rn m_txd.oper_id[7] = (byte)'1';rn //0101rn m_txd.oper_pwd[0] = (byte)'0';rn m_txd.oper_pwd[1] = (byte)'1';rn m_txd.oper_pwd[2] = (byte)'0';rn m_txd.oper_pwd[3] = (byte)'1';rnrn //0001rn //m_txd.mac[0]=0x20;rn for (int i = 0; i < 8; i++)rn rn m_txd.mac[i] = 0x20;rn rn m_txd.park_ver[0] = (byte)'0';rn m_txd.park_ver[1] = (byte)'0';rn m_txd.park_ver[2] = (byte)'0';rn m_txd.park_ver[3] = (byte)'1';rn //0102rn m_txd.oper_ver[0] = (byte)'0';rn m_txd.oper_ver[1] = (byte)'1';rn m_txd.oper_ver[2] = (byte)'0';rn m_txd.oper_ver[3] = (byte)'2';rnrn byte[] buf = new byte[100];rn int nlen = Pack_Ex(m_txd, buf);//执行到这里报<em>异常</em>NotSupportedExceptionrn rn catch (System.Exception ex)rn rn string exstr = ex.Message;rn rnrn rn[/code]rn
调用hibernate操作报异常求解
项目中有个Action~rn当在Action初始化的时候new一个ServiceManage就会报<em>异常</em>rnServiceManage:rn[code=Java]rnpackage com.guangguang.service;rnrnimport org.hibernate.Session;rnimport org.hibernate.SessionFactory;rnimport org.hibernate.cfg.Configuration;rnimport com.guangguang.model.User;rnrnpublic class ServiceManage rn static Configuration cfg = new Configuration();rn static SessionFactory sf= cfg.configure().buildSessionFactory();rn static Session session = sf.openSession();rn rn public void begin()rn session.beginTransaction();rn rn public void end()rn session.getTransaction().commit();rn session.close();rn sf.close(); rn rn public void add(User u)rn begin();rn session.save(u); rn end();rn rn rn public void delete(User u)rn begin();rn session.delete(u);rn end();rn rn rn public void update(User u)rn begin();rn session.update(u);rn end();rn rn rn public void load(User u)rn begin();rn session.load(u ,u.getClass());rn end();rn rn rnrnrnrnrn[/code]rnrn<em>异常</em>信息:rn[code=Java]rn严重: Servlet.service() for servlet default threw exceptionrnjava.lang.ClassNotFoundException: org.hibernate.Sessionrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)rn at java.lang.ClassLoader.loadClassInternal(Unknown Source)rn at com.guangguang.action.RegisterAction.(RegisterAction.java:14)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)rn at java.lang.reflect.Constructor.newInstance(Unknown Source)rn at java.lang.Class.newInstance0(Unknown Source)rn at java.lang.Class.newInstance(Unknown Source)rn at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:119)rn at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150)rn at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:139)rn at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:109)rn at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:288)rn at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:388)rn at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:187)rn at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)rn at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)rn at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:478)rn at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Unknown Source)rnrn[/code]rn环境是:rnJDK6.0 struts2.1.6 hibernate3.3.2rnrn我觉得问题出在hibernate内部了rn但是是怎么回事,我也不知道`rnrn请有过类似问题的高手指点一下`rn还需要什么信息请留言..rnrn
中国站长报总第四期
本 期 目 录: 专题 Alexa排名高手 在线访谈全记录 新闻 2004年 GOOGLE称喜欢娱乐的中国人 新闻 从百度下吧所看到的 新闻 博客中国 网站收购 博客动力 新闻 2004中国IT风云榜评选揭晓 关注 再谈WEB服务器的目录权限问题(图) 关注 教如何挑选出一款优秀的网站空间 关注 如何让你的网站部分网页不被收录 关注 登录搜索引擎失败的原因 关注 IIS6架设网站常见问题及症状举例答疑 关注 搜索引擎及其优化的新趋势 关注 全方位网站流量分析 精华 IIS 错误代码大汇总 精华 IIS服务器完全配置使IIS实现ASP,CGI,PERL和PHP+MYSQL(图) 精华 让3721也无奈的弹出窗口(代码) 精华 让网页跳转的几种<em>方法</em>(代码) 精华 最全的HTML特殊字符列表
addin
1|)Security Wizard Anyone that has set up Jet security on an application knows how difficult and confusing it can be. The Security Wizard is a tool that will allow you to setup your own security mechanism in your Access application without having to implement Jet security. Running the wizard from Tools/Add-ins/Security Add-In will copy several objects into your application. It will drop a table (tblOperators) into your application that will contains the list of users of your app and their password (passwords are encrypted using very simple XOR encryption.) Also, it will drop several modules, two class modules(GlobalProperties and SecurityClass) and one standard module (basMiscSecurityFunctions). (NOTE: The basMiscSecurityFunctions module has an IsLoaded function in it. If you already have an IsLoaded function in your application you will needed to delete if from the basMiscSecurityFunctions module. Delete the function only, not the whole module). Also, several forms are added to your project. Three of them (frmCreateUser, frmChangePassword, frmGetUserName) are used by the class module. The fourth form (frmEditUsers) can be used to manage the user accounts (make users administrators for example). Once you run the Security wizards you add the following to the startup procedure of your application: PWs.ConfirmPassword Once the user logs in you can query there user name or authority using several GlobalProps properties as follows: If GlobalProps.Administrator = True Then ... or If GlobalProps.CurrentUser = &quot;JohnS&quot; then ... For more information the Security Add-In please click here or read the help file that is distributed with the wizards. 2) Global Error Handler Error handling is a necessary evil of programming in ANY VB environment. All well-developed applications will have error handling code in most if not all of the procedures. The &quot;evil&quot; lies in the fact that VB does not add this error handling code for you. It only create the procedure &quot;stub&quot; (Sub...End Sub) for you so that it is up to the developer to add the error handling. The Global Error Handler add-ins has two components. The first component, like the Security Add-In described above, adds all the objects that are needed to enable error handling and is installed from the Tools/Add-Ins/Global Error Handler menu item. This will add two(2) objects to your table: A table (usysErrors) which is the where all the errors are logged. (Yes - one of the features of thjs Add-In is that all errors get logged into this table which makes troubleshooting problems much easier.) And a module (basGlobalErrorHandler) which is procedure called by your handlers in order to handle and log the errors. The second component is a &quot;builder&quot; that is installed by the setup routine. When you create a new procedure the builder will automatically add all of the error handling for it including the call to the Global Error Handler (which logs the error). To execute the builder, right click in the procedure and choose &quot;Build&quot; from the context menu. Now, instead of going straight to the Expression Builder, a selection box will appear. Choose &quot;Global Error Handler&quot; from the list and click OK. The error handling code will be automatically inserted into your procedure. For more information on the Error Handling Add-Ins or error handling in general please click here or read the help file that is distributed with the wizards. 3)Many-to-Many Wizard The Many-to-Many Add-In provides a way for developers to quickly and easily create forms that can be used to populate the junction table of a many-to-many table relationship. Normally, populating a junction table requires use of a Main-Form/Sub-Form interface with the junction table being populated by a Combo Box which is in the Sub-Form. (Don&#39;t know what I am talking about? Click HERE.) This kind of interface is extremely &quot;kludgy&quot; but it the only option available to non-programmers (unless they use some kind of Add-In such as the one described here.) You start the Many-To-Many wizards (there are two of them) by selecting either Tools/Add-Ins/M2M CheckBox Wizard or Tools/Add-Ins/M2M ListBox Wizard from the menu. Each of these will step you through a wizard that will create a form for you (that you name at the end) that can then be used to populate the junction table with an form that is easy to use and intuitive. (NOTE: These wizards are the least tested of all of them and you probably WILL find bugs.) For more information the Many-to-Many wizards or table relationships in general please click here or read the help file that is distributed with the wizards. 4) Name Builder Microsoft Built-In wizards are very useful but they have one annoying flaw. That is, no naming conventions are used. Naming conventions are commonly used standards that all professional developers use to better manage their code and their projects. Even controls on forms should have standard naming conventions. For example, combo box usually begin with cbo (i.e., cboNames) and text boxes start with txt (i.e. txtAddress). When these conventions are used it makes managing the code associated with the controls easier. The Microsoft wizards do NOT use these conventions. So when you create a form or report with the wizard, instead of &quot;cboName&quot; or &quot;txtAddress&quot; you get simply get &quot;Name&quot; or &quot;Address&quot;. (This can cause some expressions to return #Name instead of the correct value, expecially in reports.) The problem is that it is difficult to remember the standard naming convention prefixes for controls and renaming them can be time consuming. The Name Builder will correctly prefix a control with the right convention based on its type. To use it (the name builder is installed by the setup program) simply select the control and view its property sheet. Select the Name property from the property sheet. Click on the Build (...) button that is to the right of the property. It will take the current name that is in the property cell and replace it with the same value stripped of spaces and other undesirable text and prefixed with the right three letter convention. Coming soon: A Name Builder wizard that will rename ALL controls on a new form using proper conventions. Send us an e-mail so that we can notify you when the change is available. 5) Linked Table Manager and other Wizards Also included with the setup are a Linked Table Manager and other Add-Ins.
为何总报下标越界
Documents.open 提示缺少对象?
利用vbs在服务器上操作一个doc文档rnrnset wApp=CreateObject("word.Application") 'OKrnif err.number>0 thenrn response.write err.description&err.numberrn response.endrnendrnwApp.Documents.open "d:\doc\template.doc" '提示缺少对象rn有人知道这个是什么问题吗?
中国站长报总第五期
专题 XML 的初步认识 XML语法全接触(精) XML 编程初步研究 XML的应用(HTML结合) XML与ASP结合使用的小偷<em>程序</em> 评论 百度成长之路 搜索引擎优化背后的利益驱动力:85%毛利率 2004年度中文非主流网站100强评选结果揭晓√ 广告联盟看起来很“完美” Google AdSense与其他广告联盟的区别是什么? 当当失算于Email营销 知己知彼分析:何防止google adsense fraud clicks(欺骗点击作弊)的文章 Google AdSense工作原理 Google AD 何时可以取得收入? 研究 IIS6中上传文件尺寸太小的解决办法 关于IIS连接数和在线人数的详细说明 一位高手整理的IIS FAQ 鼠标自动移动/点击(难) 自动启动/关闭广告条多种<em>方法</em>(难) HTML 标记语言全面详细解 一天学会 玩透9种网页弹出窗口(精) 令人生厌的form元素! 让IIS服务器支持中文文件名 如何避免被人看成业余网站 把小商业网站做成大企业形象 提供两个常用合同书样本 :☆ 网站制作 doc 服务器托管 doc
jdk7 Collections.sort()方法报非法参数异常
JDK7的Comparison method violates its general contract<em>异常</em> 前一阵遇到了一个使用Collections.sort()时报<em>异常</em>的问题,跟小伙伴@zhuidawugui 一起排查了一下,发现问题的原因是JDK7的排序实现改为了TimSort,之后我们又进一步研究了一下这个神奇的算法。 2.背景 先说一下为什么要研究这个<em>异常</em>,前几天线上...
Close();方法异常?~~~~~~~~~~到底是怎么回事。。
if (con == null)rn rn con = new SqlConnection(JW_conn);rn rn if (con.State == ConnectionState.Closed)rn rn tryrn rn ///打开数据库连接rn con.Open();rn rn catch (Exception ex)rn rn HttpContext.Current.Response.Write(ex.Message);rn rnrn rnrn rn /// rn /// 关闭数据库连接rn /// rn public void Close()rn rn ///判断连接是否已经创建rn if (con != null)rn rn ///判断连接的状态是否打开rn if (con.State == ConnectionState.Open)rn rn con.Close();///这句出现<em>异常</em>信息,到底是怎么回事rn rn
多线程调用同一个方法异常
我多线程<em>调用</em>同一个<em>方法</em>rn执行 Graphics.DrawStringrn抛出<em>异常</em>:该对象当前正在其他地方使用rnrn使用了lock 将Graphics.DrawString锁住rn也没用rnrn怎么办呢?
调用RMI 方法出现的异常...
rnrn启动TOMCAT <em>调用</em>RIM <em>方法</em> 时出现rn............rn............rnrn01:52:19,218 INFO :: SessionFactoryImpl > closingrn01:52:19,218 ERROR :: ContextLoader > Context initialization failedrnorg.springframework.beans.factory.BeanCreationException: Error creating bean witrnh name 'org.springframework.remoting.rmi.RmiServiceExporter#1' defined in ServlerntContext resource [/WEB-INF/classes/applicationContext-service.xml]: Invocationrnof init method failed; nested exception is java.rmi.ServerException: RemoteExceprntion occurred in server thread; nested exception is:rn java.rmi.UnmarshalException: error unmarshalling arguments; nested exceprntion is:rn java.net.MalformedURLException: no protocol: Files/Tomcat5.5.9/webapps/frnimsserver/WEB-INF/classes/rnCaused by:rnjava.rmi.ServerException: RemoteException occurred in server thread; nested excernption is:rn java.rmi.UnmarshalException: error unmarshalling arguments; nested exceprntion is:rn java.net.MalformedURLException: no protocol: Files/Tomcat5.5.9/webapps/frnimsserver/WEB-INF/classes/rn at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385rn)rn at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)rn at sun.rmi.transport.Transport$1.run(Transport.java:153)rn at java.security.AccessController.doPrivileged(Native Method)rn at sun.rmi.transport.Transport.serviceCall(Transport.java:149)rn at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4rn66)rn at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransportrn.java:707)rn at java.lang.Thread.run(Thread.java:595)rn at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamrnRemoteCall.java:247)rn at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:rn223)rn at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)rn at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)rn at org.springframework.remoting.rmi.RmiServiceExporter.prepare(RmiServicrneExporter.java:256)rn at org.springframework.remoting.rmi.RmiServiceExporter.afterPropertiesSernt(RmiServiceExporter.java:197)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanrnFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1062)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanrnFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1029)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanrnFactory.createBean(AbstractAutowireCapableBeanFactory.java:420)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObrnject(AbstractBeanFactory.java:245)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistrrny.getSingleton(DefaultSingletonBeanRegistry.java:141)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBeanrn(AbstractBeanFactory.java:242)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBeanrn(AbstractBeanFactory.java:156)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.rnpreInstantiateSingletons(DefaultListableBeanFactory.java:290)rn at org.springframework.context.support.AbstractApplicationContext.refresrnh(AbstractApplicationContext.java:348)rn at org.springframework.web.context.support.AbstractRefreshableWebApplicarntionContext.refresh(AbstractRefreshableWebApplicationContext.java:156)rn at org.springframework.web.context.ContextLoader.createWebApplicationConrntext(ContextLoader.java:246)rn at org.springframework.web.context.ContextLoader.initWebApplicationConternxt(ContextLoader.java:184)rn at org.springframework.web.context.ContextLoaderListener.contextInitialirnzed(ContextLoaderListener.java:49)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContexrnt.java:3669)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4rn104)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBasern.java:759)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:73rn9)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)rnrn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.javrna:894)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.jrnava:857)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475rn)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.javarn:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecyclrneSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)rnrn at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)rnrn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442rn)rn at org.apache.catalina.core.StandardService.start(StandardService.java:4rn50)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:683rn)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:537)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.rnjava:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesrnsorImpl.java:25)rn............rn...........rn2007-10-2 1:52:19 org.apache.catalina.startup.Catalina startrn信息: Server startup in 19953 msrn
调用excel Rate方法异常
[code=csharp]Application app = new Application();rndouble x = app.WorksheetFunction.Sum(1, 2);rnvar aaa = app.WorksheetFunction.Rate((double)repayPeriods, -pactMoney, repayMoney);rn[/code]rnrnSum<em>方法</em>可以正常执行,rn但是Rate就会报:类 WorksheetFunction 的 Rate <em>方法</em>无效 <em>异常</em>!rnrn求大神~~~ [img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/1.gif][/img]
在VS2008中调试SERIALPORT总过不去
[code=C#]using System;rnusing System.Collections.Generic;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Linq;rnusing System.Text;rnusing System.Windows.Forms;rnusing System.IO.Ports;rnrnnamespace test_serialportrnrn public partial class Form1 : Formrn rn public Form1()rn rn InitializeComponent();rn rnrn private void button1_Click(object sender, EventArgs e)rn rn SerialPort1.Portname = "COM2";rn SerialPort1.BaudRate = "9600";rnrn rn rnrn[/code]
spring 定时任务中调用context 报异常NullPointer
我在项目中用到了quartz定时任务rn然后在启动的<em>方法</em>中使用:rnServletContext context = ServletActionContext.getServletContext(); rnList list=(List) context.getAttribute("dictionaryInfo");rnrn这个dictionaryInfo是我在listener中set进去的。rn rn启动项目,报rn[code=Java]rnCaused by: java.lang.NullPointerExceptionrn at org.apache.struts2.ServletActionContext.getServletContext(ServletActionContext.java:139)rn[/code]rn请问这是什么原因造成的,如何解决呢?
MFC dll 中 调用 ado 接口 报异常! 等待高人!
我在 常规 MFC dll 中 <em>调用</em> ado 接口 ,rnrnm_pConnection.CreateInstance(__uuidof(Connection)); 这条 语句 过不去rnrnrn在这里报错 :rnInterface* operator->() const rn rn if (m_pInterface == NULL) rn _com_issue_error(E_POINTER);rn rnrn return m_pInterface; rn rnrn我都 快崩溃了 ,再折腾了 好几天了 ,请问 您碰到 过 这种问题吗 ??
菜鸟求救高人!servlet中调用类总是报异常
配置文件和类(service1)测试正常,在JUnit测试中可以返回值,但是在servlet中<em>调用</em>service1类,始终出错,不是空指针就是下面的<em>异常</em>。rn请看代码:rnrn这是service1部分:rnrnpackage com.yb.web;rnimport java.io.FileInputStream;rnimport java.io.IOException;rnimport java.sql.*;rnimport java.util.ArrayList;rnimport java.util.Properties;rnrnpublic class Service1 rnrn /**rn * @param argsrn */rn private static Connection ct=null;rn private static PreparedStatement ps=null;rn private static ResultSet rs=null;rn private static ArrayList al=null;rn rn private static FileInputStream fis=null;rn private static Properties pp=null;rn rn private static String url="";rn private static String user="";rn private static String passw="";rn private static String driver="";rn rn rn //加载驱动,仅需一次。rn staticrnrn try rn //建立输入流,引入配置文件。rn fis = new FileInputStream("peizhi.properties");rn pp = new Properties();rn pp.load(fis);rn url=pp.getProperty("url");rn user=pp.getProperty("user");rn passw=pp.getProperty("passw");rn driver=pp.getProperty("driver");rn //加载驱动rn Class.forName(driver);rn rn catch (Exception e) rn // TODO: handle exceptionrn e.printStackTrace();rn finallyrn //关闭输入流rn rn try rn fis.close();rn catch (IOException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn finallyrn fis=null;rn rn rn rnrn public static Connection getConnection()rn //建立连接rn try rn ct=DriverManager.getConnection(url,user,passw);rn rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn return ct;rn rn rn rn //建立连接的<em>方法</em>rnrn public static String chaxun()rn int i=0;rn String pin=""; rn tryrn //建立连接rn ct=getConnection();rn //建立语句对象rn ps=ct.prepareStatement("select url,wenzi from info limit 0,10");rn //回收结果rn rs=ps.executeQuery(); rn rn //装箱 rn al=new ArrayList();rnrn while(rs.next())rn JavaBean jb =new JavaBean();rn jb.setUrl(rs.getString(1));rn jb.setWenzi(rs.getString(2));rn al.add(jb);rn rn for(i = 0; i
声明式事务管理时总报异常!用的spring-3.0与hibernate-3.5整合
请各位大虾帮小弟看下,当我把UserDAOImpl.java中的Session s = sessionFactory.getCurrentSessionrnrn();改为Session s = sessionFactory.openSession();不会报错,但是事务就根本没用上啊!请问是rnrngetCurrentSession()在以前的版本上改了么?我在网上搜说把配置文件beans.xml中的thread的thread改为jta还是不行啊!请大家帮rnrn我解决下非常感谢啊!!!rn用Junit测试时的出错信息如下:rn[code=Java]rnorg.hibernate.HibernateException: save is not valid without active transactionrnat org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invokernrn(ThreadLocalSessionContext.java:340)rnat $Proxy13.save(Unknown Source)rnat com.bjsxt.dao.impl.UserDAOImpl.save(UserDAOImpl.java:34)rnat com.bjsxt.service.UserService.add(UserService.java:23)rnat com.bjsxt.service.UserService$$FastClassByCGLIB$$189fc15d.invoke()rnat net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)rnat org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpointrnrn(Cglib2AopProxy.java:692)rnat org.springframework.aop.framework.ReflectiveMethodInvocation.proceedrnrn(ReflectiveMethodInvocation.java:150)rnat org.springframework.transaction.interceptor.TransactionInterceptor.invokernrn(TransactionInterceptor.java:110)rnat org.springframework.aop.framework.ReflectiveMethodInvocation.proceedrnrn(ReflectiveMethodInvocation.java:172)rnat org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.interceptrnrn(Cglib2AopProxy.java:625)rnat com.bjsxt.service.UserService$$EnhancerByCGLIB$$cd485331.add()rnat com.bjsxt.service.UserServiceTest.testAdd(UserServiceTest.java:18)rnat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rnat sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rnat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rnat java.lang.reflect.Method.invoke(Unknown Source)rnat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)rnat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)rnat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)rnat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)rnat org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)rnat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)rnat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)rnat org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)rnat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)rnat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)rnat org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)rnat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)rnat org.junit.runners.ParentRunner.run(ParentRunner.java:236)rnat org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)rnat org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rnat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rnat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rnat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rnat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rn[/code]rn我的beans.xml内容如下:rn[code=Java]rnrnrn rn rn rn rn rn rnrn rn rnrnrnrnrnrnrnrnrnrnrncom.bjsxt.modelrnrnrnrnrnrnorg.hibernate.dialect.MySQLDialectrnrntruernrnthreadrnrnrnrnrnrn rnrnrn rn rn rnrn rn[/code]rnJunit的测试代码:rn[code=Java]rnpackage com.bjsxt.service;rnimport org.junit.Test;rnimport org.springframework.context.ApplicationContext;rnimport org.springframework.context.support.ClassPathXmlApplicationContext;rnimport com.bjsxt.model.User;rnpublic class UserServiceTest rn @Test rn public void testAdd() throws Exception rn ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml"); rnrn UserService service = (UserService)ctx.getBean("userService");rn service.add(new User());rn ctx.destroy();rnrn rnrnrn[/code]rnUserService.java的代码如下:rn[code=Java]rnpackage com.bjsxt.service;rnimport javax.annotation.Resource;rnimport org.springframework.stereotype.Component;rnimport org.springframework.transaction.annotation.Propagation;rnimport org.springframework.transaction.annotation.Transactional;rnimport com.bjsxt.dao.UserDAO;rnimport com.bjsxt.model.User;rnrn@Componentrn@Transactionalrnpublic class UserService rnrn private UserDAO userDAO; rnrn public void init() rn System.out.println("init");rn rnrn public void add(User user) rn userDAO.save(user);rn rn public UserDAO getUserDAO() rn return userDAO;rn rn @Resource(name="u")rn public void setUserDAO( UserDAO userDAO) rn this.userDAO = userDAO;rn rn public void destroy() rn System.out.println("destroy");rn rnrn[/code]rnUserDAOImpl.java的代码如下:rn[code=Java]rnpackage com.bjsxt.dao.impl;rnrnimport javax.annotation.Resource;rnimport org.hibernate.Session;rnimport org.hibernate.SessionFactory;rnimport org.springframework.stereotype.Component;rnimport com.bjsxt.dao.UserDAO;rnimport com.bjsxt.model.User;rnrn@Component("u") rnpublic class UserDAOImpl implements UserDAO rnrn private SessionFactory sessionFactory;rnrn public SessionFactory getSessionFactory() rn return sessionFactory;rn rnrn @Resourcern public void setSessionFactory(SessionFactory sessionFactory) rn this.sessionFactory = sessionFactory;rn rnrn public void save(User user) rn Session s = sessionFactory.getCurrentSession();rn s.save(user);rn rnrnrn[/code]rnUserDAO.java的代码如下:rn[code=Java]rnpackage com.bjsxt.dao;rnimport com.bjsxt.model.User;rnrnpublic interface UserDAO rn public void save(User user);rnrn[/code]rn实体类User代码如下:rn[code=Java]rnpackage com.bjsxt.model;rnrnimport javax.persistence.Entity;rnimport javax.persistence.GeneratedValue;rnimport javax.persistence.Id;rnrn@Entityrnpublic class User rn private int id;rn private String name;rnrn @Idrn @GeneratedValuern public int getId() rn return id;rn rn public void setId(int id) rn this.id = id;rn rn public String getName() rn return name;rn rn public void setName(String name) rn this.name = name;rn rnrn[/code]rn
.NET2005中的Addin问题
编译错误:rnThe type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)rnreference里也不能添加office,不知道怎么搞得
加了struts2之后总报NoSuchMethod这个异常。。。。。
在成形的项目用struts2改写,只改写了登陆,可是其他的添加的功能都不能运行了,总报NoSuchMethod<em>异常</em>。。。。求解。。。。。。。。。。。。。。。。rn难道是servlet和struts2不能同时存在项目中?
try 语句中的语句为什么总报io异常
Imports System.IOrnrnrnPrivate Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Clickrn Dim myFileStream As FileStreamrnrn Tryrn myFileStream = New FileStream("\\test.txt", FileMode.Open, FileAccess.Read, FileShare.None)rn Catch ex As Exceptionrn MsgBox(ex.Message)rn End Tryrn
asp.net(C#)程序频繁报异常
C#+Sql Server2000 ASP.NET APPLICATIONrnrnSERVER:rn WINDOWS SERVER2003rn RAID5rn rn频繁报以下<em>异常</em>:rnrn1.未将对象引用设置到对象的实例rn2.响应在此上下文中不可用rn3.常规网络错误。请检查您的网络文档rn4.内部连接致命错误
初学RMI 程序狂报异常!
最近在看JAVA核心技术 看到了RMI 那里 我照着书上打代码。 基本上没怎么改动 然后运行 就狂报<em>异常</em>!rnrn代码如下:rnyuancheng.javarnrnrnimport java.rmi.Remote;rnimport java.rmi.RemoteException;rnrnpublic interface yuancheng extends Remote rn String returnstring() throws RemoteException;rnrnrn=======================================================rnduixiang.javarnrnimport java.rmi.*;rnimport java.rmi.server.*;rnpublic class duixiang extends UnicastRemoteObject implements yuanchengrn rn private String str=null;rn public duixiang(String str) throws RemoteExceptionrn rn this.str=str;rn rn rn public String returnstring() throws RemoteExceptionrn rn return this.str;rn rnrnrnrnrn===================================================================rnServer.javarnrnimport java.rmi.*;rnimport java.rmi.server.*;rnimport javax.naming.*;rnrnpublic class Server rn public static void main(String[] args) rn try rn duixiang first=new duixiang("wufangdong");rn duixiang second=new duixiang("wangdi");rn rn Context namingContext=new InitialContext();rn namingContext.bind("rmi:toaster",first);rn namingContext.bind("rmi:microwave",second);rn catch (Exception ex) rn ex.printStackTrace();rn rn rnrnrn贴出一些<em>异常</em>信息:rnjavax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: rn java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: rn java.lang.ClassNotFoundException: yuancheng]rn at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:122)rn at com.sun.jndi.toolkit.url.GenericURLContext.bind(GenericURLContext.java:208)rn at javax.naming.InitialContext.bind(InitialContext.java:359)rn at duixiang.main(duixiang.java:27)rnCaused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: rn java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: rn java.lang.ClassNotFoundException: yuanchengrn at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385)rn at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)rn at sun.rmi.transport.Transport$1.run(Transport.java:153)rn at java.security.AccessController.doPrivileged(Native Method)rn at sun.rmi.transport.Transport.serviceCall(Transport.java:149)rn at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)rn at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)rn at java.lang.Thread.run(Thread.java:595)rn at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)rn at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)rn at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)rn at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)rn at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:116)rn ... 3 morernCaused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: rn java.lang.ClassNotFoundException: yuanchengrnrnrnrn哪位朋友帮忙看下是怎么回事啊? 谢谢!!!!!!!!rn
Wince程序在设备上运行报异常!!!
我将bin目录下的exe文件和sdf数据库文件复制到wince设备上,运行exe文件就报<em>异常</em>。rn<em>异常</em>信息:rnErrorrnSmartDevice.exernMissingMethodExceptionrnFile or assembly name 'System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=3BE235DF1C8D2AD3', or one of its dependencies, was not found.rn求解!!!
addin中的问题
在VS.net中的扩展环境编程中。rn1、在Addins中插入菜单项rn2、增加工具条rn用AddCommand可以完成上面的操作,但是如何只增加图片形工具条。其参数中的图片ID是如何确定图片的。rn是否可以用其它函数。rn
VS2008 WebHost.Host 异常
未解析成员“Yukon.ERP.User,Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”的类型。rnrnrn 在 Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)rn 在 Microsoft.VisualStudio.WebHost.Server.OnSocketAccept(Object acceptedSocket)rn 在 System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)rn 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)rn 在 System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)rn 在 System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)rnrnrn(win 7 64位)rnrn这个报错是 使用 Context.Request.ServerVariables 获取数据时发生的<em>异常</em>rnrnrn在网上查很久说是VS的一个BUG,不用 WebHost 可以用IIS服务器来调试。rn我设置后,连启动都启动不了。rnrn你有遇到过吗?
vs2008捕获不到异常
系统xp sp3rnIDE <em>vs2008</em> 中文版rnMFC项目按钮事件测试如下代码:rntryrn rn BYTE* pch ; rn pch = ( BYTE* )00001234 ; //给予一个非法地址 rnrn *pch = 6 ; //对非法地址赋值,会造成Access Violation <em>异常</em>rn rn catch (CException* e)rn rn AfxMessageBox("CException catch !!");rn rnrn无法捕获到<em>异常</em>,<em>程序</em>直接蹦掉rn网上找过原因大多说设置:Vc-〉项目属性配置属性c/C++代码生成启用C++<em>异常</em>,选中"是,但有SEH<em>异常</em>(/EHa)"。(此处贴子也是测试我上面的那段代码)rn即可,但是我设置了依然没用,请问是什么原因?
vs2008 单步调试异常缓慢
比如rn[code=C/C++]rnstd::vector BufferList;rnstd::vector Length;rnint TotalLength = sizeof(unsigned int);rn[/code]rnrn运行到std::vector BufferList;这一句,黄色光标停留在这一行的前面,停顿几秒钟(按F10没有反应,有时候还会弹出DOS窗口),然后再执行下一条语句。每一步都是这样,怎么回事?
VS2008的异常模块
[img=https://img-bbs.csdn.net/upload/201407/17/1405582529_285885.jpg][/img]rnrn我就想问这个<em>异常</em>提示是指这个函数本身有可能出现的<em>异常</em>,还是这个函数在此处出现的<em>异常</em>。比如图片中的Add ,他的<em>异常</em>提示是参数可能为Null,但是在这里,参数不可能为null。我就想问这个<em>异常</em>提示是什么意思,谢谢给位
VS2008 C#打开异常
今天早上发现点击<em>程序</em>项目文件,VS没有反应,不运行,必须从桌面点击VS2008<em>程序</em>,然后点击打开,选择项目文件才可以打开!别的文件也是这样了。还有<em>程序</em>在调试的时候总是出现HTTP 无法注册 URL http://+:8731/BASE.svc/。另一应用<em>程序</em>已使用 HTTP.SYS 注册了该 URL。请帮帮小弟,谢谢!
VS2008 C# 异常 InvalidProgramException
最近在写一代<em>程序</em>是要用到指针,代码如下,编译时能通过,但运行就报<em>异常</em>:InvalidProgramException:rn当<em>程序</em>包含无效 Microsoft 中间语言 (MSIL) 或元数据时将引发的<em>异常</em>。这通常表示生成<em>程序</em>的编译器中有 bug。rn[code=csharp]rnusing System;rnusing System.Linq;rnusing System.Collections.Generic;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Text;rnusing System.Windows.Forms;rnrnnamespace SmartDeviceProject2rnrn public partial class Form1 : Formrn rn public Form1()rn rn InitializeComponent();rn rnrn private void button1_Click(object sender, EventArgs e)rn rn unsafern rn int i = 0;rn int j = 0rn MessageBox.Show("sdfsfsfsdfsdfsdfs");rn int* p = stackalloc int[1222];rn MessageBox.Show("sdfsfsfsdfsdfsdfs");rn rn rn rnrn[/code]rnA:每次点击BUTTON事件时就报错,(以上是测试代码,编译时能通过)。如果屏蔽掉 int* p = stackalloc int[1222];这句就正常(Wince平台)。rnB:以上代码在XP平台下运行正常,WINCE平台就报错。感觉好像WINCE平台不支持stackalloc 关键字似的?还是我那里参数没设好似的。现求教,谢谢。rnC:WINCE平台 VS2008 C#
VS2008 Ribbon界面异常
我用VS2008开发的Ribbon风格的界面,形如Office2007 Word那种,我<em>程序</em>打开并静止等待一段时间(2小时以上)界面工具栏,菜单部分很大机率给变成黑色,而且最小化等按钮也消失,大家有没有遇到过这种情况,是什么原因?怎么解?
C#WinForm程序调用VLC异常
[b]问题描述[/b]rn使用WinForm<em>程序</em>,<em>调用</em>VLC初始化实例时报<em>异常</em>,就是运行到libvlc_new(arguments.Length, argvPtr)<em>方法</em>时报的<em>异常</em>rnrn<em>异常</em>消息:System.BadImageFormatException:“试图加载格式不正确的<em>程序</em>。 (<em>异常</em>来自 HRESULT:0x8007000B)rn图片:rn[img=https://img-bbs.csdn.net/upload/201810/04/1538621708_565740.png][/img]rn[b]问题出现的环境背景及自己尝试过哪些<em>方法</em>[/b]rn环境:rn1..Net版本:4.5rn2.VLC版本:vlc-3.0.4-win64rn3.IDE:VS2017rn4.OS:Win10 64rn[b]尝试的<em>方法</em>:[/b]rn1.将<em>程序</em>以X86的方式重新生成(无法解决)rn2.libvlc.dll和libvlccore.dll和plugins都在Debug目录下(无法解决)rnrn[b]相关代码[/b]rnrn[code=csharp]libvlc_new(arguments.Length, argvPtr);rnrn// 创建一个libvlc实例,它是引用计数的rn[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]rn[SuppressUnmanagedCodeSecurity]rnprivate static extern IntPtr libvlc_new(int argc, IntPtr argv);[/code]rnrn[b]你期待的结果是什么?实际看到的错误信息又是什么?[/b]rn期待的结果是能够创建实例,但现在报<em>异常</em>。因为是C#<em>调用</em>C++的DLL,也是第一次用,望有大佬解答
解码调用avcodec_decode_video报内存调用冲突异常
我在windows上解码H264文件,<em>调用</em>avcodec_decode_video(2) 第一次没问题frameFinished为0,但第二次<em>调用</em>avcodec_decode_video2(_videoState->pCodecCtx,_videoState->pFrame,&frameFinished,packet);就报内存<em>调用</em>冲突<em>异常</em>的错。而播放其他格式都能正常。rn我也参考了网上H264的解码注意事项在一开始初始化的时候加了avcodec_init();rn我给下具体代码,各位高手指导下:rnint CCGFFmpeg::CGFFmpegInit()rnrn avcodec_init();rn av_register_all();rn avcodec_register_all();rn _videoState = new DataStruct();rn memset(_videoState,0,sizeof(DataStruct));rnrn rn Gdiplus::GdiplusStartup(&_videoState->m_gdiplusToken, &_gdiplusStartupInput, NULL);rnrn return 0;rnrnrnint CCGFFmpeg::CGFFmpegOpenFile(int nPort,char* fileName)rnrn LONG hr;rn rn int ret = av_open_input_file(&(_videoState->pFormatCtx),fileName,NULL,0,NULL);rn if(ret!=0)rn rn return -1;rn rn if(av_find_stream_info(_videoState->pFormatCtx) < 0)rn return -1;rn dump_format(_videoState->pFormatCtx,0,fileName,0);rnrn _totalFrame = _videoState->pFormatCtx->streams[0]->nb_frames;rn if(_videoState->pFormatCtx->streams[0]->r_frame_rate.num)rn _videoState->intervaltime = 1000*_videoState->pFormatCtx->streams[0]->r_frame_rate.den/_videoState->pFormatCtx->streams[0]->r_frame_rate.num;rn if(_totalFrame == 0)rn rn _totalTime = _videoState->pFormatCtx->duration * 1.0 / 1000000;rn _totalFrame = _videoState->pFormatCtx->duration * 1.0 / 1000 / _videoState->intervaltime;rn rn elsern _totalTime = _totalFrame * _videoState->intervaltime*1.0/1000;rnrn return 0;rnrnrnint OpenStream()rnrn _videoState->videoStream = -1;rn _videoState->audioStream = -1;rn for(int i=0;i< _videoState->pFormatCtx->nb_streams;i++)rn rn if(_videoState->pFormatCtx->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO && _videoState->videoStream < 0)rn rn _videoState->videoStream = i;rn rn if(_videoState->pFormatCtx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO && _videoState->audioStream < 0)rn rn _videoState->audioStream = i;rn rn rn if(_videoState->videoStream == -1)rn return -1;rn if(_videoState->audioStream == -1)rn _videoState->isMuted = true;rnrn _videoState->pCodecCtx = _videoState->pFormatCtx->streams[_videoState->videoStream]->codec;rn _videoState->pCodec = avcodec_find_decoder(_videoState->pCodecCtx->codec_id);rn if(_videoState->pCodecCtx->codec_id == CODEC_ID_H264)rn rn _videoState->pCodecCtx->time_base.num = 1;rn _videoState->pCodecCtx->time_base.den = 25;rn _videoState->pCodecCtx->bit_rate = 0;rn _videoState->pCodecCtx->frame_number = 1;rn _videoState->pCodecCtx->codec_type = CODEC_TYPE_VIDEO;rn rn if(avcodec_open(_videoState->pCodecCtx,_videoState->pCodec) < 0)rn return -1;rn packet_queue_init(&_videoState->videoq);rn if(_videoState->audioStream >=0)rn rn _videoState->aCodecCtx = _videoState->pFormatCtx->streams[_videoState->audioStream]->codec;rnrn _videoState->aCodec = avcodec_find_decoder(_videoState->aCodecCtx->codec_id);rn if(avcodec_open(_videoState->aCodecCtx,_videoState->aCodec) < 0)rn return -1;rnrn _videoState->wanted_spec.freq = _videoState->aCodecCtx->sample_rate; rn _videoState->wanted_spec.format = AUDIO_S16SYS; rn _videoState->wanted_spec.channels = _videoState->aCodecCtx->channels; rn _videoState->wanted_spec.silence = 0; rn _videoState->wanted_spec.samples = SDL_AUDIO_BUFFER_SIZE; rn _videoState->wanted_spec.callback = audio_callback; rn _videoState->wanted_spec.userdata = _videoState->aCodecCtx;rn if(SDL_OpenAudio(&_videoState->wanted_spec, &_videoState->spec) < 0) rn rn fprintf(stderr, "SDL_OpenAudio: %s\n", SDL_GetError()); rn return -1; rn rn packet_queue_init(&_videoState->audioq);rnrn SDL_PauseAudio(0);rn rnrn if(_videoState->pCodec == NULL)rn rn fprintf(stderr,"Unsupported codec!\n");rn return -1;rn rn return 0;rnrnrnint CCGFFmpeg::CGFFmpegStartPlay(int nPort,HWND hWnd)rnrn _videoState->isQuit = false;rn if(OpenStream()seekTime = 0;rn _videoState->seekReq = true;rn _mainThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)RealPlayThread,(LPVOID)hWnd,0,0);rn _videoThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)VideoThread,(LPVOID)hWnd,0,0);rn if(_mainThread == NULL || _videoThread == NULL)rn return -1;rn elsern return 0;rnrnrnrn//解码视频帧并将YUV转换为bmp显示rnDWORD WINAPI VideoThread(LPVOID phWnd)rnrnrn AVPicture pict;rn AVPacket pkt1, *packet = &pkt1;rn HWND hWnd = (HWND)phWnd;rn int frameFinished;rn int64_t realtime = 0;rn int oldtime = 0;rn RECT rect;rn GetWindowRect(hWnd,&rect);rn int winWidth = rect.right - rect.left;rn int winHeight = rect.bottom - rect.top;rn winWidth = winWidth/4*4;rn if(_videoState->pCodecCtx->codec_id == CODEC_ID_H264)rn rn _videoState->pCodecCtx->width = winWidth;rn _videoState->pCodecCtx->height = winHeight;rn rn AVRational oneRational;rn oneRational.den = 1;rn oneRational.num = 1;rn rn // Allocate video framern _videoState->pFrame = avcodec_alloc_frame();rn int numBytes = avpicture_get_size(PIX_FMT_RGB24,winWidth,winHeight);rnrn uint8_t* buffer = new uint8_t[numBytes];rnrnrn uint8_t* bitmapBuf = new uint8_t[numBytes]; rnrn //Assign appropriate parts of buffer to image planes in pFrameRGBrn int imageSize = avpicture_fill(&pict,buffer,PIX_FMT_RGB24,winWidth,winHeight);rnrnrn //change pixel format from pCodecCtx->pix_fmt to PIX_FMT_RGB24rn SwsContext *pswsCtx = sws_getContext(_videoState->pCodecCtx->width,_videoState->pCodecCtx->height,_videoState->pCodecCtx->pix_fmt,winWidth,winHeight,PIX_FMT_BGR24,SWS_BICUBIC,NULL,NULL,NULL);rnrn while(_videoState->isQuit == false)rn rn if(packet_queue_get(&_videoState->videoq, packet, 1) < 0)rn break;rn if(packet->data == flush_pkt.data) rn avcodec_flush_buffers(_videoState->pCodecCtx);rn rn _videoState->mainclock = av_gettime()/1000;rn continue;rn rnrn avcodec_decode_video2(_videoState->pCodecCtx,_videoState->pFrame,&frameFinished,packet);rn //[color=#FF0000][size=10px][b]就是这个函数在解码H264时报错[/b][/size][/color]。rnrnrnrnrn //Did we get a video frame?rn if(frameFinished)rn rn rn int time2 = (int)k;*/rnrn rn Graphics graphics(hWnd,0);rn rn sws_scale(pswsCtx,_videoState->pFrame->data,_videoState->pFrame->linesize,0,_videoState->pCodecCtx->height,pict.data,pict.linesize);rn //上面只是转换了像素点存放的格式,即从YUV420P转换到RGB24,而这这是从内部把颜色空间转换,实际存储的数据结构并没有改变,rn //所以要想用GDI的格式将其输出,必须先将存储像素点的内存单元_videoState->pict.data[0]拷贝到bitmap的内存空间bitmapBufrnrn //uint8_t* bitmapBuf = new uint8_t[numBytes]; 在循环里面太耗时间,放在外面rn memcpy(bitmapBuf,pict.data[0],numBytes);rnrn bitmap(pCodecCtx->width,pCodecCtx->height,3*pCodecCtx->width,PixelFormat24bppRGB,bitmapBuf);rn Bitmap bitmap(winWidth,winHeight,3*winWidth,PixelFormat24bppRGB,bitmapBuf);//注意其初始化过程!!!rn CachedBitmap cachedBitmap(&bitmap,&graphics);rn graphics.DrawCachedBitmap(&cachedBitmap,0,0/*rect.left,rect.top*/);rn if(_currentFrame==0)rn rn _videoState->mainclock = av_gettime()/1000;rn realtime = _videoState->mainclock;rn Sleep(_videoState->intervaltime);rn rn elsern rn realtime = av_gettime()/1000;rn _videoState->mainclock+=_videoState->intervaltime;rn if(_videoState->mainclock>realtime)rn rn Sleep(_videoState->mainclock-realtime);rn rn rn rn rn if(_currentFrameisQuit = true;rn delete []bitmapBuf;rn delete []buffer;rn return 0;rnrnrn//读取每一帧存放到队列中(包括视频和音频)rnDWORD WINAPI RealPlayThread(LPVOID phWnd)rnrn //Find the first video streamrn HWND hWnd = (HWND)phWnd;rn //int videoStream = -1;rn AVIFILEINFO avi_info;rn AVPacket pkt1, *packet = &pkt1;rnrn _currentFrame = 0;rn av_init_packet(&flush_pkt);rn flush_pkt.data = (uint8_t*)"FLUSH";rn while(_videoState->isQuit == false)rn rnrn if(_videoState->seekReq)rn rn AVRational avTimeBaseQ;rn avTimeBaseQ.num = 1;rn avTimeBaseQ.den = AV_TIME_BASE;rn _currentFrame = (_totalFrame*1.0*(_videoState->seekTime/AV_TIME_BASE))/_totalTime -1;rn int64_t seekTarget= av_rescale_q(_videoState->seekTime,avTimeBaseQ/*AV_TIME_BASE_Q*/,_videoState->pFormatCtx->streams[0]->time_base);rn _videoState->errorCode = av_seek_frame(_videoState->pFormatCtx,_videoState->videoStream,rn seekTarget,AVSEEK_FLAG_BACKWARD);rn if(_videoState->errorCodeisQuit = true;rn _videoState->seekReq = false;rn break;rn rn if(_videoState->audioStream >= 0) rn packet_queue_flush(&_videoState->audioq);rn packet_queue_put(&_videoState->audioq, &flush_pkt);rn rn if(_videoState->videoStream >= 0) rn packet_queue_flush(&_videoState->videoq);rn packet_queue_put(&_videoState->videoq, &flush_pkt);rn rn //av_free_packet(&_videoState->packet);rn //avcodec_flush_buffers(_videoState->pFormatCtx->streams[0]->codec);rn _videoState->seekReq = false;rn //oldtime = (int)GetTickCount();rn rn if(_videoState->audioq.size > MAX_AUDIOQ_SIZE ||rn _videoState->videoq.size > MAX_VIDEOQ_SIZE) rn Sleep(10);rn continue;rn rn if(av_read_frame(_videoState->pFormatCtx,packet) >= 0)rn rn //Is this a packet from the video stream?rn if(packet->stream_index == _videoState->videoStream)rn rn packet_queue_put(&_videoState->videoq, packet);rn rn /*if(_videoState->i == 4)rn _videoState->i = 0;*/rn rn elsern rn if(!_videoState->isMuted&&packet->stream_index == _videoState->audioStream)rn packet_queue_put(&_videoState->audioq, packet); rn rn rn elsern rn //break;rn rnrn rnrn //av_free(_videoState->pFrame->data[0]);rn av_free(_videoState->pFrame);rn //delete _videoState->lpsystemtime;rnrn return 1;rn
谁用过EnvDTE
谁在C#里用过EnvDTE这样的命名空间啊,如何引用其??
vs2008调用外部控件
在引用了dll之后还需要什么配置呢?rnrn我这样会报一个:rn 未知的服务器标记“AjaxControlToolkit:ResizableControlExtender”。的错误,要怎么解决
异常--Throwsable中的方法
/* * getMessage() * 获取<em>异常</em>信息,返回字符串。 * toString() * 获取<em>异常</em>类名和<em>异常</em>信息,返回字符串。 * printStackTrace() * 获取<em>异常</em>类名和<em>异常</em>信息,以及<em>异常</em>出现在<em>程序</em>中的位置。返回值void。 * printStackTrace(PrintStream s) * 通常用该<em>方法</em>将<em>异常</em>内容保存在日志文件中,以便查阅...
VS2008编译总出现错误
[img=https://img-bbs.csdn.net/upload/201605/25/1464151743_263987.png][/img]rnrnVS2008编译一次就会出现一次,怎么解决永久不跳,从新编译一次就正常了,但是新加了内容你编译一下就会出,要按2次,求教。
vs2008 ScriptManager 前台调用webservice方法 报对象不支持属性 方法错误
rn前台引用rnrn //******************************************rn //<em>调用</em>webservice<em>方法</em>rn //********************************************* rn function onsuccess(result)rn rn alert(result);rn rn function onfill(result)rn rn rn rn function onover(result)rn rn rnrn脚本rnWebServiceCheck.Check("11",onsuccess,onfill,onover);rnrn rn rn rn rnrn后台asmxrnusing System;rnusing System.Collections;rnusing System.Linq;rnusing System.Web;rnusing System.Web.Services;rnusing System.Web.Services.Protocols;rnusing System.Xml.Linq;rnusing System.Text;rn//using Microsoft.Web.Script.Services;rnrn/// rn///WebServiceCheck 的摘要说明rn/// rn[WebService(Namespace = "http://tempuri.org/")]rn[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]rn//若要允许使用 ASP.NET AJAX 从脚本中<em>调用</em>此 Web 服务,请取消对下行的注释。 rn [System.Web.Script.Services.ScriptService]rnpublic class WebServiceCheck : System.Web.Services.WebService rnrn public WebServiceCheck () rnrn //如果使用设计的组件,请取消注释以下行 rn //InitializeComponent(); rn rnrn [WebMethod]rn public string HelloWorld() rn return "Hello World";rn rnrn [WebMethod]rn public string Check(string str)rn rn string a = "05.01-20080812-0000343409-1816239923";rn byte[] bytetest = ASCIIEncoding.ASCII.GetBytes(a);rn // byte[] bytearr = ASCIIEncoding.ASCII.GetBytes(str);rn string sam = "";rn for (int i = 0; i < bytetest.Length; i++)rn rn // sam += bytearr[i].ToString();rn sam += bytetest[i];rn rn return sam;rn rn rnrnrn
java--hibernate分页报异常
org.hibernate.exception.GenericJDBCException: 只进结果集不支持请求的操作。rnat org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)rnat org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)rnat org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)rnat org.hibernate.engine.jdbc.internal.proxy.AbstractResultSetProxyHandler.continueInvocation(AbstractResultSetProxyHandler.java:108)rnat org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)rnat $Proxy6.absolute(Unknown Source)rnat org.hibernate.loader.Loader.advance(Loader.java:1640)rnat org.hibernate.loader.Loader.getResultSet(Loader.java:1966)rnat org.hibernate.loader.Loader.doQuery(Loader.java:829)rnat org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)rnat org.hibernate.loader.Loader.doList(Loader.java:2447)rnat org.hibernate.loader.Loader.doList(Loader.java:2433)rnat org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2263)rnat org.hibernate.loader.Loader.list(Loader.java:2258)rnat org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470)rnat org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)rnat org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196)rnat org.hibernate.internal.SessionImpl.list(SessionImpl.java:1161)rnat org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)rnat com.qingmou.dao.impl.DaoSupeortImpl.paqingBypages(DaoSupeortImpl.java:246)rnat com.qingmou.test.Test.main(Test.java:38)rnCaused by: com.microsoft.sqlserver.jdbc.SQLServerException: 只进结果集不支持请求的操作。rnat com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)rnat com.microsoft.sqlserver.jdbc.SQLServerResultSet.throwNotScrollable(Unknown Source)rnat com.microsoft.sqlserver.jdbc.SQLServerResultSet.verifyResultSetIsScrollable(Unknown Source)rnat com.microsoft.sqlserver.jdbc.SQLServerResultSet.absolute(Unknown Source)rnat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rnat sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rnat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rnat java.lang.reflect.Method.invoke(Unknown Source)rnat org.hibernate.engine.jdbc.internal.proxy.AbstractResultSetProxyHandler.continueInvocation(AbstractResultSetProxyHandler.java:104)rn... 17 morern说明:rnrnString hql="from TSysGpsData";rnrnList ulist=dao.paqingBypages(hql, null, 2, 10);rnrn传1(hql, null, 1, 10);可以得到结果.2就不行,hibernate 4.1.1
C# IndexOf 报异常
不多说 直接上代码 rn if (!string.IsNullOrEmpty(m_str))rn rn if (GlobleDate.m_databuffUser.TagList.IndexOf(m_str) == -1) rn rn GlobleDate.m_databuffUser.TagList.Add(m_str); rn rn rn m_str = "";rn GlobleDate.userWaitor.Set(); //data资源 告诉界面可以进行更新 rnrnrnrn
开机报异常
十块板子,中间有一块很奇怪:rn开机的时候有时候会报这样一个错误:rnException 'Data Abort' (4): Thread-Id=07b7000e(pth=9b5b9594), Proc-Id=00400002(pprc=88111308) 'NK.EXE', VM-active=065e0002(pprc=9b5cd948) 'explorer.exe'rnPC=80157fd0(kernel.dll+0x00030fd0) RA=801421e0(kernel.dll+0x0001b1e0) SP=d713f468, BVA=00000098rnrn也有的时候是“device.exe”rnrn这样软件会经常运行起来不正常 rn我DEBUG调试的方式跑软件,他又正常rnrnNK都一样的,其它板子都没有这个问题rnrn不知道大家有没有碰到过这种类型的,或提供一个查找的思路也行rnrn个人曾怀疑是不是DDR跟CPU之间有什么有影响或是CPU片子的问题
[异常]报406
1、查看是否Jackson包是否存在。2、如果后缀是html是不能响应json数据的。需要修改后缀名,改成.do或者.action。
SQL连接报异常
package fixedassets;rnrnimport java.sql.*;rnimport javax.swing.tree.DefaultMutableTreeNode;rnrnrnpublic class JDBC rn Statement st=null;rn ResultSet rs2=null;rn ResultSet rs=null;rn public JDBC() rn try rn Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");rn Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;databaseName=AssetsManage","sa","sa");rn st = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);rn catch (Exception ex) rn ex.printStackTrace();rn rn rn public ResultSet yan(String s,String s1) //验证用户名和密码rn ResultSet rsa=null;rn try rn rsa = st.executeQuery("select *from operater where ID='"+s+"'and PassWord='"+s1+"'");rn catch (SQLException ex) rn ex.printStackTrace();rn rn return rsa;rn rn public int chaxun(String s,int i) //查询数据rn try rn if(i==0) //以资产编号查询rn clear();rn rs = st.executeQuery("select *from asset where aId="+s);rn else if(i==1) //以资产名称查询rn clear();rn rs = st.executeQuery("select *from asset where aName='"+s+"'");rn rn if(rs.next()) rn zhi();rn rnrn catch (SQLException ex) rn ex.printStackTrace();rn rn return 0;rn rnrn/*错误就在zhi()这个<em>方法</em>里,上面的chaxun()<em>方法</em><em>调用</em>本<em>方法</em>来把查询出来的信息显示在文本框内,第一次<em>调用</em>时信息都可以提出来没问题,但是我想做一个导航条,可以通过按钮点击来查看数据,所以我在另外一个类里做了一个按钮事件,当点击时就zhi()这个<em>方法</em>,就在这里就报<em>异常</em>了,<em>异常</em>如下:rnjava.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Object has been closed.rn at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)rn at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)rn at com.microsoft.jdbc.base.BaseResultSet.validateClosedState(Unknown Source)rn at com.microsoft.jdbc.base.BaseResultSet.getString(Unknown Source)rn at fixedassets.JDBC.zhi(JDBC.java:68)rn at fixedassets.Frame3.jButton4_actionPerformed(Frame3.java:405)rn at fixedassets.Frame3_jButton4_actionAdapter.actionPerformed(Frame3.java:431)rn at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)rn at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)rn at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)rn at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)rn at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)rn at java.awt.Component.processMouseEvent(Component.java:5100)rn at java.awt.Component.processEvent(Component.java:4897)rn at java.awt.Container.processEvent(Container.java:1569)rn at java.awt.Component.dispatchEventImpl(Component.java:3615)rn at java.awt.Container.dispatchEventImpl(Container.java:1627)rn at java.awt.Component.dispatchEvent(Component.java:3477)rn at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)rn at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)rn at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)rn at java.awt.Container.dispatchEventImpl(Container.java:1613)rn at java.awt.Window.dispatchEventImpl(Window.java:1606)rn at java.awt.Component.dispatchEvent(Component.java:3477)rn at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)rn at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)rn at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)rn at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)rn at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)rn at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)rnrn我在网上查了一下,好像是说连接池被已关闭,但是我所有的连接一个也没关啊,不知道是怎么回事,急~!请各位高手帮忙看一下*/rnrn public void zhi() rn try rn String s3 = rs.getString(1);rn String s10 = rs.getString(2);rn String s11 = rs.getString(3);rn String s5 = rs.getString(4);rn String s6 = rs.getString(8);rn String s7 = rs.getString(9);rn String s8 = rs.getString(7);rn String s12 = rs.getString(5);rn String s13 = rs.getString(6);rn String s14 = rs.getString(10);rn Frame3.jTextField3.setText(s3);rn Frame3.jTextField5.setText(s5);rn Frame3.jTextField6.setText(s6);rn Frame3.jTextField10.setText(s10);rn Frame3.jTextField11.setText(s11);rn Frame3.jTextField12.setText(s12);rn if (s13.equals("0")) rn Frame3.jTextField13.setText("正常");rn else if (s13.equals("1")) rn Frame3.jTextField13.setText("维修");rn else if (s13.equals("2")) rn Frame3.jTextField13.setText("报废");rn rn Frame3.jTextField14.setText(s14);rnrn if (Frame3.i == 1) //通过游标判断是否可以上下翻页rn if (rs.next()) rn Frame3.jButton4.setEnabled(true);rn else rn Frame3.jButton4.setEnabled(false);rn rn else rn if (rs.previous()) rn Frame3.jButton3.setEnabled(true);rn else rn Frame3.jButton3.setEnabled(false);rn rn rnrn ResultSet rls = st.executeQuery(rn "select eName from employee where eId=" +rn s7);rn rls.next();rn Frame3.jTextField7.setText(rls.getString(1));rn ResultSet rs1 = st.executeQuery(rn "select type from cateGory where cateId='" + s11 + "'");rn rs1.next();rn String s4 = rs1.getString(1);rn if (s4.equals("0")) rn Frame3.jTextField4.setText("");rn else rn Frame3.jTextField4.setText(s4);rn rnrn if (!(s8 == null)) rn ResultSet rls1 = st.executeQuery(rn "select eName from employee where eId=" + s8);rn rls1.next();rn Frame3.jTextField8.setText(rls1.getString(1));rn rs2 = st.executeQuery("select *from lend where aId=" +rn s3);rn rs2.last();rn String s9 = rs2.getString(4);rn String s15 = rs2.getString(3);rn String s16 = rs2.getString(5);rn Frame3.jTextField9.setText(s9);rn Frame3.jTextField15.setText(s15);rn if (s16.equals("0")) rn Frame3.jTextField16.setText("否");rn else if (s16.equals("1")) rn Frame3.jTextField16.setText("是");rn rn rnrn catch (Exception a) rn System.out.println("asdfwdfasdf");rn a.printStackTrace();rn rn rnrnrnrnrn public void clear() //清空rn Frame3.jTextField3.setText("");rn Frame3.jTextField4.setText("");rn Frame3.jTextField5.setText("");rn Frame3.jTextField6.setText("");rn Frame3.jTextField7.setText("");rn Frame3.jTextField8.setText("");rn Frame3.jTextField9.setText("");rn Frame3.jTextField10.setText("");rn Frame3.jTextField11.setText("");rn Frame3.jTextField12.setText("");rn Frame3.jTextField13.setText("");rn Frame3.jTextField14.setText("");rn Frame3.jTextField15.setText("");rn Frame3.jTextField16.setText("");rn rnrnrn
Graphics异常,报内存不足
原因:很有可能是因为图片大小导致的,需要通过PS修改一下图片大小 string imageName = sourceImageTb.Substring(sourceImageTb.LastIndexOf('/')); string imageSourcePath = Path.Combine(Config_MCDWX.Instance.Exam_Certifi
tomcat5.5一直报异常
tomcat5.5 一直报java.sql.SQLException: ORA-28000: the account is lockedrn但还是可以用的
crontab执行报异常
<em>异常</em>信息:nohup: failed to run command `java': No such file or directory /data/om-analytics/business/hive_hbase/workwf.sh: line 4: 4: command not found 这就是由于环境变量引起的,这种情况出现时,只需要在你的脚本中,比如XX.sh中加入以下两条语句
日期格式化报异常
今天做自定义标签的时候,写了几个日期格式化的<em>方法</em>,结果在测试将日期格式化为时分秒的时候报了java.text.ParseException: Unparseable date: &quot;13:14:14&quot;<em>异常</em>,由于对这块不熟悉不知道输入的字符串必须与new SimpleDateFormat(&quot;yyyy-MM-dd HH:mm:ss&quot;)保持一致/** * * 格式化日期的自定义标签 * <em>方法</em>...
mybatis 报空值异常
mybatis 报空值<em>异常</em>及其解决办法
mybatis 报异常
### Cause: java.sql.SQLException: 出现不支持的 SQL92 标记: 288: 0 <em>异常</em>原因:传递参数本来是 #{0},#{1},由于赶时间漏:东西了 写成 {0} 、{1} 解决<em>方法</em>: {0} 、{1} 修改为#{0} #{1} ...
yml文件报异常
Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token found character '@' that cannot start any token. (Do not use @ for indentation)  in 'reader', line 14, column ...
UEStudio '06.part1.rar(UE绿色版)下载
UEStudio '06.(UE绿色版) 很不错,内含增加右键、注册机等。 相关下载链接:[url=//download.csdn.net/download/xiaou_is_me/2260772?utm_source=bbsseo]//download.csdn.net/download/xiaou_is_me/2260772?utm_source=bbsseo[/url]
oracle简单查找知识总结下载
oracle简单查找知识总结 字符串函数 日期函数 各种简单查找技术 相关下载链接:[url=//download.csdn.net/download/xiegq112/4879584?utm_source=bbsseo]//download.csdn.net/download/xiegq112/4879584?utm_source=bbsseo[/url]
sanyitiong 软件下载
sanyitiong 软件 相关下载链接:[url=//download.csdn.net/download/u012674035/6488881?utm_source=bbsseo]//download.csdn.net/download/u012674035/6488881?utm_source=bbsseo[/url]
相关热词 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图 c# 验证码图片生成类 c# 再次尝试 连接失败 c#开发编写规范 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数
我们是很有底线的