Exception in thread "main" java.lang.NoClassDefFoundError,有导入对应jar包,但显示无法找到对应类? 5C

spring项目,main函数中调用ApplicationContext类


import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml");
        TextEditor te = (TextEditor) context.getBean("textEditor");
        te.spellCheck();    
    }
}

也有导入相应jar包

图片说明

但是运行后会提示

图片说明

且报错如下

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 7 more

请问应如何解决呢?

3个回答

NoClassDefFoundError发生在JVM在动态运行,建议作者clean项目后重新编译一下试试。

weixin_44708092
weixin_44708092 回复qq_36074361: 请问解决了吗
大约一年之前 回复
qq_36074361
qq_36074361 并不是欸T T
一年多之前 回复
qq_34872748
L星火燎原 回复qq_36074361: 你的包是不是maven管理的??如果是,那么请试试maven clean和maven install 命令看看
一年多之前 回复
qq_36074361
qq_36074361 您好,clean之后似乎没有解决问题呐
一年多之前 回复

这个是JVM的问题,而不是JAR包的问题,通常情况下可以通过直接安装STS的方法解决(省的做这做那),只要配置好JAVA环境变量就行。

qq_38310070
???.BMP 回复qq_36074361: 这就触及到我的知识盲区了
一年多之前 回复
qq_36074361
qq_36074361 您好,STS里面运行确实是没有问题的:-),但如果是JVM问题的话我其他spring项目为什么又是可以运行的呢
一年多之前 回复

jave 环境不布配

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Exception in thread "main" java.lang.NullPointerException

import org.apache.commons.io.FileUtils; import org.json.JSONException; import org.json.JSONObject; public class ReadJSONSample { public static void main(String[] args) throws IOException, JSONException { File file = new File(ReadJSONSample.class.getResource("/wangxiaoer.json").toString()); String content = FileUtils.readFileToString(file); JSONObject jsonObject = new JSONObject(content); System.out.println("姓名是:"+jsonObject.getString("name")); } } 控制台运行后报错 Exception in thread "main" java.lang.NullPointerException at json.ReadJSONSample.main(ReadJSONSample.java:13)

运行hive出现的错误Exception in thread "main" java.lang.ClassNotFoundException: org.apache.hive.beeline.HiveSchemaTool

``` [root@bigdata113 bin]# ./schematool -dbType mysql -initSchema Exception in thread "main" java.lang.ClassNotFoundException: org.apache.hive.beeline.HiveSchemaTool at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.apache.hadoop.util.RunJar.run(RunJar.java:214) at org.apache.hadoop.util.RunJar.main(RunJar.java:136) ``` 求怎么jie'ju

