问题遇到的现象和发生背景
您好,我是一名学管理的学生,编程方面零基础(真的什么都不会)
我用的代码是未优化前的代码(手上也有优化后的代码,但是遇到的问题一模一样),代码中neo4j的密码也改成了我的。
问题一,HanLPtest测试时testC和testRDD报红
问题二,运行项目有spring的标志,但是无法访问端口8080,只能从index.html进入,且提问无反应
问题三,用的是neo4j-3.5.30,spark2.3.0,是否需要更换版本?
问题四,SessionCreater下有import是灰色
问题五,只有360浏览器能访问localhost:7687,edge和uc浏览器访问则出现空白,这是否正常?
问题相关代码,请勿粘贴截图
运行结果及报错内容
以下是项目运行控制面板
. ____ _ __ _ _
/\ / _' __ _ ()_ __ __ _ \ \ \
( ( )__ | '_ | '| | ' / ` | \ \ \
\/ _)| |)| | | | | || (_| | ) ) ) )
' || .|| ||| |_, | / / / /
=========||==============|_/=//_//
:: Spring Boot :: (v2.1.2.RELEASE)
2022-01-25 15:24:59,985 INFO (StartupInfoLogger.java:50)- Starting AnswerApp on X9UEN6LUOFCAG93 with PID 71908 (started by Kayono in D:\知识图谱\CSDN电影问答系统java-Spring-Boot-Neo4j-Movies-master)
2022-01-25 15:24:59,990 INFO (SpringApplication.java:675)- No active profile set, falling back to default profiles: default
2022-01-25 15:25:00,098 INFO (DeferredLog.java:227)- Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2022-01-25 15:25:00,098 INFO (DeferredLog.java:227)- For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2022-01-25 15:25:02,395 INFO (RepositoryConfigurationDelegate.java:126)- Bootstrapping Spring Data repositories in DEFAULT mode.
2022-01-25 15:25:02,797 INFO (RepositoryConfigurationDelegate.java:182)- Finished Spring Data repository scanning in 330ms. Found 5 repository interfaces.
2022-01-25 15:25:03,871 INFO (PostProcessorRegistrationDelegate.java:330)- Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$adc93af5] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-01-25 15:25:06,100 INFO (TomcatWebServer.java:90)- Tomcat initialized with port(s): 8080 (http)
2022-01-25 15:25:06,345 INFO (DirectJDKLog.java:173)- Initializing ProtocolHandler ["http-nio-8080"]
2022-01-25 15:25:06,386 INFO (DirectJDKLog.java:173)- Starting service [Tomcat]
2022-01-25 15:25:06,387 INFO (DirectJDKLog.java:173)- Starting Servlet engine: [Apache Tomcat/9.0.14]
2022-01-25 15:25:06,436 INFO (DirectJDKLog.java:173)- The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [D:\javajdk\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:\javajdk\bin;%MAVEN_HOME%\bin;D:\javajdk\JRE1\bin;D:\Program Files (x86)\neo4j\neo4j-community-3.5.30\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;D:\scala\bin;D:\Program Files (x86)\Python\Scripts;D:\Program Files (x86)\Pycharm\PyCharm 2019.3.5\bin;D:\Program Files (x86)\Python;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\spark-2.3.0-bin-hadoop2.6\bin;D:\hadoop-3.0.1\bin;"D:\scala\bin; D:\javajdk\bin;;D:\hadoop-3.0.1\bin";C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;E:\LINGO9;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;D:\Program Files (x86)\neo4j\neo4j-community-3.5.30\bin;D:\Program Files (x86)\KnowledgeGraph\Scala\bin;;D:\Program Files (x86)\Pycharm\PyCharm 2019.3.5\bin;;.]
2022-01-25 15:25:06,845 INFO (DirectJDKLog.java:173)- Initializing Spring embedded WebApplicationContext
2022-01-25 15:25:06,845 INFO (ServletWebServerApplicationContext.java:296)- Root WebApplicationContext: initialization completed in 6747 ms
2022-01-25 15:25:14,624 INFO (DomainInfo.java:154)- Starting Post-processing phase
2022-01-25 15:25:14,625 INFO (DomainInfo.java:120)- Building annotation class map
2022-01-25 15:25:14,625 INFO (DomainInfo.java:133)- Building interface class map for 32 classes
2022-01-25 15:25:14,646 INFO (DomainInfo.java:210)- Post-processing complete
2022-01-25 15:25:15,130 WARN (Neo4jPersistentProperty.java:94)- Owning ClassInfo is null for property: org.apache.commons.logging.Log.fatalEnabled
2022-01-25 15:25:15,132 WARN (Neo4jPersistentProperty.java:94)- Owning ClassInfo is null for property: org.apache.commons.logging.Log.errorEnabled
2022-01-25 15:25:15,132 WARN (Neo4jPersistentProperty.java:94)- Owning ClassInfo is null for property: org.apache.commons.logging.Log.infoEnabled
2022-01-25 15:25:15,133 WARN (Neo4jPersistentProperty.java:94)- Owning ClassInfo is null for property: org.apache.commons.logging.Log.debugEnabled
2022-01-25 15:25:15,133 WARN (Neo4jPersistentProperty.java:94)- Owning ClassInfo is null for property: org.apache.commons.logging.Log.traceEnabled
2022-01-25 15:25:15,134 WARN (Neo4jPersistentProperty.java:94)- Owning ClassInfo is null for property: org.apache.commons.logging.Log.warnEnabled
2022-01-25 15:25:15,221 INFO (Neo4jMappingContext.java:130)- No class information found in OGM meta-data for class org.apache.spark.mllib.classification.NaiveBayesModel so treating as simple type for SD Commons
2022-01-25 15:25:15,234 INFO (Neo4jMappingContext.java:66)- Neo4jMappingContext initialisation completed
2022-01-25 15:25:17,562 INFO (Logging.scala:54)- Running Spark version 2.4.0
2022-01-25 15:25:18,512 WARN (NativeCodeLoader.java:62)- Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2022-01-25 15:25:18,951 INFO (Logging.scala:54)- Submitted application: NaiveBayesTest
2022-01-25 15:25:19,333 INFO (Logging.scala:54)- Changing view acls to: Kayono
2022-01-25 15:25:19,334 INFO (Logging.scala:54)- Changing modify acls to: Kayono
2022-01-25 15:25:19,335 INFO (Logging.scala:54)- Changing view acls groups to:
2022-01-25 15:25:19,337 INFO (Logging.scala:54)- Changing modify acls groups to:
2022-01-25 15:25:19,338 INFO (Logging.scala:54)- SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(Kayono); groups with view permissions: Set(); users with modify permissions: Set(Kayono); groups with modify permissions: Set()
2022-01-25 15:25:20,993 INFO (Logging.scala:54)- Successfully started service 'sparkDriver' on port 52558.
2022-01-25 15:25:21,066 INFO (Logging.scala:54)- Registering MapOutputTracker
2022-01-25 15:25:21,140 INFO (Logging.scala:54)- Registering BlockManagerMaster
2022-01-25 15:25:21,145 INFO (Logging.scala:54)- Using org.apache.spark.storage.DefaultTopologyMapper for getting topology information
2022-01-25 15:25:21,146 INFO (Logging.scala:54)- BlockManagerMasterEndpoint up
2022-01-25 15:25:21,194 INFO (Logging.scala:54)- Created local directory at C:\Users\Administrator\AppData\Local\Temp\blockmgr-96721b0c-0f28-47e0-80c2-d8d7d0ede1a9
2022-01-25 15:25:21,294 INFO (Logging.scala:54)- MemoryStore started with capacity 625.5 MB
2022-01-25 15:25:21,364 INFO (Logging.scala:54)- Registering OutputCommitCoordinator
2022-01-25 15:25:21,780 INFO (Log.java:192)- Logging initialized @25248ms
2022-01-25 15:25:21,943 INFO (Server.java:351)- jetty-9.3.z-SNAPSHOT, build timestamp: unknown, git hash: unknown
2022-01-25 15:25:21,989 INFO (Server.java:419)- Started @25457ms
2022-01-25 15:25:22,073 INFO (AbstractConnector.java:278)- Started ServerConnector@2e356384{HTTP/1.1,[http/1.1]}{0.0.0.0:4040}
2022-01-25 15:25:22,074 INFO (Logging.scala:54)- Successfully started service 'SparkUI' on port 4040.
2022-01-25 15:25:22,106 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@c3cf3ba{/jobs,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,107 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@2fc4ca48{/jobs/json,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,108 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@46667975{/jobs/job,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,110 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@4370db81{/jobs/job/json,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,111 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@4a6fdf2d{/stages,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,113 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@3f37aac4{/stages/json,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,114 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@67d1ec9e{/stages/stage,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,115 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@14f94376{/stages/stage/json,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,117 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@7c24f86b{/stages/pool,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,118 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@1a0399e6{/stages/pool/json,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,118 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@590d25af{/storage,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,119 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@7b12f0b{/storage/json,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,121 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@5c8d7836{/storage/rdd,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,122 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@5ac716e8{/storage/rdd/json,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,123 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@6a577042{/environment,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,124 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@6490c374{/environment/json,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,126 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@53eb4b18{/executors,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,128 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@317967db{/executors/json,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,129 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@607dc4d6{/executors/threadDump,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,131 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@21420ce{/executors/threadDump/json,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,141 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@bae081f{/static,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,142 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@5a3a427f{/,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,144 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@1f4aac50{/api,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,145 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@645769b0{/jobs/job/kill,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,146 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@703ab9f6{/stages/stage/kill,null,AVAILABLE,@Spark}
2022-01-25 15:25:22,147 INFO (Logging.scala:54)- Bound SparkUI to 0.0.0.0, and started at http://X9UEN6LUOFCAG93:4040
2022-01-25 15:25:22,557 INFO (Logging.scala:54)- Starting executor ID driver on host localhost
2022-01-25 15:25:22,695 INFO (Logging.scala:54)- Successfully started service 'org.apache.spark.network.netty.NettyBlockTransferService' on port 52579.
2022-01-25 15:25:22,696 INFO (Logging.scala:54)- Server created on X9UEN6LUOFCAG93:52579
2022-01-25 15:25:22,729 INFO (Logging.scala:54)- Using org.apache.spark.storage.RandomBlockReplicationPolicy for block replication policy
2022-01-25 15:25:22,973 INFO (Logging.scala:54)- Registering BlockManager BlockManagerId(driver, X9UEN6LUOFCAG93, 52579, None)
2022-01-25 15:25:23,018 INFO (Logging.scala:54)- Registering block manager X9UEN6LUOFCAG93:52579 with 625.5 MB RAM, BlockManagerId(driver, X9UEN6LUOFCAG93, 52579, None)
2022-01-25 15:25:23,047 INFO (Logging.scala:54)- Registered BlockManager BlockManagerId(driver, X9UEN6LUOFCAG93, 52579, None)
2022-01-25 15:25:23,048 INFO (Logging.scala:54)- Initialized BlockManager: BlockManagerId(driver, X9UEN6LUOFCAG93, 52579, None)
2022-01-25 15:25:23,068 INFO (ContextHandler.java:781)- Started o.s.j.s.ServletContextHandler@59ad2e7f{/metrics/json,null,AVAILABLE,@Spark}
2022-01-25 15:25:23,419 WARN (AbstractApplicationContext.java:554)- Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'questionController': Unsatisfied dependency expressed through field 'questService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'questionServiceImpl': Unsatisfied dependency expressed through field 'queryProcess'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'modelProcess' defined in class path resource [com/appleyk/config/ConfigBean.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.appleyk.core.CoreProcessor]: Factory method 'modelProcess' threw exception; nested exception is java.lang.Exception: 缺少问题训练样本,请核查!
2022-01-25 15:25:23,423 INFO (DirectJDKLog.java:173)- Stopping service [Tomcat]
2022-01-25 15:25:23,456 INFO (ConditionEvaluationReportLoggingListener.java:142)-
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-01-25 15:25:23,509 ERROR (SpringApplication.java:858)- Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'questionController': Unsatisfied dependency expressed through field 'questService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'questionServiceImpl': Unsatisfied dependency expressed through field 'queryProcess'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'modelProcess' defined in class path resource [com/appleyk/config/ConfigBean.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.appleyk.core.CoreProcessor]: Factory method 'modelProcess' threw exception; nested exception is java.lang.Exception: 缺少问题训练样本,请核查!
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1378)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.appleyk.AnswerApp.main(AnswerApp.java:12)
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.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'questionServiceImpl': Unsatisfied dependency expressed through field 'queryProcess'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'modelProcess' defined in class path resource [com/appleyk/config/ConfigBean.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.appleyk.core.CoreProcessor]: Factory method 'modelProcess' threw exception; nested exception is java.lang.Exception: 缺少问题训练样本,请核查!
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:596)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1378)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1244)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1164)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593)
... 24 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'modelProcess' defined in class path resource [com/appleyk/config/ConfigBean.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.appleyk.core.CoreProcessor]: Factory method 'modelProcess' threw exception; nested exception is java.lang.Exception: 缺少问题训练样本,请核查!
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1244)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1164)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:593)
... 37 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.appleyk.core.CoreProcessor]: Factory method 'modelProcess' threw exception; nested exception is java.lang.Exception: 缺少问题训练样本,请核查!
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)
... 50 common frames omitted
Caused by: java.lang.Exception: 缺少问题训练样本,请核查!
at com.appleyk.core.CoreProcessor.loadClassifierModel(CoreProcessor.java:289)
at com.appleyk.core.CoreProcessor.(CoreProcessor.java:58)
at com.appleyk.config.ConfigBean.modelProcess(ConfigBean.java:27)
at com.appleyk.config.ConfigBean$$EnhancerBySpringCGLIB$$2aed65e9.CGLIB$modelProcess$0()
at com.appleyk.config.ConfigBean$$EnhancerBySpringCGLIB$$2aed65e9$$FastClassBySpringCGLIB$$44c6452b.invoke()
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)
at com.appleyk.config.ConfigBean$$EnhancerBySpringCGLIB$$2aed65e9.modelProcess()
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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 51 common frames omitted
2022-01-25 15:25:23,516 INFO (Logging.scala:54)- Invoking stop() from shutdown hook
2022-01-25 15:25:23,535 INFO (AbstractConnector.java:318)- Stopped Spark@2e356384{HTTP/1.1,[http/1.1]}{0.0.0.0:4040}
2022-01-25 15:25:23,537 INFO (Logging.scala:54)- Stopped Spark web UI at http://X9UEN6LUOFCAG93:4040
2022-01-25 15:25:23,567 INFO (Logging.scala:54)- MapOutputTrackerMasterEndpoint stopped!
2022-01-25 15:25:23,594 INFO (Logging.scala:54)- MemoryStore cleared
2022-01-25 15:25:23,595 INFO (Logging.scala:54)- BlockManager stopped
2022-01-25 15:25:23,625 INFO (Logging.scala:54)- BlockManagerMaster stopped
2022-01-25 15:25:23,637 INFO (Logging.scala:54)- OutputCommitCoordinator stopped!
2022-01-25 15:25:23,646 INFO (Logging.scala:54)- Successfully stopped SparkContext
2022-01-25 15:25:23,646 INFO (Logging.scala:54)- Shutdown hook called
2022-01-25 15:25:23,647 INFO (Logging.scala:54)- Deleting directory C:\Users\Administrator\AppData\Local\Temp\spark-54f0c613-d466-4f7b-99a2-d442e836ce40
进程已结束,退出代码 0
以下是testC报红部分
java.lang.Exception: 缺少问题训练样本,请核查!
at com.appleyk.core.CoreProcessor.loadClassifierModel(CoreProcessor.java:289)
at com.appleyk.core.CoreProcessor.<init>(CoreProcessor.java:58)
at HanLPTest.TestC(HanLPTest.java:65)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
以下是testRDD报红
org.apache.spark.SparkException: Only one SparkContext may be running in this JVM (see SPARK-2243). To ignore this error, set spark.driver.allowMultipleContexts = true. The currently running SparkContext was created at:
org.apache.spark.api.java.JavaSparkContext.(JavaSparkContext.scala:58)
com.appleyk.core.CoreProcessor.loadClassifierModel(CoreProcessor.java:277)
com.appleyk.core.CoreProcessor.(CoreProcessor.java:58)
HanLPTest.TestC(HanLPTest.java:65)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.apache.spark.SparkContext$.$anonfun$assertNoOtherContextIsRunning$2(SparkContext.scala:2483)
at org.apache.spark.SparkContext$.$anonfun$assertNoOtherContextIsRunning$2$adapted(SparkContext.scala:2479)
at scala.Option.foreach(Option.scala:257)
at org.apache.spark.SparkContext$.assertNoOtherContextIsRunning(SparkContext.scala:2479)
at org.apache.spark.SparkContext$.markPartiallyConstructed(SparkContext.scala:2568)
at org.apache.spark.SparkContext.<init>(SparkContext.scala:85)
at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:58)
at HanLPTest.TestRDD(HanLPTest.java:77)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
以下是SessionCreater中灰色部分
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
我的解答思路和尝试过的方法
找了一些运行成功的人询问,但是并没有解决以上问题
我想要达到的结果
希望您能在百忙中能抽一些时间来指导我,对于您的帮助,我十分感激!