hadoop3.1.1 $MkdirsRequestProto cannot be cast to com.google.protobuf.Message [问题点数:50分]

Bbs1
本版专家分:0
结帖率 25%
Bbs1
本版专家分:0
$Proxy0 cannot be cast to org.hibernate.impl.SessionFactoryImpl
$Proxy0 cannot be <em>cast</em> to org.hibernate.impl.SessionFactoryImpl 請問高手這是哪里的問題 ssh+<em>com</em>pass時出現的問題,請高手指點啊!
java.util.ArrayList cannot be cast to txgl.entity.P_Person
就是一个页面 页面数据包括俩表的数据 然后当我点击修改的时候 页面的数据帮定到修改页面的文本框里面 我现在绑定了一个表的数据 另外一个表的数据怎么绑定啊
com.casinocity.bean.GameCategory cannot be cast to java.lang.Comparable
Technical Details rnjava.lang.ClassCastException: <em>com</em>.casinocity.bean.GameCategory cannot be <em>cast</em> to java.lang.Comparable at java.util.TreeMap.put(TreeMap.java:542) at <em>com</em>.casinocity.front.action.HomeAction.execute(HomeAction.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) at <em>com</em>.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163) at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at <em>com</em>.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at <em>com</em>.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at <em>com</em>.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at <em>com</em>.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at <em>com</em>.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at <em>com</em>.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at <em>com</em>.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at <em>com</em>.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at <em>com</em>.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at <em>com</em>.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at <em>com</em>.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at <em>com</em>.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at <em>com</em>.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119) at <em>com</em>.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:619) rn
java.util.ArrayList cannot be cast to java.lang.Integer
[code=java]rn public List searchApprovingDocuments(int userId) rn User user = getHibernateTemplate().load(User.class, userId);rn List docIds = workflowManager.searchApprovingDocuments(userrn .getUsername());rn if (docIds == null || docIds.isEmpty()) rn return null;rn rnrn return getSession().createQuery("select d from Document d where d.id in (:ids)").setParameter("ids", docIds).list();rn rn[/code]rn执行getSession().createQuery("select d from Document d where d.id in (:ids)").setParameter("ids", docIds).list()时,总是提示java.lang.ClassCastException: java.util.ArrayList cannot be <em>cast</em> to java.lang.Integer。rn别人这么写就可以,为什么在我这就不行了呢???
java.util.ArrayList cannot be cast to ....pojo.SchoolInfo
做了一个修改学校的模块,如下,大家帮忙看看哪里写错了。rnrnSchoolAction.javarn[img=https://img-bbs.csdn.net/upload/201407/23/1406082906_416921.png][/img]rnrnSchoolService.javarn[img=https://img-bbs.csdn.net/upload/201407/23/1406082918_817556.png][/img]rn[img=https://img-bbs.csdn.net/upload/201407/23/1406082982_545419.png][/img]rnrnSchoolDao.javarn[img=https://img-bbs.csdn.net/upload/201407/23/1406083042_400536.png][/img]rnrnupdateschool.jsprn[img=https://img-bbs.csdn.net/upload/201407/23/1406083067_574326.png][/img]
org.eclipse.jdt.internal.ui.javaeditor.JarEntryEditorInput cannot be cast to org
java.lang.ClassCastException: org.eclipse.jdt.internal.ui.javaeditor.JarEntryEditorInput cannot be <em>cast</em> to org.eclipse.ui.IFileEditorInputrn at <em>com</em>.genuitec.eclipse.struts2.editor.Struts2Editor.setInput(Struts2Editor.java:258)rn at org.eclipse.gef.ui.parts.GraphicalEditor.init(GraphicalEditor.java:318)rn at <em>com</em>.genuitec.eclipse.struts2.editor.Struts2Editor.init(Struts2Editor.java:207)rn at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:238)rn at <em>com</em>.genuitec.eclipse.struts2.editor.Struts2ConfigEditor.createPages(Struts2ConfigEditor.java:59)rn at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:357)rn at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:662)rn at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462)rn at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)rn at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:286)rn at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2857)rn at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2762)rn at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2754)rn at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2705)rn at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)rn at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2701)rn at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2685)rn at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2676)rn at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:374)rn at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:178)rn at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:229)rn at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:208)rn at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)rn at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)rn at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:373)rn at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:526)rn at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)rn at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:842)rn at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)rn at org.eclipse.core.runtime.Platform.run(Platform.java:888)rn at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)rn at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)rn at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:840)rn at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1101)rn at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1205)rn at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264)rn at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258)rn at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298)rn at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)rn at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)rn at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)rn at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)rn at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)rn at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)rn at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)rn at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)rn at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)rn at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)rn at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)rn at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)rn at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)rn at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)rn at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)rn at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)rn at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)rn at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)rn at org.eclipse.equinox.launcher.Main.run(Main.java:1311)rnrn================================================================================================rn今天在打开struts2-core-2.3.24.jar时碰到了,然后打开其他jar文件下的xml文件同样也是这样,求大神赐教!
java.lang.String cannot be cast to [Ljava.lang.Object;
谁能告诉我什么原因啊 求大虾·rnjava.lang.ClassCastException: java.lang.String cannot be <em>cast</em> to [Ljava.lang.Object;rn at org.hibernate.cache.StandardQueryCache.put(StandardQueryCache.java:104)rn at org.hibernate.loader.Loader.putResultInQueryCache(Loader.java:2208)rn at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2159)rn at org.hibernate.loader.Loader.list(Loader.java:2117)rn at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)rn at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1722)rn at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)rn at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)rn at <em>com</em>.gold.dao.impl.EnterpriseInfoDao.showLonName(EnterpriseInfoDao.java:114)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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn at $Proxy27.showLonName(Unknown Source)rn at <em>com</em>.gold.service.impl.EnterpriseService.showLonName(EnterpriseService.java:68)rn at <em>com</em>.gold.action.EnterpriseInfoAction.showAll(EnterpriseInfoAction.java:479)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 <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)rn at <em>com</em>.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)rn at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at <em>com</em>.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at <em>com</em>.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at <em>com</em>.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at <em>com</em>.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at <em>com</em>.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at <em>com</em>.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at <em>com</em>.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at <em>com</em>.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at <em>com</em>.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)rn at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at <em>com</em>.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at <em>com</em>.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at <em>com</em>.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)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 <em>com</em>.gold.filter.MyStrutsPrepareAndExecuteFilter.doFilter(MyStrutsPrepareAndExecuteFilter.java:23)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at <em>com</em>.gold.filter.EncodingFilter.doFilter(EncodingFilter.java:26)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)
java.util.ArrayList cannot be cast to com.hxll.hr.entity.SalaryStandard
报错:rnHibernate: select salarystan0_.SSD_ID as SSD1_25_, salarystan0_.STANDARD_ID as STANDARD2_25_, salarystan0_.STANDARD_NAME as STANDARD3_25_, salarystan0_.DESIGNER as DESIGNER25_, salarystan0_.REGISTER as REGISTER25_, salarystan0_.CHECKER as CHECKER25_, salarystan0_.CHANGER as CHANGER25_, salarystan0_.REGIST_TIME as REGIST8_25_, salarystan0_.CHECK_TIME as CHECK9_25_, salarystan0_.CHANGE_TIME as CHANGE10_25_, salarystan0_.SALARY_SUM as SALARY11_25_, salarystan0_.CHECK_STATUS as CHECK12_25_, salarystan0_.CHANGE_STATUS as CHANGE13_25_, salarystan0_.CHECK_COMMENT as CHECK14_25_, salarystan0_.REMARK as REMARK25_ from SALARY_STANDARD salarystan0_ where salarystan0_.STANDARD_ID like '10004'rn[color=#FF0000]Exception in thread "main" java.lang.ClassCastException: java.util.ArrayList cannot be <em>cast</em> to <em>com</em>.hxll.hr.entity.SalaryStandardrn at <em>com</em>.hxll.hr.dao.impl.SalaryStandardDaoImpl.salaryStandardId(SalaryStandardDaoImpl.java:88)rn at <em>com</em>.hxll.hr.dao.impl.SalaryStandardDaoImpl.main(SalaryStandardDaoImpl.java:95)[/color]rnrn声明一下这个<em>com</em>.hxll.hr.entity.SalaryStandard是实体类。rn我运行这段代码:rn/**rn * 薪酬标准信息编号查询rn */rn public SalaryStandard salaryStandardId(String standardId) rn String hql = "from SalaryStandard s where s.standardId like '"+standardId+"'";rn return (SalaryStandard)super.getHibernateTemplate().find(hql);rn rn rn public static void main(String[] args) rn // TODO Auto-generated method stubrn ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");rn SalaryStandardDaoImpl salaryStandardDao=(SalaryStandardDaoImpl)context.getBean("salaryStandardDao");rn salaryStandardDao.salaryStandardId("10004");rn System.out.println(salaryStandardDao);rn rnrn
android.widget.RelativeLayout cannot be cast to android.widget.LinearLayout
java.lang.ClassCastException: android.widget.RelativeLayout cannot be <em>cast</em> to android.widget.LinearLayoutrnrnactivity 主界面是这样的rn[code=html]rnrn rn rn rn rn rn rn rn rnrnrn[/code]rnrnrnListView 中每个 item 是这样的rn[code=html]rnrnrn rn rn rnrn rnrn rnrnrn[/code]rnrnrnListView 还有个头rn[code=html]rnrnrn rn rn rnrn[/code]rnrnListView 在代码中添加这个头rn[code=java]View HeaderView = View.inflate(this, R.layout.selectedmenuheader, null);rn lv.addHeaderView(HeaderView);[/code]rnrn最后我要循环遍历 ListView 中个每个 itemrn[code=java]try rn LinearLayout layout = (LinearLayout) lv.getChildAt(i);rn TextView tvName = (TextView) layout.findViewById(R.id.labMingCheng2);rn EditText etFenShu = (EditText) layout.findViewById(R.id.iFenShu);rn CheckBox cb = (CheckBox) layout.findViewById(R.id.delete);rn rn catch (Exception ee)rn rn Log.i("44445555", ee.toString());rn [/code]rnrn总之,异常就出现在LinearLayout layout = (LinearLayout) lv.getChildAt(i);。rn就算把 LinearLayout 换成 RelativeLayout 也一样转换异常,不能转换。
Ljava.lang.Object; cannot be cast to ...问题
大家好,我在以下这段代码中遇到了上边显示的异常,rnfor(GgMarketDetailDto ggMarketDetailDto:ggMarketDetailDtoList)rn 。。。rnrn这段代码的意思是这样,GgMarketDetailDto是一个实体类,我使用了list的泛型来存储了这个实体类对象的一个集合,即ggMarketDetailDtoList是一个泛型的列表,但是在这行代码的执行中,一直遇到上边的问题,请问有谁遇到过这种问题吗?
java.lang.NoClassDefFoundError cannot be cast to java.lang.Exception
我的程序在IE里浏览时出现这样的错误:rndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: An exception occurred processing JSP page /errorpage.jsp at line 13rnrn10: ; rn12: if (exception != null )rn13: message = message+((Exception)exception).get<em>Message</em>();rn14: rn15: out.println(message);rn16: rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:694)rn org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:665)rn org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:806)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)rn org.apache.jsp.InsertNewNotice_jsp._jspService(InsertNewNotice_jsp.java:133)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnroot cause rnrnjava.lang.ClassCastException: java.lang.NoClassDefFoundError cannot be <em>cast</em> to java.lang.Exceptionrn org.apache.jsp.errorpage_jsp._jspService(errorpage_jsp.java:69)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:694)rn org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:665)rn org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:806)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)rn org.apache.jsp.InsertNewNotice_jsp._jspService(InsertNewNotice_jsp.java:133)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrn请问这是什么原因?
java.lang.Long cannot be cast to java.lang.Integer
我在做批量删除的时候,要根据用户表的id删除,id是Inreger类型的rn下面分别是DAO和Action的代码和报错信息rn请高手帮忙~~~~~~rnrnDAOrn[code=Java]public void delByIds(String[] ids)rnrn String hql = "delete TransUsers where id=?";rn try rn rn Query q = getSession().createQuery(hql);rn for (int i = 0; i < ids.length; i++) rn rn q.setParameter(0, Long.parseLong(ids[i]));rn rn q.executeUpdate();rn rn catch (HibernateException e) rn // TODO: handle exceptionrn log.error("attach failed", e);rn throw e;rn rn rn [/code]rnActionrn[code=Java]public ActionForward delByIds(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response) rn // TODO Auto-generated method stubrn Action<em>Message</em>s messages = new Action<em>Message</em>s();rn GloBalCookie cookie = new GloBalCookie();rn cookie.setCookie("alitransPage", "/index.trans?method=translog", response, 10*60);rn rn String[] ids=request.getParameterValues("id"); rn rn for (int i = 0; i < ids.length; i++) rn System.out.println(ids[i]);rn rn rn ActionErrors errors = new ActionErrors();rn HttpSession session = request.getSession();rn if(ids != null || ids.length);rn [/code]rnrn报错信息[code=Java]rnjava.lang.ClassCastException: java.lang.Long cannot be <em>cast</em> to java.lang.Integerrn at org.hibernate.type.IntegerType.set(IntegerType.java:41)rn at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:83)rn at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65)rn at org.hibernate.param.PositionalParameterSpecification.bind(PositionalParameterSpecification.java:39)rn at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:67)rn at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:334)rn at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:209)rn at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1126)rn at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:94)rn at <em>com</em>.hibernate.TransUsersDAO.delByIds(TransUsersDAO.java:288)rn at <em>com</em>.alitrans.admin.action.IndexAction.delByIds(IndexAction.java:478)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:589)rn at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)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.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 <em>com</em>.alitrans.RequestCharacterEncodingFilter.doFilter(RequestCharacterEncodingFilter.java:56)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.Http11AprProcessor.process(Http11AprProcessor.java:833)rn at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)rn at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1285)rn at java.lang.Thread.run(Thread.java:619)rn[/code]
cannot be cast to javax.servlet.Filter
我写了一个过滤器,配置在Web.xml文件中,启动程序时候就报以下错误:rnrnrnrn 严重: Exception starting filter sessionFilterrnjava.lang.ClassCastException: <em>com</em>.ghb.web.filter.SessionFilter cannot be <em>cast</em> to javax.servlet.Filterrn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:255)rn at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3800)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4450)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)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:583)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.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnrnrnrn类文件:rnrn package <em>com</em>.ghb.web.filter;rnrnimport java.io.IOException;rnrnimport javax.servlet.FilterChain;rnimport javax.servlet.FilterConfig;rnimport javax.servlet.ServletException;rnimport javax.servlet.ServletRequest;rnimport javax.servlet.ServletResponse;rnrnpublic class SessionFilter rnrn private FilterConfig config;rnrn public void destroy() rn // TODO Auto-generated method stubrn rnrn public void doFilter(ServletRequest req, ServletResponse resp,rn FilterChain chain) throws IOException, ServletException rn String enconding = config.getInitParameter("encoding");rn req.setCharacterEncoding(enconding);rn resp.setCharacterEncoding(enconding);rn chain.doFilter(req, resp);rn rnrn public void init(FilterConfig config) throws ServletException rn this.config = config;rn rnrnrnrnrnrn web.xml文件配置信息rn rn rn sessionFilterrn <em>com</em>.ghb.web.filter.SessionFilterrn rn encodingrn UTF-8rn rn rn rn sessionFilterrn /*rn rnrnrnrn 我之前用myeclipse的时候,是没有错的,我换到Eclipse后就报这个错了,网上搜了一大圈,有的说是包和rntomcat冲突,rnrn 这到底是什么原因啊rn
org.apache.poi.hssf.usermodel.HSSFWorkbook cannot be cast to org.apache.poi.ss.u
org.apache.poi.hssf.usermodel.HSSFWorkbook cannot be <em>cast</em> to org.apache.poi.ss.usermodel.Workbook
org.hibernate.hql.ast.HqlToken cannot be cast to antlr.Token.
Jboss 版本 6.0.0.CR1. 启动报这个错rnrnjava.lang.ClassCastException: org.hibernate.hql.ast.HqlToken cannot be <em>cast</em> to antlr.Token.rnrn我的.ear\lib下面放了antlr.jar 和hibernate3.jar 是我的应用需要的。这样的错有办法解决吗?
java.math.BigInteger cannot be cast to com.labmanager.fw.data.bo.Lab
[code=java]rnpackage <em>com</em>.labmanager.fw.JUNIT;rnrnimport java.util.ArrayList;rnimport java.util.Iterator;rnimport java.util.List;rnrnimport org.hibernate.SQLQuery;rnimport org.hibernate.Session;rnimport org.hibernate.Transaction;rnrnimport <em>com</em>.labmanager.fw.data.bo.Lab;rnimport <em>com</em>.labmanager.fw.util.HibernateSessionFactory;rnrnpublic class PageDeviceTestrnrn public List getResultCount(String table)rn Session session=HibernateSessionFactory.getSession();rn Transaction ts=session.beginTransaction();rn List list=new ArrayList();rn String sql="select count(*) from "+table+" where id > 0";rn tryrn ts.begin();rn SQLQuery sqlQuery=session.createSQLQuery(sql); rn list=sqlQuery.list();rn ts.<em>com</em>mit();rn System.out.println("查询到数据"+list.get(0).toString()+"条");rn catch(Exception e)rn ts.rollback();rn e.printStackTrace();rn finallyrn HibernateSessionFactory.closeSession();rn rn return list;rn rn public void dispaly()rn List list=new ArrayList();rn list=this.getResultCount("tblab");rn Iterator it=list.iterator();rn while(it.hasNext())rn System.out.println(((Lab)it.next()).getName());rn rn rn public static void main(String[] args)rn new PageDeviceTest().dispaly(); rn rnrnrnrn[/code]rnrnrn&rnrnConsole输出:rnrn查询到数据20条rnException in thread "main" java.lang.ClassCastException: java.math.BigInteger cannot be <em>cast</em> to <em>com</em>.labmanager.fw.data.bo.Labrn at <em>com</em>.labmanager.fw.JUNIT.PageDeviceTest.dispaly(PageDeviceTest.java:40)rn at <em>com</em>.labmanager.fw.JUNIT.PageDeviceTest.main(PageDeviceTest.java:44)rnrnrn&rnLab类是Hibernate inverse 生成的。rn主键类型为Shortrn配置文件如下rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrn错误实在搞不明白。网上也看了搞了很久没辙了。。。
java.util.ArrayList cannot be cast to org.apache.struts.upload.FormFile
请问这个问题怎么解决?rn我在Action里面,程序经过:List uploadFileList = super.uploadFile(form, true, 0, new int[] 120, 240, 400, 640 );rn这句话的时候,就报上面的错误;rn错误提示:rnjava.lang.ClassCastException: java.util.ArrayList cannot be <em>cast</em> to org.apache.struts.upload.FormFilern <em>com</em>.ebiz.ssi.web.struts.BaseSsiAction.uploadFile(BaseSsiAction.java:255)rn <em>com</em>.ebiz.ssi.web.struts.BaseSsiAction.uploadFile(BaseSsiAction.java:203)rn <em>com</em>.ebiz.easybiz.web.struts.admin.manager.NewsInfoAllAction.save(NewsInfoAllAction.java:229)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 org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)rn rnrn其中BaseSsiAction.java中该方法代码如下:rnprotected transient List uploadFile(ActionForm form, String uploadDir, boolean isResizeImage, int resizeType, int resizeVersions[])rn throws Exceptionrn rn if (StringUtils.isBlank(uploadDir))rn uploadDir = StringUtils.join(new String[] rn "files", "upload", ""rn , File.separator);rn String folderPatterns[] = rn "yyyy", "MM", "dd", ""rn ;rn String autoCreatedDateDir = DateFormatUtils.format(new Date(), StringUtils.join(folderPatterns, File.separator));rn String ctxDir = getServlet().getServletContext().getRealPath(File.separator);rn if (!ctxDir.endsWith(File.separator))rn ctxDir = (new StringBuilder(String.valueOf(ctxDir))).append(File.separator).toString();rn File savePath = new File((new StringBuilder(String.valueOf(ctxDir))).append(uploadDir).append(autoCreatedDateDir).toString());rn logger.debug("===> save path is: ", savePath);rn if (!savePath.exists())rn savePath.mkdirs();rn List uploadFileList = new ArrayList();rn UploadFile uploadFile = null;rn int i = 0;rn Hashtable fileh = form.getMultipartRequestHandler().getFileElements();rn for (Enumeration e = fileh.keys(); e.hasMoreElements();)rn rn String key = (String)e.nextElement();rn FormFile formFile = (FormFile)fileh.get(key);rn String fileName = formFile.getFileName().trim();rn if (!"".equals(fileName))rn rn uploadFile = new UploadFile();rn uploadFile.setContentType(formFile.getContentType());rn uploadFile.setFileSize(formFile.getFileSize());rn uploadFile.setFileName(formFile.getFileName().trim());rn uploadFile.setFormName(key);rn String fileSaveName = StringUtils.join(new String[] rn UUID.randomUUID().toString(), ".", uploadFile.getExtension()rn );rn String fileSavePath = (new StringBuilder(String.valueOf(uploadDir))).append(autoCreatedDateDir).append(fileSaveName).toString();rn uploadFile.setFileSaveName(fileSaveName);rn uploadFile.setFileSavePath(StringUtils.replace(fileSavePath, File.separator, "/"));rn logger.debug(uploadFile.toString());rn uploadFileList.add(uploadFile);rn InputStream ins = formFile.getInputStream();rn OutputStream os = new FileOutputStream((new StringBuilder(String.valueOf(ctxDir))).append(fileSavePath).toString());rn int bytesRead = 0;rn byte buffer[] = new byte[8192];rn while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) //代码中第255行rn os.write(buffer, 0, bytesRead);rn os.close();rn ins.close();rn rn return uploadFileList;rn rnrn请教高手啊 !
java.util.HashSet cannot be cast to org.hibernate.collection.PersistentCollectio
error:java.util.HashSet cannot be <em>cast</em> to org.hibernate.collection.PersistentCollectionrnrnhibernate在做session.merge的操作rn然后我调用flush方法同步数据库报错了rnrnmerge应该是做的update的操作,因为我修改了实体对象rn我想知道hibernate merge 这种错误一般什么原因导致的?
cannot be cast to javax.servlet.Servlet
刚开始学习,写了一个简单的servlet:rn问题是:在Jcreator上编译通过,但是发布以后浏览器中出现rnroot cause rnrn[b]java.lang.ClassCastException: <em>com</em>.tsinghua.Hello cannot be <em>cast</em> to javax.servlet.Servletrn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)rn org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)rn org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)rn org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn java.lang.Thread.run(Thread.java:619)rnrn[/b]rn请问问题何在啊?rnpublic class Hellorn rn public void init(ServletConfig parm1) throws ServletException rn // TODO: Add your code herern System.out.println("init it");rn rn rnrn rn public ServletConfig getServletConfig() rn // TODO: Add your code herern return null;rn rnrn rn rn public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException rn // TODO: Add your code herern System.out.println("sdfjsdf");rn PrintWriter pw = res.getWriter();rn pw.println("helle");rnrn rn rnrn rn public String getServletInfo() rn // TODO: Add your code herern return "";rn rnrn rn public void destroy() rn // TODO: Add your code herern System.out.println("destroy");rn rn rn rn
java.lang.String cannot be cast to
type Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Exception in JSP: /bookshowcart.jsp:58rnrn55: rn60: rn61: rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnroot cause rnrnjava.lang.ClassCastException: java.lang.String cannot be <em>cast</em> to shop.BookDetailsrn org.apache.jsp.bookshowcart_jsp._jspService(org.apache.jsp.bookshowcart_jsp:159)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrn这句真的有错吗?rnBookDetails book=(BookDetails)item.getItem();
cannot be cast to javassist.util.proxy.Proxy
这是我的代码结构:n![图片说明](https://img-ask.csdn.net/upload/201703/21/1490089343_799107.png)n代码下载地址(好像贴不完,有字数要求,麻烦了):http://pan.baidu.<em>com</em>/s/1cDzTAAn运行TestM2O时报错:nINFO: HHH000327: Error performing load <em>com</em>mand : org.hibernate.HibernateException: HHH000142: Javassist Enhancement failed: entity.Graden三月 21, 2017 5:43:35 下午 org.hibernate.event.internal.DefaultLoadEventListener doOnLoadnINFO: HHH000327: Error performing load <em>com</em>mand : org.hibernate.HibernateException: HHH000142: Javassist Enhancement failed: entity.GradenException in thread "main" org.hibernate.HibernateException: HHH000142: Javassist Enhancement failed: entity.Graden at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:130)n at org.hibernate.tuple.entity.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:717)n at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:4580)n at org.hibernate.event.internal.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:359)n at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:274)n at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121)n at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89)n at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1142)n at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:1025)n at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:639)n at org.hibernate.type.EntityType.resolve(EntityType.java:431)n at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:165)n at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:125)n at org.hibernate.loader.plan.exec.process.internal.AbstractRowReader.performTwoPhaseLoad(AbstractRowReader.java:238)n at org.hibernate.loader.plan.exec.process.internal.AbstractRowReader.finishUp(AbstractRowReader.java:209)n at org.hibernate.loader.plan.exec.process.internal.ResultSetProcessorImpl.extractResults(ResultSetProcessorImpl.java:133)n at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:122)n at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:86)n at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.load(AbstractLoadPlanBasedEntityLoader.java:167)n at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4069)n at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:508)n at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:478)n at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:219)n at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:278)n at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121)n at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89)n at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1142)n at org.hibernate.internal.SessionImpl.access$2600(SessionImpl.java:167)n at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.doLoad(SessionImpl.java:2762)n at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2741)n at org.hibernate.internal.SessionImpl.get(SessionImpl.java:978)n at test.TestM2O.findGradeByStudent(TestM2O.java:37)n at test.TestM2O.main(TestM2O.java:14)nCaused by: java.lang.ClassCastException: entity.Grade_$$_javassist_0 cannot be <em>cast</em> to javassist.util.proxy.Proxyn at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:123)n ... 32 morenn如果我把student.hbm.xml中的标签删除就可以运行,不知道为什么,大家能帮我解答一下吗,我用的是hibernate5.1.5nnnnnnnnnnnnnnn
com.wzk.CMS.Users cannot be cast to java.util.List
恩 我编写了一个 Users类 。。。rn[code="java"]rnpackage <em>com</em>.wzk.CMS;rnpublic class Users rnrn private int id;rn private int wor_id;rn private int deb_id; rn private int war_id; rn private int dep_id; rn private int fil_id; rn private int cul_id; rn private int dut_id; rn private String username; rn private String password;rn private String name;rn public int getDeb_id() rn return deb_id;rn rn public void setDeb_id(int debId) rn deb_id = debId;rn rn public int getDep_id() rn return dep_id;rn rn public void setDep_id(int depId) rn dep_id = depId;rn rn public int getId() rn return id;rn rn public void setId(int id) rn this.id = id;rn rn public int getWor_id() rn return wor_id;rn rn public void setWor_id(int worId) rn wor_id = worId;rn rn public int getWar_id() rn return war_id;rn rn public void setWar_id(int warId) rn war_id = warId;rn rn public int getFil_id() rn return fil_id;rn rn public void setFil_id(int filId) rn fil_id = filId;rn rn public int getCul_id() rn return cul_id;rn rn public void setCul_id(int culId) rn cul_id = culId;rn rn public int getDut_id() rn return dut_id;rn rn public void setDut_id(int dutId) rn dut_id = dutId;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 getName() rn return name;rn rn public void setName(String name) rn this.name = name;rn rn rnrn[/code]rn然后 编写了 一个 DAO实现方法 其中声明private static final String select_users_sql="select * from users order by id desc" ;rn[code="java"]rn//****************读取表中所有记录*******************rn rn public List getUserList() rn rn QueryRunner qr=getQueryRunner();rn List userList=null;rn rn try rn userList=(List)qr.query(select_users_sql, new BeanHandler(Users.class));rn rn catch (Exception e) rn e.printStackTrace();rn rn rn return userList;rn rn[/code]rnrnrn编译运行后 报错rn[code="java"]rnjava.lang.ClassCastException: <em>com</em>.wzk.CMS.Users cannot be <em>cast</em> to java.util.Listrn at <em>com</em>.wzk.CMS.dao.DaoJdbc.getUserList(DaoJdbc.java:81)rn at <em>com</em>.wzk.CMS.servlet.UsersServlet.getUsersList(UsersServlet.java:73)rn at <em>com</em>.wzk.CMS.servlet.UsersServlet.doPost(UsersServlet.java:34)rn at <em>com</em>.wzk.CMS.servlet.UsersServlet.doGet(UsersServlet.java:22)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)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: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)rnrn[/code]rnrnrnUsersServlet代码 为rn[code="java"]rnpublic void getUsersList(HttpServletRequest request,rn HttpServletResponse response) throws ServletException, IOException rn Dao dao = new DaoJdbc();rn List userList = dao.getUserList();rn request.setAttribute("userList", userList);rn request.getRequestDispatcher("/userList.jsp")rn .forward(request, response);rnrn rn[/code]rn怎么办呀
java.lang.String cannot be cast to java.lang.Long
java.lang.ClassCastException: java.lang.String cannot be <em>cast</em> to java.lang.Longrnrn[code=java]rnQuery query = getSession().createQuery("select e.provinceid from Province e where e.sid=?");rn query.setParameter(0, pid);rn String father =(String)query.uniqueResult();rn System.out.println(father);rn [/code]rn这是model的属性rn private String provinceid; //这个是string类型啊rn
org.apache.tomcat.websocket.server.WsSci cannot be cast to javax.servlet.Servlet
web工程依赖一个SpringBoot工程,web工程为Tomcat插件启动rnweb工程启动的时候每次报下面三个错误中的一个。rn1.org.springframework.web.SpringServletContainerInitializer cannot be <em>cast</em> to javax.servletrn2.org.apache.tomcat.websocket.server.WsSci cannot be <em>cast</em> to javax.servlet.Servletrn3.ch.qos.logback.classic.servlet.LogbackServletContainerInitializer cannot be <em>cast</em> to javax.servlet.ServletContainerInitializerrn两个工程的pom依赖如下,rnweb项目rn[code=java] rn junitrn junitrn 4.11rn testrn rn rn <em>com</em>.yhrn buspay-gatern 1.0rn rn rn org.slf4jrn slf4j-log4j12rn 1.7.21rn rn rn <em>com</em>.fasterxml.jackson.corern jackson-corern 2.5.1rn rn rn <em>com</em>.fasterxml.jackson.corern jackson-databindrn 2.5.1rn rn rn org.apache.shirorn shiro-corern 1.2.5rn rn rn org.apache.shirorn shiro-ehcachern 1.2.5rn rn rn org.apache.shirorn shiro-webrn 1.2.5rn rn rn org.apache.shirorn shiro-springrn 1.2.5rn rn rn org.apache.tomcatrn servlet-apirn 6.0.37rn providedrn rn rn org.apache.tomcatrn jsp-apirn 6.0.37rn providedrn rn rn net.sf.json-librn json-librn 2.4rn jdk15rn rn rn <em>com</em>mons-collectionsrn <em>com</em>mons-collectionsrn 3.2.1rn rn rn <em>com</em>mons-fileuploadrn <em>com</em>mons-fileuploadrn 1.3.1rn rn [/code]rnrnspringboot项目日志用的rnrnrn ch.qos.logbackrn logback-classicrn 1.2.3rn
cannot be cast to java.lang.Integer
[code=Java]rnrn//查询表中最大记录数rnString blogName="blog";rn String newSql = "select ROWCNT from SYSINDEXES where id =OBJECT_ID('"+blogName+"') and INDID;rnrnint result = (Integer)db.query(newSql, null, new ScalarHandler(1));rnrn//报错:rnjava.lang.ClassCastException: java.lang.Long cannot be <em>cast</em> to java.lang.Integerrn//写成 Integer.parseInt(db.query(newSql, null, new ScalarHandler(1)));还是抱这个错rnrnrn[/code]rn
com.mysql.jdbc.JDBC4ResultSet cannot be cast to com.mysql.jdbc.ResultSet
<em>com</em>.mysql.jdbc.JDBC4ResultSet cannot be <em>cast</em> to <em>com</em>.mysql.jdbc.ResultSet,,如何解决
Ljava.lang.Object; cannot be cast to mq.net.front.lookHouse.model.IookHouseModel
daornrn [img=https://img-bbs.csdn.net/upload/201404/16/1397620024_142618.jpg][/img]rnrnrnservice 方法rnrnrn[img=https://img-bbs.csdn.net/upload/201404/16/1397620050_750207.jpg][/img]rnrnrnrnaction 方法 rnrn[img=https://img-bbs.csdn.net/upload/201404/16/1397620072_708204.jpg][/img]rnrnrn错误信息[size=18px][color=#FF0000]46 行[/color][/size]rnrnrn[img=https://img-bbs.csdn.net/upload/201404/16/1397620159_440996.jpg][/img]rnrnrn求 大神 解答。。。。rnrnrn实体类 是根据 查询的结果 自己封装的 一个尸体累
cannot be cast to java.util.Collection
[code=Java]package <em>com</em>.hollycrm.hollyv8.zsptest.zsp.service.impl;rnrnimport ...rnpublic class UserManagerServiceImpl implements UserManagerService rn private UserManagerDao userDao;rn rn public void setUserManagerDao(UserManagerDao userDao)rn rn this.userDao = userDao ;rn rn public UserManagerDao getUserManagerDao()rn rn return this.userDao ;rn rnrnrn public void addUser(UserInfo user) rnrn this.userDao.add(user) ;rnrn rnrn public void deleteUser(String account) rn // TODO Auto-generated method stubrn this.userDao.delete(account) ;rn rn public UserInfo getUser(String account) rn // TODO Auto-generated method stubrn return this.userDao.getUserInfo(account);rn rn public UserInfo getUser(String name, String account) rn // TODO Auto-generated method stubrn List list = this.userDao.getUserInfo(name, account);rn if(list != null&&list.size() > 0)rn return list.get(0);rn elsern return null;rn rn rn public List listUser() rn // TODO Auto-generated method stubrn return this.userDao.getUserInfos();rn rn public void saveOrUpdate(UserInfo user) rn // TODO Auto-generated method stubrn this.userDao.saveOrUpdate(user);rn rn public UserInfo query() rn return this.userDao.query();rn rnrn[/code]rnrnrn[code=Java]<em>com</em>.hollycrm.hollyv8.zsptest.zsp.service.impl.UserManagerServiceImpl cannot be <em>cast</em> to java.util.Collection [/code]rnrnrn大家帮我看看这是怎么回事?
org.apache.struts.action.DynaActionForm cannot be cast to org.apache.struts.validator.DynaValidatorForm
org.apache.struts.action.DynaActionForm cannot be <em>cast</em> to org.apache.struts.validator.DynaValidatorFormrn有谁知道是什么问题吗???
testjpa.book.WebBookstoreBooks cannot be cast to testjpa.book.WebBookstoreBooks
List list = bw1.findAll(); rnfor (int i = 0; i < list.size(); i++) rn list.get(i).getBookId(); rn rnrn错误行:list.get(i).getBookId(); rnrn错误信息:testjpa.book.WebBookstoreBooks cannot be <em>cast</em> to testjpa.book.WebBookstoreBooks rnrnbw1.findAll()返回类型List rnrn我感觉是:spring和jpa整合的问题,但不知道怎么改,请教各位,谢谢
java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
在网上找了一个hibernate通用dao泛型接口代码:rnpublic interface GenericDao rn void create(T entity);rnrn void delete(T entity);rnrnrn实现类:rnpackage <em>com</em>.dao;rnrnimport java.io.Serializable;rnimport java.lang.reflect.ParameterizedType;rnimport java.util.List;rnimport org.hibernate.criterion.Projections;rnimport org.springframework.orm.hibernate3.support.HibernateDaoSupport;rnrnpublic class GenericHibernateDaoImpl extends HibernateDaoSupport implementsrn GenericDao rn private Class clazz;rnrn @SuppressWarnings("unchecked")rn public GenericHibernateDaoImpl() rn // 通过反射获取T的类型信息实例rn this.clazz = (Class) ((ParameterizedType) this.getClass()rn .getGenericSuperclassrnrn ()).getActualTypeArguments()[0];rn rnrn public void create(T entity) rnrn super.getSession().save(entity);rnrn rnrn public void delete(T entity) rn super.getSession().delete(entity);rn .....rn结果启动tomcat服务器的时候报java.lang.Class cannot be <em>cast</em> to java.lang.reflect.ParameterizedType错误,什么问题?求解决。。。。。
flex.messaging.io.amf.ASObject cannot be cast to错误。。。
情况是这样的。。rnFlex 前台rn有个两AS类 Group 和 UserrnGroup 类里有个ArrayCollectionrnrnjava 后台rn对应的两个JPA实体类 Group 和 UserrnrnGroup里设置了 @OneToMany(fetch=FetchType.EAGER) rn这样,我在前台查询的时候, 后台程序会把User一起查询出来返送给前台,映射成为Flex的ArrayCollection(_acDP) 然后把这个 ArrayCollection做为DATAGRID的数据源。rnrn当选中某一记录进行修改的时候rnrn_acDP[dg.selectedIndex] as Group ; //这样Group 里就包含了一个 子ArrayCollection ,里面是属于该Group的User信息。rnrn然后把这个修改过的 Group对象发送至Java后台,进行保存,这时候就出现了这个错误。。。rnrnflex.messaging.io.amf.ASObject cannot be <em>cast</em> to...rnrn好像是因为Group里面的User信息,只是一个ArrayCollection ,没法转换成java的 User类。。rn这个具体该怎么做rnrn求教。。。。
java.lang.Integer cannot be cast to
public List findAllMaterialsByAppid(Integer appid) rn String hql1 = "select medid from Materials where appid = ? and pid = 0";rn List list = this.hibernateTemplate.find(hql1, appid);rn if (list != null && list.size() > 0) rn if(list.get(0).getMedid() != null)rn Integer medid = (Integer)list.get(0).getMedid();rn String hql2 = "from Materials where appid = ? and pid = ?";rn return this.hibernateTemplate.find(hql2, appid, medid);rn rnrnrn请教一下大家
java.lang.String cannot be cast to com.yxq.value.NameSingle
NameSingle tempuser=(NameSingle)temp.elementAt(i);报错rnjava.lang.String cannot be <em>cast</em> to <em>com</em>.yxq.value.NameSinglernrn[color=#FF0000]NameSingle.java[/color]package <em>com</em>.yxq.value;rnrnpublic class NameSingle rnpublic String name;rnrnrn
java.util.ArrayList cannot be cast to java.lang.String
小弟初学struts2,很多地方都不明白,遇到了很多问题,麻烦帅哥,美女,解决下!谢谢!rn从数据库里获得list (包括ID(自增),姓名,年龄)rn在strut2写的JSP里用iterator将list遍历输出rnrn下面是Actionrn[code=Java]rnpublic class UserAction extends ActionSupport rn private String name;//姓名rn private int age;//年龄rn private UserDao userdao;rn List list=new ArrayList();//获得数据库里所有的用户集合rn //下面是getter setter 方法rn public UserDao getUserdao() rn return userdao;rn rnrn public void setUserdao(UserDao userdao) rn this.userdao = userdao;rn rnrn public List getList() rn return list;rn rnrn public void setList(List list) rn this.list = list;rn rnrn public String getName() rn return name;rn rnrn public void setName(String name) rn this.name = name;rn rnrn public int getAge() rn return age;rn rnrn public void setAge(int age) rn this.age = age;rn rnrn //JSP页面里调用的action方法,从数据库中获得用户列表(ID(自增),姓名,年龄)rn public List listUser()rn list= userdao.list();rn return getList();rn rnrnrnrn[/code]rnrn这个是JSP页面rn[code=Java]rnrnrn rn rn rn rn rn rnrnrn[/code]rnrnrn运行时,就报错了。下面是错误信息rn[code=Java]rnrnjava.lang.ClassCastException: java.util.ArrayList cannot be <em>cast</em> to java.lang.Stringrn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)rn <em>com</em>.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)rn <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn <em>com</em>.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn <em>com</em>.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn <em>com</em>.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn <em>com</em>.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn <em>com</em>.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn <em>com</em>.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn <em>com</em>.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn <em>com</em>.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn <em>com</em>.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn <em>com</em>.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn <em>com</em>.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn <em>com</em>.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)rnrnrn[/code]rnrnrn请教大虾们,帮帮忙,谢谢!
cannot be cast to org.apache.struts.action.Action 什么问题??
formrn[code=java]rnpackage <em>com</em>.your<em>com</em>pany.struts;rnrnimport java.io.Serializable;rnrnimport org.apache.struts.action.ActionForm;rnrn/*rn * 存放用户提交信息rn */rnpublic class LoginForm extends ActionForm implements Serializable rn private static final long serialVersionUID = 1L;rn private String username, password;rnrn public String getUsername() rn return username;rn rnrn public void setUsername(String username) rn this.username = username;rn rnrn public String getPassword() rn return password;rn rnrn public void setPassword(String password) rn this.password = password;rn rnrnrn[/code]rnrnactionrn[code=java]package <em>com</em>.your<em>com</em>pany.struts;rnrnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnrnimport org.apache.struts.action.Action;rnimport org.apache.struts.action.ActionForm;rnimport org.apache.struts.action.ActionForward;rnimport org.apache.struts.action.ActionMapping;rnimport <em>com</em>.your<em>com</em>pany.struts.LoginForm;rnrn/**rn * 控制转向,处理用户登录事件rn * rn * @author smaltrn * rn */rnpublic class LoginAction extends Action rn public ActionForward execute(ActionMapping mapping, ActionForm form,rn HttpServletRequest req, HttpServletResponse res) rn // 获取表单对象rn LoginForm loginform = (LoginForm) form;rn String username = loginform.getUsername();rn String password = loginform.getPassword();rnrn if (username.equals("123") && password.equals("123")) rn System.out.println("验证success");rn return new ActionForward("/pages/success.jsp");rn else rn System.out.println("验证fail");rn return new ActionForward("/pages/fail.jsp");rn rn rnrn[/code]rnrnstruts:rn[code=text]rnrnrnrn rn rn rn rn rn rn rn rnrn rn rn rnrnrn[/code]rnrnweb.xmlrn[code=text]rnrnrn rnrn actionrnrn rn org.apache.struts.action.ActionServletrn rnrn rnrn configrnrn /WEB-INF/struts-config.xmlrnrn rnrn rnrn debugrnrn 3rnrn rnrn rnrn detailrnrn 3rnrn rnrn 0rnrn rnrn rnrn actionrnrn *.dornrn rnrnrn rn index.jsprn rnrnrn[/code]
ImageSwitcher cannot be cast to Button_ClassCastException
rnrn rnrn rnrn rnrnrnrnprivate Button button1, button2;rn private ImageSwitcher imageSwitcher;rn private int index = 0;rn private int[] imageId = new int[] R.drawable.landscape1,rn R.drawable.landscape2, R.drawable.landscape3,rn R.drawable.landscape4, R.drawable.landscape5,rn R.drawable.landscape6, R.drawable.landscape7 ;rnrn @Overridern protected void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.activity_main);rn rn button1 = (Button) findViewById(R.id.button1);rn button2 = (Button) findViewById(R.id.button2);rn imageSwitcher = (ImageSwitcher) this.findViewById(R.id.imageSwitcher);rn imageSwitcher.setFactory(this);rn rn button1.setOnClickListener(this);rn button2.setOnClickListener(this);rn imageSwitcher.setImageResource(imageId[index]);rn rnrn public void onClick(View v) rn switch(v.getId()) rn case R.id.button1:rn index--;rn if (index < 0) rn index = imageId.length - 1;rn rn imageSwitcher.setImageResource(imageId[index]);rn Toast.makeText(MainActivity.this, "第" + (index + 1) + "张", 1).show();rn break;rn case R.id.button2:rn index++;rn if (index >= imageId.length) rn index = 0;rn rn imageSwitcher.setImageResource(imageId[index]);rn Toast.makeText(MainActivity.this, "第" + (index + 1) + "张", 1).show();rn break;rn rn rnrn public View makeView() rn ImageView imageView = new ImageView(MainActivity.this);rn imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);rn imageView.setLayoutParams(new ImageSwitcher.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));rn return imageView ;rn rnrnrn实现的是通过两个按钮来前后查看图片, 用的是ImageSwitcher rn可是在xml文件中, 如果把ImageSwitcher标签放在Button上面就会报错如下图rn[img=https://img-bbs.csdn.net/upload/201511/09/1447063525_88303.png][/img]rnImageSwitcher cannot be <em>cast</em> to Button_ClassCastException 但是如果像上面xml文件中放置就可以正常运行,大神们知道这是为什么吗?rnrnrnrnrn
org.apache.ibatis.executor.ExecutionPlaceholder cannot be cast to java.util.List
今天在做分页搜索的时候,出现的问题。谷歌上也搜不到什么。公司的项目是struts2+mybatis。我把代码和错误信息都贴上来,各位大神给我看看rnrn[img=https://img-bbs.csdn.net/upload/201409/25/1411614290_919820.png][/img]rnrn这是action中的代码,错误报在第115行。rnrnrn[img=https://img-bbs.csdn.net/upload/201409/25/1411614337_957864.png][/img]rnrn这是相应的数据层的代码,错误就出在第120行。第117行是计算符合条件的数据量有多少;第119行是把所有搜索条件清空了,所以第120行就是计算数据总量有多少。rnrn[img=https://img-bbs.csdn.net/upload/201409/25/1411614574_623873.png][/img]rnrn这就是第二张图片中,第120行在xml文件中的对应的sql语句。图片不是很清晰(将就一下)。上面说过由于搜索条件被清空了,所以这里的条件之后的代码其实都是没用上的rnrnrn下面就是错误信息 非常的长 我全部都贴出来rnrnrnrn
java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcResultSet cannot be cast to
java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcResultSet cannot be <em>cast</em> to java.lang.Stringrn org.apache.jsp.updateSpecial_005fnew_jsp._jspService(updateSpecial_005fnew_jsp.java:93)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrn问题代码:rn[code=Java]rnrnrnrnrn[/code]rn我其实不是想用循环取出来,因为这样只有一个变量,我的目的是获取INDEX,然后再用符号传到一个INPUT里去,不过有好方法也可以告诉我哦!!谢谢各位!@!!
java.lang.ClassCastException: java.lang.String cannot be cast to eshop.User
public User get(String username) //用用户名取得该用户的所有属性rn Session session=HibernateUtil.currentSession();rn tx=session.beginTransaction();rn String sql="select username from User where username='"+username+"'";rn List list=session.createQuery(sql).list();rn [color=#FF0000]User user=(User)list.iterator().next();[/color]rn tx.<em>com</em>mit();rn HibernateUtil.closeSession();rn return user;rnrn---------------------------------------rnrn [color=#FF0000]user2=userdao2.get(username);[/color]rnrn出现错误java.lang.ClassCastException: java.lang.String cannot be <em>cast</em> to eshop.Userrnrneshop.UserDAO.get(UserDAO.java:76)rn eshop.action.admin.AdminLogin.execute(AdminLogin.java:54)rnrnrn红色为报错部分 貌似是强制转换错误 不知道怎么解决 希望大家来帮帮忙 先谢谢大家了
java.lang.ClassCastException: java.lang.String cannot be cast to common.User
java.lang.ClassCastException: java.lang.String cannot be <em>cast</em> to <em>com</em>mon.Userrn at Server.RequestProcessor.logout(RequestProcessor.java:147)rn at Server.RequestProcessor.run(RequestProcessor.java:38)rn at java.lang.Thread.run(Thread.java:662)rnrn其中User是rnpublic class User implements Serializable rn private static final long serialVersionUID = -427838794924380991L;rn private String id;rn private String password; rn private String box1;rn private String grade;rn private String department;rn private String ip;rnrn public User(String id,String password, String box1, String department,String grade,String ip) rn this.id=id;rn this.password = password;rn this.box1 = box1; rn this.department =department;rn this.grade = grade;rn this.ip = ip;rn rn rn public User(String id, String password) rn this.id = id;rn this.password = password;rn rnrn报错的地方是:rn /** 客户端退出 */rn public boolean logout(OnlineClientIOCache oio, Request request) throws IOExceptionrn System.out.println(currentClientSocket.getInetAddress().getHostAddress()+ ":" + currentClientSocket.getPort() + "走了");rn [color=#FF0000]User user0 = (User)request.getAttribute("user");[/color]rn rn ServerDataBuffer.onlineUserIOCacheMap.remove(user0.getid());//把当前上线客户端的IO从Map中删除 rn ServerDataBuffer.onlineUsersMap.remove(user0.getid());//从在线用户缓存Map中删除当前用户rn rn Response response = new Response(); //创建一个响应对象rn response.setType(ResponseType.LOGOUT);rn response.setData("logoutUser", user0);rn oio.getOos().writeObject(response); //把响应对象往客户端写rn oio.getOos().flush();rn currentClientSocket.close(); //关闭这个客户端Socket rn ServerDataBuffer.onlineUserTableModel.remove(String.valueOf(user0.getid())); //把当前下线用户从在线用户表Model中删除 rn return false; //断开监听rn rnrn这是什么原因啊?
java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Obj
java.lang.ClassCastException: java.lang.String cannot be <em>cast</em> to [Ljava.lang.Object;rnat <em>com</em>.six.biz.impl.ReportBizImpl.createPdf(ReportBizImpl.java:153)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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn at $Proxy1.createPdf(Unknown Source)rn at <em>com</em>.six.action.ReportAction.createPdf(ReportAction.java:71)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 <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)rn at <em>com</em>.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)rn at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at <em>com</em>.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at <em>com</em>.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at <em>com</em>.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at <em>com</em>.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at <em>com</em>.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at <em>com</em>.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at <em>com</em>.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at <em>com</em>.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at <em>com</em>.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn at <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at <em>com</em>.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at <em>com</em>.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at <em>com</em>.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn at <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)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 <em>com</em>.six.filter.EncodeFilter.doFilter(EncodeFilter.java:40)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:230)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:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)rn
Cannot cast from ActtionForm to addBookForm
Cannot <em>cast</em> from ActtionForm to addBookFormrn这个错误是什么导致的?是因为jar包没导入么?
Cannot cast from View to Spinner
Spinner spinner = (Spinner) findViewById(R.id.SpinnerId);在myeclipse中写这段代码时出现Cannot <em>cast</em> from View to Spinner的错误
Cannot cast from View to GridView
有句代码如下rnGridView gridview = (GridView) findViewById(R.id.gridview);rn报错如题rn请教高手是什么原应,代码我是从网上copy的
Cannot cast from long to Map
listView01.setOnItemClickListener(new AdapterView.OnItemClickListener() rnrn @Overridern public void onItemClick(AdapterView parent, View view, int position, rn long id) rn Map clkMap = (Map) parent.getItemIdAtPosition(position);rn setTitle(clkMap.get("title").toString()+"的网址为:"+clkMap.get("info").toString());rn rn );rn错误提示:Cannot <em>cast</em> from long to Map,哪位大神帮忙解决一下,谢谢!
急救:java.lang.String cannot be cast to [Ljava.lang.Obj
使用hibernate3.1,strut1.2,数据库用mssqlserver2000rn 在执行 String hql=" FROM Oauser as a " ;rn Vector myList1=new Vector();rn ArrayList result1 = new ArrayList();rn rn Transaction t = null; rn t = this.session.beginTransaction(); rn Query q = this.session.createQuery(hql); rn result1 = (ArrayList) q.list(); rn t.<em>com</em>mit(); rn rn Iterator myIterator1= result1.iterator(); rn Oauser oauser=new Oauser();rn while (myIterator1.hasNext()) rn rn [color=#FF0000]Object[] o = (Object[]) myIterator1.next(); [/color]rn oauser=(Oauser) o[0];rn System.out.println(oauser.getPoliceid());rn rn 后,报错:rnrn[color=#FF0000]java.lang.ClassCastException: java.lang.String cannot be <em>cast</em> to [Ljava.lang.Objrnect;[/color]rn at <em>com</em>mon.db.dboperation.DbOperation.send<em>Message</em>s(DbOperation.java:494)rn at org.apache.jsp.oa.oapad.send_jsp._jspService(send_jsp.java:228)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(JspServletWrapperrn.java:384)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3rn20)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(ApplrnicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFrnilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVrnalve.java:228)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVrnalve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jrnava:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jrnava:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValrnve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.javrna:216)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.javarn:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.procernss(Http11Protocol.java:634)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44rn5)rn at java.lang.Thread.run(Thread.java:619)rnrnrn 困扰我几天了。。。 但是前面有个查询,可以照常使用,没有提示字符类型不匹配问题。rn 急救!!rn
java.math.BigInteger cannot be cast to java.lang.Integer 错误???
select count(a.id) from table_a as arnrn数据库用的是mysql rn
java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.Inte
package card.struts;rnrnimport global.hibernate.MyBeanFactory;rnimport history.hibernate.History;rnrnimport java.util.List;rnimport java.util.Map;rnrnimport org.apache.struts2.interceptor.SessionAware;rnrnimport allDao.CardDao;rnimport allDao.HistoryDao;rnimport card.hibernate.Card;rnrnimport <em>com</em>.opensymphony.xwork2.ActionSupport;rnrnpublic class ChoiseCardAction extends ActionSupport implements SessionAwarern /**rn * rn */rn private static final long serialVersionUID = 1L;rn private int cardId;rn private CardDao cardDao;rn private HistoryDao historyDao;rn @SuppressWarnings("rawtypes")rn private Map session;rnrn @SuppressWarnings("rawtypes")rn public Map getSession() rn return session;rn rnrn public void setSession(@SuppressWarnings("rawtypes") Map session) rn this.session = session;rn rn public int getCardId() rn return cardId;rn rnrn public void setCardId(int cardId) rn this.cardId = cardId;rn rnrn @SuppressWarnings("unchecked")rn public String execute()rn rn System.out.println("正在执行choiseCard请求!"); rn if(this.cardDao==null)rn rn this.cardDao=(CardDao)MyBeanFactory.MyGetBean("cardDao");rn rn if(this.historyDao==null)rn rn this.historyDao=(HistoryDao)MyBeanFactory.MyGetBean("historyDao");rn rn Card card=this.cardDao.queryById(this.cardId);rn System.out.println("选择的卡号为:"+cardId);rn System.out.println("卡里还有的钱:"+card.getBalance()); rn this.session.put("card",card);rn List listOfHistory=this.historyDao.queryByCard(this.cardId);//问题就在这里rn System.out.println("此卡共有消费记录条数:"+listOfHistory.size());rn this.session.put("listOfHistory", listOfHistory);rn return "success";rn rnrnrn下面是控制台的输出:rn正在执行choiseCard请求!rn选择的卡号为:7951rn卡里还有的钱:100.0rnrn问题是listOfHistory=this.historyDao.queryByCard(this.cardId);中如果我把this.cardId改成7951就能运行通过,但是用this.cardId就会报错:rnrnjava.lang.ClassCastException: java.lang.Float cannot be <em>cast</em> to java.lang.Integerrn org.hibernate.type.descriptor.java.IntegerTypeDescriptor.unwrap(IntegerTypeDescriptor.java:36)rn org.hibernate.type.descriptor.sql.IntegerTypeDescriptor$1.doBind(IntegerTypeDescriptor.java:57)rn org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:92)rn org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:305)rn org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:300)rn org.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:57)rn org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2602)rn org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2983)rn org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2918)rn org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3247)rn org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:140)rn org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:362)rn org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:354)rn org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:276)rn org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:326)rn org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)rn org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1214)rn org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:403)rn org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)rn org.hibernate.engine.transaction.spi.AbstractTransactionImpl.<em>com</em>mit(AbstractTransactionImpl.java:175)rn org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:480)rn org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)rn org.springframework.transaction.support.AbstractPlatformTransactionManager.<em>com</em>mit(AbstractPlatformTransactionManager.java:723)rn org.springframework.transaction.interceptor.TransactionAspectSupport.<em>com</em>mitTransactionAfterReturning(TransactionAspectSupport.java:393)rn org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)rn allDao.HistoryDao$$EnhancerByCGLIB$$ca6aaefe.queryByCard()rn card.struts.ChoiseCardAction.execute(ChoiseCardAction.java:60)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn java.lang.reflect.Method.invoke(Method.java:601)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)rn <em>com</em>.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)rn <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn <em>com</em>.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn <em>com</em>.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn <em>com</em>.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn <em>com</em>.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn <em>com</em>.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn <em>com</em>.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn <em>com</em>.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn <em>com</em>.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn <em>com</em>.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)rn <em>com</em>.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn <em>com</em>.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn <em>com</em>.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn <em>com</em>.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)rn <em>com</em>.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rnrnrn个人感觉好像是bug,求大侠看一下,哪里有问题?
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integ
at org.hibernate.type.IntegerType.set(IntegerType.java:64)rn at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:154)rn at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:136)rn at org.hibernate.param.PositionalParameterSpecification.bind(PositionalParameterSpecification.java:62)rn at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:514)rn at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1589)rn at org.hibernate.loader.Loader.doQuery(Loader.java:696)rn at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)rn at org.hibernate.loader.Loader.doList(Loader.java:2228)rn at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)rn at org.hibernate.loader.Loader.list(Loader.java:2120)rn at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)rn at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)rn at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)rn at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)rn at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)rn at <em>com</em>.scu.service.impl.BaseServiceImpl.getResult(BaseServiceImpl.java:55)rn at <em>com</em>.scu.service.impl.StudentServiceImpl.check(StudentServiceImpl.java:16)rn at <em>com</em>.scu.struts.action.UserLoginAction.userLogin(UserLoginAction.java:77)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.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)rn at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)rn at org.apache.struts.chain.<em>com</em>mands.servlet.ExecuteAction.execute(ExecuteAction.java:58)rn at org.apache.struts.chain.<em>com</em>mands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)rn at org.apache.struts.chain.<em>com</em>mands.ActionCommandBase.execute(ActionCommandBase.java:51)rn at org.apache.<em>com</em>mons.chain.impl.ChainBase.execute(ChainBase.java:190)rn at org.apache.<em>com</em>mons.chain.generic.LookupCommand.execute(LookupCommand.java:304)rn at org.apache.<em>com</em>mons.chain.impl.ChainBase.execute(ChainBase.java:190)rn at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)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.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)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:198)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)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:230)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:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)rn
Cannot cast from int[] to Object[]
如题:rn[code=Java]rn public static void main(String[] args) rn rn int[] arr = new int[]1,2,4,5,6,7;rn System.out.println(Arrays.asList((Object[])arr));rn //报错:Cannot <em>cast</em> from int[] to Object[]rn rn Integer[] arr1 = new Integer[]1,2,4,5,6,7;rn System.out.println(Arrays.asList((Object[])arr1));rn //这个可以rn rn rn[/code]rn希望把int[]转换为Object[],而不是Integer[]转换为Object[],大家赐招。rnPS:为什么下面可以上面却不行?
hibernate java.lang.Double cannot be cast to java.lang.Long
我mysql数据库有个字段,存钱的,hibernate映射实体类变成了double,现在要做一个求和,五毛钱也不能少。rnrn但是返回值不知道怎么转换类型,因为是货币类型,肯定不能转换成int,不然精度会丢失rnrn[code=Java]rnSession session = super.getSession().getSessionFactory().openSession();rn Transaction ta = session.beginTransaction();rn Query q = session.createQuery("select sum(t.b) from table t where 2 > 1");rn q.setFirstResult(0);rn q.setMaxResults(1);rn double Spending = ((Long)q.uniqueResult()).doubleValue();rn ta.<em>com</em>mit();rn session.close();rn[/code]rnrnrn报错提示这个:java.lang.ClassCastException: java.lang.Double cannot be <em>cast</em> to java.lang.Long,求解,怎嘛解决?多谢
EJB类型转换问题,cannot be cast to
代码如下:rnTest tt = (Test) context.lookup("TestBean/local");rnrn提示出错<em>cast</em>Exception, cannot be <em>cast</em> $Proxy(181) to src.Testrn有一个接口Test, 为localrn有一个TestBeanrnrn找不出什么原因,请高手指点。
cannot be cast to javax.servlet.filter 初学者请教
启动tomcat时一般如题的错误是什么原因导致的?rnrnAug 26, 2011 2:58:02 PM org.apache.catalina.core.StandardContext filterStartrnSEVERE: Exception starting filter SessionValidationFilterrnjava.lang.ClassCastException: <em>com</em>.xxx.controller.session.SessionValidationFilter cannot be <em>cast</em> to javax.servlet.Filterrn......rnrn比较纳闷,前后两个类的jar包都引用正确了,但是为什么映射不到呢?
tomcat报错org.apache.struts.action.ActionServlet cannot be cast to javax.servlet
[color=#FF0000]严重: Servlet /test threw load() exceptionrnjava.lang.ClassCastException: org.apache.struts.action.ActionServlet cannot be <em>cast</em> to javax.servlet.Servletrn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)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:546)rn at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)rn at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)rn at org.apache.catalina.core.StandardService.start(StandardService.java:519)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:581)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.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rn2012-1-10 9:49:57 org.apache.catalina.core.ApplicationContext log[/color]信息: Marking servlet jsp as unavailablern2012-1-10 9:49:57 org.apache.catalina.core.StandardContext loadOnStartuprnexamplesrn2012-1-10 9:50:00 org.apache.catalina.core.ApplicationContext logrn信息: ContextListener: contextInitialized()rn2012-1-10 9:50:00 org.apacrn[color=#FF0000]严重: Servlet /test threw load() exceptionrnjava.lang.ClassCastException: org.apache.jasper.servlet.JspServlet cannot be <em>cast</em> to javax.servlet.Servletrn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116)rn at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)rn at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)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:546)rn at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)rn at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)rn at org.apache.catalina.core.StandardService.start(StandardService.java:519)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:581)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.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rn2012-1-10 9:49:57 org.apache.tomcat.util.modeler.Registry registerComponent[/color]严重: Null <em>com</em>ponent Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/test,J2EEApplication=none,J2EEServer=nonern2012-1-10 9:49:57 org.apache.catalina.startup.HostConfig deployWARrn信息: Deploying web application archive axis2.warrn[INFO] Clustering has been disabledrn[INFO] Deploying module: addressing-1.5.1 - file:/D:/apache-tomcat-6.0.29/webapps/axis2/WEB-INF/modules/addressing-1.5.1.marrn[INFO] Deploying module: jaxws-1.5.1 - file:/D:/apache-tomcat-6.0.29/webapps/axis2/WEB-INF/modules/axis2-jaxws-mar-1.5.1.marrn[INFO] Deploying module: script-1.5.1 - file:/D:/apache-tomcat-6.0.29/webapps/axis2/WEB-INF/modules/axis2-scripting-1.5.1.marrn[INFO] Deploying module: metadataExchange-1.5.1 - file:/D:/apache-tomcat-6.0.29/webapps/axis2/WEB-INF/modules/mex-1.5.1.marrn[INFO] Deploying module: mtompolicy-1.5.1 - file:/D:/apache-tomcat-6.0.29/webapps/axis2/WEB-INF/modules/mtompolicy-1.5.1.marrn[INFO] Deploying module: ping-1.5.1 - file:/D:/apache-tomcat-6.0.29/webapps/axis2/WEB-INF/modules/ping-1.5.1.marrn[INFO] Deploying module: soapmonitor-1.5.1 - file:/D:/apache-tomcat-6.0.29/webapps/axis2/WEB-INF/modules/soapmonitor-1.5.1.marrn[INFO] Deploying module: metadataExchange-1.5.1-impl - file:/D:/apache-tomcat-6.0.29/webapps/axis2/WEB-INF/lib/mex-1.5.1-impl.jarrn[INFO] Deploying Web service: version-1.5.1.aar - file:/D:/apache-tomcat-6.0.29/webapps/axis2/WEB-INF/services/version-1.5.1.aarrn2012-1-10 9:49:59 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory docsrn2012-1-10 9:49:59 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory he.catalina.core.ApplicationContext logrn信息: SessionListener: contextInitialized()rn2012-1-10 9:50:00 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory myapprn2012-1-10 9:50:00 org.apache.catalina.startup.HostConfig deployDirectoryrn信息: Deploying web application directory ROOTrn2012-1-10 9:50:00 org.apache.coyote.http11.Http11Protocol startrn信息: Starting Coyote HTTP/1.1 on http-8080rn2012-1-10 9:50:00 org.apache.jk.<em>com</em>mon.ChannelSocket initrn信息: JK: ajp13 listening on /0.0.0.0:8009rn2012-1-10 9:50:00 org.apache.jk.server.JkMain startrn信息: Jk running ID=0 time=0/62 config=nullrn2012-1-10 9:50:00 org.apache.catalina.startup.Catalina startrn信息: Server startup in 4094 msrnrn菜鸟学struts,写logindemo的时候出现红色标记的报错,另外启动tomcat之后localhost:8080和127.0.0.1都进不到tomcat的欢迎页面rn求指点
java.lang.ClassCastException: testjpa.book.WebBookstoreBooks cannot be cast to testjpa.book.WebBooks
List list = bw1.findAll(); rnWebBookstoreBooks bk = new WebBookstoreBooks();rnIterator myIterator1= list.iterator(); rnwhile (myIterator1.hasNext())rn Object o = myIterator1.next(); rn bk = (WebBookstoreBooks)o;rnrn rn实在不知道是怎么改了,请教各位大侠,很急,谢谢
java.lang.ClassCastException: $Proxy71 cannot be cast to com.nfschina.dao.NewsDao
我被这个问题折腾了好半天了,还没找到合适的答案,下面是我jsp代码[code="java"]rnrnrn [code="java"][/code]rnrnrnrn rn rn My JSP 'index.jsp' starting pagern rn rn rn rn rn rn rn rn rn rn newss=newsdao.getList();rn for(News news:newss)rn out.println(" rn rn idrn titlern contentrn typern picrn createtimernrnrnrnrn rn rnrn[/code]
java.lang.ClassCastException: java.util.ArrayList cannot be cast错误
<em>Message</em>s: rnjava.util.ArrayList cannot be <em>cast</em> to org.ygh.vo.SysUserrnFile: org/ygh/dao/impl/SysUserDAOImpl.javarnLine number: 19rnStacktracesrnjava.lang.ClassCastException: java.util.ArrayList cannot be <em>cast</em> to org.ygh.vo.SysUserrnrn org.ygh.dao.impl.SysUserDAOImpl.checkLogin(SysUserDAOImpl.java:19)rn org.ygh.service.impl.SysUserServiceImpl.checkLogin(SysUserServiceImpl.java:29)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn java.lang.reflect.Method.invoke(Method.java:606)rn org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)rn org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)rn org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)rn org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn <em>com</em>.sun.proxy.$Proxy12.checkLogin(Unknown Source)rn org.ygh.action.SysUserAction.checkLogin(SysUserAction.java:39)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn java.lang.reflect.Method.invoke(Method.java:606)rn ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:891)rn ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1293)rn ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)rn <em>com</em>.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:117)rn <em>com</em>.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:108)rn ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1369)rn ognl.ASTMethod.getValueBody(ASTMethod.java:90)rn ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)rn ognl.SimpleNode.getValue(SimpleNode.java:258)rn ognl.Ognl.getValue(Ognl.java:494)rn ognl.Ognl.getValue(Ognl.java:458)rn <em>com</em>.opensymphony.xwork2.ognl.OgnlUtil$2.execute(OgnlUtil.java:309)rnrn[code=java]public SysUser checkLogin(SysUser sysUser) rn String strHQL="From SysUser u Where u.userName=? And u.userPassword=? And u.userFlag=1";rn Object [] values=sysUser.getUserName(),sysUser.getUserPassword();rn sysUser=(SysUser)this.getHibernateTemplate().find(strHQL, values);rn return sysUser;[/code]rnrnrnobject 就是报错那一行。rn rnrn
java.lang.ClassCastException: java.lang.StringBuffer cannot be cast to java.lang
判断验证码的时候出现这个错误提示 是什么意思?
sparksql HiveHBaseTableOutputFormat cannot be cast to HiveOutputFormat
工作中发现sparksql 在向hive的hbase外表插入数据的时候报错问题:rnHiveHBaseTableOutputFormat cannot be <em>cast</em> to org.apache.<em>hadoop</em>.hive.ql.io.HiveOutputFormat .rn采用ALTER TABLE tablename SET TBLPEOPERTIES ('OutputFormat'='HiveOutputFormat' )是不行的。rn不知道大侠有没有什么处理办法。rn这是第一种方法,已经被列为bug。rnhttps://issues.apache.org/jira/browse/SPARK-6628rn方案二 ,目前采用的是分批次往hbase中put数据,是可行的。rn方案三,采用saveAsNewAPIHadoopDataset处理 ,先前试过也会报错。rn不过为了使结果尽量接近sql,尽量是采用方案一比较合理。rn方案三也是可以接收的,但是还是要验证具体可行才行。rn
Native.loadLibrary提示cannot be cast错误
windows java环境下使用NLPIR分词包,JDK是1.8rnrnCLibrary instance = (CLibrary)Native.loadLibrary(System.getProperty("user.dir")+"\\source\\NLPIR", CLibrary.class);rn如上,NLPIR.dll放到工程source文件夹下rnrn运行报错Exception in thread "main" java.lang.ClassCastException: <em>com</em>.sun.proxy.$Proxy0 cannot be <em>cast</em> to <em>com</em>.sun.jna.Libraryrnrn跟踪代码发现在 rn public static Object loadLibrary(String name,Class interfaceClass, Map options) rn Library.Handler handler =rn new Library.Handler(name, interfaceClass, options);rn ClassLoader loader = interfaceClass.getClassLoader();rn Library proxy = (Library)rn Proxy.newProxyInstance(loader, new Class[] interfaceClass,rn handler);rn cacheOptions(interfaceClass, options, proxy);rn return proxy;rn rn函数内Library proxy = (Library)Proxy.newProxyInstance(loader, new Class[] interfaceClass,handler);转换失败rnrn求各位大手看看应该怎么解决这个问题rn
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
for(int i=0;i
求助:java.util.ArrayList cannot be cast to com.github.pagehelper.Page
在同一个工程下rn最开始用<em>com</em>.github.pagehelper插件进行数据分页没有配置spring导致类型转换不了,加上配置就OK了rn现在开发另一个接口spring也配置了但是又出了这个问题,求大神帮助rnrnmaven:rnrn <em>com</em>.github.pagehelperrn pagehelperrn 3.7.0rnrnrnspring:rnrn rn rn rn rn rn rn rn rn dialect=mysqlrn reasonable=truern rowBoundsWithCount=truern offsetAsPageNum=truern pageSizeZero=truern rn rn rn rn rn rnrn程序报错代码:rnList collection = new ArrayList<>();rnPageHelper.startPage(1 , 1);rnPage page = (Page)collection;rnrn强转的时候就报类型不对rn(collection size=2,因为中间业务代码太多就没有贴出来了)
json-lib net.sf.ezmorph.bean.MorphDynaBean cannot be cast to xxx
NULL 博文链接:https://hw1287789687.iteye.<em>com</em>/blog/1993048
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lorg.omg.CO
[img=https://img-bbs.csdn.net/upload/201509/17/1442472397_105023.png][/img]rnrn在SQLHelper中执行查询的时候已经把结果保存到ArrayList中,但是取回的时候报上面的错误 求解
java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.I
各位大哥,小弟初次使用hibernate抛出了如上异常不知道该如何处理,主要代码如下:rn Session session = null;rn tryrn session = HibernateUtil.getSessionFactory().openSession();rn List l = session.createSQLQuery("select count(*) from person").list();rn int t = l.get(0).intValue();rnrn System.out.println(t);rn catch(Exception e)rn e.printStackTrace();rn finallyrn session.close(); rn rn我想执行上面的语句来得到数据库中数据的条数,但是不知道有什么好的方法,所以就想用上面的代码试试,结果出现了这个异常,不知道各位有什么好的方法可以告诉小弟一声,谢谢!
Cannot cast from List to List
一个简单的Spring mvc mybatis框架的CRUD实例。但是下面DAOIMPL里面代码报错,改不了首先interface IProfessorDao写了npublic List findAll(); n然后IProfessorDaoImpl里面下面方法报错 n public List findAll() n n // TODO Auto-generated method stub n String sql = this.getStatementId(Professor.class, SELECTALL); n List list = (List)sqlSession.selectList(sql);n return list; n n其中(List)sqlSession.selectList(sql); 这里提示 Cannot <em>cast</em> from List to ListnSQLMAPPER设置也没有问题,代码如下n n select * from ALL_EXP_LIST_TBL ; n n 求助怎么解决
java.lang.String cannot be cast to java.lang.Integer错误
jTextField1.setText(((Integer)jTable.getValueAt(row, 1)).toString());rnrnrn程序一执行到这里就出错了,不知道为什么rnjTextField1接收的是数据库里面的一个字段,类型为numericrn请问一下高手,应该怎么改才不会出错啊,我是初学者
cannot cast from object to boolean
multiple markers at this linern-cannot <em>cast</em> from object to booleanrn这个是说什么啊 。。是不 能用booleanrn吗。。为什么我 把它改为int 也 不 行啊 ~· · rnif(([color=#FF0000]boolean[/color]) teacherdao.save(tea))rn //if(teacherdao.save(tea))//这句也 不行~·rn rn return (map.findForward("addok"));rn elsern errors.add("fail_6",new Action<em>Message</em>("AddStudentAction.e"));rn saveErrors(request,errors);rn return (map.getInputForward());
Cannot cast from ActionForm to XXForm
package <em>com</em>.hgq.student_information.web.struts.action;rnrnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnrnimport org.apache.struts.action.Action;rnimport org.apache.struts.action.ActionForm;rnimport org.apache.struts.action.ActionForward;rnimport org.apache.struts.action.ActionMapping;rnrnimport <em>com</em>.hgq.student_information.dao.DAOFactory;rnimport <em>com</em>.hgq.student_information.dao.TeacherDAO;rnimport <em>com</em>.hgq.student_information.domain.Student;rnimport <em>com</em>.hgq.student_information.domain.Teacher;rnimport <em>com</em>.hgq.student_information.web.struts.form.StudentForm;rnimport <em>com</em>.hgq.student_information.web.struts.form.TeacherForm;rnrnpublic class EditTeacher extends Actionrn private TeacherDAO teaDao;rnrn public TeacherDAO getTeacherDAO() rn return DAOFactory.getInstance().createTeacherDAO();rn rnrn /**rn * Method executern * rn * @param mappingrn * @param formrn * @param requestrn * @param responsern * @return ActionForwardrn */rn public ActionForward execute(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response) rn rn String id = (String)request.getParameter("teacher_id");rn rn /*rn * 声明一个StudentForm类型的对象. form为页面中提交的表单信息,将它rn * 强制转换为StudentForm类型,并赋值给stuForm对象rn */rn TeacherForm teaForm = (TeacherForm) form ; // 错误代码rnrn teaDao = this.getTeacherDAO();rn // 根据ID获取学生信息rn Teacher tea = teaDao.getTeacherByID(id);rn rn // 设置相应的更新属性rn tea.setName( teaForm.getName());rn tea.setPassword( teaForm.getPassword());rn tea.setXuebu( teaForm.getXuebu());rn tea.setSex( teaForm.getSex() );rn tea.setTitle(teaForm.getTitle());rn tea.setTel( teaForm.getTel()) ;rn tea.setEmail( teaForm.getEmail()) ;rn rn if(teaDao.updateTeacher(tea))rn // 更新成功,跳转页面rn return (mapping.findForward("success"));rn else rn rn return (mapping.getInputForward());rn rn rn rnrnrnrn代码我已经继承Action类了..为什么还会出现这个错误...rn最奇怪的是..之前有个类也是试用此代码..都没有错误.rn就这个类的代码出现这个错误...rnrn求高手解答..
java.lang.ClassCastException: java.lang.Integer cannot be cast to com.alibaba.fa
java.lang.ClassCastException: java.lang.Integer cannot be <em>cast</em> to <em>com</em>.alibaba.fastjson.JSONObjectrn[code=java]dataJson = JSON.parseObject(str);[/code]rnrn为什么会报这样错误,怎么解决好点rn
ssh [Ljava.lang.Object; cannot be cast to 的问题
[code=java]List list =getHibernateTemplate().find(rn "select g.goodsid,g.goodsname,g.introduce,g.image,g.addr," +rn "gt.typename,g.price,g.time " +rn "from Goods g,Goodstype gt where g.goodstype = gt.goodstypeid and g.istop='1'");rn System.out.println(list.get(0).getGoodsname());[/code]rnrnrn错误信息rnStruts has detected an unhandled exception: rnrn<em>Message</em>s: [Ljava.lang.Object; cannot be <em>cast</em> to domain.Goods rn rnFile: dao/TopDAO.java rnLine number: 18 rnrnrn--------------------------------------------------------------------------------rnrnStacktracesrnjava.lang.ClassCastException: [Ljava.lang.Object; cannot be <em>cast</em> to domain.Goods rnrnrnGoods类rnpublic class Goods rn private String goodsid; //作为String是原作者设计不良?rn private String goodsname;rn private String introduce;rn private String image;rn private String addr;rn private int goodstypeid;rn private String typename;rn private Goodstype goodstype;rn private String istop;rn private String isre<em>com</em>m;rn private Date time;//最新的更新时间rn private String price;//最新的价格rn //getter、setter略rnrnrnhbm.xmlrnrnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrn困扰挺久了,求解答。
急!!'type cast' : cannot convert from '' to 'float'
rn......rn......rnrnint r1=GetRValue(cr1); rnint r2=GetRValue(cr2);rnrn......rn......rnfloat dr=(((float)(r2-r1))/(float)(rect.Width)); //错在这里rnrn.....rn.....rnrnerror C2440: 'type <em>cast</em>' : cannot convert from '' to 'float'rn Context does not allow for disambiguation of overloaded functionrnrn请问怎么解决~~....
java.math.BigDecimal cannot be cast to java.lang.String 这个错误
vpd.put("var7", userList.get(i).getString("CELL")); //7 导出excel时报那个错误,错误指向这句,cell在数据库是number,这块需要怎么写呢? 创建一个BigDecimal 类型的对象来接收数据,然后在做数据类型的转换??具体怎么写,我写的都不对。谢谢
图像操作时:sun.awt.image.ToolkitImage cannot be cast to java.awt.image.BufferedImage
图像操作时:想要将一个JFrame的Panel中createImage产生的Image图像转化为BufferedImage图像,rn使用ImageProducer ip=new MemoryImageSource(iw,ih,pixels,0,iw);rn tmp=createImage(ip);rnBufferedImage im=(BufferedImage)tmp;rn方法强制转换时产生错误rn提示:sun.awt.image.ToolkitImage cannot be <em>cast</em> to java.awt.image.BufferedImage
Save Failed java.util.ArrayList cannot be cast to com.example.model.Connection
编辑好的流程图点击保存时,跳出这个错误,求教是什么原因?rnSave Failedrnjava.util.ArrayList cannot be <em>cast</em> to <em>com</em>.example.model.Connectionrn
关于ssh的$Proxy0 cannot be cast to 报错
报错:Exception in thread "main" java.lang.ClassCastException: $Proxy0 cannot be <em>cast</em> to <em>com</em>.wr.domain.Userrn度娘了,说解决方法有两种 1、给service类添加一个接口iService,让service类实现它,则创建代理类时使用JDK动态代理就不会出现问题 2、设置beanNameAutoProxyCreator的proxyTargetClass属性为true,意思是强制使用CGLIB代理,前提是你已经将CGLIB包加入到项目中rn第一种方法我已经做了,但是第二种方法我不会怎么弄。rnrn贴上代码,大神帮忙啊,急急!!!rn测试文件Testrn[code=Java]public class Test rnrn /**rn * @param argsrn */rn public static void main(String[] args) rn ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");rn User u = (User)ac.getBean("userServiceImpl");rn rn u.setId("101");rn u.setPwd("101");rn rn UserServiceImpl userServiceImpl = new UserServiceImpl();rn userServiceImpl.addUser(u);rn rn rnrnrn[/code]rn[color=#FF0000]applicationContext.xml文件[/color]rn[code=Java]rnrnrnrn 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 rnrn rn rn rn rn rn rn rnrnrn[/code]
java.util.Date cannot be cast to java.sql.Date如何解决?
我用了struts+hibernate 出现这个java.util.Date cannot be <em>cast</em> to java.sql.Date,我没有直接写hql语句,请问各位高手帮帮忙·应该如何解决··谢谢了·
CXF3.0 Cannot cast from Endpoint to EndpointImpl
CXF3.0 Cannot <em>cast</em> from Endpoint to EndpointImplrnrnEndpoint 不能强转为Endpoint Impl要怎么办rnrn[code=java]EndpointImpl ei = (EndpointImpl)Endpoint.publish("http://192.168.0.103/helloworld", hw);[/code]
求助错误解决 java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
用的CGLIB代理的,不知道哪个出错了,不用CGLIB代理的话,就又会出现代理对象找不到该方法的异常rn求解决。。。
java类型错误java.lang.Integer cannot be cast to java.lang.String
spring framwork DAO的基类(下面代码忽略注解,那个应该没错)rn[code=Java]rnpublic class HibernateCommonImpDAOextends HibernateDaoSupport rnrnrn [color=#FF0000]public ID save(T transientObject) rn return (ID) super.getSession().save(transientObject);[/color] rnrn[/code]rn这个返回类型是ID 我在这里很没搞懂这是个什么类型,接下来用到save方法的时候怎么定义类型。。。。rnrnService类的saveUser方法rn[code=Java]rnpublic class LoginServiceImp implements LoginServicern public String saveUser(LoginResource loginResource)rn [color=#FF0000]return (String)loginResourceDAO.save(loginResource);[/color]rn rn[/code]rnLoginResource 是model实体rn这里的类型就出问题啦。。。。rn[code=Java]rn@RequestMapping(value="/regeditSave.do")rn public String regeditSave(HttpServletRequest request,Model model) throws Exception rn HttpSession session = request.getSession();rn tryrn rnrn LoginResource user = new LoginResource();rn [color=#FF0000]loginService.saveUser(user);[/color]rnrn session.setAttribute("sessionUser", user);rn rn rn catch(Exception e)rn rn e.printStackTrace();rn rn rn return "wel<em>com</em>e";//跳转到欢迎界面rn rn [/code]rn页面结果:页面跳转了,但添加不进数据库,session为空。rn异常:rnjava.lang.ClassCastException: java.lang.Integer cannot be <em>cast</em> to java.lang.Stringrn at <em>com</em>.sofmit.sd.login.service.LoginServiceImp.saveUser(LoginServiceImp.java:32)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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn at $Proxy7.saveUser(Unknown Source)rn at <em>com</em>.sofmit.sd.login.web.LoginController.regeditSave(LoginController.java:68)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.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421)rn at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136)rn at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:326)rn at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:313)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)rn at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)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.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)rn at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852)rn at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584)rn at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)rn at java.lang.Thread.run(Thread.java:619)rn错误地方是知道了,但是怎么解决请大家教教我~~
hadoop hdfs异常:DistributedFileSystem cannot be cast to FileSystem
java代码如下:rnConfiguration conf = new Configuration();rnconf.set("fs.default.name", "hdfs://namenode:9000");rnFileSystem fileSystem = FileSystem.get(conf);rnrn报错:java.lang.ClassCastException: org.apache.<em>hadoop</em>.hdfs.DistributedFileSystem cannot be <em>cast</em> to org.apache.<em>hadoop</em>.fs.FileSystemrn at org.apache.<em>hadoop</em>.fs.FileSystem.createFileSystem(FileSystem.java:1377)rn at org.apache.<em>hadoop</em>.fs.FileSystem.access$200(FileSystem.java:66)rn at org.apache.<em>hadoop</em>.fs.FileSystem$Cache.get(FileSystem.java:1390)rn at org.apache.<em>hadoop</em>.fs.FileSystem.get(FileSystem.java:196)rn at org.apache.<em>hadoop</em>.fs.FileSystem.get(FileSystem.java:95)rnrn求高手解答!~
高手请进来帮帮我!java.lang.String cannot be cast to [Ljava.lang.Object
public List getCellRunInfo_byCellID(String cellID)rnrn String hql = "select cr.cpu,cr.memory,cr.disk from Cell_Run cr where cr.cellid='"+cellID+"'";rn List list = HibernateQuery.HbmQuery(hql).list();rn return list;rn rn rnrnIterator it = getCellRunInfo_byCellID("139932")rnif(it.hasNext())rnrn Object[] obj=(Object[])it.next();rn cpu=(Integer)obj[0];rn memory = (Integer)obj[1];rn disk = (Integer)obj[2];rnrn这就开始报异常。。。不明白哪出问题了rnexception rnrnorg.apache.jasper.JasperException: java.lang.ClassCastException: java.lang.String cannot be <em>cast</em> to [Ljava.lang.Object;rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:541)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)rn org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:690)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn <em>com</em>.wiselink.filter.SetCharacterEncoding.doFilter(SetCharacterEncoding.java:23)rnrnrnroot cause rnrnjava.lang.ClassCastException: java.lang.String cannot be <em>cast</em> to [Ljava.lang.Object;rn <em>com</em>.wiselink.javaBean.CellInfoPrint.cellInfo(CellInfoPrint.java:27)rn org.apache.jsp.login.cellinfo_jsp._jspService(cellinfo_jsp.java:78)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)rn org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:690)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn <em>com</em>.wiselink.filter.SetCharacterEncoding.doFilter(SetCharacterEncoding.java:23)rn
jxl导入错误:jxl.biff.drawing.Opt cannot be cast to jxl.biff.drawing.EscherContainer
jxl导入错误:jxl.biff.drawing.Opt cannot be <em>cast</em> to jxl.biff.drawing.EscherContainer 为什么啊?
E2031 Cannot cast from 'TComponent *' to 'TColumn *'
void __fastcall TfrmMain::btnClick(TObject *Sender)rnrn TComponent *frmComponent;rn TIniFile *ini;rn ini = new TIniFile( "abc.ini" );rn tryrn rn for(int i=0 ;iClassNameIs("TColumn") )rn rn dynamic_<em>cast</em>(frmComponent)->Title->Caption=rn ini->ReadString(pFrom->Name,frmComponent->Namern +".Title.Caption",dynamic_<em>cast</em>(frmComponent)->Title->Caption);rn rn rn rn __finallyrn rn delete ini;rn rn类型转换出错,请问如何处理???rn[C++ Error] utLanguage.cpp(149): E2031 Cannot <em>cast</em> from 'TComponent *' to 'TColumn *'rnrn
关于java.lang.Integer cannot be cast to java.lang.Long的 疑问
大家好,我是个J2EE初学者,我写了这么一段代码,但是出现了,类型转换不合法的问题。但是我不清楚为什么会出现这样的错误。希望大家能够帮我看看。谢谢大家了。rnrnpublic class ScjLogic extends KmapBaseLogic rn// 注入scjdao rn private ScjDao scjdao;rnrn public ScjDao getScjdao() rn return scjdao;rn rnrn public void setScjdao(ScjDao scjdao) rn this.scjdao = scjdao;rn rn rn /**rn * 初始化技能点页面rn * @returnrn */rn public String initJndScj()rn this.getHttpRequest().getSession().setAttribute("empId",1586);rn rn //String sessionLL = (String)session.getAttribute("sessionLL") ;rn Long empId = (Long)this.getHttpRequest().getSession().getAttribute("empId");rn rn List JndName = new ArrayList();rn rn List JndList = scjdao.getJnd(empId);rn rn getHttpRequest().getSession().setAttribute("JndList", JndList);rn rn int listlength = JndList.size();rn for(int i=0;i
myeclipse报错java.lang.ClassCastException: java.lang.Integer cannot be cast to org.model.Login
package org.model;rnrnpublic class Login rn private Integer id;rn private String password;rn private String name;rn private boolean role;rn public Integer getId() rn return id;rn rn public void setId(Integer id) rn this.id = id;rn rn public String getPassword() rn return password;rn rn public void setPassword(String password) rn this.password = password;rn rn public String getName() rn return name;rn rn public void setName(String name) rn this.name = name;rn rn public boolean isRole() rn return role;rn rn public void setRole(boolean role) rn this.role = role;rn rn rnrnrnrn```rnrn```rn```rnrn```
报错ParameterMap cannot be cast to java.util.HashMap的问题
代码片段如下rn[code=java]rnpublic void doPost(HttpServletRequest request, HttpServletResponse response)rn throws ServletException, IOException rn String nextPage = "digitalweb/cart_list.jsp";rn HttpSession session = request.getSession();rn HashMap map=(HashMap) request.getParameterMap();rn ArrayList cartList = (ArrayList) session.getAttribute("cartList");rn if(map.get("type")[0].equals("add"))rn Cart cart = new Cart();rn cart.setId(Integer.parseInt(map.get("id")[0]));rn cart.setName(map.get("name")[0]);rn cart.setSale(Double.parseDouble(map.get("sale")[0]));rn cart.setPrice(Double.parseDouble(map.get("price")[0]));rn cart.setPic(map.get("pic")[0]);rn cart.setNum(Integer.parseInt(map.get("num")[0]));rn if(cartList==null)rn cartList = new ArrayList();rn session.setAttribute("cartList", cartList);rn rn //判断是否又相同的商品rn boolean hasCart = false;rn for(Cart c:cartList)rn if(c.getId() == cart.getId())rn c.setNum(c.getNum()+cart.getNum());rn hasCart=true;rn break;rn rn rn if(!hasCart)rn cartList.add(cart);rn rn response.sendRedirect(nextPage);rn rnrn[/code]rn这是一个购物车跳转的servlet,在前一个jsp界面点击跳转之后输出如下错误[img=https://img-bbs.csdn.net/upload/201710/30/1509368961_118845.png][/img]rnrn应该是HashMap map=(HashMap) request.getParameterMap();出了问题rn request.getParameterMap()返回的是一个Map,想把它转换为HashMap操作应该怎么办呢
Hibernate中java.lang.String cannot be cast to java.lang.Integer
[img=https://img-bbs.csdn.net/upload/201411/26/1416968034_558165.jpg][/img]rn这个是查询源码!rn实体配置中对应的类型也没有问题,但是执行就会报这个错误!rn问题是我自己开发的机器上运行没有问题,但一放到服务器上,就会出现这个问题!rn求大神指教!在线急等!
求助求助~~:Ljava.lang.Integer; cannot be cast to java.lang.Integer
大家好,我看视频学习ssh系统开发,但是报了这个错误:rn[b]Ljava.lang.Integer; cannot be <em>cast</em> to java.lang.Integer[/b]rn但是视频中老师的就运行正常,没有报这个错误。rn[b]baseimpl中的代码是:[/b]rn public List getResult(String hql, Object[] parameters) rn // TODO Auto-generated method stub rn Query query = sessionFactory.getCurrentSession().createQuery(hql);rn //注入?rn if(parameters != null && parameters.length > 0)rn for(int i = 0; i < parameters.length; i++)rn query.setParameter(i, parameters[i]);rn rn rn return query.list();rn rn[b]我在action中的代码是[/b]:rn request.setAttribute("provincelist", provinceService.getResultrn ("from Province where country.id=?", new Object[]new Integer[1]));rnrn错在哪里了呀。
为什么会出现java.lang.String cannot be cast to java.lang.Integer
type Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnorg.apache.jasper.JasperException: An exception occurred processing JSP page /ApplicationExample.jsp at line 31rnrn28: rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnroot cause rnjava.lang.ClassCastException: java.lang.String cannot be <em>cast</em> to java.lang.Integerrn org.apache.jsp.ApplicationExample_jsp._jspService(ApplicationExample_jsp.java:91)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.rnrn[color=#FF0000]这些信息是浏览器上显示的,我的源程序如下[/color]:rnrnrnrnrn 您是第rn rn rn rn 个访问本站的客户。rnrnrnrnrn rn rn rn My JSP 'ApplicationExample.jsp' starting pagern rn rn rn rn rn rn rnrn rn rn rn rnrn初学JSP,真的不知道错在哪里,望各位大牛不吝赐教,谢谢!(在线等)
spring cglib报错 xxx cannot be cast to xxx
[b][size=18px]1, 想使用 ehcache + spring jdbc 实现查询结果缓存,现在功能都实现了,但是使用时报错[/size]:[/b]rnrn[code=java]rnjava.lang.ClassCastException: <em>com</em>.hbzx.bean.ShopViewCountBean cannot be <em>cast</em> to java.util.Listrn at <em>com</em>.hbzx.dao.ShopViewCountDao$$EnhancerBySpringCGLIB$$1c70ff76.queryAll()rn at <em>com</em>.hbzx.service.ShopViewCountService.fillHistory(ShopViewCountService.java:143)rn at <em>com</em>.hbzx.service.ShopViewCountService.query(ShopViewCountService.java:46)rn at <em>com</em>.hbzx.controller.UserCommissionController.getMyShopLog(UserCommissionController.java:45)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:483)rn at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)rn at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)rn at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:743)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:672)rn at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:82)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)rn at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:202)rn at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:180)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)rn at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)rn at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)rn at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:745)rn[/code]rnrn
异常怎么解决org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
org.apache.catalina.util.DefaultAnnotationProcessor cannot be <em>cast</em> to org.apache.AnnotationProcessor
求组MainActivity cannot be cast to android.view.View$OnClickListener
java.lang.RuntimeException: Unable to start activity ComponentInfo<em>com</em>.dmz.system/<em>com</em>.dmz.system.MainActivity: java.lang.ClassCastException: <em>com</em>.dmz.system.MainActivity cannot be <em>cast</em> to android.view.View$OnClickListenerrn
SpringMVC报java.util.HashMap cannot be cast to java.lang.String错误
一个用户注册控制器rn[code=java]@RequestMapping(value="/register.do")rn public String insertUser(HttpServletRequest request,rn HttpServletResponse response,Integer id ,String name,String sex,User user)rn Map map= new HashMap();rn map.put("name", user.getName());rn map.put("passWord",user.getpassWord());rn String name1=userService.selectRegister(name);rn if(name1==null)rn rn rn userService.insertUser(map);rn request.setAttribute("registerName",map.get("name"));rn return "register_success.jsp";rn rn return"index.jsp";rn [/code]rn测试当name1==null时候没问题,注册成功并跳转到register_success.jsp,但是第二个条件就会报java.util.HashMap cannot be <em>cast</em> to java.lang.String错误,也就是说数据库已经有用户的时候,我猜应该是控制器部分的问题,求大神解决。
遇到这个java.lang.Integer cannot be cast to study.exa1
package study;rnrnimport java.util.Comparator;rnimport java.util.Set;rnimport java.util.TreeMap;rnrnpublic class exa1 rn rn int no;rn public exa1(int aa)rn no=aa;rn rn rn public static void main(String[] args) rn rn @SuppressWarnings("unchecked")rn TreeMap a =new TreeMap(new Comparator()rn rn public int <em>com</em>pare(Object arg0, Object arg1)rn rn exa1 a=(exa1)arg1;rn exa1 b=(exa1)arg0;rn return a.no-b.no;rn rn rn );rn a.put(new exa1(122),"a");rn a.put(new exa1(2),"b");rn a.put(new exa1(223),"b");rn System.out.println(a.get(1));rn System.out.println(a.entrySet());rn rnrnrn运行之后报java.lang.Integer cannot be <em>cast</em> to study.exa1rn不知道怎么改呀,希望各位朋友帮帮我
maven中的cannot be cast to javax.servlet.Filter如何解决
这个如何在不改动代码的情况下解决?
硕士论文:基于矩阵分解的图像数字水印算法模型下载
硕士论文:基于矩阵分解的图像数字水印算法模型 相关下载链接:[url=//download.csdn.net/download/x40148939/3006922?utm_source=bbsseo]//download.csdn.net/download/x40148939/3006922?utm_source=bbsseo[/url]
java版QQ聊天程序下载
先运行服务器端,后运行客户端,可以同时运行多个客户端进行聊天。 相关下载链接:[url=//download.csdn.net/download/wen860/3638145?utm_source=bbsseo]//download.csdn.net/download/wen860/3638145?utm_source=bbsseo[/url]
3310写卡器安装流程下载
可以使用本方法写UIM卡,联通专用的,详细资料使用方法 相关下载链接:[url=//download.csdn.net/download/u010478805/5307394?utm_source=bbsseo]//download.csdn.net/download/u010478805/5307394?utm_source=bbsseo[/url]
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview
我们是很有底线的