排行榜

  • 用户榜
  • 标签榜
  • 冲榜分奖金

频道

最新最热悬赏待采纳 筛选
  • 1

    回答

  • 6

    浏览

所有的项目有启动不了都有Server Tomcat v8.5 Server at localhost failed to start.难道是我用了JUtils单元测试,运行其他项目就报错了该怎么办呢?Server Tomcat v8.5 Server at localhost failed to start.报错(子容器启动失败该怎么办) 有的还出现 运行报错是这样的 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server.服务器版本: Apache Tomcat/9.0.45 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: 服务器构建: Mar 30 2021 10:29:04 UTC 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: 服务器版本号: 9.0.45.0 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: 操作系统名称: Windows 10 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS.版本: 10.0 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: 架构: amd64 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java 环境变量: C:\Program Files\Java\jdk1.8.0_131\jre 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java虚拟机版本: 1.8.0_131-b11 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM.供应商: Oracle Corporation 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: D:\javaEE\apache-tomcat-9.0.45 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: D:\javaEE\apache-tomcat-9.0.45 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: 命令行参数: -Dcatalina.base=D:\javaEE\apache-tomcat-9.0.45 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: 命令行参数: -Dcatalina.home=D:\javaEE\apache-tomcat-9.0.45 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: 命令行参数: -Dwtp.deploy=D:\javaEE\apache-tomcat-9.0.45\wtpwebapps 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: 命令行参数: -Djava.endorsed.dirs=D:\javaEE\apache-tomcat-9.0.45\endorsed 五月 07, 2021 6:17:46 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: 命令行参数: -Dfile.encoding=UTF-8 五月 07, 2021 6:17:46 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: 使用APR版本[1.7.0]加载了基于APR的Apache Tomcat本机库[1.2.27]。 五月 07, 2021 6:17:46 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: APR功能:IPv6[true]、sendfile[true]、accept filters[false]、random[true]。 五月 07, 2021 6:17:46 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: APR/OpenSSL配置:useAprConnector[false],useOpenSSL[true] 五月 07, 2021 6:17:46 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL 信息: OpenSSL成功初始化 [OpenSSL 1.1.1k 25 Mar 2021] 五月 07, 2021 6:17:47 下午 org.apache.coyote.AbstractProtocol init 信息: 初始化协议处理器 ["http-nio-8181"] 五月 07, 2021 6:17:47 下午 org.apache.catalina.startup.Catalina load 信息: 服务器在[1429]毫秒内初始化 五月 07, 2021 6:17:47 下午 org.apache.catalina.core.StandardService startInternal 信息: 正在启动服务[Catalina] 五月 07, 2021 6:17:47 下午 org.apache.catalina.core.StandardEngine startInternal 信息: 正在启动 Servlet 引擎:[Apache Tomcat/9.0.45] 五月 07, 2021 6:17:49 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。 五月 07, 2021 6:17:49 下午 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info 信息: Parsing configuration file [struts-default.xml] 五月 07, 2021 6:17:49 下午 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info 信息: Unable to locate configuration files of the name struts-plugin.xml, skipping 五月 07, 2021 6:17:49 下午 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info 信息: Parsing configuration file [struts-plugin.xml] 五月 07, 2021 6:17:49 下午 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info 信息: Parsing configuration file [struts.xml] 五月 07, 2021 6:17:50 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。 五月 07, 2021 6:17:51 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。 五月 07, 2021 6:17:52 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。 五月 07, 2021 6:17:52 下午 org.apache.catalina.core.ContainerBase startInternal 严重: 子容器启动失败 java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/4]] at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:772) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473) Caused by: org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/4]] at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) ... 21 more Caused by: java.lang.NoClassDefFoundError: HttpServletRequest at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.getDeclaredMethods(Class.java:1975) at org.apache.catalina.util.Introspection.getDeclaredMethods(Introspection.java:121) at org.apache.catalina.startup.WebAnnotationSet.loadMethodsAnnotation(WebAnnotationSet.java:285) at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:138) at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:69) at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:332) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:989) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5077) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ... 27 more Caused by: java.lang.ClassNotFoundException: HttpServletRequest at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1364) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1187) ... 40 more 五月 07, 2021 6:17:52 下午 org.apache.catalina.core.ContainerBase startInternal 严重: 子容器启动失败 java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/8.03]] at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:772) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473) Caused by: org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/8.03]] at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) ... 21 more Caused by: java.lang.NoClassDefFoundError: HttpServletRequest at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.getDeclaredMethods(Class.java:1975) at org.apache.catalina.util.Introspection.getDeclaredMethods(Introspection.java:121) at org.apache.catalina.startup.WebAnnotationSet.loadMethodsAnnotation(WebAnnotationSet.java:285) at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:138) at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:69) at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:332) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:989) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5077) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ... 27 more Caused by: java.lang.ClassNotFoundException: HttpServletRequest at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1364) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1187) ... 40 more 五月 07, 2021 6:17:52 下午 org.apache.catalina.core.ContainerBase startInternal 严重: 子容器启动失败 java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: 子容器启动失败 at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:772) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473) Caused by: org.apache.catalina.LifecycleException: 子容器启动失败 at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) ... 13 more Caused by: org.apache.tomcat.util.MultiThrowable: 2 wrapped Throwables: [org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/4]]][org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/8.03]]] at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:920) ... 21 more 五月 07, 2021 6:17:52 下午 org.apache.catalina.startup.Catalina start 严重: 所必需的服务组件启动失败,所以无法启动Tomcat org.apache.catalina.LifecycleException: 子容器启动失败 at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:772) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473) Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: 子容器启动失败 at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916) ... 13 more Caused by: org.apache.catalina.LifecycleException: 子容器启动失败 at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) ... 13 more Caused by: org.apache.tomcat.util.MultiThrowable: 2 wrapped Throwables: [org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/4]]][org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/8.03]]] at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:920) ... 21 more 五月 07, 2021 6:17:52 下午 org.apache.coyote.AbstractProtocol pause 信息: 暂停ProtocolHandler["http-nio-8181"] 五月 07, 2021 6:17:52 下午 org.apache.catalina.core.StandardService stopInternal 信息: 正在停止服务[Catalina] 五月 07, 2021 6:17:52 下午 org.apache.coyote.AbstractProtocol destroy 信息: 正在摧毁协议处理器 ["http-nio-8181"]  

  • 2

    回答

  • 12

    浏览

