RuntimeError: Exception thrown in SimpleITK ReadImage。File cannot be read请问这要怎么解决啊?

RuntimeError: Exception thrown in SimpleITK ReadImage : C:\d\VS14-Win64-pkg\SimpleITK-build\ITK\Modules\IO\Meta\src\itkMetaImageIO.cxx:491:。File cannot be read请问这要怎么解决啊?图片说明

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
javax.jdo.JDOFatalUserException: Exception thrown by getPersistenceManagerFactor
哪位大大帮忙看一下这个是什么错误,十分感谢rn private PersistenceManagerFactory pmf;rnrn public LiberatorDAOFactory() rn final Properties p = new Properties();rn InputStream in = null;rn try rn in = ForumActionServlet.class.getResourceAsStream("jdo.properties");rn if (in == null)rn throw new RuntimeException( "jdo.properties not on classpath");rn// p.load(in);rn p.put("javax.jdo.PersistenceManagerFactoryClass", "com.redsoft.jdo.PersistenceManagerFactoryImpl");rn p.put("javax.jdo.option.ConnectionDriverName", "com.mysql.jdbc.Driver");rn p.put("javax.jdo.option.ConnectionURL", "jdbc:mysql://localhost/forum?useUnicode=true&characterEncoding=gb2312");rn p.put("javax.jdo.option.ConnectionUserName", "xpforum");rn p.put("javax.jdo.option.ConnectionPassword", "demo1234");rn p.put("com.sun.jdori.option.ConnectionCreate", "true");rn pmf = JDOHelper.getPersistenceManagerFactory(p);//报错的地方rn catch (Exception e) rn e.printStackTrace();rn finally rn tryrn if (in != null)rn in.close();rn catch( final IOException ioe )rn // do nothingrn rn rn rnrn报错内容rnjavax.jdo.JDOFatalUserException: Exception thrown by getPersistenceManagerFactory(Properties)rnNestedThrowables:rnjava.lang.reflect.InvocationTargetExceptionrn at javax.jdo.JDOHelper.getPersistenceManagerFactory(Unknown Source)rn at javax.jdo.JDOHelper.getPersistenceManagerFactory(Unknown Source)rn at org.redsoft.forum.dao.jdo.LiberatorDAOFactory.(LiberatorDAOFactory.java:57)rn at org.redsoft.forum.dao.DAOFactory.getInstance(DAOFactory.java:38)rn at org.redsoft.forum.ForumActionServlet.init(ForumActionServlet.java:34)rn at javax.servlet.GenericServlet.init(GenericServlet.java:212)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4042)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4348)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:566)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnCaused by: java.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn ... 32 morernCaused by: java.lang.NullPointerExceptionrn at com.redsoft.jdo.PersistenceManagerFactoryImpl.freezeConfiguration(PersistenceManagerFactoryImpl.java:443)rn at com.redsoft.jdo.PersistenceManagerFactoryImpl.getPersistenceManagerFactory(PersistenceManagerFactoryImpl.java:468)rn ... 36 morernNestedThrowablesStackTrace:rnjava.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at javax.jdo.JDOHelper.getPersistenceManagerFactory(Unknown Source)rn at javax.jdo.JDOHelper.getPersistenceManagerFactory(Unknown Source)rn at org.redsoft.forum.dao.jdo.LiberatorDAOFactory.(LiberatorDAOFactory.java:57)rn at org.redsoft.forum.dao.DAOFactory.getInstance(DAOFactory.java:38)rn at org.redsoft.forum.ForumActionServlet.init(ForumActionServlet.java:34)rn at javax.servlet.GenericServlet.init(GenericServlet.java:212)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4042)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4348)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:566)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnCaused by: java.lang.NullPointerExceptionrn at com.redsoft.jdo.PersistenceManagerFactoryImpl.freezeConfiguration(PersistenceManagerFactoryImpl.java:443)rn at com.redsoft.jdo.PersistenceManagerFactoryImpl.getPersistenceManagerFactory(PersistenceManagerFactoryImpl.java:468)rn ... 36 morernrn
怎么解决Cannot read property 'getElementsByTagName' of null
[code=text]<%@ page language="java" contentType="text/html; charset=UTF-8"rn pageEncoding="UTF-8"%>rn<%@ page import="entity.*,java.util.List,dao.impl.*"%>rn<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>rnrnrnrn rn Insert title herern rn rn [/code]rnrnrnrn[code=java]package servlet;rnrnimport java.io.IOException;rnimport java.io.PrintWriter;rnimport java.sql.ResultSet;rnimport java.sql.SQLException;rnrnimport javax.servlet.ServletException;rnimport javax.servlet.annotation.WebServlet;rnimport javax.servlet.http.HttpServlet;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnrnimport util.DBUtil;rnrn/**rn * Servlet implementation class ZyServletrn */rn@WebServlet("/ZyServlet")rnpublic class ZyServlet extends HttpServlet rn private static final long serialVersionUID = 1L;rn rn /**rn * @see HttpServlet#HttpServlet()rn */rn public ZyServlet() rn super();rn // TODO Auto-generated constructor stubrn rnrn /**rn * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)rn */rn protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException rn // TODO Auto-generated method stubrn response.getWriter().append("Served at: ").append(request.getContextPath());rn response.setContentType("text/xml;charset=utf-8");rn String xyid=request.getParameter("xy");rn PrintWriter out = response.getWriter();rn String SQL_SELECT="SELECT * FROM ZY";rn DBUtil db=new DBUtil();rn db.getConnection();rn String sql=SQL_SELECT+" where xyid=?";rn ResultSet rs = db.executeQuery(sql, new String[] xyid);rn out.print("");rn try rn while(rs.next())rn String a,b;rn a=rs.getString("id");rn b=rs.getString("zy");rn out.print("");rn out.print(""+b+"");rn out.print(""+a+"");rn out.print("");rn rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn out.print("");rn out.flush(); rn out.close();rn rnrn /**rn * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)rn */rn protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException rn // TODO Auto-generated method stubrn doGet(request, response);rn rnrn[/code]rnrn百度到说问题是因为response.setContentType("text/xml;charset=utf-8");这个的问题 可是写上了还是不对 求解0.0
这要怎么传参数啊!
我定义了这样一个函数,他接收的是一个字段rnvoid __fastcall TFrom1::PicSaveToTable(TBolbField * pFieldName)rn请问调用时应该如何用啊!rnTFrom1->PicSaveToTable(),这里的参数如何写啊,假设字段名是photo
请问这要怎么实现?
我的网页有个框架,有两个JSP,一个jsp提交后到另一个jsp,我想在新的jsp里修改原来的jsp中的内容,请问如何实现啊?不是open的,是submit过去的。
错误:Exception of type System.OutOfMemoryException was thrown
最近服务端程序总是出现这个错误:Exception of type System.OutOfMemoryException was thrownrnrnGoogle这个错误,网上资料都是asp.net的,说是设置IIS的“memoryLimit”值,但我这个程序时WinForm的该怎么办?
ORA-00376: file 88 cannot be read at this time
[code=SQL]rnORA-01171: datafile 88 going offline due to error advancing checkpointrnORA-01122: database file 88 failed verification checkrnORA-01110: data file 88: '/u01/oracle/app/oradata/orcl/test01.dbf'rnORA-01251: Unknown File Header Version read for file number 88rnrnrn 在这之前 执行了:rnBBED> inforn File# Name Size(blks)rn ----- ---- ----------rn 88 /u01/oracle/app/oradata/orcl/test01.dbf 6400rnrnBBED> modify 22 55rnrn然后 rnSQL>alter system checkpoint;rnrnSQL> conn test/testrnConnected.rnSQL> select count(*) from test.t1;rnselect count(*) from test.t1rn*rnERROR at line 1:rnORA-00376: file 88 cannot be read at this timernORA-01110: data file 88: '/u01/oracle/app/oradata/orcl/test01.dbf'rnrn[/code]rnrnrn 怎么修复?
Unhandled Exception thrown: class java.lang.NullPointerException
WARN : 2011-04-04 17:15:29,906: RequestProcessor[line:538: Unhandled Exception thrown: class java.lang.NullPointerExceptionrnjavax.servlet.ServletExceptionrn at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at com.sinosoft.module.system.login.service.LoginFilter.doFilter(LoginFilter.java:48)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at com.sinosoft.util.tool.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:30)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)rn at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)rn at java.lang.Thread.run(Thread.java:619)rnWARN : 2011-04-04 17:15:30,000: RequestProcessor[line:538: Unhandled Exception thrown: class java.lang.NullPointerExceptionrnjavax.servlet.ServletExceptionrn at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at com.sinosoft.module.system.login.service.LoginFilter.doFilter(LoginFilter.java:48)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at com.sinosoft.util.tool.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:30)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)rn at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)rn at java.lang.Thread.run(Thread.java:619)rnrn上面是我访问一个登陆页面,进去是一片空白,,不知道是什么问题,rn
Unhandled Exception thrown: class org.springframework.dao.CannotAcquireLockExcep
开发使用的SSH框架,oracle11gR1版本,查看oracle日志,发现有很多这个错误,有人遇到过吗,可能是哪些原因造成的呢?
cannot read file data: Error 21
error while loading shared libraries: libpcap.so.1: cannot read file data: Error 21rnrn我在安装libpcap库的时候,出现的这个问题。。请问该怎么解决?rnrn
解决vsftpd不能重启的问题 (cannot read config file)
我重启vsftpd时,总是报500 OOPS: cannot read config file:restart :网上有不少的相关的问题,但是都没能解决,而且我的路径是 /usr/sbin/vsftpd 。有些的电脑是在/etc/init.d/vsftpd。查看vsftpd在那个路径下面使用下面的命令查看which vsftpd 命令查看vsftpd所在的路径下面:我们回到刚才的问题:故障原因是没...
Cannot find or open the PDB file 怎么解决啊
exe”: 已加载“D:\MFC\TCPSrv\Debug\TCPSrv.exe”,已加载符号。rnrn“TCPSrv.exe”: 已加载“C:\Windows\System32\gdi32.dll”,Cannot find or open the PDB filernrnPDB filernrn线程 'Win32 线程' (0xeb4) 已退出,返回值为 -1073741510 (0xc000013a)。rnrn程序“[3704] TCPSrv.exe: 本机”已退出,返回值为 -1073741510 (0xc000013a)。rnrnVS2010这个问题你咋解决的啊 求指教 求指教 rn
用enum,这要怎么解决?
题目是这样的:rn先前我们说过,C++中的输入输出语句并不能自动识别enum类型的数据。作为替代,>>和<rnusing namespace std;rnrnenum etype laborer, serectary, manager, accountant, executive, researcher ;rnrnint main()rnrn etype Etype;rn char type;rnrn cout<<"Please enter employee type(first letter only:laborer, serectary, manager, accountant, executive, researcher):";rn cin>>type;rn switch (type)rn rn case 'l': cout<<"Employee type is laborer."<
Cannot open include file: 'exception': No such file or directory 这是什么错误
Cannot open include file: 'exception': No such file or directoryrn编辑一个程序时出现连续五个这样的错误rn双击此错误跳到stdexcpt.h文件中去了rn不知道是怎么回事
Cannot open include file: 'stdafx.h': No such file or directory 怎么解决??????????
原来的程序添加的头文件太多了,想单独放在几个文件夹中,调整后出现上述错误;越来越多,rn我把setting->C++ ->编译头文件 设置成 不使用头文件出现下面错误rnfatal error C1083: Cannot open include file: 'stdafx.h': No such file or directoryrn相反使用预编译头文件pch,则产生下面错误,rnfatal error C1852: 'Debug/ZHJK.pch' is not a valid precompiled header filern请问怎么解决,谢谢
请问这要怎么实现?谢谢!
我现在想根据窗体一DropDownList的选择决定是否把另一个窗体显示在本窗体下面,同时希望能保持原来窗体用户已经输入的项目,请问要怎么实现?谢谢!
read file
如何从web page 上读文件?比如我的xml/rdf文件发布在http://www.test.com/~test/first.rdfrnrn文件名在java中如何表示?rnInputStream in = new FileInputStream ("http://www.test.com/~test/first.rdf");????
exception has been thrown by the target of an invocation
运行程序出现这个问题[img=https://img-bbs.csdn.net/upload/201405/20/1400550629_957636.jpg][/img] 然后关掉vs2010 重新打开vs[img=https://img-bbs.csdn.net/upload/201405/20/1400550648_747467.jpg][/img]vs都打不开鸟 什么原因哪~rn在修复vs中,还请大神们给点意见。先谢了~
Unhandled Exception thrown: class java.lang.NullPointerException 请教高人
2010-08-06 10:24:15,609 WARN [org.apache.struts.action.RequestProcessor] - rn2010-8-6 10:24:15 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet action threw exceptionrnjava.lang.NullPointerExceptionrn at com.cmszportal.modules.Count.action.CountAction.Add_Taocan(CountAction.java:76)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.extremecomponents.table.filter.AbstractExportFilter.doFilter(AbstractExportFilter.java:49)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.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.cmszportal.common.LoginFilter.doFilter(LoginFilter.java:54)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.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)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:228)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.valves.CometConnectionManagerValve.invoke(CometConnectionManagerValve.java:256)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)rn at java.lang.Thread.run(Unknown Source)rn2010-08-06 10:24:15,687 ERROR [/CountAction.do] - rn我的actionrnpublic class CountAction extends DispatchAction rn private CountManager countManager;rnrn public CountManager getCountManager() rn return countManager;rn rnrn public void setCountManager(CountManager countManager) rn this.countManager = countManager;rn rnrn public ActionForward Add_Taocan(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response)rn throws IllegalAccessException, InvocationTargetException rn CommonForm commonForm = (CommonForm) form;rn List list = null;rn boolean flag = false;rn System.out.println("---------------套餐添加开始--------------"+ commonForm.getYUEBINIT_ADDR());rn String startTime = DateUtil.currentDate2String();rn commonForm.setYUEBINIT_ID(RandomUtil.getRandom()); //获取随机数设置IDrnrn CommonPropertites com = new CommonPropertites();rn BeanUtils.copyProperties(com, commonForm);rn flag = countManager.add_taocan(com);rnrn if (flag) rn list = countManager.selectAllTaocan(com);rn request.setAttribute("List_Taocan", list);rn return mapping.findForward("List_Taocan");rn rn return mapping.findForward("error");rn rn我的业务类rnpublic class CountManager extends HibernateEntityDao rn /**rn * 添加套餐rn * @param taocanrn * @returnrn */rn public boolean add_taocan(CommonPropertites taocan) rnrn if (StringUtil.CovertNulltoBlank(taocan)!=null) rn this.getHibernateTemplate().saveOrUpdate(taocan);rn return true;rn rn return false;rn rnrn//spring的配置注入 serviceContext.xmlrnrn rn rn rn rnrn每次添加数据的时候总是报错,空指针,请问大侠我是哪里少配置了东西吗??是找不到CountManager的方法么?
急:请帮忙解决org.apache.struts.action.RequestProcessor.processException Unhandled Exception thrown
web.xml的过滤器配置如下:rnrnrn Set Character Encodingrn com.fiberhome.jxt.common.util.SetCharacterEncodingFilterrn rn encodingrn GB2312rn rn rn ignore rn truern rn rn rn Set Character Encodingrn actionrn rn rn Set Character Encodingrn *.jsprn rn rn rn PrivilegeFilterrn com.fiberhome.jxt.common.sys.PrivilegeFilterrn rn rn rn PrivilegeFilterrn actionrn rn rn PrivilegeFilterrn *.jsprn rn rn PrivilegeFilterrn *.dorn rnrn当系统运行后:tomcat后台不断的报如下错误:rn[WARN ] 2009-01-14 16:34:59,437 method:org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:516)rnUnhandled Exception thrown: class java.lang.NullPointerExceptionrnjavax.servlet.ServletExceptionrn at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at com.fiberhome.jxt.common.sys.PrivilegeFilter.doFilter(PrivilegeFilter.java:99)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at com.fiberhome.jxt.common.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:78)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at com.fiberhome.jxt.common.sys.PrivilegeFilter.doFilter(PrivilegeFilter.java:99)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)rn at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)rn at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)rn at java.lang.Thread.run(Unknown Source)rn请高人指点,一定送高分
unreported exception org.apache.commonms.configuration.ConfiguationException ;must be caught or declared to be thrown
private String target = getTarget();????[color=#FF0000]unreported exception org.apache.commonms.configuration.ConfiguationException ;must be caught or declared to be thrown[/color]rn rn public static String getTarget() throws ConfigurationException rn String target = "";rn ClassLoader classLoader = Thread.currentThread().getContextClassLoader();rn URL url = classLoader.getResource("org/seatore/resources/targetMachine.properties");rn try rn Configuration config = new PropertiesConfiguration(url);rn target = config.getString("target.ip");rn logger.info("Connect to the machine:" + target);rnrn catch (ConfigurationException e) rn rn rn return target;rn rn就是这句报错啊,而且我已经导入了rnimport org.apache.commons.configuration.Configuration;rnimport org.apache.commons.configuration.PropertiesConfiguration;rnimport org.apache.commons.configuration.ConfigurationException;rn请问这个是这么回事?
unreported exception java.sql.SQLException; must be caught or declared to be thrown
private static void sendSms(DBConnection conn, int lngEmpID, String strMessage) rn String sql = "SELECT STRMOVETEL FROM EMPBASEINFO WHERE (LNGEMPID = " + lngEmpID + ")";rn String phone = DBUtil.getString(conn, sql);rn if (phone != null && phone.startsWith("13")) rn rn Connection conn_orcl =null;rn javax.sql.DataSource ds = null;rn ResultSet rs = null;rn Statement stm =null;rn rn try rn javax.naming.InitialContext ctx = new javax.naming.InitialContext();rn ds = (javax.sql.DataSource) ctx.lookup("jdbc/swoa2.0"); rn conn_orcl = ds.getConnection(); rn stm = conn_orcl.createStatement(); rn String sql_orcl ="insert into sms_tosend(msgid, sendtime,f_flag, phone,msgtext,sendflag) VALUES(SELL.NEXTVAL,SYSDATE-3,'0','"+phone+"','"+strMessage+"','111')";rn System.out.println(sql_orcl);rn stm.executeUpdate(sql_orcl); rn rn catch (Exception e)rn System.out.println(e.getMessage());rn rn finallyrn rn //就是这几行代码报错rn /*if(rs!=null) rs.close();rn if(stm!=null) stm.close();rn if(conn_orcl!=null) conn_orcl.close();*/ rn rn rn rnrnC:\IBM\WebSphere\AppServer\installedApps\zhangyx\cdyc_war.ear\cdyc.war\WEB-INF\crnlasses>javac swoa\common\Message.javarnswoa\common\Message.java:91: unreported exception java.sql.SQLException; must bern caught or declared to be thrownrn if(rs!=null) rs.close();rn ^rnswoa\common\Message.java:92: unreported exception java.sql.SQLException; must bern caught or declared to be thrownrn if(stm!=null) stm.close();rn ^rnswoa\common\Message.java:93: unreported exception java.sql.SQLException; must bern caught or declared to be thrownrn if(conn_orcl!=null) conn_orcl.close();rnrn ^rn3 errorsrnrn什么原因阿???
TyrexDataSourceFactory: Cannot create DataSource, Exception如何解决
Starting service Tomcat-StandalonernApache Tomcat/4.0.4rnStarting service Tomcat-ApachernApache Tomcat/4.0.4rnTyrexDataSourceFactory: Cannot create DataSource, Exceptionrnjava.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriverrn at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClasrnsLoader.java:1127)rn at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClasrnsLoader.java:992)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)rn at java.lang.Class.forName0(Native Method)rn at java.lang.Class.forName(Class.java:130)rn at org.apache.naming.factory.TyrexDataSourceFactory.getObjectInstance(TyrnrexDataSourceFactory.java:210)rn at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFrnactory.java:165)rn at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:3rn01)rn at org.apache.naming.NamingContext.lookup(NamingContext.java:835)rn at org.apache.naming.NamingContext.lookup(NamingContext.java:181)rn at org.apache.naming.NamingContext.lookup(NamingContext.java:822)rn at org.apache.naming.NamingContext.lookup(NamingContext.java:194)rn at auth.DBConn.getConn(DBConn.java:28)rn at auth.DBCurrent.doQuery(DBCurrent.java:54)rn at org.apache.jsp.index$jsp._jspService(index$jsp.java:182)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspSerrnvlet.java:201)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3rn81)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplrnicationFilterChain.java:247)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFrnilterChain.java:193)rn at objclass.EncodingFilter.doFilter(EncodingFilter.java:27)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplrnicationFilterChain.java:213)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFrnilterChain.java:193)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVrnalve.java:243)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelinern.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.javrna:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rnrn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVrnalve.java:190)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelinern.java:566)rn at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValvern.java:246)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelinern.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.javrna:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rnrn at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:rn2347)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jrnava:180)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelinern.java:566)rn at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatchernrValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelinern.java:564)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jrnava:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelinern.java:564)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:rn468)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelinern.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.javrna:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rnrn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValrnve.java:174)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipelinern.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.javrna:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rnrn at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessornr.java:1027)rn at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.jarnva:1125)rn at java.lang.Thread.run(Thread.java:536)rn[系统异常]:javax.naming.NamingException: Exception creating DataSource: oracle.jrndbc.driver.OracleDriverrn
Exception thrown by getter for property age of bean org.apache.struts.taglib.htm
struts1.2老是报rnException thrown by getter for property age of bean org.apache.struts.taglib.html.BEAN错误rnrn代码如下rnpublic class RegForm extends ActionForm rnrnrn /**rn * rn */rn private static final long serialVersionUID = 1L;rn rn private String username;rn private String password;rn private String sex;rn private Integer age;rn private Integer date;rn rn public String getUsername() rn return username;rn rn public void setUsername(String username) rn this.username = username;rn rn public String getPassword() rn return password;rn rn public void setPassword(String password) rn this.password = password;rn rn public String getSex() rn return sex;rn rn public void setSex(String sex) rn this.sex = sex;rn rn public Integer getAge() rn return age;rn rn public void setAge(Integer age)rn rn this.age = age;rn rn public Integer getDate()rn rn return date;rn rn rn public void setDate(Integer date) rn this.date = date;rn rnrn public ActionErrors validate(ActionMapping mapping,HttpServletRequest request)rn rn rn System.out.println("===================我是验证======================");rn rn System.out.println("================= " + this + " **********************");rn rn ActionErrors err = new ActionErrors();rnrn if(!isAge())rn rn err.add("age", new ActionMessage("非法年龄"));rn rn rn if(!isDate())rn rn err.add("date", new ActionMessage("非法日期"));rn rn rn return err;rn rn rn public boolean isAge()rn rn if(age>100 || age<1)rn rn return false;rn rn return true;rn rn rn public boolean isDate()rn rn if(date>99999999 || date<10000101)rn rn return false;rn rn return true;rn rn rn public String toString()rn rn return "[username="+username+",password="+password+",sex="+age+",age="+age+",date="+date+"]";rn rnrnrnrnstruts-config.xmlrnrnrn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rnrnrnrnindex.jsprnrn rn rn user:rn rn 用户名不能为空,且只能是字母rn rn rn rn password:rn rn 密码不能为空rn rn rn rn sex:rn rn 性别不能为空rn rn rn rn age:rn rn 年龄不能为空且只能是数字rn rn rn rn date:rn rn 请输入日期rn rn rn rn rnrnrnrnrn其中,我知道的原因是:rnprivate Integer age;rnprivate Integer date;rnrn这两个字段是integer,我只要把integer改成string就没有问题,rnrn但是,这样没道理。rnrnrn急求答案
hibernate Unhandled Exception thrown: class java.l
在通过hibernate访问数据库时,报错如下:rnWARN action.RequestProcessor - Unhandled Exception thrown: class java.lang.NullPointerExceptionrn大概是什么原因呢?n[b]问题补充:[/b]n是查询的时候,调用查询方法时直接报这个错。rn文件配置应该没有问题。n[b]问题补充:[/b]n这是全部的错误提示:rn25609 [http-8888-1] WARN action.RequestProcessor - Unhandled Exception thrown: class java.lang.NullPointerExceptionrn2008-8-14 14:48:17 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet action threw exceptionrnjava.lang.NullPointerExceptionrn at com.afa.struts.action.Test1Action.execute(Test1Action.java:19)rn at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)rn at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)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我的访问数据库的方法如下:rnpublic List findAll(Class clazz) rn try rn return this.getHibernateTemplate().find(" from " + clazz.getName());rn catch (DataAccessException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rnSystem.out.println("e "+e.getMessage()); rn rn return null;rn rn调用该方法时参数类是通过hibernate映射而成的。rn我怀疑是不是没有通过hibernate得到对象?n[b]问题补充:[/b]n这是action的execute方法:rnpublic ActionForward execute(ActionMapping mapping, ActionForm arg1, HttpServletRequest arg2, HttpServletResponse arg3) throws Exception rn System.out.println("action!");rn ComDaoIMPL comservice=new ComDaoIMPL();rn comservice.findAll(Test.class); return mapping.findForward("test1");rn rn这是ComServiceIMPL方法:rnpublic class ComServiceIMPL implements IComService rn Comdao comdaoimpl;rn public Comdao getComdaoimpl() rn return comdaoimpl;rn rn public void setComdaoimpl(Comdao comdaoimpl) rn this.comdaoimpl = comdaoimpl;rn rn public List findAll(Class clazz) rn return this.comdaoimpl.findAll(clazz);rn rnrn其中comdaoimpl是通过spring依赖注入的:rnrn rn rn rn rn其中comDao对应的方法是:rnpublic List findAll(Class clazz) rn try rn return this.getHibernateTemplate().find(" from " + clazz.getName());rn catch (DataAccessException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rnSystem.out.println("e "+e.getMessage()); rn rn return null;rn rn不知道问题出在哪个环节上了。n[b]问题补充:[/b]n这是spring ,hibernat配置文件 spring-config.xmlrnrnrnrnrn rn com.microsoft.jdbc.sqlserver.SQLServerDriverrn rn rn jdbc:microsoft:sqlserver://192.168.0.7:1433;DatabaseName=dsltxsalaryrn rn rn rn 5 rn 10 rn 60 rn 50 rn true rn sarn rn rn rn rn rn rn rn rn rn rn org.hibernate.dialect.SQLServerDialectrn truern rn rn rn rn classpath*:com/afa/auto/*.hbm.xmlrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn PROPAGATION_REQUIRED,-InfoObjectExceptionrn PROPAGATION_REQUIRED,-InfoObjectExceptionrn PROPAGATION_REQUIRED,-InfoObjectExceptionrn PROPAGATION_REQUIRED,readOnly,-InfoObjectExceptionrn PROPAGATION_REQUIRED,readOnly,-InfoObjectException rn PROPAGATION_REQUIRED,readOnly,-InfoObjectException rn rn rn rnrn rn rn rn rn rn rn rn rnrnrnrn这是spring actionrnrn rn rnrn这是struts actionrnrn rn rn我将那一句注释掉还是老毛病,快晕死了,是不是hibernate的部署有问题?n[b]问题补充:[/b]n在这里注入的:rn rn rn rn rn rnrn其他action 都继承BaseActionn[b]问题补充:[/b]n折磨了我将近一周的问题就在忘记了继承baseAction的这个配置。rn疯了。rn十分感谢小疯子的帮助。
Exception has been thrown by the target of an invocation.
一个程序在多台机器上运行都没有问题?rnrn今天他们说装在一台新机器上,输入密码点登陆后出现错误提示:rn Exception has been thrown by the target of an invocation.rnrn可能会是什么问题引起的————请教rn
Exception activating module的问题怎么解决啊?
采用wls8.1和jb9整合开发rn配置都完成,包括wls里面的Connection Pool和Data Sourcernrn但是部署的时候却提示:rnrnDeployment failed on Server myserverrnrnweblogic.management.DeploymentException: rnException:weblogic.management.ApplicationException: activate failed for warehousernModule: warehouseError: Exception activating module: EJBModule(warehouse,status=PREPARED)rnrnrnUnable to deploy EJB: User from warehouse.jar:rnrn[EJB:011031]The Entity EJB requires the table: user to be accessible. Please ensure that this table exists and is accessible.rnrnrn换用MSSQL自己带的数据库Northwind,一切正常rn但是用了自己的数据库就不行了:(rnrn而且,MSSQL是用sa登录以后创建的rnrn
Exception in thread "main" java.lang.NullPointerException怎么解决啊
[b]StudentMain.java[/b]rnpackage com.lele.jdbc.main;rnrnimport java.util.Scanner;rnrnimport com.lele.jdbc.menu.Menu;rnimport com.lele.jdbc.menu.Menu;rnrnrnpublic class StudentMain rn public static void main(String[] args)rn Scanner s=new Scanner(System.in);rn boolean ok = true;rn while(ok)rn Menu.startInterface();rn int i = s.nextInt(); //输入一个整数rn switch(i )rn case 1:rn Menu.look();rn break;rn case 2:rn Menu.Insert();rn break;rn case 3:rn Menu.alter();rn break;rn case 4:rn Menu.query();rn break;rn case 5:rn System.out.println(" 欢迎使用学生信息管理系统,再见!");rn ok = false;rn break;rn rn rn rn rnrnrnrn[b]Menu.java[/b]rnpackage com.lele.jdbc.menu;rnrnimport java.util.List;rnimport java.util.Scanner;rnrnimport com.lele.jdbc.dao.StudentD;rnimport com.lele.jdbc.model.Student;rnrnpublic class Menu rn rn public static StudentD sD = new StudentD();rn public static Scanner s = new Scanner(System.in);rn rn public static void startInterface()rn System.out.println("***********欢迎使用学生信息管理系统************");rn System.out.println("1.浏览信息数据");rn System.out.println("2.增加信息数据");rn System.out.println("3.修改信息数据");rn System.out.println("4.查询信息数据");rn System.out.println("5.退出");rn rnrn public static void look() rn List< Student > l = sD.getAllStudent();rn System.out.println("所有的学生信息为:");rn System.out.println("-------------------");rn System.out.println("学生编号\t学生学号\t学生姓名\t学生性别\t学生年龄");rn for( Student s : l )rn System.out.println(s.getId()+"\t"+s.getNumber()+"\t"+s.getName()+"\t"+s.getSex()+"\t"+s.getAge());rn rn if( l.size()==0 )rn System.out.println("您所查询的 数据不存在!");rn rn methodEnd();rn rnrn public static void Insert() rn Student student = new Student();rn System.out.println("学生信息输入");rn Scanner s = new Scanner(System.in);rn System.out.println("请输入学生学号:");rn int number= s.nextInt();rn System.out.println("请输入学生姓名:");rn String name=s.next();rn System.out.println("请输入学生性别:");rn String sex=s.next();rn System.out.println("请输入学生年龄:");rn int age=s.nextInt();rn sD.save(student);rn System.out.println("添加成功!");rn methodEnd();rn rnrn public static void alter() rn List< Student > l = sD.getAllStudent();rn System.out.println("全部学生信息:");rn System.out.println("-------------------");rn System.out.println("学生编号\t学生学号\t学生姓名\t学生性别\t学生年龄");rn for( Student s : l )rn System.out.println(s.getId()+"\t"+s.getNumber()+"\t"+s.getName()+"\t"+s.getSex()+"\t"+s.getAge());rn rn Student student = new Student();rn System.out.println("请输入要修改的学生的编号");rn Scanner a=new Scanner(System.in); rn int ID=a.nextInt();rn System.out.println("请输入学生学号:");rn int number= a.nextInt();rn System.out.println("请输入学生姓名:");rn String name=a.next();rn System.out.println("请输入学生性别:");rn String sex=a.next();rn System.out.println("请输入学生年龄:");rn int age=a.nextInt();rn try rn sD.updateById(student);rn catch (Exception e) rn System.out.println("更新失败,请检查您的输入!");rn return ;rn rn System.out.println("更新成功");rn methodEnd();rn rnrn public static void query() rn System.out.println("请输入要查询的学生编号:");rn String num = s.next();rn int number = 0 ;rn try rn number = Integer.parseInt(num);rn catch (NumberFormatException e) rn rn if( number==0 )rn System.out.println("输入的学号不正确,请重新输入:");rn query();rn elsern Student s = sD.getById(number);rn if( s==null )rn System.out.println("所查询的学生不存在!");rn elsern System.out.println(s);rn methodEnd();rn rn rn rn public static void methodEnd()rn System.out.println("请按任意键并回车继续......");rn new Scanner(System.in).next();rn rnrnrnrnrnrnrn[b]DataBase。java[/b]rnrnrnpackage com.lele.jdbc.util;rnrnimport java.sql.Connection;rnimport java.sql.DriverManager;rnimport java.sql.SQLException;rnrnpublic class DataBase rn static rn tryrn Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");rn catch (ClassNotFoundException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn public static Connection getConnection() throws SQLException rn Connection con = null;rn String url = "jdbc:odbc:Driver=MicroSoft Access Driver (*.mdb);DBQ=D:\\study software\\java\\java实验\\综合性实验\\stu.mdb"; rn Connection conn = DriverManager.getConnection(url, "", ""); rn return con;rn rnrnrnrnrnrn[b]StudentD.java[/b]rnpackage com.lele.jdbc.dao;rnrnimport java.sql.Connection;rnimport java.sql.ResultSet;rnimport java.sql.SQLException;rnimport java.sql.Statement;rnimport java.util.ArrayList;rnimport java.util.List;rnrnimport com.lele.jdbc.model.Student;rnimport com.lele.jdbc.util.DataBase;rnrnpublic class StudentD rnrn private Connection con = null;rn private Statement stmt = null;rn private ResultSet rs = null;rn rn public List getAllStudent() rn List list = new ArrayList();rn try rn con = DataBase.getConnection();rn stmt = con.createStatement();rn String sql = "select * from student";rn rs = stmt.executeQuery(sql);rn while(rs.next()) rn Student po = new Student();rn po.setId(rs.getInt(1));rn po.setNumber(rs.getInt(2));rn po.setName(rs.getString(3));rn po.setSex(rs.getString(4));rn po.setAge(rs.getInt(5));rn list.add(po);rn rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn finally rn try rn rs.close();rn stmt.close();rn con.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn return list;rn rn public boolean save(Student po) rn System.out.println(po);rn boolean b =false;rn try rn con = DataBase.getConnection();rn stmt = con.createStatement();rn String sql = "insert into student values(null,"+po.getNumber()+",'"+po.getName()+"','"+po.getSex()+"',"+po.getAge()+")";rn int i =stmt.executeUpdate(sql);rn if(i>0) b = true;rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn finally rn try rn stmt.close();rn con.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn return b;rn rn rn public Student getById(int id) rn Student po = null;rn try rn con = DataBase.getConnection();rn stmt = con.createStatement();rn String sql = "select * from student where Id="+id;rn rs = stmt.executeQuery(sql);rn if(rs.next()) rn po = new Student();rn po.setId(rs.getInt(1));rn po.setNumber(rs.getInt(2));rn po.setName(rs.getString(3));rn po.setSex(rs.getString(4));rn po.setAge(rs.getInt(5));rn rn rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn finally rn try rn stmt.close();rn con.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn return po;rn rn public boolean updateById(Student po) rn boolean b =false;rn try rn con = DataBase.getConnection();rn stmt = con.createStatement();rn String sql = "update student set name='"+po.getName()+"',age="+po.getAge()+",gender='"+po.getSex()+"',studyNumber='"+po.getNumber()rn +"' where Id="+po.getId();rn int i = stmt.executeUpdate(sql);rn if(i>0) b = true;rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn finally rn try rn stmt.close();rn con.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn return b;rn rnrnrnrnrnrnrn[b]rnStudent.java[/b]rnrnrnpackage com.lele.jdbc.model;rnrnpublic class Student rn rn /**rn * 学生编号rn */rn private int id;rn /**rn * 学好rn */rn private int number;rn /**rn * 姓名rn */rn private String name;rn /**rn * 性别rn */rn private String sex;rn /**rn * 年龄rn */rn private int age;rn rn rn rn rn public int getId() rn return id;rn rn public void setId(int id) rn this.id = id;rn rn public int getNumber() rn return number;rn rn public void setNumber(int Number) rn this.number = Number;rn rn public String getName() rn return name;rn rn public void setName(String name) rn this.name = name;rn rn public String getSex() rn return sex;rn rn public void setSex(String sex) rn this.sex = sex;rn rn public int getAge() rn return age;rn rn public void setAge(int age) rn this.age = age;rn rn @Overridern public String toString() rn return "学生 [编号=" + id + ", 学号=" + number + ", 名字="rn + name + ", 性别=" + sex + ", 年龄=" + age + "]";rn rn rn rnrnrnrnrnrn一下是异常提示rnrnException in thread "main" java.lang.NullPointerExceptionrn at com.lele.jdbc.dao.StudentD.getAllStudent(StudentD.java:40)rn at com.lele.jdbc.menu.Menu.look(Menu.java:24)rn at com.lele.jdbc.main.StudentMain.main(StudentMain.java:18)
Exception in thread "Timer-0"怎么解决啊
Exception in thread "Timer-0" java.lang.UnsupportedOperationException: Not supported yet.rn at nepu.quan.Synchronous_Datetime.run(Synchronous_Datetime.java:38)rn at java.util.TimerThread.mainLoop(Timer.java:512)rn at java.util.TimerThread.run(Timer.java:462)rnException in thread "Timer-1" java.lang.UnsupportedOperationException: Not supported yet.rn at nepu.quan.Do_For_Timer2.run(Do_For_Timer2.java:54)rn at java.util.TimerThread.mainLoop(Timer.java:512)rn at java.util.TimerThread.run(Timer.java:462)rn各位大神们,这到底是什么问题啊
Interceptor has thrown exception, unwinding now(ClassCastException)
这个是测试类:rnpublic void test()rn System.out.println("juint test run!");rn //声明JAXRS服务对象rn JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();rn //加载服务类rn factory.setServiceBeans(new SaleServiceImpl());rn //声明地址,注意只声明地址和端口即可rn factory.setAddress("http://localhost:8080/");rn rn// SaleService saleClient = (SaleService) factory.create();rn// System.out.println("2"); rn// ClientProxy proxy = (ClientProxy) Proxy.getInvocationHandler(saleClient);rn// rn// Client client = proxy.getClient();rn rn// Map outProps = new HashMap();rn// outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);rn// outProps.put(WSHandlerConstants.USER, "admin");rn// outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);rn// outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, WsClientOutAuthHandler.class.getName());rn// factory.getOutInterceptors().add(new SAAJOutInterceptor());rn// factory.getOutInterceptors().add(new WSS4JOutInterceptor(outProps));rn //factory.getOutInterceptors().add(new JAXRSOutInterceptor());rn rn Map inProps = new HashMap();rn inProps.put("action", "UsernameToken");rn inProps.put("passwordType", "PasswordText");rn inProps.put("passwordCallbackClass", "com.csair.acp.handler.WsOutAuthHandler");rn factory.getInInterceptors().add(new SAAJInInterceptor());rn factory.getInInterceptors().add(new WSS4JInInterceptor(inProps));rn rn rn rn GetMethod get = new GetMethod("http://localhost:8080/v1/infos/");rnrn get.setRequestHeader("accept","application/xml");rn //get.setRequestHeader("accept","application/json");rnrn HttpClient hc = new HttpClient();rnrn hc.getParams().setContentCharset("UTF-8"); //设置编码rnrn int code=0;rn try rn code = hc.executeMethod(get);rn catch (HttpException e) rn e.printStackTrace();rn catch (IOException e) rn e.printStackTrace();rn rnrn System.err.println("返回的状态码:"+code);rnrn if(code==200)rn String str="";rn try rn str = get.getResponseBodyAsString();rn catch (IOException e) rn e.printStackTrace();rn rnrn System.err.println("返回信息:\n"+str);rnrn rnrn get.releaseConnection(); rn rn rnrnrnrnrnSpring配置文件 (备注:是Restful风格的WebService)rnrnrn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrnrn没加入用户身份验证的时候WebService能发布成功,也能运行返回xmlrnrnrn2013-6-26 10:27:05 org.apache.cxf.interceptor.LoggingInInterceptor loggingrn信息: Inbound Messagern----------------------------rnID: 1rnAddress: /v1/infos/rnEncoding: rnContent-Type: rnHeaders: Host=[localhost:8080], User-Agent=[Jakarta Commons-HttpClient/3.0.1], Content-Type=[null], Accept=[application/xml]rnPayload: rn--------------------------------------rn2013-6-26 10:27:05 org.apache.cxf.phase.PhaseInterceptorChain doInterceptrn警告: Interceptor has thrown exception, unwinding nowrnjava.lang.ClassCastException: org.apache.cxf.message.XMLMessage cannot be cast to org.apache.cxf.binding.soap.SoapMessagern at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessage(SAAJInInterceptor.java:71)rn at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)rn at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)rn at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99)rn at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:452)rn at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:159)rn at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:220)rn at org.apache.cxf.transport.servlet.AbstractCXFServlet.doGet(AbstractCXFServlet.java:158)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)rn at org.apache.cxf.transport.servlet.AbstractCXFServlet.service(AbstractCXFServlet.java:211)rn at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530)rn at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:427)rn at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)rn at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:494)rn at org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:182)rn at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:933)rn at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362)rn at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867)rn at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)rn at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)rn at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)rn at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)rn at org.eclipse.jetty.server.Server.handle(Server.java:334)rn at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559)rn at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:992)rn at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:541)rn at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:203)rn at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406)rn at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462)rn at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)rn at java.lang.Thread.run(Thread.java:619)rnrn这是控制台输出的异常信息,求指导,自己找资料搞了一天了,没办法解决
请问“error: cannot read: Tb.java”是什么原因啊???
javac Tb.javarn error: cannot read: Tb.javarn就是这么一句,到底是什么原因啊,编程的时候经常碰到,不会是硬盘的问题,谁碰到过?
Uncaught TypeError: Cannot read property 'options' of undefined怎么解决?
[img=https://img-bbs.csdn.net/upload/201711/08/1510121281_150701.png][/img]rn[img=https://img-bbs.csdn.net/upload/201711/08/1510121290_854362.png][/img]rnrn一般出现这种情况都是怎么回事啊?是不是要很懂JQuery内核才能明白?rn[img=https://img-bbs.csdn.net/upload/201711/08/1510121458_265182.png][/img]rn[code=html] 查询[/code]rn[code=javascript] manager_tool = rn search: function () rn $('#manager').datagrid('load', rn manager: $('input[name="user"]').val(),rn startDate: $('input[name="date_from"]').datebox('getValue'),rn endDate: $('input[name="date_to"]').datebox('getValue')rn );rn ,[/code]rnrn按钮设置了函数,怎么点了没反应,反而再控制台报出错误?rn
error: cannot read: HelloJava.java
rn第一种配置:rn1.java运行环境安装与测试及HelloWorld的实现。rn2.运行刚刚下载的j2sdk-1_4_1_02-windows-i586.exe文件进行正式安装rn(以下假设安装于c:\j2sdk1.4.1,建议安装路径不要有空格,不宜安装在\Program Files目录下!)。rn系统变量->新建->变量名:JAVA_HOME 变量值:c:\j2sdk1.4.1    rn系统变量->新建->变量名:CLASSPATH 变量值:.;%JAVA_HOME%\lib   rn 系统变量->编辑->变量名:Path 在变量值的最前面加上:%JAVA_HOME%\bin;  rn  (CLASSPATH中有一英文句号"."后跟一个分号,表示当前路径的意思)rnrn~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~rn我用 的是第一种的 装在C盘新建名为 JAVA文件夹下rn新建 变量名:JAVA_HOME 值:c:\javarn变量名 :CLASSPATH 值:.;%JAVA_HOME%\librnPATH 值:rn %JAVA_HOME%\bin;rnrn第二:rn2.2 设置ClasspathrnrnJava执行环境本身就是一个平台,执行于这个平台上的程序是已编译完成的Java程序rnrn(后面会介绍到Java程序编译完成之后,会以.class文件存在)。如果将Java执行环境比喻为操作系统,rnrn如果设置Path变量是为了让操作系统找到指定的工具程序(以Windows来说就是找到.exe文件),rnrn则设置Classpath的目的就是让Java执行环境找到指定的Java程序(也就是.class文件)。rnrn有几个方法可以设置Classpath,最简单的方法是在系统变量中新增Classpath环境变量。rnrn在图2-9中的“系统变量”下单击“新建”按钮,在“变量名”文本框中输入Classpath,rn在“变量值”文本框中输入Java类文件的位置。rn例如可以输入“.;C:\Program Files\Java\jdk1.5.0_06\lib\tools.jar; C:\Program Files\Java\jdk1.5.0_06\lib\rt.jar”(jar文件是zip压缩格式,其中包括.class文件和jar中的Classpath设置),每一路径中间必须以;作为分隔。rnrn~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~rn 发现这个C:\Program Files\Java\jdk1.5.0_06\lib\rt.jar 在 lib文件下根本没有rt.jar ;rn 1 ) 我照着设置了一个“.;C:Java\lib\tools.jar; C:\Java\lib\rt.jar”不行rn ((然后在网上查了下还有人把这个设置为 : dt.jar我也设置了一下还是不行)rnrn 2)我的这个rt.jar 是 在 C:\java\jre\lib 下的,rn我也这样试了一下改为:rn“.;C:\Java\lib\tools.jar; C:\java\jre\lib\rt.jar”rn还是不行rn 3)把HelloWorld.java 复制到 lib下 还是不行rn还有的说是 什么文件扩展名的问题 我 也把隐藏文件扩展名给去掉了(文件属性开来看过是JAVA的)rncmd--->javac HelloWorld.java——》ENTER-->出现: error: cannot read: HelloJava.java rnrn~~~~~~~~~~~~~~~~~~~~~~~~~~~rn 偶 已经快接近昏迷状态了!!!!rn哪个大虾 帮帮忙 ,,,说明一下 我到底错在哪里了rn
Cannot open include file: 'exception': No such file or directory 这个错误只能解决
Cannot open include file: 'exception': No such file or directory rn编辑一个程序时出现连续五个这样的错误 rn双击此错误跳到stdexcpt.h文件中去了 rn不知道是怎么回事
read的阻塞怎么解决???
我正在使用socket下一些东西,但是有时后网络很卡,在取得s.getInputStream(),以后read()的时候,阻塞了,一个1024b的数组,要读很长时间rn我想在read()进行比如1分钟还没有读完就退出,或者抛异常,应该怎样做???rnrn还有,我曾经尝试了nio,我在网上找了很长时间都没有上面这个问题的相关处理,nio在客户端如何使用异步I/O,就是即使我rnrnReadableByteChannel rbc = Channels.newChannel(dis);rnint length = rbc.read(buffer);rnrn这样做了,能保证read()方法不会阻塞吗?不明白啊,我觉得好像不会,十分迷茫????
异常:Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: com.wsb.pub.Item cannot 怎么解决
用netbeans 6.5时,遇到一个问题,没有解决。rnrnDAO.java内的方法:rnrn public List getKhInfos()rn ArrayList lst=new ArrayList();rn tryrn if(setConnection())rn ResultSet rs=findResultSet("select ID,khname from tb_khinfo order by ID");rn while(rs.next())rn Item item=new Item();rn item.setID(rs.getString(1).trim());rn item.setName(rs.getString(2).trim());rn lst.add(item);rn rn rs.close();rn rn catch(Exception e)rn return lst;rn rnrn自定义的方法,初始化comboBox列表:rnrn private void initComboID(JComboBox combo)rn List khinfo=dao.getKhInfos();rn List items=new ArrayList();//创建Item列表rn combo.removeAllItems();rn for(Iterator iter=khinfo.iterator();iter.hasNext();)rn List element=(List) iter.next();rn Item item=new Item();rn item.setID(element.get(0).toString().trim());rn item.setName(element.get(1).toString().trim());rn //如果Item封闭包含客户信息,跳出循环rn if(items.contains(item))rn continue;rn rn items.add(item);rn combo.addItem(item);rn rn rnrn当程序运行到:List element=(List)iter.next();时出现如下异常:rnrnException in thread "AWT-EventQueue-0" java.lang.ClassCastException: com.wsb.pub.Item cannot be cast to java.util.Listrn at com.wsb.khguanli.frmKhguanli.initComboID(frmKhguanli.java:331)rn at com.wsb.khguanli.frmKhguanli.(frmKhguanli.java:31)rn at com.wsb.JXCFrame.btnKehuGuanliActionPerformed(JXCFrame.java:322)rn at com.wsb.JXCFrame.access$000(JXCFrame.java:26)rn at com.wsb.JXCFrame$1.actionPerformed(JXCFrame.java:135)rn at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)rn at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)rn at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)rn at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)rn at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)rn at java.awt.Component.processMouseEvent(Component.java:6038)rn at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)rn at java.awt.Component.processEvent(Component.java:5803)rn at java.awt.Container.processEvent(Container.java:2058)rn at java.awt.Component.dispatchEventImpl(Component.java:4410)rn at java.awt.Container.dispatchEventImpl(Container.java:2116)rn at java.awt.Component.dispatchEvent(Component.java:4240)rn at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)rn at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)rn at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)rn at java.awt.Container.dispatchEventImpl(Container.java:2102)rn at java.awt.Window.dispatchEventImpl(Window.java:2429)rn at java.awt.Component.dispatchEvent(Component.java:4240)rn at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)rn at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)rn at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)rn at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)rn at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)rn at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)rn at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)rnrnrnrn这个异常:Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: com.wsb.pub.Item cannot be cast to java.util.List,不知为什么?rnrn说明一下,List类是引用“java.util.*”内的。
在java编译的时候出现error: cannot read: Student.java?怎么解决?
在使用javac 编译的时候出现:error: cannot read: Student.java怎样解决?
编译错误:cannot read: StudentTest.java
我输入以下命令行时:rnjavac StudentTest.javarn出现:rnerror: cannot read:StudentTest.javarn1 errorrn请各位高手帮帮忙
error: cannot read: HelloWorld.java
xp下的..rn路径设置 java -version执行正确.rn文件Hello.java(在bin路径下) 内容如下:rnimport java.io.*rnrnpublic class Hellornrn public static void main(String[] args) rn rn System.out.println("Hello World!");rn rnrnrn在cmd下执行:rncd E:\j2sdk1.4\binrn但显示的是c:\>rn(不知道咋回事)rn然后:rnjavac Hello.javarn出现标题所示错误..rnrn请高手解答,本人才初学java啊~~~~`rn
read ini file .h file
read ini file .h file 建议在.h文件中只保留函数的声明,在.cpp文件中重写函数的定义。防止.h文件被多个文件饮用时,编译报错“函数重复定义”
请问C++发明人的名字怎么READ啊?????
Bjarne Stroustruprnrn哈哈,怎么发音啊???
相关热词 c#部署端口监听项目、 c#接口中的属性使用方法 c# 昨天 c#func链接匿名方法 c#怎么创建文件夹 c#从键盘接收空格 c#da/ad c#部门请假管理系统 c#服务器socket c# 默认的访问修饰符