安卓程序提示java.lang.IndexOutOfBoundsException

这是java代码

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button btn=(Button) this.findViewById(R.id.btn3);
SpannableString span=new SpannableString("Lift");
Bitmap bit= BitmapFactory.decodeResource(getResources(),R.drawable.image2);
ImageSpan image=new ImageSpan(bit,DynamicDrawableSpan.ALIGN_BOTTOM);
span.setSpan(image,0,4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
btn.append(span);
btn.append("我的按钮");
}

这是布局
android:layout_width="150sp"
android:layout_height="150sp"
android:id="@+id/btn3"
android:layout_below="@+id/btn2"/>

6个回答

下标越界啦,再好好检查下,你可以的,加油!

。。。天,你Lift一共才4个。你要在第4个位置插入,你是在骗自己还是在骗as。

sorry,i dot know,i just get point

贴报错的信息,提示的大概意思是下标越界了。

应该是你的资源文件太大了吧

0,1,2,3不是1,2,3,4

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
java.lang.IndexOutOfBoundsException
java.util.ArrayList.throwIndexOutOfBoundsException(255)rnjava.util.ArrayList.get(308)rnandroid.widget.HeaderViewListAdapter.isEnabled(164)rnandroid.widget.AbsListView.onInitializeAccessibilityNodeInfoForItem(2553)rnandroid.widget.ListView.onInitializeAccessibilityNodeInfoForItem(3946)rnandroid.widget.AbsListView$ListItemAccessibilityDelegate.onInitializeAccessibilityNodeInfo(2484)rnandroid.view.View.onInitializeAccessibilityNodeInfo(6104)rnandroid.view.View.createAccessibilityNodeInfoInternal(6065)rnandroid.view.View$AccessibilityDelegate.createAccessibilityNodeInfo(22414)rnandroid.view.View.createAccessibilityNodeInfo(6048)rnandroid.view.accessibility.AccessibilityRecord.setSource(145)rnandroid.view.accessibility.AccessibilityRecord.setSource(119)rnandroid.view.View.onInitializeAccessibilityEventInternal(6002)rnandroid.view.View$AccessibilityDelegate.onInitializeAccessibilityEvent(22326)rnandroid.view.View.onInitializeAccessibilityEvent(5988)rnandroid.view.View.sendAccessibilityEventUncheckedInternal(5855)rnandroid.view.View$AccessibilityDelegate.sendAccessibilityEventUnchecked(22265)rnandroid.view.View.sendAccessibilityEventUnchecked(5838)rnandroid.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.run(7395)rnandroid.view.ViewRootImpl$SendWindowContentChangedAccessibilityEvent.runOrPost(7421)rnandroid.view.ViewRootImpl.postSendWindowContentChangedCallback(6522)rnandroid.view.ViewRootImpl.notifySubtreeAccessibilityStateChanged(6701)rnandroid.view.ViewGroup.notifySubtreeAccessibilityStateChanged(3007)rnandroid.view.ViewGroup.notifySubtreeAccessibilityStateChanged(3007)rnandroid.view.ViewGroup.notifySubtreeAccessibilityStateChanged(3007)rnandroid.view.ViewGroup.notifySubtreeAccessibilityStateChanged(3007)rnandroid.view.ViewGroup.notifySubtreeAccessibilityStateChanged(3007)rnandroid.view.ViewGroup.notifySubtreeAccessibilityStateChanged(3007)rnandroid.view.ViewGroup.notifySubtreeAccessibilityStateChanged(3007)rnandroid.view.ViewGroup.notifySubtreeAccessibilityStateChanged(3007)rnandroid.view.ViewGroup.notifySubtreeAccessibilityStateChanged(3007)rnandroid.view.View.notifySubtreeAccessibilityStateChangedIfNeeded(8834)rnandroid.view.View.setFrame(16836)rnandroid.view.View.layout(16721)rnandroid.view.ViewGroup.layout(5452)rnandroid.widget.ListView.setupChild(1968)rnandroid.widget.ListView.makeAndAddView(1878)rnandroid.widget.ListView.fillSpecific(1354)rnandroid.widget.ListView.layoutChildren(1662)rnandroid.widget.AbsListView.onLayout(2223)rncom.vic.common.shop.PinnedHeaderExpandableListView.(void onLayout(boolean,int,int,int,int))(235)rnandroid.view.View.layout(16728)rnandroid.view.ViewGroup.layout(5452)rnandroid.widget.FrameLayout.layoutChildren(336)rnandroid.widget.FrameLayout.onLayout(273)rnandroid.view.View.layout(16728)rnandroid.view.ViewGroup.layout(5452)rnandroid.widget.LinearLayout.setChildFrame(1743)rnandroid.widget.LinearLayout.layoutVertical(1586)rnandroid.widget.LinearLayout.onLayout(1495)rnandroid.view.View.layout(16728)rnandroid.view.ViewGroup.layout(5452)rnandroid.widget.RelativeLayout.onLayout(1079)rnandroid.view.View.layout(16728)rnandroid.view.ViewGroup.layout(5452)rnandroid.widget.RelativeLayout.onLayout(1079)rnandroid.view.View.layout(16728)rnandroid.view.ViewGroup.layout(5452)rnandroid.widget.RelativeLayout.onLayout(1079)rnandroid.view.View.layout(16728)rnandroid.view.ViewGroup.layout(5452)rnandroid.widget.FrameLayout.layoutChildren(336)rnandroid.widget.FrameLayout.onLayout(273)rnandroid.view.View.layout(16728)rnandroid.view.ViewGroup.layout(5452)rnandroid.widget.LinearLayout.setChildFrame(1743)rnandroid.widget.LinearLayout.layoutVertical(1586)rnandroid.widget.LinearLayout.onLayout(1495)rnandroid.view.View.layout(16728)rnandroid.view.ViewGroup.layout(5452)rnandroid.widget.FrameLayout.layoutChildren(336)rnandroid.widget.FrameLayout.onLayout(273)rncom.android.internal.policy.PhoneWindow$DecorView.onLayout(2728)rnandroid.view.View.layout(16728)rnandroid.view.ViewGroup.layout(5452)rnandroid.view.ViewRootImpl.performLayout(2288)rnandroid.view.ViewRootImpl.performTraversals(2025)rnandroid.view.ViewRootImpl.doTraversal(1174)rnandroid.view.ViewRootImpl$TraversalRunnable.run(6241)rnandroid.view.Choreographer$CallbackRecord.run(873)rnandroid.view.Choreographer.doCallbacks(676)rnandroid.view.Choreographer.doFrame(606)rnandroid.view.Choreographer$FrameDisplayEventReceiver.run(859)rnandroid.os.Handler.handleCallback(739)rnandroid.os.Handler.dispatchMessage(95)rnandroid.os.Looper.loop(168)rnandroid.app.ActivityThread.main(5845)rnjava.lang.reflect.Method.invoke(-2)rncom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(798)rncom.android.internal.os.ZygoteInit.main(688)rnrnrn只有这行是我自己的代码 com.vic.common.shop.PinnedHeaderExpandableListView.(void onLayout(boolean,int,int,int,int))(235) rnrn但是这一行是 rn @Overridern protected void onLayout(boolean changed, int left, int top, int right, int bottom) rn super.onLayout(changed, left, top, right, bottom); // 235 行 rnrn // TODO xxxrnrnrn这种问题怎么解决呢? 有没有人遇到 ??rn
报错java.lang.IndexOutOfBoundsException
Java项目,部署项目后,启动tomcat6.0没报错,在浏览器键入访问地址http://localhost:8080/gyqp,显示:无法显示该页面,Myeclipse后台报异常,异常信息如下:rn 信息: Server startup in 12175 ms 2012-1-6 15:49:07 org.apache.jk.common.MsgAjp processHeader 严重: BAD packet signature 18245 2012-1-6 15:49:07 org.apache.jk.common.ChannelSocket processConnection 严重: Error, processing connection java.lang.IndexOutOfBoundsException     at java.io.BufferedInputStream.read(BufferedInputStream.java:306)     at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:628)     at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:585)     at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:693)     at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)     at java.lang.Thread.run(Thread.java:595)rn 搞了好几天都不知道是什么原因,请大家帮帮我。谢谢了。rn
hibernate异常java.lang.IndexOutOfBoundsException
我用ssh做一个简单的登录演示,下面是我的DAO类:rnrnrnpublic class SSHActionServ extends HibernateDaoSupport implements ActionInterface rn //private User user;rn public boolean isLogin(String user, String password) rn boolean flog=false;rn //String hql="from User";rn List list = (List)getHibernateTemplate().find("from User");rn Iterator i=list.iterator();rn int index=0;rn while(i.hasNext()) rn User u=(User)list.get(index);rn if(u.getUsername().equals(user)&&u.getPassword().equals(password))rn flog=true;rn break;rn rn index++;rn rn System.out.println(index);rn rn rn // TODO Auto-generated method stubrn return flog;rn rnrnrn小弟初学hibernate,还知道怎么用hql条件查寻,所以全部查询出用户表记录,一个一个的匹配,当输入的用户密码存在时,能顺利登陆,不存在时会出现:rnrnrnHTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: java.lang.IndexOutOfBoundsException: Index: 4, Size: 4rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)rn org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:422)rn org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)rnrnrnroot cause rnrnjava.lang.IndexOutOfBoundsException: Index: 4, Size: 4rn java.util.ArrayList.RangeCheck(Unknown Source)rn java.util.ArrayList.get(Unknown Source)rn com.test.serviceBeans.SSHActionServ.isLogin(SSHActionServ.java:23)rn com.test.action.SSHLoginAction.execute(SSHLoginAction.java:26)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn java.lang.reflect.Method.invoke(Unknown Source)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doInterceptrn。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。rnrnrn
启动tomcat时报java.lang.IndexOutOfBoundsException
[img=https://img-bbs.csdn.net/upload/201412/08/1418025253_100362.jpg][/img]
Exception in thread "Thread-20" java.lang.IndexOutOfBoundsException
在我进行 图片下载的时候,会报[code=java]Exception in thread "Thread-20" java.lang.IndexOutOfBoundsExceptionrn at java.io.FileOutputStream.writeBytes(Native Method)rn at java.io.FileOutputStream.write(FileOutputStream.java:345)rn at com.ehl.itgs.batch.action.thread.DownloadHttpURLThread.run(DownloadHttpURLThread.java:52)[/code]rn这是为什么?当我再次点击进行图片下载,图片倒是能够下载下来,但是也报错[code=java] org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet default threw exceptionrnjava.lang.IllegalStateExceptionrn at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407)rn at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:888)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:569)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:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)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:298)rn at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:886)rn at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:721)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2256)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:745)[/code]rn并且下载下来的图片是空的,即字节为0.请教各位这是为什么?
java.lang.IndexOutOfBoundsException越界问题
getSupportFragmentManager().getFragments().clear()当我在执行这一句的时候,n会报java.lang.IndexOutOfBoundsException这个异常,请问大神,这是为什么?
java报错java.lang.IndexOutOfBoundsException
![图片说明](https://img-ask.csdn.net/upload/201606/04/1465016132_558449.png)n![图片说明](https://img-ask.csdn.net/upload/201606/04/1465016148_409766.png)n![图片说明](https://img-ask.csdn.net/upload/201606/04/1465016141_240819.png)n![图片说明](https://img-ask.csdn.net/upload/201606/04/1465016206_139184.png)nException in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0n at java.util.ArrayList.rangeCheck(ArrayList.java:653)n at java.util.ArrayList.get(ArrayList.java:429)n at RobotInterface.joke(RobotInterface.java:295)n at RobotGUI.main(RobotGUI.java:47)n在mac上跑的时候没有报错,在win上跑的时候就有这样的错误了,然后发现同样的语句在我另一个相似的函数里也有但是没有这样的报错,求谈里大神给分析分析,我baidu的情况来看好像是数组超界了?
安卓首次进入程序提示demo
使用帧动画完成首次进入程序提示的动画效果
java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-base
见鬼了...百思不得其解...rnrn下面3种问号的用法都同样报错;rn将query.setParameter(i, params[i]); 第一个参数强制设置为0和1也都报错;rnrn效果如下:rnrn[code=java]rnString name = "xxx";rnString hql = "FROM Obj WHERE name like '%?%'"; //第一种rnString hql = "FROM Obj WHERE name like '?'"; //第二种rnString hql = "FROM Obj WHERE name like '%'?'%'"; //第三种rnObject[] params = name ;rn[/code]rnrn[code=java]rnpublic Pager findForPagerByHql(final int firstResult,rn final int maxResults, final String hql, final Object[] params) rn Pager pager = (Pager) super.getHibernateTemplate().execute(rn new HibernateCallback>() rn @SuppressWarnings("unchecked")rn public Pager doInHibernate(Session session)rn throws HibernateException, SQLException rn Query query = session.createQuery(hql);rn for (int i = 0; i < params.length; i++) rn query.setParameter(i, params[i]); // 报错...rn rn int totalCounts = query.list().size(); if (maxResults > 0) rn query.setFirstResult(firstResult);rn query.setMaxResults(maxResults);rn rn List list = query.list();rn Pager pager = new Pager();rn pager.setList(list);rn pager.setTotalCounts(totalCounts);rn return pager;rn rn );rn return pager;rn[/code]rnrn[code=text]rnjava.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-based!rn at org.hibernate.engine.query.ParameterMetadata.getOrdinalParameterDescriptor(ParameterMetadata.java:79)rn at org.hibernate.engine.query.ParameterMetadata.getOrdinalParameterExpectedType(ParameterMetadata.java:85)rn at org.hibernate.impl.AbstractQueryImpl.determineType(AbstractQueryImpl.java:421)rn at org.hibernate.impl.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:393)rn at util.BaseDAO$7.doInHibernate(BaseDAO.java:310)rn at util.BaseDAO$7.doInHibernate(BaseDAO.java:1)rn at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)rn at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)rn at util.BaseDAO.findForPagerByHql(BaseDAO.java:303)rn at dao.impl.SuitDAOImpl.findByName(SuitDAOImpl.java:33)rn at service.impl.SuitServiceImpl.list(SuitServiceImpl.java:28)rn at action.SuitAction.list(SuitAction.java:48)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 com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:236)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:236)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:511)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:191)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:286)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)[/code]
安卓toast文字提示
添加三行代码即可 import android.widget.Toast; String str = "Username or password error!"; Toast.makeText(MainActivity.this, str, Toast.LENGTH_LONG).show();
安卓隐藏权限提示
&lt;application&gt; &lt;meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" /&gt; &lt;/application&gt; 修改这里的内容,编程false,或者注释掉 但是在调用未授权的权限的时候有些手机直接crash,有些手机则是很好的输出ad...
安卓提示信息管理
import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.c
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
如下面程序所示,tc是一个对象,包含state、ID和position三个属性,当我有一个新的tc时,我想根据tc的ID来将它存入arrayList对应的位置,为什么一运行就出错?各位大侠,请帮帮我吧!rnif(tc.getTC_ID().substring(3, 4).equals("0"))rn String ID = tc.getTC_ID();rn if(ID.equals("1000"))rn tcListleft.add(0,tc);rn System.out.println("tcListleft 0:"+tcListleft.get(0).TC_ID);rn rn if(ID.equals("2000"))rn tcListleft.add(1,tc);rn System.out.println("tcListleft 1:"+tcListleft.get(1).TC_ID);rn rn if(ID.equals("3000"))rn tcListleft.add(2,tc);rn System.out.println("tcListleft 2:"+tcListleft.get(2).TC_ID);rn rn if(ID.equals("4000"))rn tcListleft.add(3,tc);rn System.out.println("tcListleft 3:"+tcListleft.get(3).TC_ID);rn rn if(ID.equals("5000"))rn tcListleft.add(4,tc);rn System.out.println("tcListleft 4:"+tcListleft.get(4).TC_ID);rn rn rn
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1rn at java.util.ArrayList.RangeCheck(ArrayList.java:547)rn at java.util.ArrayList.get(ArrayList.java:322)rn at com.ump.serviceimpl.TSearchServiceInterImpl.pageBean(TSearchServiceInterImpl.java:106)rn at com.ump.struts.TSearchInterAction.doTSearchBack(TSearchInterAction.java:94)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 com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:186)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at 求高手看一下,我这个错要怎么解决,rn我要实现的效果是用程序替换两张表的字段,也就是说在后台调用方法的时候就替换方法里面查到的值的内存地址。rn非常感谢。。。。
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
具体代码如下rn public Comhr findcomhr(Company company)rn rn Comhr comhr= (Comhr) getDao().getHibernatetemplate().find("from Comhr as c where c.company.comId="+company.getComId()).get(0);rn return comhr;rnrn rn这边的company 对象是session中的对象rn在Comhr表中有一个com_id的外键rn[img=https://img-bbs.csdn.net/upload/201409/29/1411986194_33703.jpg][/img]rnrn之前在其他的地方测试的时候是可以的不知道为何会突然出现这样。这个问题是因为hr没有关联的company信息导致的?就是说com_id找不到hr的数据吗?
安卓程序
安卓程序
1_kotlion安卓(点击提示)toast
Kotlin 是一个用于现代多平台应用的静态编程语言 ,由 JetBrains 开发。Kotlin可以编译成Java字节码,也可以编译成JavaScript,方便在没有JVM的设备上运行。Kotlin已正式成为Android官方支持开发语言。 看本系列文章需要你有kotlin基础语法和安卓基础经验,本系列不过多解释这部分内容。首先点击start a ...
安卓弹出提示显示框
在做项目时需要一个小小的提示,比如在一个TextView中不能把所以的内容都显示出来,这个时候可以选择点击一下文本框让其弹出一个提示框,在提示框中展现具体的内容, 这是个很小的问题,但在某些时候也很方便。哈哈,不说了,看效果图,上代码。 这里写的比较简单,第一个是根据输入框中的内容提示,第二张可以根据自己的需要,选择需要的参数,在弹出内容后,点击屏幕其他的地方或返回键就可以消失都很简单了。
安卓运行提示错误未定义
我只是想建一个”你好“的程序,可是直到现在还没解决,已经濒临崩溃状态
效果不错的安卓提示控件
github的安卓提示控件,颜色可调,效果很好
安卓来电转移提示工具
有多个手机号的人,经常把来电转移到一个手机上,但是安卓手机无法区分是不是来电转移的电话。本工具就是用于此情况,在来电显示界面显示是不是呼叫转移来电。 来电转移的电话可以用箭头图标显示,也可以用自定义文字显示。
仿照安卓Toast 弹窗提示
类似于Toast弹窗提示,不同于iOS的Alter,可自定义宽高、展示坐标、颜色、展示时间等,展示之后自动消失!
出现java.lang.IndexOutOfBoundsException: Index: 0, Size: 0错误
The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)rn org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:422)rnrnrnroot cause rnrnjava.lang.IndexOutOfBoundsException: Index: 0, Size: 0rn java.util.ArrayList.RangeCheck(ArrayList.java:547)rn java.util.ArrayList.get(ArrayList.java:322)rn teacher.action.RecordAction.convertr(RecordAction.java:97)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:184)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(
java.lang.IndexOutOfBoundsException: Index: 12, Size: 12 如题
首先我知道是越界,关键怎么解决,跪求高手!在线等rn严重: Servlet.service() for servlet jsp threw exceptionrnjava.lang.IndexOutOfBoundsException: Index: 12, Size: 12rn at java.util.ArrayList.RangeCheck(Unknown Source)rn at java.util.ArrayList.get(Unknown Source)rn at org.apache.jsp.NewProducts_jsp._jspService(NewProducts_jsp.java:335)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)rn at com.fz.control.productsClServlet.doGet(productsClServlet.java:47)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)rn2011-3-15 12:28:58 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet productsClServlet threw exceptionrnjava.lang.IndexOutOfBoundsException: Index: 12, Size: 12rn at java.util.ArrayList.RangeCheck(Unknown Source)rn at java.util.ArrayList.get(Unknown Source)rn at org.apache.jsp.NewProducts_jsp._jspService(NewProducts_jsp.java:335)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)rn at com.fz.control.productsClServlet.doGet(productsClServlet.java:47)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)rn
数组越界java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
第一个程序里面的部分代码: rn try rn String charsetName = "UTF-8"; rn if (file.isFile() && file.exists()) rn rn InputStreamReader insReader = new InputStreamReader( rn new FileInputStream(file), charsetName); rn BufferedReader bufReader = new BufferedReader(insReader); rn String line=null;rn while ((line = bufReader.readLine()) != null) rn rn double sim= WordSimilarity.WordSimilarity.simWord(line, s);rn if(sim>0.1)rn maps.put(tokens[n], tokens3);rn rn bufReader.close(); rn insReader.close(); rn rn rn rn rn catch (Exception e) rn rn System.out.println("读取文件内容操作出错"); rn e.printStackTrace(); rn rnrn第二个程序里面的部分代码:rn public static double simWord(String word1, String word2) rn if (ALLWORDS.containsKey(word1) && ALLWORDS.containsKey(word2)) rn List list1 = ALLWORDS.get(word1);rn List list2 = ALLWORDS.get(word2);rn double max = 0;rn for (Word w1 : list1) rn for (Word w2 : list2) rn double sim = simWord(w1, w2);rn max = (sim > max) ? sim : max;rn rn rn return max;rn rn rn return 0.0;rn rnrn /**rn * 计算两个词语的相似度rn * @param w1rn * @param w2rn * @returnrn */rn public static double simWord(Word w1, Word w2) rn // 虚词和实词的相似度为零rn if (w1.isStructruralWord() != w2.isStructruralWord()) rn return 0;rn rn // 虚词rn if (w1.isStructruralWord() && w2.isStructruralWord()) rn List list1 = w1.getStructruralWords();rn List list2 = w2.getStructruralWords();rn return simList(list1, list2);rn rn // 实词rn if (!w1.isStructruralWord() && !w2.isStructruralWord()) rn // 实词的相似度分为4个部分rn // 基本义原相似度rn String firstPrimitive1 = w1.getFirstPrimitive();rn String firstPrimitive2 = w2.getFirstPrimitive();rn double sim1 = simPrimitive(firstPrimitive1, firstPrimitive2);rn // 其他基本义原相似度rn List list1 = w1.getOtherPrimitives();rn List list2 = w2.getOtherPrimitives();rn double sim2 = simList(list1, list2);rn // 关系义原相似度rn Map> map1 = w1.getRelationalPrimitives();rn Map> map2 = w2.getRelationalPrimitives();rn double sim3 = simMap(map1, map2);rn // 关系符号相似度rn map1 = w1.getRelationSimbolPrimitives();rn map2 = w2.getRelationSimbolPrimitives();rn double sim4 = simMap(map1, map2);rn double product = sim1;rn double sum = beta1 * product;rn product *= sim2;rn sum += beta2 * product;rn product *= sim3;rn sum += beta3 * product;rn product *= sim4;rn sum += beta4 * product;rn return sum;rn rn return 0.0;rn rnrn /**rn * map的相似度。rn * rn * @param map1rn * @param map2rn * @returnrn */rn public static double simMap(Map> map1,rn Map> map2) rn if (map1.isEmpty() && map2.isEmpty()) rn return 1;rn rn int total =map1.size() + map2.size();rn double sim = 0;rn int count = 0;rn for (String key : map1.keySet()) rn if (map2.containsKey(key)) rn List list1 = map1.get(key);rn List list2 = map2.get(key);rn sim += simList(list1, list2);rn count++;rn rn rn return (sim + delta * (total-2*count))rn / (total-count);rn rnrn /**rn * 比较两个集合的相似度rn * rn * @param list1rn * @param list2rn * @returnrn */rn public static double simList(List list1, List list2) rn if (list1.isEmpty() && list2.isEmpty())rn return 1;rn int m = list1.size();rn int n = list2.size();rn int big = m > n ? m : n;rn int N = (m < n) ? m : n;rn int count = 0;rn int index1 = 0, index2 = 0;rn double sum = 0;rn double max = 0;rn while (count < N) rn max = 0;rn for (int i = 0; i < list1.size(); i++) rn for (int j = 0; j < list2.size(); j++) rn double sim = innerSimWord(list1.get(i), list2.get(j));rn if (sim > max) rn index1 = i;rn index2 = j;rn max = sim;rn rn rn rn sum += max;rn list1.remove(index1);rn list2.remove(index2);rn count++;rn rn return (sum + delta * (big - N)) / big;rn rnrnrnrnjava.lang.IndexOutOfBoundsException: Index: 0, Size: 0rn at java.util.ArrayList.rangeCheck(Unknown Source)rn at java.util.ArrayList.remove(Unknown Source)rn at WordSimilarity.WordSimilarity.simList(WordSimilarity.java:362)rn at WordSimilarity.WordSimilarity.simMap(WordSimilarity.java:322)rn at WordSimilarity.WordSimilarity.simWord(WordSimilarity.java:285)读取文件内容操作出错rnrn at WordSimilarity.WordSimilarity.simWord(WordSimilarity.java:244)rn at tfidf.TfIdf.main(TfIdf.java:329)rn只知道数组越界,不过不清楚怎么改
程序提示?
我常常看到,但程序最小化的时候,鼠标移到程序上的时候会有一个的提示,像所有windows程序一样,在vb中该如何实现?
IDA调试安卓程序提示“The debugger could not ...”解决办法
调试环境: IDA7.0 手机: 华为nova青春版  已root 系统版本: android 7.0 解决办法: 关闭selinux 异常提示界面如图: 1 命令查看出selinux的状态getenforce2 临时关闭 selinux setenforce 0
Unity3D安卓程序中常用静态方法封装
Unity3D/安卓封装SDK常用方法 本文提供全流程,中文翻译。Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 —— 高分辨率用户请根据需求调整网页缩放比例) 1 IO —— - - IO流写...
java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
8266-8266/? E/AndroidRuntime﹕ FATAL EXCEPTION: mainrn java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0rn at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)rn at java.util.ArrayList.get(ArrayList.java:304)rn at android.widget.HeaderViewListAdapter.isEnabled(HeaderViewListAdapter.java:164)rn at android.widget.ListView.dispatchDraw(ListView.java:3221)rn at android.view.View.draw(View.java:13806)rn at android.widget.AbsListView.draw(AbsListView.java:3875)rn at android.view.View.getDisplayList(View.java:12741)rn at android.view.View.getDisplayList(View.java:12785)rn at android.view.View.draw(View.java:13519)rn at android.view.ViewGroup.drawChild(ViewGroup.java:3019)rn at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2883)rn at android.view.View.getDisplayList(View.java:12739)rn at android.view.View.getDisplayList(View.java:12785)rn at android.view.View.draw(View.java:13519)rn at android.view.ViewGroup.drawChild(ViewGroup.java:3019)rn at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2883)rn at android.view.View.getDisplayList(View.java:12739)rn at android.view.View.getDisplayList(View.java:12785)rn at android.view.View.draw(View.java:13519)rn at android.view.ViewGroup.drawChild(ViewGroup.java:3019)rn at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2883)rn at android.view.View.getDisplayList(View.java:12739)rn at android.view.View.getDisplayList(View.java:12785)rn at android.view.View.draw(View.java:13519)rn at android.view.ViewGroup.drawChild(ViewGroup.java:3019)rn at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2883)rn at android.view.View.draw(View.java:13806)rn at android.support.v4.view.ViewPager.draw(ViewPager.java:2171)rn at android.view.View.getDisplayList(View.java:12741)rn at android.view.View.getDisplayList(View.java:12785)rn at android.view.View.draw(View.java:13519)rn at android.view.ViewGroup.drawChild(ViewGroup.java:3019)rn at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2883)rn at android.view.View.getDisplayList(View.java:12739)rn at android.view.View.getDisplayList(View.java:12785)rn at android.view.View.draw(View.java:13519)rn at android.view.ViewGroup.drawChild(ViewGroup.java:3019)rn at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2883)rn at android.view.View.draw(View.java:13806)rn at android.view.View.getDisplayList(View.java:12741)rn at android.view.View.getDisplayList(View.java:12785)rn at android.view.View.draw(View.java:13519)rn at android.view.ViewGroup.drawChild(ViewGroup.java:3019)rn at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2883)rn at android.view.View.getDisplayList(View.java:12739)rn at android.view.View.getDisplayList(View.java:12785)rn at android.view.View.draw(View.java:13519)rn at android.view.ViewGroup.drawChild(ViewGroup.java:3019)rn at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2883)rn at android.view.View.getDisplayList(View.java:12739)rn at android.view.View.getDisplayList(View.java:12785)rn at android.view.View.draw(View.java:13519)rn at android.view.ViewGroup.drawChild(ViewGroup.java:3019)rn at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2883)rn at android.view.View.draw(View.java:13806)rn at android.widget.FrameLayout.draw(FrameLayout.java:467)rn at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2226)rn at android.view.View.getDisplayList(View.java:12741)rn at android.view.View.getDisplayList(View.java:12785)rn at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1249)rn at android.view.ViewRootImpl.draw(ViewRootImpl.java:2480)rn at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2340)rn at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2142)rn at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)rn at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4879)rn at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776)rn at android.view.Choreographer.doCallbacks(Choreographer.java:579)rn at android.view.Choreographer.doFrame(Choreographer.java:548)rn at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762)rn at andrornrn程序加载数据的时候,有的版块上拉加载的时候出现这个,有的没事,求大神指教
异常java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
严重: Servlet.service() for servlet jsp threw exceptionrnjava.lang.IndexOutOfBoundsException: Index: 0, Size: 0rn at java.util.ArrayList.RangeCheck(ArrayList.java:547)rn at java.util.ArrayList.remove(ArrayList.java:387)rn at com.opensymphony.xwork2.util.CompoundRoot.pop(CompoundRoot.java:36)rn at com.opensymphony.xwork2.ognl.OgnlValueStack.pop(OgnlValueStack.java:379)rn at org.apache.struts2.components.Bean.end(Bean.java:146)rn at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)rn at org.apache.jsp.list_jsp._jspx_meth_s_005fbean_005f2(list_jsp.java:238)rn at org.apache.jsp.list_jsp._jspService(list_jsp.java:120)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)rn at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)rn at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)rn at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)rn at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)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:286)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)rn
求解:java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
我用Hibernate查询:rnhql = "select u.email, u.password from ApplicantPO as u where u.username=?";rn query = sessionH.createQuery(hql);rn query.setString(0, Username);rn rn list.clear();rn list = query.list();rn System.out.println("list.size() = " + list.size());rn rn if(list.size()>0)rn this.setEmail(list.get(0).toString().trim()); //给email赋值rn System.out.println("查到的email为:"+list.get(0).toString().trim());rn this.setUserPassword(list.get(1).toString().trim()); //给userPassword赋值rn rn HibernateServiceProvider.closeSession();rnrn得到的是这样的结果:rnlist.size() = 1rn查到的email为:[Ljava.lang.Object;@13cebdarn2011-7-26 21:32:36 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet default threw exceptionrnjava.lang.IndexOutOfBoundsException: Index: 1, Size: 1rnat java.util.ArrayList.RangeCheck(ArrayList.java:547)rnat java.util.ArrayList.get(ArrayList.java:322)rnat rims.action.GetPasswordAction.checkUser(GetPasswordAction.java:133)rnat rims.action.GetPasswordAction.validate(GetPasswordAction.java:153)rnat com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:200)rnat com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnrn麻烦大家指点一二~
【新人求助】java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
SSH整合 查询数据库数据 做 分页 报错rn(部分)rnException occurred during processing request: Index: 0, Size: 0rnjava.lang.IndexOutOfBoundsException: Index: 0, Size: 0rnat java.util.ArrayList.rangeCheck(ArrayList.java:635)rn at java.util.ArrayList.get(ArrayList.java:411)rn at cn.zhs.daoImpl.BaseDaoImpl.getRowCount(BaseDaoImpl.java:33)rn at cn.zhs.bizImpl.ClaimVoucherBizImpl.findByPage(ClaimVoucherBizImpl.java:69)rn at cn.zhs.action.ClaimVoucherAction.searchClaimVoucher(ClaimVoucherAction.java:34)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rnrnrnBaseDaoImplrnrn[code=java]package cn.zhs.daoImpl;rnrnimport java.util.List;rnrnimport org.hibernate.criterion.DetachedCriteria;rnimport org.springframework.orm.hibernate3.support.HibernateDaoSupport;rnrnimport cn.zhs.dao.BaseDao;rnimport cn.zhs.entiy.BizClaimVoucher;rnrnpublic class BaseDaoImpl extends HibernateDaoSupport implements BaseDao rnrn rnrn //查询账单rn @Overridern public List search() rn rn List bizClaimVoucher = this.getHibernateTemplate().find("from BizClaimVoucher");rn rn return bizClaimVoucher;rn rn //分页查询rn public List findByPage(DetachedCriteria criteria, int pageNo, int pageSize)rn rn return this.getHibernateTemplate().findByCriteria(criteria, (pageNo-1)*pageSize , pageSize);rn rn //也数计算rn @Overridern public Long getRowCount(DetachedCriteria criteria) rnrn rn return (Long)this.getHibernateTemplate().findByCriteria(criteria).get(0);rn rnrn[/code]rnrnrnClaimVoucherBizImplrnrn[code=java]package cn.zhs.bizImpl;rnrnimport java.util.Date;rnimport java.util.List;rnrnimport org.hibernate.criterion.DetachedCriteria;rnimport org.hibernate.criterion.Property;rnimport org.hibernate.criterion.Restrictions;rnimport org.springframework.stereotype.Service;rnimport org.springframework.transaction.annotation.Transactional;rnrnimport com.opensymphony.xwork2.conversion.impl.DateConverter;rnrnimport cn.zhs.biz.ClaimVoucherBiz;rnimport cn.zhs.biz.EmployeeBiz;rnimport cn.zhs.dao.BaseDao;rnimport cn.zhs.dao.EmployeeDao;rnimport cn.zhs.entiy.BizClaimVoucher;rnimport cn.zhs.entiy.SysEmployee;rnimport cn.zhs.util.PaginationSupport;rnrn@Servicern@Transactionalrnpublic class ClaimVoucherBizImpl implements ClaimVoucherBiz rnrnprivate BaseDao baseDao;rnrn public BaseDao getBaseDao() rn return baseDao;rnrnrnpublic void setBaseDao(BaseDao baseDao) rn this.baseDao = baseDao;rnrnrn @Overridern public List searchClaimVoucherBiz() rn List bizClaimVoucher = baseDao.search();rn rn return bizClaimVoucher;rn rnrn @Overridern public PaginationSupport findByPage(String sn,rn String status, Date startDate, Date endDate, int pageNo,rn int pageSize) rn System.out.println("@@@@@@@@ 来自 Biz impl @@@@@@@@@@@");rn PaginationSupport page = new PaginationSupport();rn if(pageNo > 1)rn page.setCurrPageNo(pageNo);rn rn if(pageSize > 0)rn page.setPageSize(pageSize);rn rn //條件查詢rn DetachedCriteria criteria = DetachedCriteria.forClass(BizClaimVoucher.class);rn criteria.add(Restrictions.eq("sysEmployeeByCreateSn.sn", sn));rn if(status !=null && status.length() != 0)rn criteria.add(Restrictions.eq("status",status));rn rn if(startDate !=null)rn criteria.add(Restrictions.gt("createTime",startDate));rn rn if(endDate !=null)rn criteria.add(Restrictions.lt("modifyTime",endDate));rn rn rn criteria.setProjection(Property.forName("id"));rn int rowCount = baseDao.getRowCount(criteria).intValue();rn page.setTotalCount(rowCount);rn int pageCount = (rowCount + page.getPageSize() -1) / page.getPageSize();rn page.setTotalPageCount(pageCount);rn if(page.getTotalPageCount() >pageCount )rn page.setTotalPageCount(pageCount);rn rn criteria.setProjection(null);rn rn List result = baseDao.findByPage(criteria, page.getCurrPageNo(), page.getPageSize());rn page.setItems(result);rn return page;rn rn rnrnrnrnrn[/code]rnrnrn
上传文本文件没问题,图片文件报错java.lang.IndexOutOfBoundsException
请大虾帮忙看看问题在哪?rn1、从request中读出字节: rn ServletInputStream stm=request.getInputStream();rn int len=request.getContentLength(),rn n=0;rn byte[] b=new byte[len];rn while(n
请问大侠,java.lang.IndexOutOfBoundsException是什么原因造成的
我在运行JSP页面时出现了下面的异常,请问是什么原因啊:rntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: Index: 0, Size: 0rn 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 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnroot cause rnrnjava.lang.IndexOutOfBoundsException: Index: 0, Size: 0rn java.util.ArrayList.RangeCheck(ArrayList.java:547)rn java.util.ArrayList.get(ArrayList.java:322)rn com.zel.web.struts.action.GetpaperAction.execute(GetpaperAction.java:192)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrn
数组溢出错误java.lang.IndexOutOfBoundsException,在线等
[code=Java]rnrnList lista=districtService.getc(district_id);rn StringBuffer s = new StringBuffer();rn for(int i=0;i
语音识别的安卓程序,调用安卓自带的语音识别
语音识别是一门交叉学科。近二十年来,语音识别技术取得显著进步,开始从实验室走向市场。人们预计,未来10年内,语音识别技术将进入工业、家电、通信、汽车电子、医疗、家庭服务、消费电子产品等各个领域。 语音识别听写机在一些领域的应用被美国新闻界评为1997年计算机发展十件大事之一。很多专家都认为语音识别技术是2000年至2010年间信息技术领域十大重要的科技发展技术之一。 语音识别技术所涉及的领域包括:信号处理、模式识别、概率论和信息论、发声机理和听觉机理、人工智能等等。
代写安卓app程序
找人代写安卓端医学图像查看软件
安卓择吉程序1.2
软件非常好用,无需注册,没有时间使用限制。破解版。喜欢的朋友可以下载。
安卓Helloworld程序出问题
楼主刚开始学安卓,每次建一个Helloworld,都会出现3个错误rnrnrn[2015-04-21 18:11:55 - Hello] C:\Users\melo\workspace\Hello\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.rn[2015-04-21 18:11:55 - Hello]rn[2015-04-21 18:11:55 - Hello] C:\Users\melo\workspace\Hello\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.rn[2015-04-21 18:11:55 - Hello]rn[2015-04-21 18:11:55 - Hello] C:\Users\melo\workspace\Hello\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.rn[2015-04-21 18:11:55 - Hello]rnrnsdk和sdt都装了,sdk是5.0的,sdt是23,只是sdk里有几个没更新,android tv和wear没装,有没有懂的哥们帮忙看下
安卓第一个程序
博主是一位大二普通学生  所学习的内容都和郭霖老师的&amp;lt;第一行代码&amp;gt;相关 前提:安装好开发安卓所需要的开发环境 1.在左边右键new-Android Application Project Application name:项目的名称; Project name:工程名称; Package name:包名;当大家填入项目名称,剩下两个自动生成,可以使用默认的; Min...
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件