如图 此按照提供的视频调整,缺留下这一个错误 视频里却正常运行。想请问是是什么问题  

  • 2

    回答

  • 14

    浏览

写一个接口读取word内容的全过程,怎么实现?

回答 java_empty
采纳率0%
4小时前
  • 0

    回答

  • 7

    浏览

BinaryTree<String> bitree = new BinaryTree<String>(prelist);     System.out.println("本程序功能菜单如下,请输入:");     System.out.println("1——先序遍历");     System.out.println("2——中序遍历");     System.out.println("3——后序遍历");     System.out.println("4——层次遍历");     System.out.println("5——求结点总数");     System.out.println("6——求高度");     System.out.println("0——退出");

回答 gzcqdl
采纳率0%
6小时前
  • 3

    回答

  • 13

    浏览

如果地图上的墙与敌人能算成一个类,方法不一样。如何让地图跟随玩家移动? 定义不同场景的状态不同为 int STA ,起始STA=0。 If(STA==0){//绘制场景1,A键清除绘制并令STA=1} 进而如此来加载下场一景,思路如何?

  • 1

    回答

  • 16

    浏览

import java.util.Scanner; public class BinaryTree { public static void main(String arges[]) { Scanner reader = new Scanner(System.in); System.out.print("请输入结点个数: "); int number = reader. nextInt() ; System. out. print("请输入各个结点数据:"); int t=0; String[] prelist = new String[number] ; for (t = 0;t<number; t++) { prelist[t] = reader. next() ;} BinaryTree<String>bitree=new BinaryTree<String>(prelist); System.out.println("菜单如下:"); System.out.println("1——先序遍历"); System.out.println("2——中序遍历"); System.out.println("3——后序遍历"); System.out.println("4——层次遍历"); System.out.println("5——求结点总数"); System.out.println("6——求高度"); System.out.println("0——退出"); int num=-1; while(num!=0) { num=reader.nextInt(); if(num==-1) { bitree.preOrder();} else { if(num==2) { bitree.inOrder(); } else { if(num==3) { bitree.postOrder(); } else { if(num==4) { bitree.levelOrder(); }else { if(num==5) { System.out.println("二叉树结点数:"+bitree.count()); }else { if(num==6) { System.out.println("二叉树高度:"+bitree.height()); } else { System.out.println("输入值超出范围"); } } } } } } }if(num==0) { System.out.println("退出程序"); } } }

回答 huashishuai89
采纳率100%
22小时前
  • 4

    回答

  • 24

    浏览

//这个是测试的代码块 package dao.impl; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; import pojo.User; @SuppressWarnings("unused") class UserDaoTest { UserDao userDao=new UserDaoImpl(); @Test void testQueryUserByusername() { //fail("Not yet implemented"); if(userDao.queryUserByusername("admin123")==null) { System.out.println("用户名可用!"); } else { System.out.println("用户名已存在!"); } } @Test void testQueryUserByusernameAndpassword() { //fail("Not yet implemented"); if(userDao.queryUserByusernameAndpassword("admin","admin123")==null) {System.out.println("用户名或密码错误!登录失败!"); } else { System.out.println("查询成功!"); } } @Test void testSaveUser() { //fail("Not yet implemented"); //System.out.println(userDao.saveUser(new User(null,"admins","12d2888","w17f8@qq.com"))); System.out.println( userDao.saveUser(new User(null,"wzg168", "123456", "wzg168@qq.com"))); } } package dao.impl; import java.sql.Connection; import java.sql.SQLException; import java.util.List; import org.apache.commons.dbutils.QueryRunner; import org.apache.commons.dbutils.handlers.BeanHandler; import org.apache.commons.dbutils.handlers.BeanListHandler; import org.apache.commons.dbutils.handlers.ScalarHandler; import org.apache.jasper.compiler.NewlineReductionServletWriter; import utils.JdbcUtilss; @SuppressWarnings("unused") public abstract class BaseDao { //使用Jdbcutilss来操作数据库 private QueryRunner queryRunner=new QueryRunner(); //使用update方法执行insert和update与delete操作 public int update(String sql,Object...args) { Connection connection=JdbcUtilss.getConnection(); try { return queryRunner.update(connection, sql, args); //return queryRunner.update(connection,sql,args); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally { JdbcUtilss.close(connection); } return -1; } /** * 查询返回一个 javaBean 的 sql 语句 * * @param type 返回的对象类型 * @param sql 执行的 sql 语句 * @param args sql 对应的参数值 * @param <T> 返回的类型的泛型 * @return * @return */ public <T> T queryForOne(Class<T>type,String sql,Object...args){ Connection conn=JdbcUtilss.getConnection(); try { return queryRunner.query(conn, sql, new BeanHandler<T>(type), args); } catch (Exception e) { // TODO: handle exception } finally { JdbcUtilss.close(conn); } return null; } /** * 查询返回多个 javaBean 的 sql 语句 * * @param type 返回的对象类型 * @param sql 执行的 sql 语句 * @param args sql 对应的参数值 * @param <T> 返回的类型的泛型 * @return */ public <T> List<T> queryForList(Class<T>type,String sql,Object...args){ Connection conn=JdbcUtilss.getConnection(); try { return queryRunner.query(conn, sql, new BeanListHandler<T>(type), args); } catch (Exception e) { // TODO: handle exception } finally { JdbcUtilss.close(conn); } return null; } //返回执行一个一行一列; public Object quarForStringValue(String sql,Object...args) { Connection con=JdbcUtilss.getConnection(); try { return queryRunner.query(con, sql, new ScalarHandler(),args); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { JdbcUtilss.close(con); } return null; } }     //接口 package dao.impl; import pojo.User; public interface UserDao { public User queryUserByusername(String username); //public User queryUserByUsername(String username); public User queryUserByusernameAndpassword(String username,String password); public int saveUser(User user); } package dao.impl; import pojo.User; public class UserDaoImpl extends BaseDao implements UserDao{ @Override public User queryUserByusername(String username) { // TODO Auto-generated method stub String sql="select`id`,`username`,`password`,`email` from t_user where username= ?"; return queryForOne(User.class, sql, username); } @Override public User queryUserByusernameAndpassword(String username, String password) { String sql="select`id`,`username`,`password`,`email` from t_user where username = ? and password = ?"; // TODO Auto-generated method stub return queryForOne(User.class, sql, username,password); } @Override public int saveUser(User user) { // TODO Auto-generated method stub /* * String sql="insert into t_user(`username`,`password`,`email`)value(?,?,?)"; * return update(sql, user.getUsername(),user.getPassword(),user.getEmail()); */ String sql = "insert into t_user(`username`,`password`,`email`)values(?,?,?)"; //return update(sql, user.getUsername(),user.getPassword(),user.getEmail()); return update(sql, user.getUsername(),user.getPassword(),user.getEmail()); } }   //类User package pojo; public class User { private Integer id; private String username; private String password; private String email; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } @Override public String toString() { return "User [id=" + id + ", username=" + username + ", password=" + password + ", email=" + email + ", getId()=" + getId() + ", getUsername()=" + getUsername() + ", getPassword()=" + getPassword() + ", getEmail()=" + getEmail() + ", getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()=" + super.toString() + "]"; } public User() { } public User(Integer id, String username, String password, String email) { super(); this.id = id; this.username = username; this.password = password; this.email = email; } }  

  • 5

    回答

  • 21

    浏览

WARN ClassPathXmlApplicationContext:551 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.zhanglv.user.service.UserService': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/framework/AopProxyUtils Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.zhanglv.user.service.UserService': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/framework/AopProxyUtils     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)     at com.zhanglv.myTest.MainOfTest1.main(MainOfTest1.java:14) Caused by: java.lang.NoClassDefFoundError: org/springframework/aop/framework/AopProxyUtils     at org.springframework.context.event.AbstractApplicationEventMulticaster.addApplicationListener(AbstractApplicationEventMulticaster.java:105)     at org.springframework.context.support.AbstractApplicationContext.addApplicationListener(AbstractApplicationContext.java:494)     at org.springframework.context.support.ApplicationListenerDetector.postProcessAfterInitialization(ApplicationListenerDetector.java:78)     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:423)     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1633)     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)     ... 11 more  

  • 2

    回答

  • 30

    浏览