java程序编译成功但运行不了(Exception in thread "main" java.lang.IllegalArgumentException

D:\work>javac JComboBoxDemo.java D:\work>java JComboBoxDemo Exception in thread "main" java.lang.IllegalArgumentException: adding container' s parent to itself at java.awt.Container.checkAddToSelf(Unknown Source) at java.awt.Container.addImpl(Unknown Source) at java.awt.Container.add(Unknown Source) at JComboBoxDemo.go(JComboBoxDemo.java:61) at JComboBoxDemo.main(JComboBoxDemo.java:12) D:\work> 以上是我的程序运行情况,如有你知道点什么,给我留言 附件是我的java程序

linux中运行jar包Exception in thread "main" java.lang.ClassNotFoundException

Exception in thread "main" java.lang.ClassNotFoundException: com.tiger.hbasemr.dame01.HBase2HbaseMain at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.apache.hadoop.util.RunJar.run(RunJar.java:214) at org.apache.hadoop.util.RunJar.main(RunJar.java:136) 查到的方法几乎都试过了还是不行![图片说明] (https://img-ask.csdn.net/upload/201910/15/1571114983_418541.png)![图片说明](https://img-ask.csdn.net/upload/201910/15/1571114996_85366.png)![图片说明](https://img-ask.csdn.net/upload/201910/15/1571115003_36300.png)

xml出现Exception in thread "main" java.lang.NullPointerException怎么解决

## 运行代码出现Exception in thread "main" java.lang.NullPointerException ![图片说明](https://img-ask.csdn.net/upload/202003/05/1583381600_143599.png)![图片说明](https://img-ask.csdn.net/upload/202003/05/1583381609_587656.png) JsoupDemo1.java代码如下: ``` package study.java.xml.jsoup; /* * Jsoup快速入门 * */ import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import java.io.File; import java.io.IOException; public class JsoupDemo1 { public static void main(String[] args) throws IOException { //2.1获取student.xml的path String path = JsoupDemo1.class.getClassLoader().getResource("src\\student.xml").getPath(); //上面的student.xml是已经写好的xml文件 //2.2解析xml文档,加载文档进内存,获取dom树--->Document Document document = Jsoup.parse(new File(path), "UTF-8"); //3.获取xml文档里面的元素标签对象 Element-----name Elements elements = document.getElementsByTag("name"); System.out.println(elements.size()); //3.1获取第一个name的Element对象 Element element = elements.get(0); //3.2获取数据 String name = element.text(); System.out.println(name); } } ``` student.xml代码如下: ``` <?xml version="1.0" encoding="UTF-8" ?> <students> <student number="heima_0001"> <name>zhangsan</name> <age>11</age> <sex>male</sex> </student> <student number="heima_0002"> <name>lisi</name> <age>44</age> <sex>female</sex> </student> </students> ```

es 连接错误 Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE

报错信息如下 ``` Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:146) at io.searchbox.client.config.HttpClientConfig$Builder.build(HttpClientConfig.java:285) ```

Exception in thread "main" java.lang.AbstractMethodError

Class.forName("com.mysql.jdbc.Driver"); connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/testjdbc", "root", "123456"); ps = connection.prepareStatement("INSERT into t_user (username,myinfo) VALUES(?,?)"); ps.setString(1, "mm"); ps.setClob(2, new FileReader(new File("d:/a.txt"))); ps.executeUpdate();

Exception in thread "main" java.awt.HeadlessException

請問解決以下報錯的方法: Exception in thread "main" java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204) at java.awt.Window.<init>(Window.java:536) at java.awt.Frame.<init>(Frame.java:420) at java.awt.Frame.<init>(Frame.java:385) at javax.swing.JFrame.<init>(JFrame.java:189) at com.stepforward.Mirrorworld.P4_View.Thing_Manager_View.<init>(Thing_Manager_View.java:68) at com.stepforward.Mirrorworld.P2_Base_Bean.Thing_Manager_Service.Set_visible(Thing_Manager_Service.java:33) at com.stepforward.Mirrorworld.MirrorworldApplication.main(MirrorworldApplication.java:24) 背景: 我計劃把已在開發的非web工程轉換成web工程,我打算分兩步實施:先將非web工程搬到spring boot架構上,然後再來開發表示層組件。

Exception in thread "main" java.lang.NoClassDefFoundError:

这是我的java代码,用于Mapreduce打包,至于Linux里。 import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.mapreduce.Reducer; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import java.io.IOException; public class WordCountAPP { public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException { if(args.length == 0){ args = new String[]{"/wordcount.txt","/wordcount-result"}; } Configuration conf=new Configuration(); Job job=Job.getInstance(conf,WordCountMap.class.getName()); //打成jar包运行 job.setJarByClass(WordCountMap.class); //数据来自哪里 FileInputFormat.setInputPaths(job,args[0]); //使用哪个mapper处理输入的数据 job.setMapperClass(WordCountMap.class); //map输出的数据类型是什么 job.setMapOutputKeyClass(Text.class); job.setMapOutputValueClass(LongWritable.class); //使用哪个reducer处理输出的数据 job.setReducerClass(WordCountReduce.class); //reduce输出数据的类型是什么 job.setOutputKeyClass(Text.class); job.setOutputValueClass(LongWritable.class); //数据输出到哪里 FileOutputFormat.setOutputPath(job,new Path(args[1])); //交给yarn去执行,直到执行结束后才退出本程序 job.waitForCompletion(true); } public static class WordCountMap extends Mapper<LongWritable,Text,Text,LongWritable> { @Override public void map(LongWritable key, Text value, Mapper<LongWritable,Text,Text,LongWritable>.Context context) throws IOException, InterruptedException { String line=value.toString(); String[] splited=line.split(" "); for(String word: splited){ context.write(new Text(word),new LongWritable(1)); } } } public static class WordCountReduce extends Reducer<Text,LongWritable,Text,LongWritable> { @Override public void reduce(Text key, Iterable<LongWritable> values, Reducer<Text,LongWritable,Text,LongWritable>.Context context) throws IOException, InterruptedException { long count=0L; for (LongWritable v:values){ count+=v.get(); } LongWritable v2=new LongWritable(count); context.write(key,v2); } } } 这是运行后报的错 Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration at WordCountAPP.main(WordCountAPP.java:17) Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.conf.Configuration at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 1 more

Exception in thread "Thread-12" java.lang.RuntimeException: java.lang.NullPointerException

第一次着手项目,springboot+mybatis,项目搭建是跟着教程做的。项目搭建好之后项目能正常运行,但是启动后报: Exception in thread "Thread-12" java.lang.RuntimeException: java.lang.NullPointerException at com.mysql.jdbc.JDBC4Connection$1$1.run(JDBC4Connection.java:106) Caused by: java.lang.NullPointerException at com.mysql.jdbc.ConnectionImpl.abortInternal(ConnectionImpl.java:1240) at com.mysql.jdbc.JDBC4Connection$1$1.run(JDBC4Connection.java:104) 启动Console: 2019-08-05 10:29:12.921 INFO 7416 --- [ restartedMain] com.xintujiuzhang.aimanagement.App : Starting App on DESKTOP-J57CTN6 with PID 7416 (D:\JAVA\eclipse\TaxHandwritingRecognition\target\classes started by Administrator in D:\JAVA\eclipse\TaxHandwritingRecognition) 2019-08-05 10:29:12.921 INFO 7416 --- [ restartedMain] com.xintujiuzhang.aimanagement.App : No active profile set, falling back to default profiles: default 2019-08-05 10:29:12.958 INFO 7416 --- [ restartedMain] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@6070b0bb: startup date [Mon Aug 05 10:29:12 CST 2019]; root of context hierarchy 2019-08-05 10:29:13.450 INFO 7416 --- [ restartedMain] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from class path resource [mybatis-config.xml] 2019-08-05 10:29:13.503 INFO 7416 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'sqlSessionFactory' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=app; factoryMethodName=sqlSessionFactoryBean; initMethodName=null; destroyMethodName=(inferred); defined in com.xintujiuzhang.aimanagement.App] with [Generic bean: class [org.mybatis.spring.SqlSessionFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [mybatis-config.xml]] 2019-08-05 10:29:13.599 WARN 7416 --- [ restartedMain] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.xintujiuzhang.aimanagement]' package. Please check your configuration. 2019-08-05 10:29:13.958 INFO 7416 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$b535b905] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-08-05 10:29:14.332 INFO 7416 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2019-08-05 10:29:14.348 INFO 7416 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-08-05 10:29:14.349 INFO 7416 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.28 2019-08-05 10:29:14.355 INFO 7416 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : Loaded APR based Apache Tomcat Native library [1.2.21] using APR version [1.6.5]. 2019-08-05 10:29:14.355 INFO 7416 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 2019-08-05 10:29:14.355 INFO 7416 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 2019-08-05 10:29:14.357 INFO 7416 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : OpenSSL successfully initialized [OpenSSL 1.1.1a 20 Nov 2018] 2019-08-05 10:29:14.418 INFO 7416 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-08-05 10:29:14.418 INFO 7416 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1462 ms 2019-08-05 10:29:14.514 INFO 7416 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/] 2019-08-05 10:29:14.517 INFO 7416 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*] 2019-08-05 10:29:14.517 INFO 7416 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 2019-08-05 10:29:14.517 INFO 7416 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*] 2019-08-05 10:29:14.517 INFO 7416 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*] 2019-08-05 10:29:14.631 INFO 7416 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2019-08-05 10:29:19.625 INFO 7416 --- [ restartedMain] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 - Driver does not support get/set network timeout for connections. (com.mysql.jdbc.JDBC4Connection.getNetworkTimeout()I) 2019-08-05 10:29:19.629 INFO 7416 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2019-08-05 10:29:19.670 INFO 7416 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default' 2019-08-05 10:29:19.684 INFO 7416 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [ name: default ...] 2019-08-05 10:29:19.738 INFO 7416 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate Core {5.2.10.Final} 2019-08-05 10:29:19.739 INFO 7416 --- [ restartedMain] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found 2019-08-05 10:29:19.770 INFO 7416 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final} 2019-08-05 10:29:19.874 INFO 7416 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect 2019-08-05 10:29:19.897 INFO 7416 --- [ restartedMain] o.h.e.j.e.i.LobCreatorBuilderImpl : HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4 2019-08-05 10:29:20.037 INFO 7416 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 10:29:20,543 INFO App:32-org.springframework.orm.jpa.JpaTransactionManager 2019-08-05 10:29:20.796 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@6070b0bb: startup date [Mon Aug 05 10:29:12 CST 2019]; root of context hierarchy 2019-08-05 10:29:20.824 WARN 7416 --- [ restartedMain] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning 2019-08-05 10:29:20.846 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/application/handwriting_authorization],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.ApplicationAuthorizationController.joinHWA(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.847 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/application/handwriting_information],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.ApplicationInformationController.joinHWI(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.847 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/log/background_management_login],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.BackgroundManagementLoginController.joinHWI(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.847 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/log/computer_login],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.ComputerLoginController.jumpDEM(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.847 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/authority/department_management],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.DepartmentManagementController.jumpDEM(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.848 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/authority/dictionary_management],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.DictionaryManagementController.jumpDM(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.848 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/equipment/hardware_devices],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.EquipmentManagementController.jumpDM(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.848 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/queryGetServerStatusInterface],methods=[GET]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.xintujiuzhang.aimanagement.controller.GetServerStatusInterfaceController.queryGetServerStatus(java.lang.String,java.lang.String) 2019-08-05 10:29:20.848 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/queryHandwritingInterface],methods=[GET]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.xintujiuzhang.aimanagement.controller.HandwritingInterfaceController.queryHandwriting(java.lang.String,java.lang.String,java.lang.Integer,java.util.Date) 2019-08-05 10:29:20.849 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/identity/identity_management],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.IdentityManagementController.jumpDM(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.849 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/queryInstallationRequest],methods=[GET]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.xintujiuzhang.aimanagement.controller.InstallationRequestInterfaceController.queryInstallationRequest(java.lang.String,java.lang.String,java.lang.String) 2019-08-05 10:29:20.849 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/queryLicenseInterface],methods=[GET]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.xintujiuzhang.aimanagement.controller.LicenseInterfaceController.queryLicense(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.util.Date) 2019-08-05 10:29:20.851 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.MainController.main(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.851 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/login],methods=[GET]}" onto public org.springframework.web.servlet.ModelAndView com.xintujiuzhang.aimanagement.controller.MainController.login() 2019-08-05 10:29:20.851 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/login],methods=[POST]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.MainController.login(java.lang.String,java.lang.String,java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.851 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/main],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.MainController.jumpmain(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.852 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/authority/menu_management],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.MenuManagementController.jumpMM(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.852 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/log/module_browsing],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.ModuleBrowsingController.jumpTM(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.852 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/log/module_operation],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.ModuleOperationController.jumpMM(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.852 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/deletehandwriting],methods=[POST]}" onto public void com.xintujiuzhang.aimanagement.controller.NotesController.deletehandwriting(java.lang.String) 2019-08-05 10:29:20.852 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/updatehandwriting],methods=[POST]}" onto public void com.xintujiuzhang.aimanagement.controller.NotesController.updatehandwriting(com.xintujiuzhang.aimanagement.pojo.Handwriting) 2019-08-05 10:29:20.852 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/addhandwriting],methods=[POST]}" onto public void com.xintujiuzhang.aimanagement.controller.NotesController.addhandwriting(com.xintujiuzhang.aimanagement.pojo.Handwriting) 2019-08-05 10:29:20.853 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/querynotes],methods=[GET]}" onto public com.xintujiuzhang.aimanagement.pojo.Handwriting com.xintujiuzhang.aimanagement.controller.NotesController.querynotes(java.lang.String) 2019-08-05 10:29:20.853 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/authority/parameter_settings],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.parameterSettingsController.jumpPS(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.853 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/authority/role_authorization],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.RoleAuthorizationController.jumpRA(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.853 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/log/service_call],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.ServiceCallController.jumpRA(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.853 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/authority/task_management],methods=[GET]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.TaskManagementController.jumpTM(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.854 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/authority/user_management]}" onto public java.lang.String com.xintujiuzhang.aimanagement.controller.UserController.jnmpUM(java.util.Map<java.lang.String, java.lang.Object>) 2019-08-05 10:29:20.854 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/queryUserInterface],methods=[GET]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.xintujiuzhang.aimanagement.controller.UserInterfaceController.queryLicense(java.lang.String,java.lang.String,java.lang.Integer,java.util.Date) 2019-08-05 10:29:20.854 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/queryVersionCheckingInterface],methods=[GET]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.xintujiuzhang.aimanagement.controller.VersionCheckingInterfaceController.queryVersionChecking(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.Integer,java.util.Date) 2019-08-05 10:29:20.854 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/queryVersionupdateInterface],methods=[GET]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.xintujiuzhang.aimanagement.controller.VersionUpdateInterfaceController.queryVersionupdate(java.lang.String,java.lang.String,java.lang.String,java.util.Date) 2019-08-05 10:29:20.857 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest) 2019-08-05 10:29:20.857 INFO 7416 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) 2019-08-05 10:29:20.881 INFO 7416 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2019-08-05 10:29:20.881 INFO 7416 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2019-08-05 10:29:20.906 INFO 7416 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2019-08-05 10:29:21.115 INFO 7416 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 2019-08-05 10:29:21.164 INFO 7416 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup 2019-08-05 10:29:21.165 INFO 7416 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'dataSource' has been autodetected for JMX exposure 2019-08-05 10:29:21.170 INFO 7416 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource] 2019-08-05 10:29:21.196 INFO 7416 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2019-08-05 10:29:21.198 INFO 7416 --- [ restartedMain] com.xintujiuzhang.aimanagement.App : Started App in 8.458 seconds (JVM running for 8.828) Exception in thread "Thread-12" java.lang.RuntimeException: java.lang.NullPointerException at com.mysql.jdbc.JDBC4Connection$1$1.run(JDBC4Connection.java:106) Caused by: java.lang.NullPointerException at com.mysql.jdbc.ConnectionImpl.abortInternal(ConnectionImpl.java:1240) at com.mysql.jdbc.JDBC4Connection$1$1.run(JDBC4Connection.java:104) **在执行一些方法后“Thread-12”会不断增加** **ps:“Thread-668"**