这是个错误的时序图,要求是根据这个错误的时序图利用eclipse 或者 intenllij 来写出大致的代码(不知道的条件可以设为空白,例如返回值可以是null或者0)大神们帮帮忙,急用,有重谢

  • 4

    回答

  • 50

    浏览

  大佬们有知道这是什么原因吗? 这是GameCharacter的代码部分 序列化了,这个class运行也是同样的错误 刚开始用eclipse不太懂怎么回事   是因为我eclipse用的JavaEE的环境吗? 我在notepad里面就可以正常运行

  • 0

    回答

  • 14

    浏览

引用自己下载的echarts.min.js(饼图 雷达图 仪表盘)以后,wordcloud就不显示了,请问怎么解决? 引用之前: 引用之后: f12控制台:  

  • 5

    回答

  • 24

    浏览

import java.util.List; import java.util.Map; import com.entity.Chufangmoban; public interface ChufangmobanMapper {     int deleteByPrimaryKey(Integer id);     int insert(Chufangmoban record);     int insertSelective(Chufangmoban record);     Chufangmoban selectByPrimaryKey(Integer id);     int updateByPrimaryKeySelective(Chufangmoban record);          int updateByPrimaryKey(Chufangmoban record);     public Chufangmoban quchongChufangmoban(Map<String, Object> chufang);     public List<Chufangmoban> getAll(Map<String, Object> map);     public List<Chufangmoban> getsychufangmoban1(Map<String, Object> map);     public List<Chufangmoban> getsychufangmoban3(Map<String, Object> map);     public List<Chufangmoban> getsychufangmoban2(Map<String, Object> map);     public int getCount(Map<String, Object> po);     public List<Chufangmoban> getByPage(Map<String, Object> map);     public List<Chufangmoban> select(Map<String, Object> map); //    所有List }

  • 5

    回答

  • 63

    浏览

求北交的好人给一下project的代码吧,孩子实在写不出来了,就是Bank的那个 坐等好人出xian

回答 卿涸
采纳率0%
2天前
  • 1

    回答

  • 6

    浏览

错误提示如下: D:\ProgramFiles\eclipse-hadoop3x-master\src\contrib\eclipse-plugin> ant jar -Dhadoop.version=3.1.3 -Declipse.home=D:\ProgramFiles\eclipse\ -Dhadoop.home=D:\ProgramFiles\hadoop-3.1.3\hadoop-3.1.3\ Buildfile: D:\ProgramFiles\eclipse-hadoop3x-master\src\contrib\eclipse-plugin\build.xml compile:      [echo] contrib: eclipse-plugin jar: BUILD FAILED Target "3.1.3" does not exist in the project "eclipse-plugin".   但我查看我的目录eclipse-plugin,下面已经生成了hadoop-eclipse-plugin-3.1.3.jar文件。 我的build.xml内容如下: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project default="jar" name="eclipse-plugin"> <import file="../build-contrib.xml"/> <path id="eclipse-sdk-jars"> <fileset dir="${eclipse.home}/plugins/"> <include name="org.eclipse.ui*.jar"/> <include name="org.eclipse.jdt*.jar"/> <include name="org.eclipse.core*.jar"/> <include name="org.eclipse.equinox*.jar"/> <include name="org.eclipse.debug*.jar"/> <include name="org.eclipse.osgi*.jar"/> <include name="org.eclipse.swt*.jar"/> <include name="org.eclipse.jface*.jar"/> <include name="org.eclipse.team.cvs.ssh2*.jar"/> <include name="com.jcraft.jsch*.jar"/> </fileset> </path> <path id="hadoop-sdk-jars"> <fileset dir="${hadoop.home}/share/hadoop/mapreduce"> <include name="hadoop*.jar"/> </fileset> <fileset dir="${hadoop.home}/share/hadoop/hdfs"> <include name="hadoop*.jar"/> </fileset> <fileset dir="${hadoop.home}/share/hadoop/common"> <include name="hadoop*.jar"/> </fileset> </path> <!-- Override classpath to include Eclipse SDK jars --> <path id="classpath"> <pathelement location="${build.classes}"/> <!--pathelement location="${hadoop.root}/build/classes"/--> <path refid="eclipse-sdk-jars"/> <path refid="hadoop-sdk-jars"/> <!-- new add --> <fileset dir="${hadoop.root}"> <include name="**/*.jar" /> </fileset> </path> <!-- Skip building if eclipse.home is unset. --> <target name="check-contrib" unless="eclipse.home"> <property name="skip.contrib" value="yes"/> <echo message="eclipse.home unset: skipping eclipse plugin"/> </target> <target name="compile" unless="skip.contrib"> <!--<target name="compile" depends="init, ivy-retrieve-common" unless="skip.contrib">--> <echo message="contrib: ${name}"/> <javac encoding="${build.encoding}" srcdir="${src.dir}" includes="**/*.java" destdir="${build.classes}" debug="${javac.debug}" deprecation="${javac.deprecation}" includeantruntime="on"> <classpath refid="classpath"/> </javac> </target> <!-- Override jar target to specify manifest --> <target name="jar" depends="compile" unless="skip.contrib"> <mkdir dir="${build.dir}/lib"/> <copy todir="${build.dir}/lib/" verbose="true"> <fileset dir="${hadoop.home}/share/hadoop/mapreduce"> <include name="hadoop*.jar"/> </fileset> </copy> <copy todir="${build.dir}/lib/" verbose="true"> <fileset dir="${hadoop.home}/share/hadoop/common"> <include name="hadoop*.jar"/> </fileset> </copy> <copy todir="${build.dir}/lib/" verbose="true"> <fileset dir="${hadoop.home}/share/hadoop/hdfs"> <include name="hadoop*.jar"/> </fileset> </copy> <copy todir="${build.dir}/lib/" verbose="true"> <fileset dir="${hadoop.home}/share/hadoop/yarn"> <include name="hadoop*.jar"/> </fileset> </copy> <copy todir="${build.dir}/classes" verbose="true"> <fileset dir="${root}/src/java"> <include name="*.xml"/> </fileset> </copy> <copy file="${hadoop.home}/share/hadoop/common/lib/protobuf-java-${protobuf.version}.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/log4j-${log4j.version}.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/commons-cli-${commons-cli.version}.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/commons-configuration2-2.1.1.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/commons-lang3-3.7.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/commons-collections-${commons-collections.version}.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/jackson-core-asl-${jackson.version}.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/jackson-mapper-asl-${jackson.version}.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/slf4j-log4j12-${slf4j-log4j12.version}.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/slf4j-api-${slf4j-api.version}.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/guava-${guava.version}.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/hadoop-auth-${hadoop.version}.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/netty-${netty.version}.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/javax.servlet-api-3.1.0.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/commons-io-2.5.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/htrace-core4-${htrace.version}.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/woodstox-core-5.0.3.jar" todir="${build.dir}/lib" verbose="true"/> <copy file="${hadoop.home}/share/hadoop/common/lib/stax2-api-3.1.4.jar" todir="${build.dir}/lib" verbose="true"/> <jar jarfile="${build.dir}/hadoop-${name}-${hadoop.version}.jar" manifest="${root}/META-INF/MANIFEST.MF"> <manifest> <attribute name="Bundle-ClassPath" value="classes/, lib/hadoop-mapreduce-client-core-${hadoop.version}.jar, lib/hadoop-mapreduce-client-common-${hadoop.version}.jar, lib/hadoop-mapreduce-client-jobclient-${hadoop.version}.jar, lib/hadoop-auth-${hadoop.version}.jar, lib/hadoop-common-${hadoop.version}.jar, lib/hadoop-hdfs-${hadoop.version}.jar, lib/protobuf-java-${protobuf.version}.jar, lib/log4j-${log4j.version}.jar, lib/commons-cli-${commons-cli.version}.jar, lib/commons-configuration2-2.1.1.jar, lib/commons-httpclient-${commons-httpclient.version}.jar, lib/commons-lang3-3.7.jar, lib/commons-collections-${commons-collections.version}.jar, lib/jackson-core-asl-${jackson.version}.jar, lib/jackson-mapper-asl-${jackson.version}.jar, lib/slf4j-log4j12-${slf4j-log4j12.version}.jar, lib/slf4j-api-${slf4j-api.version}.jar, lib/guava-${guava.version}.jar, lib/hadoop-auth-${hadoop.version}.jar, lib/netty-${netty.version}.jar, lib/javax.servlet-api-3.1.0.jar, lib/commons-io-2.5.jar, lib/woodstox-core-5.0.3.jar, lib/stax2-api-3.1.4.jar"/> </manifest> <fileset dir="${build.dir}" includes="classes/ lib/"/> <!--fileset dir="${build.dir}" includes="*.xml"/--> <fileset dir="${root}" includes="resources/ plugin.xml"/> </jar> </target> </project> build-contrib文件下添加了如下内容: eclipse.home、hadoop.home、hadoop.version、hadoop.root是我添加的内容 <property name="eclipse.home" location="D:\ProgramFiles\eclipse"/> <property name="hadoop.home" location="D:\ProgramFiles\hadoop-3.1.3\hadoop-3.1.3"/> <property name="hadoop.version" value="3.1.3"/> <property name="name" value="${ant.project.name}"/> <property name="root" value="${basedir}"/> <!--property name="hadoop.root" location="${root}/../../../"/--> <property name="hadoop.root" location="D:\ProgramFiles\eclipse-hadoop3x-master"/> libraries.properties文件中相应的版本号也都更改了:部分内容如下: # This is the version of hadoop we are generating hadoop.version=3.1.3 hadoop-gpl-compression.version=0.1.0 #These are the versions of our dependencies (in alphabetical order) apacheant.version=1.10.10 ant-task.version=2.0.10 asm.version=3.2 aspectj.version=1.6.5 aspectj.version=1.6.11 checkstyle.version=4.2 commons-cli.version=1.2 commons-codec.version=1.4 commons-collections.version=3.2.2 commons-configuration.version=2.1.1 commons-daemon.version=1.0.13 commons-httpclient.version=3.0.1 commons-lang.version=2.6 commons-logging.version=1.0.4 commons-logging-api.version=1.0.4 commons-math.version=3.11 commons-el.version=1.0 commons-fileupload.version=1.2 commons-io.version=2.1 commons-net.version=3.1 core.version=3.1.1 coreplugin.version=1.3.2 请哪位大咖知道的帮忙看一下,感谢。

  • 5

    回答

  • 47

    浏览

温度数据如图  时间是datetime类型的,设想的是有没有一种方法可以把minute相同的都合并,再把second都置0,但是不知道怎么实现,这些数据缺失值较少,基本每分钟都有数据,但极端值、异常值较多,主要想得到一批等间隔的温度数据方便画时间序列折线图,有没有什么办法?想得到的结果像下面这图  

  • 1

    回答

  • 35

    浏览

如题,在Java编程中,如何获取MQTT broker上指定topic的消息,不是print模式,是要用get方法得到这个信息内容。并且能够用构造器获得topic这个string。用哪一个Java代码来实现?最好是举个例子。 我知道有个命令就是callback, 但是不会用。因为如果调用public void messageArrived, 我需要输入String s还有mqttMessage。我的目标就是获取指定topic的mqttMessage,所以感觉这个代码不对,请大神指点一下。 public class SimpleMqttCallBack implements MqttCallback { public void connectionLost(Throwable throwable) { System.out.println("Connection to MQTT broker lost!"); } public void messageArrived(String s, MqttMessage mqttMessage) throws Exception { System.out.println("Message received:\n\t"+ new String(mqttMessage.getPayload()) ); } public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) { // not used in this example } }  

  • 4

    回答

  • 48

    浏览

环境: windows10    eclipse202012    jdk12   maven3.5.3/3.6.3 问题描述: maven配置好环境变量 cmd运行成功后,修改路径并使用eclipse配置,更新本地仓库索引会报错: (因为使用时搜索不到本地仓库里的jar包,所以引出了这个问题  查了好久都没看到解决方法甚至相关问题看到的都很少  ) Reindexing error      java.nio.channels.OverlappingFileLockException  

  • 4

    回答

  • 18

    浏览

最近需要做一个跟机器人有关的项目,因为需要的地图比较大,所以我在项目里添加了横向滚动条和纵向滚动条,现在我希望视野里始终能看到机器人(随着机器人的移动,地图自动跟着移动,滚动条按照机器人横向和纵向移动的速度自动移动),我到底应该怎么编程?希望各位大佬帮帮我

  • 7

    回答

  • 30

    浏览

  public class ProjectDemo { public static void main(String[] args) { Resource res = new Resource(); AddThread at = new AddThread(res); SubThread st = new SubThread(res); new Thread(at, "加法线程-A")。start(); new Thread(st, "减法线程-B")。start(); new Thread(at, "加法线程-X")。start(); new Thread(st, "减法线程-Y")。start(); } } class Resource{ //定义一个操作的资源 private int num; //要进行加减操作的数据 private boolean flag = true; //加减的切换 //flag:true 可以进行加操作,不能进行减操作 //flag:false 可以进行减操作,不能进行加操作 public synchronized void add() throws Exception{ //执行加法操作 Thread.sleep(100); //加入延迟便于观察问题 this.num++; System.out.println("【加法操作" + Thread.currentThread().getName() + "】num = " + this.num); } public synchronized void sub() throws Exception{ //执行减法操作 Thread.sleep(200); this.num--; System.out.println("【减法操作" + Thread.currentThread().getName() + "】num = " + this.num); } } class AddThread implements Runnable{ private Resource resource; public AddThread(Resource resource) { this.resource = resource; } @Override public void run() { for(int x=0; x<50; x+=) { try { this.resource.add(); } catch (InterruptedException e) { e.printStackTrace(); } } } } class SubThread implements Runnable{ private Resource resource; public AddThread(Resource resource) { this.resource = resource; } @Override public void run() { for(int x=0; x<50; x++) { try { this.resource.sub(); } catch (InterruptedException e) { e.printStackTrace(); } } } } 用的是eclipse,提示说the type Runnable cannot be the superinterface of AddThread, a superinterface must be a interface. 求大家指教 ,谢谢

  • 0

    回答

  • 4

    浏览

错误信息中显示 找不到 default 流id  但是报错之后的地方依然能正常得到信息

回答 zhouwhui
采纳率0%
5天前
  • 4

    回答

  • 31

    浏览

求斐波那契数后四位数时,输入的n比较小时结果相同,稍微大点先求模和后求模结果不一样,比如我输入的1000,一个输出7771,一个输出8875,其中8875是正确的

  • 2

    回答

  • 34

    浏览

  • 5

    回答

  • 21

    浏览

public <T> List<T> queryForList(Class<T> type, String sql,Object ...args){         Connection con = JdbcUtils.getConnection();         try {             return queryRunner.query(con,sql,new BeanListHandler<T>(type),args);         } catch (SQLException e) {             // TODO Auto-generated catch block             e.printStackTrace();         }finally{             JdbcUtils.close(con);         }         return null;              }  

  • 5

    回答

  • 34

    浏览

JAVA生成6*6宫格并随机编号1-36小游戏,必须依次点击宫格才能显示弹窗“游戏完毕”,并记录时间。

  • 4

    回答

  • 29

    浏览

报错信息↓: 项目结构↓: UserService代码↓: package main.webapp.service; import main.webapp.dao.UserDao; import main.webapp.po.User; public interface UserService extends UserDao { /** *用户是否重复 */ public boolean isReg(User user); } UseService代码↓:   package main.webapp.service; import main.webapp.dao.UserDao; import main.webapp.po.User; public interface UserService extends UserDao { /** *用户是否重复 */ public boolean isReg(User user); } index代码↓: <%@ page import="main.*" %> <%@ page import="java.sql.*" %> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>login</title> </head> <body> <% request.setCharacterEncoding("UTF-8"); String uName = request.getParameter("name");//获取name值 String uPwd = request.getParameter("pwd");//获取pwd值 UserService userService = new UserServiceImpl(); User user=userService.findUser(new User(uName,uPwd));//调用findUser方法,用户登录 if(user!=null){//登录成功 session.setAttribute("info", user); //设置session值,自己要的数据什么的放在session里面传来传去 response.sendRedirect("success.jsp"); }else{//登录失败 response.sendRedirect("login.jsp"); } %> </body> </html>  

  • 4

    回答

  • 55

    浏览

刚学了java不久,今天照着书上的代码敲了一遍就出现了图一的问题,虽然图三可以解决,但是教材上的代码都是继承的Exception,所以想知道这是什么问题,求大佬解答

  • 3

    回答

  • 9

    浏览

Wso2编译报错,两天了,有没有大神指点一下