Exception in thread "main" java.lang.NoClassDefFoundError如何解决

本人初学Hibernate框架,网络上找的视频自学的,刚刚到第一次运行文件就出现这个错误,用的是eclipse,错误代码如下: ``` Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException at org.hibernate.boot.spi.XmlMappingBinderAccess.<init>(XmlMappingBinderAccess.java:43) at org.hibernate.boot.MetadataSources.<init>(MetadataSources.java:87) at org.hibernate.cfg.Configuration.<init>(Configuration.java:123) at org.hibernate.cfg.Configuration.<init>(Configuration.java:118) at cn.ljs.text.HibernateTest.main(HibernateTest.java:13) Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source) at java.base/java.lang.ClassLoader.loadClass(Unknown Source) ... 5 more ``` 文件代码如下: ``` package cn.ljs.text; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; import cn.ljs.pojo.User; public class HibernateTest { public static void main(String[] args) { Configuration cfg=new Configuration().configure(); ServiceRegistry registry=new StandardServiceRegistryBuilder().applySettings(cfg.getProperties()).build(); SessionFactory factory=cfg.buildSessionFactory(registry); Session session=factory.openSession(); User user=(User) session.get(User.class, 1); System.out.println(user); session.close(); factory.close(); } } ``` 很简单,就是测试一下布置有没有问题 以下是包图: ![图片说明](https://img-ask.csdn.net/upload/201902/15/1550193069_565517.jpg) 跟着教学视频走的,代码无误,视频里直接输出了数据库表中的信息,而我就报错... 已自行百度后作出以下修改: ------------------------- 1.将jar包修改到classpath目录下, ![图片说明](https://img-ask.csdn.net/upload/201902/15/1550193227_189559.jpg) 无效 2.修改classpath等配置, ![图片说明](https://img-ask.csdn.net/upload/201902/15/1550193280_600490.jpg) ![图片说明](https://img-ask.csdn.net/upload/201902/15/1550193296_623025.jpg) path:D:\OracleWINDOWS.X64_180000_db_home\bin;%JAVA_HOME%\bin;%MAVEN_HOME%\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;D:\java\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\wbem 我半路出家,在外面培训班学过4个月java基础,学的是SSM框架,现在想自己拓展一下学习Hibernate,哪知道一开始就遇到这问题 o(╥﹏╥)o,请高手指点!谢谢!

Exception in thread "main" java.lang.

从svn上down下来的源码,在搭建本机环境的时候报错 ``` Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apdplat/word/analysis/TextSimilarity : Unsupported major.minor version 52.0 2 at java.lang.ClassLoader.defineClass1(Native Method) 3 at java.lang.ClassLoader.defineClass(Unknown Source) 4 at java.security.SecureClassLoader.defineClass(Unknown Source) 5 at java.net.URLClassLoader.defineClass(Unknown Source) 6 at java.net.URLClassLoader.access$100(Unknown Source) 7 at java.net.URLClassLoader$1.run(Unknown Source) 8 at java.net.URLClassLoader$1.run(Unknown Source) 9 at java.security.AccessController.doPrivileged(Native Method) 10 at java.net.URLClassLoader.findClass(Unknown Source) 11 at java.lang.ClassLoader.loadClass(Unknown Source) 12 at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) 13 at java.lang.ClassLoader.loadClass(Unknown Source) 14 at com.platform.config.run.JfinalConfig.afterJFinalStart(JfinalConfig.java:184) 15 at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:55) 16 at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119) 17 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) 18 at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724) 19 at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265) 20 at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) 21 at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706) 22 at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492) 23 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) 24 at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) 25 at org.eclipse.jetty.server.Server.doStart(Server.java:277) 26 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) 27 at com.jfinal.server.JettyServer.doStart(JettyServer.java:135) 28 at com.jfinal.server.JettyServer.start(JettyServer.java:67) 29 at com.jfinal.core.JFinal.start(JFinal.java:154) 30 at com.platform.config.run.JfinalConfig.main(JfinalConfig.java:210) ``` 在各种网站上查阅了一下,说是用低版本的JDK编译高版本的.class就会报这个错,有以下两种易发生的情况: 1,命令行输入java -version和javac -version发现版本不一致,修改之; 2,版本一致则检查Path路径,一般安装oracle的机子配置jdk的时候会覆盖路径,修改之。 但是! 一,我没有装Oracle; Path路径为: d:\data\mblog\graphicsmagick-1.3.23-q8; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; D:\jdk1.7\bin; D:\jdk1.7\jre\bin; D:\mysqlinstallation\MySQL Utilities 1.3.6\; D:\maven\apache-maven-3.3.9\bin; 二,javac -version 下是java version “1.7.0_13” java -version下是 javac 1.7.0_13 所以,现在问题会出现在哪儿呢? 我使用的是eclipse,jfinal,maven

List操作错误Exception in thread "main" java.lang.IllegalStateException

Iterator<Teacher> iter = teacherList.iterator(); while(iter.hasNext()){ Teacher teacher =iter.next(); //①查找老师的最大上限值,如果该老师已经达到上限了,则将该老师从List中拿出,不予安排 if(teacher.getMaxnum()<=teacher.getRealnum()){ iter.remove(); teacherList.remove(teacher); } //②找到该考试的时间点,如果该考试桶中存在与该老师的ID则将该老师摘除,不予考虑. if(examBarrelDao.isRelated(exam,teacher)){ iter.remove(); teacherList.remove(teacher); } } //③按照监考上限减去监考下限差额最大的顺序排列,取该老师序列的第一个为最优老师。 for(int i=0;i<teacherList.size()-1;i++){ for (int j=i+1;j<teacherList.size();j++){ Teacher teacher = new Teacher(); if(teacherList.get(i).getMaxnum()-teacherList.get(i).getRealnum() <teacherList.get(j).getMaxnum()-teacherList.get(j).getRealnum()){ teacher =teacherList.get(i); teacherList.set(i, teacherList.get(j)); teacherList.set(j, teacher); } } 我将得到的List判断以后,remove了其中的不符合条件的teacher,然后将List中剩余的teacher重新按照大小进行了一次排序,但是有时报 Exception in thread "main" java.lang.IllegalStateException at java.util.AbstractList$Itr.remove(Unknown Source) at com.sdjzglxy.jwMis.help.ConditionalJudge.listTeacher(ConditionalJudge.java:229) at com.sdjzglxy.jwMis.help.ConditionalJudge.teacherChoiceForSecond(ConditionalJudge.java:162) at com.sdjzglxy.jwMis.action.ArrayExam.arraySecondTeacher(ArrayExam.java:132) at com.sdjzglxy.jwMis.action.ArrayExam.main(ArrayExam.java:159) 有时对有时错,我想问一下,该如何解决这个问题……

Java中遇到的一个异常Exception in thread "main" java.lang.NullPointerException

import java.util.*; public class NewHashTest { public static void main(String[] args) { HashMap hash = new HashMap(); Emp emp1 = new Emp("laoda","111",123f); Emp emp2 = new Emp("laoer","222",234f); Emp emp3 = new Emp("laosan","333",5466f); hash.put(111,emp1); hash.put(222,emp2); hash.put(333,emp3); if(hash.containsKey(111)) { Emp em = (Emp)hash.get(111); em.info();//可以正常显示 } Iterator iter = hash.keySet().iterator(); while(iter.hasNext()) { String key = iter.next().toString(); Emp ems = (Emp)hash.get(key); ems.info();//这里会报错 } } } class Emp { String name; String number; float slary; public void info() { System.out.println("名字叫:"+name); System.out.println("编号为:"+number); System.out.println("薪水是:"+slary); } public Emp(String name,String number,float slary) { this.name = name; this.number = number; this.slary = slary; } } 会在ems.info();一行报一个Exception in thread "main" java.lang.NullPointerException的错误,是不是传入的KEY类型有问题,还是什么别的问题,求指点。

求助:用Java编写存取款程序,报错 $Exception in thread "main" 和java.lang.IllegalStateException: Scanner closed

package piggybank; import java.util.Scanner; public class piggybank { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Welcome to the Piggy Bank. Please enter starting balance: "); double startingBalance = input.nextDouble(); System.out.println("Piggy Bank ATM"); System.out.printf("Balance : %6.2f", startingBalance); System.out.println(); while (true){ System.out.println(); System.out.println("OPTIONS"); System.out.println(); System.out.println("1.Deposit\n"+"2.Withdraw\n"+"3.Quit\n"); System.out.println(); System.out.println("Choose one:"); int option = input.nextInt(); switch (option) { case 1: System.out.println("Enter deposit amount:\n" + "Piggy Bank ATM"); double deposit = input.nextDouble(); double depositBalance= startingBalance + deposit; System.out.printf(" Balance: $%6.2f ",depositBalance); System.out.println(); break; case 2: System.out.println("Enter withdrawal amount:\n" + "Piggy Bank ATM"); double withdraw = input.nextDouble(); double withdrawBalance= startingBalance - withdraw; System.out.printf("Balance:$%8.2f ",withdrawBalance); System.out.println(); break; case 3: System.out.printf("Ending Balance: $%8.2f ", startingBalance); break; } input.close(); } } } 我想要反复执行存取款程序,但是就会显示出错 ![图片说明](https://img-ask.csdn.net/upload/201909/28/1569658326_406248.png) 求帮忙! 想要得到以下运行结果 ![图片说明](https://img-ask.csdn.net/upload/201909/28/1569658512_523449.png) 我的运行结果是这样的,没有办法进行第二次输入 ![图片说明](https://img-ask.csdn.net/upload/201909/28/1569658741_470527.png) 呜呜呜,初学什么都不会,求助

启动hive时报错Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V

``` Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V at org.apache.hadoop.conf.Configuration.set(Configuration.java:1357) at org.apache.hadoop.conf.Configuration.set(Configuration.java:1338) at org.apache.hadoop.mapred.JobConf.setJar(JobConf.java:536) at org.apache.hadoop.mapred.JobConf.setJarByClass(JobConf.java:554) at org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:448) at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:5141) at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:5099) at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:97) at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:81) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:699) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:683) 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.hadoop.util.RunJar.run(RunJar.java:323) at org.apache.hadoop.util.RunJar.main(RunJar.java:236) ```

Exception in thread "main" java.lang.Error

package com.dlhs; class Person(){ public void setName(String name){ this.name=name; } public void setAge(int age){ this.age=age; } public return String getName(){ return name; } public return int getAge(){ return age; } } class Student extends Person() { public return String getSchool(){ return school; } public void setSchool(String school){ this.school =school; } } public class Test{ public static void main(String args[]){ public String school; public String name; public int age; Student student =new Student(); student.setName("john"); student.setAge(18); student.setSchool("SCH"); System.out.println(student.getName()); System.out.println(student.getAge()); System.out.println(student.getSchool());} }

eclipse运行显示Exception in thread "main" java.lang.NullPointerException at work_7.Bank.Openuser(Test.java:46) at work_7.Test.main(Test.java:12)

eclipse运行显示Exception in thread "main" java.lang.NullPointerException at work_7.Bank.Openuser(Test.java:46) at work_7.Test.main(Test.java:12) 拜求各位大佬,帮忙解决一下!!!! ![图片说明](https://img-ask.csdn.net/upload/202004/20/1587390228_349436.png) ``` public class Test { public static void main(String []args){ Bank bank = new Bank(); bank.Openuser("丁老头","12345",100.1); bank.Openuser("丁老太","234567",200.5); bank.Openuser("丁小胖","3456778",300.2); bank.SearchMoney("丁小胖"); Account account = new Account("丁小女","567896",500.43); account.SaveMoney(500.123); account.DrawMoney(1000); } } ``` ``` class Account{ String username; String password; double money; Account(String username,String password,double money) { this.username=username; this.password=password; this.money=money; } void SaveMoney(double addmoney){ this.money+=addmoney; System.out.println(username +" : 存钱以后,"+money); } void DrawMoney(double decmoney){ this.money-=decmoney; System.out.println(username +" : 取钱以后,"+money); } } ``` ``` class Bank{ String name; ArrayList<Account> list; void Openuser(String username,String password,double money){ try{list.add(new Account(username,password,money));} catch(Exception ex){System.out.println("插入异常");} } void SearchMoney(String username){ for(int i=0;i<list.size();i++) { if(list.get(i).username==username){ System.out.println(username+" : "+"剩余金额为, "+list.get(i).money); } } } } ```

Exception in thread "main" java.lang.Error:报错

运行后一直报错? public class Demo { private static UxServer server; public static void testServer() throws IOException{ server = new UxServer().bind(new InetSocketAddress(8008)).listen(new UxSocketListener() { @Override public void onOpen(UxSocket socket) { System.out.println("on-socket-open:"+socket.address()); try { socket.sendData("https://www.biblegateway.com/passage/?search=Psalm+62%3A5-12&version=NLTCommon people are as worthless as a puff of wind,and the powerful are not what they appear to be.Don鈥檛 make your living by extortiondon鈥檛 make it the center of your life.God has spoken plainlyPower, O God, belongs to you".getBytes()); } catch (IOException e) { e.printStackTrace(); } } @Override public void onData(UxSocket socket, byte[] data) { System.out.println("on-socket-data:"+socket.address()+"->"+new String(data)); if(new String(data).startsWith("rp")){ try { socket.sendData(data); } catch (IOException e) { e.printStackTrace(); } } for(UxSocket s: server.clients()){ try { s.sendData(data); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } @Override public void onClose(UxSocket socket) { System.out.println("on-socket-close:"+socket.address()+ socket.closeInfo()); } }); System.out.println("server"); } public static void testClient() throws IOException{ UxSocket socket = new UxSocket(); socket.listen(new UxSocketListener() { @Override public void onOpen(UxSocket socket) { System.out.println("on-open"); try { socket.sendData("hi123456".getBytes()); socket.sendData("woabc".getBytes()); } catch (IOException e) { e.printStackTrace(); } } @Override public void onData(UxSocket socket, byte[] data) { System.out.println("on-data:"+new String(data)); } @Override public void onClose(UxSocket socket) { System.out.println("on-close-"+ socket.closeInfo()); } }) .connect(new InetSocketAddress("127.0.0.1",8008)); // .connect(new InetSocketAddress("s1.gz.1251014155.clb.myqcloud.com", 8008)); try { Thread.sleep(1000L); for(int i=0;i<1000;i++){ socket.sendData(("rp-msgat:"+i).getBytes()); Thread.sleep(10L); } Thread.sleep(300000L); System.exit(0); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void main(String[] args) throws IOException { boolean serverAble = args.length==1 && args[0].equals("1"); if(args.length==0)serverAble=true; if(serverAble){ testServer(); }else{ testClient(); } } }![图片说明](https://img-ask.csdn.net/upload/201912/05/1575544159_188253.png)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

课程主要面向嵌入式Linux初学者、工程师、学生 主要从一下几方面进行讲解: 1.linux学习路线、基本命令、高级命令 2.shell、vi及vim入门讲解 3.软件安装下载、NFS、Samba、FTP等服务器配置及使用

我以为我对Mysql事务很熟,直到我遇到了阿里面试官

太惨了,面试又被吊打

Python代码实现飞机大战

文章目录经典飞机大战一.游戏设定二.我方飞机三.敌方飞机四.发射子弹五.发放补给包六.主模块 经典飞机大战 源代码以及素材资料(图片,音频)可从下面的github中下载: 飞机大战源代码以及素材资料github项目地址链接 ————————————————————————————————————————————————————————— 不知道大家有没有打过飞机,喜不喜欢打飞机。当我第一次接触这个东西的时候,我的内心是被震撼到的。第一次接触打飞机的时候作者本人是身心愉悦的,因为周边的朋友都在打飞机, 每

Python数据分析与挖掘

92讲视频课+16大项目实战+源码+¥800元课程礼包+讲师社群1V1答疑+社群闭门分享会=99元 &nbsp; 为什么学习数据分析? &nbsp; &nbsp; &nbsp; 人工智能、大数据时代有什么技能是可以运用在各种行业的?数据分析就是。 &nbsp; &nbsp; &nbsp; 从海量数据中获得别人看不见的信息,创业者可以通过数据分析来优化产品,营销人员可以通过数据分析改进营销策略,产品经理可以通过数据分析洞察用户习惯,金融从业者可以通过数据分析规避投资风险,程序员可以通过数据分析进一步挖掘出数据价值,它和编程一样,本质上也是一个工具,通过数据来对现实事物进行分析和识别的能力。不管你从事什么行业,掌握了数据分析能力,往往在其岗位上更有竞争力。 &nbsp;&nbsp; 本课程共包含五大模块: 一、先导篇: 通过分析数据分析师的一天,让学员了解全面了解成为一个数据分析师的所有必修功法,对数据分析师不在迷惑。 &nbsp; 二、基础篇: 围绕Python基础语法介绍、数据预处理、数据可视化以及数据分析与挖掘......这些核心技能模块展开,帮助你快速而全面的掌握和了解成为一个数据分析师的所有必修功法。 &nbsp; 三、数据采集篇: 通过网络爬虫实战解决数据分析的必经之路:数据从何来的问题,讲解常见的爬虫套路并利用三大实战帮助学员扎实数据采集能力,避免没有数据可分析的尴尬。 &nbsp; 四、分析工具篇: 讲解数据分析避不开的科学计算库Numpy、数据分析工具Pandas及常见可视化工具Matplotlib。 &nbsp; 五、算法篇: 算法是数据分析的精华,课程精选10大算法,包括分类、聚类、预测3大类型,每个算法都从原理和案例两个角度学习,让你不仅能用起来,了解原理,还能知道为什么这么做。

如何在虚拟机VM上使用串口

在系统内核开发中,经常会用到串口调试,利用VMware的Virtual Machine更是为调试系统内核如虎添翼。那么怎么搭建串口调试环境呢?因为最近工作涉及到这方面,利用强大的google搜索和自己

程序员的兼职技能课

获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:csdn590)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!

MFC一站式终极全套课程包

该套餐共包含从C小白到C++到MFC的全部课程,整套学下来绝对成为一名C++大牛!!!

C++语言基础视频教程

C++语言基础视频培训课程:本课与主讲者在大学开出的程序设计课程直接对接,准确把握知识点,注重教学视频与实践体系的结合,帮助初学者有效学习。本教程详细介绍C++语言中的封装、数据隐藏、继承、多态的实现等入门知识;主要包括类的声明、对象定义、构造函数和析构函数、运算符重载、继承和派生、多态性实现等。 课程需要有C语言程序设计的基础(可以利用本人开出的《C语言与程序设计》系列课学习)。学习者能够通过实践的方式,学会利用C++语言解决问题,具备进一步学习利用C++开发应用程序的基础。

北京师范大学信息科学与技术学院笔试10复试真题

北京师范大学信息科学与技术学院笔试,可以更好的让你了解北师大该学院的复试内容,获得更好的成绩。

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

网络工程师小白入门--【思科CCNA、华为HCNA等网络工程师认证】

本课程适合CCNA或HCNA网络小白同志,高手请绕道,可以直接学习进价课程。通过本预科课程的学习,为学习网络工程师、思科CCNA、华为HCNA这些认证打下坚实的基础! 重要!思科认证2020年2月24日起,已启用新版认证和考试,包括题库都会更新,由于疫情原因,请关注官网和本地考点信息。题库网络上很容易下载到。

Python界面版学生管理系统

前不久上传了一个控制台版本的学生管理系统,这个是Python界面版学生管理系统,这个是使用pycharm开发的一个有界面的学生管理系统,基本的增删改查,里面又演示视频和完整代码,有需要的伙伴可以自行下

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

Tomcat服务器下载、安装、配置环境变量教程(超详细)

未经我的允许,请不要转载我的文章,在此郑重声明!!! 请先配置安装好Java的环境,若没有安装,请参照我博客上的步骤进行安装! 安装Java环境教程https://blog.csdn.net/qq_40881680/article/details/83585542 Tomcat部署Web项目(一)·内嵌https://blog.csdn.net/qq_40881680/article/d...

2019数学建模A题高压油管的压力控制 省一论文即代码

2019数学建模A题高压油管的压力控制省一完整论文即详细C++和Matlab代码,希望对同学们有所帮助

图书管理系统(Java + Mysql)我的第一个完全自己做的实训项目

图书管理系统 Java + MySQL 完整实训代码,MVC三层架构组织,包含所有用到的图片资源以及数据库文件,大三上学期实训,注释很详细,按照阿里巴巴Java编程规范编写

linux下利用/proc进行进程树的打印

在linux下利用c语言实现的进程树的打印,主要通过/proc下的目录中的进程文件,获取status中的进程信息内容,然后利用递归实现进程树的打印

微信小程序开发实战之番茄时钟开发

微信小程序番茄时钟视频教程,本课程将带着各位学员开发一个小程序初级实战类项目,针对只看过官方文档而又无从下手的开发者来说,可以作为一个较好的练手项目,对于有小程序开发经验的开发者而言,可以更好加深对小程序各类组件和API 的理解,为更深层次高难度的项目做铺垫。

[已解决]踩过的坑之mysql连接报“Communications link failure”错误

目录 前言 第一种方法: 第二种方法 第三种方法(适用于项目和数据库在同一台服务器) 第四种方法 第五种方法(项目和数据库不在同一台服务器) 总结 前言 先给大家简述一下我的坑吧,(我用的是mysql,至于oracle有没有这样的问题,有心的小伙伴们可以测试一下哈), 在自己做个javaweb测试项目的时候,因为买的是云服务器,所以数据库连接的是用ip地址,用IDE开发好...

人工智能-计算机视觉实战之路(必备算法+深度学习+项目实战)

系列课程主要分为3大阶段:(1)首先掌握计算机视觉必备算法原理,结合Opencv进行学习与练手,通过实际视项目进行案例应用展示。(2)进军当下最火的深度学习进行视觉任务实战,掌握深度学习中必备算法原理与网络模型架构。(3)结合经典深度学习框架与实战项目进行实战,基于真实数据集展开业务分析与建模实战。整体风格通俗易懂,项目驱动学习与就业面试。 建议同学们按照下列顺序来进行学习:1.Python入门视频课程 2.Opencv计算机视觉实战(Python版) 3.深度学习框架-PyTorch实战/人工智能框架实战精讲:Keras项目 4.Python-深度学习-物体检测实战 5.后续实战课程按照自己喜好选择就可以

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

Python数据分析师-实战系列

系列课程主要包括Python数据分析必备工具包,数据分析案例实战,核心算法实战与企业级数据分析与建模解决方案实战,建议大家按照系列课程阶段顺序进行学习。所有数据集均为企业收集的真实数据集,整体风格以实战为导向,通俗讲解Python数据分析核心技巧与实战解决方案。

YOLOv3目标检测实战系列课程

《YOLOv3目标检测实战系列课程》旨在帮助大家掌握YOLOv3目标检测的训练、原理、源码与网络模型改进方法。 本课程的YOLOv3使用原作darknet(c语言编写),在Ubuntu系统上做项目演示。 本系列课程包括三门课: (1)《YOLOv3目标检测实战:训练自己的数据集》 包括:安装darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 (2)《YOLOv3目标检测:原理与源码解析》讲解YOLOv1、YOLOv2、YOLOv3的原理、程序流程并解析各层的源码。 (3)《YOLOv3目标检测:网络模型改进方法》讲解YOLOv3的改进方法,包括改进1:不显示指定类别目标的方法 (增加功能) ;改进2:合并BN层到卷积层 (加快推理速度) ; 改进3:使用GIoU指标和损失函数 (提高检测精度) ;改进4:tiny YOLOv3 (简化网络模型)并介绍 AlexeyAB/darknet项目。

2021考研数学张宇基础30讲.pdf

张宇:博士,全国著名考研数学辅导专家,教育部“国家精品课程建设骨干教师”,全国畅销书《张宇高等数学18讲》《张宇线性代数9讲》《张宇概率论与数理统计9讲》《张宇考研数学题源探析经典1000题》《张宇考

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

DirectX修复工具V4.0增强版

DirectX修复工具(DirectX Repair)是一款系统级工具软件,简便易用。本程序为绿色版,无需安装,可直接运行。 本程序的主要功能是检测当前系统的DirectX状态,如果发现异常则进行修复

期末考试评分标准的数学模型

大学期末考试与高中的考试存在很大的不同之处,大学的期末考试成绩是主要分为两个部分:平时成绩和期末考试成绩。平时成绩和期末考试成绩总分一般为一百分,然而平时成绩与期末考试成绩所占的比例不同会导致出现不同

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

c语言项目开发实例

十个c语言案例 (1)贪吃蛇 (2)五子棋游戏 (3)电话薄管理系统 (4)计算器 (5)万年历 (6)电子表 (7)客户端和服务器通信 (8)潜艇大战游戏 (9)鼠标器程序 (10)手机通讯录系统

相关热词 c#分级显示数据 c# 不区分大小写替换 c#中调用就java c#正则表达式 验证小数 c# vscode 配置 c#三维数组能存多少数据 c# 新建excel c#多个文本框 c#怎么创建tcp通讯 c# mvc 电子病例
立即提问