调用rt.jar的类出现访问限制是怎么回事 5C

//代码如下:

BufferedReader reader = new BufferedReader(new ReaderUTF8(servletContext.getResourceAsStream(path)));
//初始化ReaderUTF8编译异常
Access restriction: The constructor 'ReaderUTF8(InputStream)' is not API (restriction on required library 'C:\Program Files\Java\jre1.8.0_121\lib\rt.jar')

1. ReaderUTF-8有公有构造

图片说明



2. JRE是1.8,可以看到有“rt.jar 但是上面有一本小书,这是怎么回事???

图片说明



3.项目编译版本也是1.8

图片说明




本人懵逼中。。。

2个回答

项目——右键——属性——构建路径——库 将JRE系统库移除,在重新添加库,将JRE系统库重新添加进去,就好了

m0_37741173
bear_0X0000 好了。。。 这是eclispe的bug么。。
大约 2 年之前 回复

你需要重新添加,我觉得你以后可以用maven管理你所用到的jar包

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
xercesImpl-2.5.0.jar和jdk rt.jar 中类冲突
xercesImpl-2.5.0.jar和jdk rt.jar 中DocumentBuilderFactoryImpl类冲突有什么好的解决办法,2个jar中的方法我都有调用 Exception in thread "main" java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V at com.itextpdf.xmp.impl.XMPMetaParser.createDocumentBuilderFactory(XMPMetaParser.java:423) at com.itextpdf.xmp.impl.XMPMetaParser.<clinit>(XMPMetaParser.java:71) at com.itextpdf.xmp.XMPMetaFactory.parseFromBuffer(XMPMetaFactory.java:167) at com.itextpdf.xmp.XMPMetaFactory.parseFromBuffer(XMPMetaFactory.java:153) at com.itextpdf.text.pdf.PdfStamperImp.close(PdfStamperImp.java:370) at com.itextpdf.text.pdf.PdfStamper.close(PdfStamper.java:230) at com.chinamf.controller.Snippet.fillTemplate(Snippet.java:70) at com.chinamf.controller.Snippet.main(Snippet.java:88)
使用JAR包中的类与JDK的rt.jar冲突的问题
[size=medium]项目中遇到这样一个问题:使用的第三方JAR包中有一个整包(javax.management)与JDK的javax.management包重复了,但是具体实现却是不一样的,运行的时候第三方JAR包里的类试图调用自己提供的javax.management包里的类,但是JDK也提供了javax.management包,所以虚拟机优先调用了自己的javax.management里的类,于是就出错了。请问这个问题要怎么解决?因为这个原因项目已经停滞好久了,希望看到的大侠给解答一下,不甚感激! 项目实际情况是:我要在JDK1.6环境下监控WebLogic8,需要用到weblogic.jar,但是weblogic.jar提供了javax.management包,与JDK1.6提供的javax.management包冲突了,而且内部实现还不完全一样。 :arrow: :arrow: :arrow: [/size]
为什么我在myeclipse中不可以调用ImageIO.write();方法?
1. ![图片说明](https://img-ask.csdn.net/upload/201810/23/1540301302_837829.png)提醒(Access restriction: The method 'ImageIO.write(RenderedImage, String, OutputStream)' is not API (restriction on required library 'E:\MYECLIPSE\binary\com.sun.java.jdk8.win32.x86_64_1.8.0.v112\jre\lib\rt.jar') 访问限制:方法“IIIIO .Read(ReDeReDimige,String,OutputStream)”不是API(限制所需的库)E:MyEclipse \Bin\\COM.Sun.jdk8. Win32. x86y64,1.1.0.0.v112\jRe\Lb\r.jar) 怎么解决啊?)
Eclipse中调用javax.swing的问题
import javax.swing.JOptionPane; public class Displayunicode { } 如上,javax.swing.JOptionPane;会显示红色波浪线,报错提示为 Access restriction: The type JOptionPane is not accessible due to restriction on required library E:\Program Files\Java\jre8\lib\rt.jar Displayunicode.java /practise/src/practise line 2 Java Problem 但什么环境变量都配置对了啊,IDE是Eclipse最新版本的啊,java版本也是最新的,求解这是为什么啊?
请问如何在没装街道口,jre的自己上运行class文件
各位,请问如何在任意的机子上运行class文件,机子是没装jdk和jre 我现在是在bat文件中调用class文件[code="java"] set CLASSPATH=%CLASSPATH%;./lib/commons-codec-1.4.jar;./lib/commons-httpclient-3.1.jar;./lib/commons-logging-1.0.4.jar;./lib/jdom.jar;./lib/dt.jar;./lib/tools.jar;./lib/rt.jar cls @echo off java client.Client pause [/code] 但是会报错java.lang.unsupporetdClassVersionError:client/Client(unsupported major.minor version:49.0) 网上说是应该jdk版本不对,应该用低版本的编译,我试了也没用 要说明一点的是我在本机测试没有问题。
在jboss7中,怎么部署消息驱动bean?
本人在学习EJB,使用的是jboss7 【环境】MyEclipse10 + jboss7.1.1 写了一个消息驱动bean发布到jboss7,并启动是报错? 代码如下: @MessageDriven ( activationConfig = { @ActivationConfigProperty(propertyName="destinationType",propertyValue="javax.jms.Queue"), @ActivationConfigProperty(propertyName="destination",propertyValue="queue/myqueue") } ) public class MyQueueMDBean implements MessageListener { @Override public void onMessage(Message message) { TextMessage msg = (TextMessage) message; try { System.out.println("消息bean: MyQueueMDBean被调用了" + msg.getText()); } catch (JMSException e) { e.printStackTrace(); } } } 报错内容如下: 23:22:18,024 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-15) MSC00001: Failed to start service jboss.deployment.unit."ejbLearn03.jar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."ejbLearn03.jar".PARSE: Failed to process phase PARSE of deployment "ejbLearn03.jar" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_13] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_13] at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_13] Caused by: org.jboss.msc.service.ServiceNotFoundException: Service service jboss.ejb.default-resource-adapter-name-service not found at org.jboss.msc.service.ServiceContainerImpl.getRequiredService(ServiceContainerImpl.java:447) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.getDefaultResourceAdapterName(MessageDrivenComponentDescriptionFactory.java:273) at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.processMessageBeans(MessageDrivenComponentDescriptionFactory.java:153) at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.processAnnotations(MessageDrivenComponentDescriptionFactory.java:81) at org.jboss.as.ejb3.deployment.processors.AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.processAnnotations(AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.java:58) at org.jboss.as.ejb3.deployment.processors.AbstractDeploymentUnitProcessor.deploy(AbstractDeploymentUnitProcessor.java:81) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] ... 5 more
No provider available from registry ip for service com.zys.store.service.api.HelloServiceApi:1.0.0 on consumer ip use dubbo version 2.6.2
springboot整合zookeeper和dubbo报错 linux上zk版本号是3.4.14 项目用的zk包是3.4.9 dubbo用的是2.6.2 springboot是2.1.6 用main方式先运行store的模块 再运行order的模块 这个时候用浏览器去访问http://localhost:8088/hello?name=zys这个时候控制台就报错No provider available from registry 启动的时候不报错 浏览器访问就报错了 看zk日志有说是HelloServiceApi这个类的节点已经存在 但是我觉得跟这个问题不大 因为运行一次就会创建一个节点 多次的话肯定报节点存在的错 我的linux是虚拟机 并且已经关闭了防火墙 不存在端口跑不通的情况 1. 项目架构是maven的聚合项目![图片说明](https://img-ask.csdn.net/upload/201911/20/1574220333_973372.png) 2. 在zys-store-api写接口 package com.zys.store.service.api; public interface HelloServiceApi { String sayHello(String name); } 3.在zys-store暴露接口 package com.zys.store.service.provider; import com.alibaba.dubbo.config.annotation.Service; import com.zys.store.service.api.HelloServiceApi; @Service( version = "1.0.0", application = "zys-store", protocol = "dubbo", registry = "zys-store-registry" ) public class HelloServiceProvider implements HelloServiceApi{ @Override public String sayHello(String name) { return "hello" + name; } } 下面是zys-store的yml的配置 dubbo: application: id: zys-store name: zys-store qos-port: 22212 qos-enable: true scan: base-packages: com.zys.store.* protocol: id: dubbo name: dubbo port: 12343 registry: id: zys-store-registry address: zookeeper://192.168.146.132:2181?backup=192.168.146.131:2181,192.168.146.133:2181 4.在zys-order调用接口 package com.zys.order.controller; import com.alibaba.dubbo.config.annotation.Reference; import com.zys.store.service.api.HelloServiceApi; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; @RestController public class HelloController { @Reference( version = "1.0.0", application = "zys-order", interfaceName = "com.zys.store.service.api.HelloServiceApi", check = false, timeout = 3000, retries = 0 //读请求3次 写请求不重复 ) private HelloServiceApi helloServiceApi; @RequestMapping("/hello") public String hello(@RequestParam("name") String name){ return helloServiceApi.sayHello(name); } } 下面是zys-order的yml的配置 ```dubbo: application: id: zys-order name: zys-order qos-port: 22211 qos-enable: true qos-accept-foreign-ip: false scan: base-packages: com.zys.order.* protocol: id: dubbo name: dubbo port: 12343 registry: id: zys-order-registry address: zookeeper://192.168.146.132:2181?backup=192.168.146.131:2181,192.168.146.133:2181 store端的启动日志 2019-11-20 10:18:35.426 INFO 50632 --- [ main] a.b.d.c.e.WelcomeLogoApplicationListener : :: Dubbo Spring Boot (v0.2.0) : https://github.com/apache/incubator-dubbo-spring-boot-project :: Dubbo (v2.6.2) : https://github.com/apache/incubator-dubbo :: Google group : dev@dubbo.incubator.apache.org 2019-11-20 10:18:35.430 INFO 50632 --- [ main] e.OverrideDubboConfigApplicationListener : Dubbo Config was overridden by externalized configuration {dubbo.application.id=zys-store, dubbo.application.name=zys-store, dubbo.application.qos-enable=true, dubbo.application.qos-port=22212, dubbo.protocol.id=dubbo, dubbo.protocol.name=dubbo, dubbo.protocol.port=12343, dubbo.registry.address=zookeeper://192.168.146.132:2181?backup=192.168.146.131:2181,192.168.146.133:2181, dubbo.registry.id=zys-store-registry, dubbo.scan.base-packages=com.zys.store.*} . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.1.6.RELEASE) 2019-11-20 10:18:35.488 INFO 50632 --- [ main] com.zys.store.ZysStoreApplication : Starting ZysStoreApplication on DESKTOP-O0S84K8 with PID 50632 (D:\ideaworkspace\zys-project\zys-store\target\classes started by Administrator in D:\ideaworkspace\zys-project) 2019-11-20 10:18:35.489 INFO 50632 --- [ main] com.zys.store.ZysStoreApplication : No active profile set, falling back to default profiles: default 2019-11-20 10:18:35.963 WARN 50632 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.zys.store.dao, com.zys.store.mapper]' package. Please check your configuration. 2019-11-20 10:18:36.030 WARN 50632 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-configs' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:36.031 WARN 50632 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-properties' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:36.031 WARN 50632 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-references' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:36.031 WARN 50632 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-services' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:36.031 WARN 50632 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-shutdown' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:36.037 INFO 50632 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The dubbo config bean definition [name : zys-store, class : com.alibaba.dubbo.config.ApplicationConfig] has been registered. 2019-11-20 10:18:36.037 INFO 50632 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : zys-store] has been registered. 2019-11-20 10:18:36.037 INFO 50632 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The dubbo config bean definition [name : zys-store-registry, class : com.alibaba.dubbo.config.RegistryConfig] has been registered. 2019-11-20 10:18:36.037 INFO 50632 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : zys-store-registry] has been registered. 2019-11-20 10:18:36.037 INFO 50632 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The dubbo config bean definition [name : dubbo, class : com.alibaba.dubbo.config.ProtocolConfig] has been registered. 2019-11-20 10:18:36.038 INFO 50632 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : dubbo] has been registered. 2019-11-20 10:18:36.060 WARN 50632 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.zys.store]' package. Please check your configuration. 2019-11-20 10:18:36.307 INFO 50632 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.boot.dubbo.autoconfigure.DubboAutoConfiguration' of type [com.alibaba.boot.dubbo.autoconfigure.DubboAutoConfiguration$$EnhancerBySpringCGLIB$$437665e0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:36.357 INFO 50632 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relaxedDubboConfigBinder' of type [com.alibaba.boot.dubbo.autoconfigure.RelaxedDubboConfigBinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:36.364 INFO 50632 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$3474c06e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:36.382 INFO 50632 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relaxedDubboConfigBinder' of type [com.alibaba.boot.dubbo.autoconfigure.RelaxedDubboConfigBinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:36.383 INFO 50632 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relaxedDubboConfigBinder' of type [com.alibaba.boot.dubbo.autoconfigure.RelaxedDubboConfigBinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:36.657 INFO 50632 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8089 (http) 2019-11-20 10:18:36.675 INFO 50632 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-11-20 10:18:36.675 INFO 50632 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.21] 2019-11-20 10:18:36.770 INFO 50632 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-11-20 10:18:36.770 INFO 50632 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1249 ms 2019-11-20 10:18:37.038 INFO 50632 --- [ main] .f.a.DubboConfigBindingBeanPostProcessor : The properties of bean [name : dubbo] have been binding by prefix of configuration properties : dubbo.protocol 2019-11-20 10:18:37.568 INFO 50632 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2019-11-20 10:18:37.744 INFO 50632 --- [ main] .f.a.DubboConfigBindingBeanPostProcessor : The properties of bean [name : zys-store] have been binding by prefix of configuration properties : dubbo.application 2019-11-20 10:18:37.747 INFO 50632 --- [ main] .f.a.DubboConfigBindingBeanPostProcessor : The properties of bean [name : zys-store-registry] have been binding by prefix of configuration properties : dubbo.registry 2019-11-20 10:18:37.816 INFO 50632 --- [ main] com.zaxxer.hikari.HikariDataSource : MyHikariCP - Starting... 2019-11-20 10:18:37.993 INFO 50632 --- [ main] com.zaxxer.hikari.HikariDataSource : MyHikariCP - Start completed. order端的启动日志 ```2019-11-20 10:18:47.233 INFO 48096 --- [ main] a.b.d.c.e.WelcomeLogoApplicationListener : :: Dubbo Spring Boot (v0.2.0) : https://github.com/apache/incubator-dubbo-spring-boot-project :: Dubbo (v2.6.2) : https://github.com/apache/incubator-dubbo :: Google group : dev@dubbo.incubator.apache.org 2019-11-20 10:18:47.239 INFO 48096 --- [ main] e.OverrideDubboConfigApplicationListener : Dubbo Config was overridden by externalized configuration {dubbo.application.id=zys-order, dubbo.application.name=zys-order, dubbo.application.qos-accept-foreign-ip=false, dubbo.application.qos-enable=true, dubbo.application.qos-port=22211, dubbo.protocol.id=dubbo, dubbo.protocol.name=dubbo, dubbo.protocol.port=12343, dubbo.registry.address=zookeeper://192.168.146.132:2181?backup=192.168.146.131:2181,192.168.146.133:2181, dubbo.registry.id=zys-order-registry, dubbo.scan.base-packages=com.zys.order.*} . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.1.6.RELEASE) 2019-11-20 10:18:47.301 INFO 48096 --- [ main] com.zys.order.ZysOrderApplication : Starting ZysOrderApplication on DESKTOP-O0S84K8 with PID 48096 (D:\ideaworkspace\zys-project\zys-order\target\classes started by Administrator in D:\ideaworkspace\zys-project) 2019-11-20 10:18:47.302 INFO 48096 --- [ main] com.zys.order.ZysOrderApplication : No active profile set, falling back to default profiles: default 2019-11-20 10:18:47.803 WARN 48096 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.zys.order.dao, com.zys.order.mapper]' package. Please check your configuration. 2019-11-20 10:18:47.868 WARN 48096 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-configs' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:47.869 WARN 48096 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-properties' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:47.870 WARN 48096 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-references' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:47.870 WARN 48096 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-services' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:47.870 WARN 48096 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'dubbo-shutdown' contains invalid characters, please migrate to a valid format. 2019-11-20 10:18:47.875 INFO 48096 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The dubbo config bean definition [name : zys-order, class : com.alibaba.dubbo.config.ApplicationConfig] has been registered. 2019-11-20 10:18:47.875 INFO 48096 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : zys-order] has been registered. 2019-11-20 10:18:47.875 INFO 48096 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The dubbo config bean definition [name : zys-order-registry, class : com.alibaba.dubbo.config.RegistryConfig] has been registered. 2019-11-20 10:18:47.875 INFO 48096 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : zys-order-registry] has been registered. 2019-11-20 10:18:47.876 INFO 48096 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The dubbo config bean definition [name : dubbo, class : com.alibaba.dubbo.config.ProtocolConfig] has been registered. 2019-11-20 10:18:47.876 INFO 48096 --- [ main] .a.d.c.s.c.a.DubboConfigBindingRegistrar : The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : dubbo] has been registered. 2019-11-20 10:18:47.894 WARN 48096 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.zys.order]' package. Please check your configuration. 2019-11-20 10:18:48.164 INFO 48096 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.boot.dubbo.autoconfigure.DubboAutoConfiguration' of type [com.alibaba.boot.dubbo.autoconfigure.DubboAutoConfiguration$$EnhancerBySpringCGLIB$$5fbcce96] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:48.239 INFO 48096 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$50bb2924] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:48.261 INFO 48096 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relaxedDubboConfigBinder' of type [com.alibaba.boot.dubbo.autoconfigure.RelaxedDubboConfigBinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:48.263 INFO 48096 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relaxedDubboConfigBinder' of type [com.alibaba.boot.dubbo.autoconfigure.RelaxedDubboConfigBinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:48.264 INFO 48096 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'relaxedDubboConfigBinder' of type [com.alibaba.boot.dubbo.autoconfigure.RelaxedDubboConfigBinder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-11-20 10:18:48.482 INFO 48096 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8088 (http) 2019-11-20 10:18:48.496 INFO 48096 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-11-20 10:18:48.496 INFO 48096 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.21] 2019-11-20 10:18:48.596 INFO 48096 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-11-20 10:18:48.596 INFO 48096 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1268 ms 2019-11-20 10:18:48.847 INFO 48096 --- [ main] .f.a.DubboConfigBindingBeanPostProcessor : The properties of bean [name : dubbo] have been binding by prefix of configuration properties : dubbo.protocol 2019-11-20 10:18:49.338 INFO 48096 --- [ main] .f.a.DubboConfigBindingBeanPostProcessor : The properties of bean [name : zys-order] have been binding by prefix of configuration properties : dubbo.application 2019-11-20 10:18:49.345 INFO 48096 --- [ main] .f.a.DubboConfigBindingBeanPostProcessor : The properties of bean [name : zys-order-registry] have been binding by prefix of configuration properties : dubbo.registry 2019-11-20 10:18:49.919 INFO 48096 --- [ main] o.a.c.f.imps.CuratorFrameworkImpl : Starting 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:zookeeper.version=3.4.9-1757313, built on 08/23/2016 06:50 GMT 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:host.name=DESKTOP-O0S84K8 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.version=1.8.0_211 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.vendor=Oracle Corporation 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.home=C:\Program Files\Java\jdk1.8.0_211\jre 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.class.path=C:\Program Files\Java\jdk1.8.0_211\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_211\jre\lib\rt.jar;D:\ideaworkspace\zys-project\zys-order\target\classes;D:\repository\org\springframework\boot\spring-boot-starter-web\2.1.6.RELEASE\spring-boot-starter-web-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter-json\2.1.6.RELEASE\spring-boot-starter-json-2.1.6.RELEASE.jar;D:\repository\com\fasterxml\jackson\core\jackson-databind\2.9.9\jackson-databind-2.9.9.jar;D:\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.9\jackson-datatype-jdk8-2.9.9.jar;D:\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.9\jackson-datatype-jsr310-2.9.9.jar;D:\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.9\jackson-module-parameter-names-2.9.9.jar;D:\repository\org\springframework\boot\spring-boot-starter-tomcat\2.1.6.RELEASE\spring-boot-starter-tomcat-2.1.6.RELEASE.jar;D:\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.21\tomcat-embed-core-9.0.21.jar;D:\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.21\tomcat-embed-el-9.0.21.jar;D:\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.21\tomcat-embed-websocket-9.0.21.jar;D:\repository\org\hibernate\validator\hibernate-validator\6.0.17.Final\hibernate-validator-6.0.17.Final.jar;D:\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;D:\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;D:\repository\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;D:\repository\org\springframework\spring-web\5.1.8.RELEASE\spring-web-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-beans\5.1.8.RELEASE\spring-beans-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-webmvc\5.1.8.RELEASE\spring-webmvc-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-aop\5.1.8.RELEASE\spring-aop-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-context\5.1.8.RELEASE\spring-context-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-expression\5.1.8.RELEASE\spring-expression-5.1.8.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter-actuator\2.1.6.RELEASE\spring-boot-starter-actuator-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-actuator-autoconfigure\2.1.6.RELEASE\spring-boot-actuator-autoconfigure-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-actuator\2.1.6.RELEASE\spring-boot-actuator-2.1.6.RELEASE.jar;D:\repository\io\micrometer\micrometer-core\1.1.5\micrometer-core-1.1.5.jar;D:\repository\org\latencyutils\LatencyUtils\2.0.3\LatencyUtils-2.0.3.jar;D:\repository\org\springframework\spring-core\5.1.8.RELEASE\spring-core-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-jcl\5.1.8.RELEASE\spring-jcl-5.1.8.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter-jdbc\2.1.6.RELEASE\spring-boot-starter-jdbc-2.1.6.RELEASE.jar;D:\repository\com\zaxxer\HikariCP\3.2.0\HikariCP-3.2.0.jar;D:\repository\org\springframework\spring-jdbc\5.1.8.RELEASE\spring-jdbc-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-tx\5.1.8.RELEASE\spring-tx-5.1.8.RELEASE.jar;D:\repository\com\baomidou\mybatis-plus-boot-starter\3.1.1\mybatis-plus-boot-starter-3.1.1.jar;D:\repository\com\baomidou\mybatis-plus\3.1.1\mybatis-plus-3.1.1.jar;D:\repository\com\baomidou\mybatis-plus-extension\3.1.1\mybatis-plus-extension-3.1.1.jar;D:\repository\com\baomidou\mybatis-plus-core\3.1.1\mybatis-plus-core-3.1.1.jar;D:\repository\com\baomidou\mybatis-plus-annotation\3.1.1\mybatis-plus-annotation-3.1.1.jar;D:\repository\com\github\jsqlparser\jsqlparser\1.2\jsqlparser-1.2.jar;D:\repository\org\mybatis\mybatis\3.5.1\mybatis-3.5.1.jar;D:\repository\org\mybatis\mybatis-spring\2.0.1\mybatis-spring-2.0.1.jar;D:\repository\org\springframework\boot\spring-boot-autoconfigure\2.1.6.RELEASE\spring-boot-autoconfigure-2.1.6.RELEASE.jar;D:\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;D:\repository\mysql\mysql-connector-java\6.0.6\mysql-connector-java-6.0.6.jar;D:\repository\com\alibaba\boot\dubbo-spring-boot-starter\0.2.0\dubbo-spring-boot-starter-0.2.0.jar;D:\repository\com\alibaba\dubbo\2.6.2\dubbo-2.6.2.jar;D:\repository\org\javassist\javassist\3.20.0-GA\javassist-3.20.0-GA.jar;D:\repository\org\jboss\netty\netty\3.2.5.Final\netty-3.2.5.Final.jar;D:\repository\org\apache\zookeeper\zookeeper\3.4.9\zookeeper-3.4.9.jar;D:\repository\jline\jline\0.9.94\jline-0.9.94.jar;D:\repository\io\netty\netty\3.10.5.Final\netty-3.10.5.Final.jar;D:\repository\org\apache\curator\curator-framework\2.12.0\curator-framework-2.12.0.jar;D:\repository\org\apache\curator\curator-client\2.12.0\curator-client-2.12.0.jar;D:\repository\com\alibaba\boot\dubbo-spring-boot-autoconfigure\0.2.0\dubbo-spring-boot-autoconfigure-0.2.0.jar;D:\repository\com\alibaba\boot\dubbo-spring-boot-actuator\0.2.0\dubbo-spring-boot-actuator-0.2.0.jar;D:\repository\com\netflix\hystrix\hystrix-core\1.5.12\hystrix-core-1.5.12.jar;D:\repository\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;D:\repository\com\netflix\archaius\archaius-core\0.4.1\archaius-core-0.4.1.jar;D:\repository\commons-configuration\commons-configuration\1.8\commons-configuration-1.8.jar;D:\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;D:\repository\io\reactivex\rxjava\1.3.8\rxjava-1.3.8.jar;D:\repository\org\hdrhistogram\HdrHistogram\2.1.9\HdrHistogram-2.1.9.jar;D:\repository\com\netflix\hystrix\hystrix-metrics-event-stream\1.5.12\hystrix-metrics-event-stream-1.5.12.jar;D:\repository\com\netflix\hystrix\hystrix-serialization\1.5.12\hystrix-serialization-1.5.12.jar;D:\repository\com\fasterxml\jackson\module\jackson-module-afterburner\2.9.9\jackson-module-afterburner-2.9.9.jar;D:\repository\com\fasterxml\jackson\core\jackson-core\2.9.9\jackson-core-2.9.9.jar;D:\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;D:\repository\com\netflix\hystrix\hystrix-javanica\1.5.12\hystrix-javanica-1.5.12.jar;D:\repository\org\aspectj\aspectjrt\1.9.4\aspectjrt-1.9.4.jar;D:\repository\org\apache\commons\commons-lang3\3.3.1\commons-lang3-3.3.1.jar;D:\repository\org\ow2\asm\asm\5.0.4\asm-5.0.4.jar;D:\repository\org\aspectj\aspectjweaver\1.9.4\aspectjweaver-1.9.4.jar;D:\repository\com\google\guava\guava\15.0\guava-15.0.jar;D:\repository\com\google\code\findbugs\jsr305\2.0.0\jsr305-2.0.0.jar;D:\repository\org\apache\rocketmq\rocketmq-client\4.3.0\rocketmq-client-4.3.0.jar;D:\repository\org\apache\rocketmq\rocketmq-common\4.3.0\rocketmq-common-4.3.0.jar;D:\repository\org\apache\rocketmq\rocketmq-remoting\4.3.0\rocketmq-remoting-4.3.0.jar;D:\repository\com\alibaba\fastjson\1.2.29\fastjson-1.2.29.jar;D:\repository\io\netty\netty-all\4.1.36.Final\netty-all-4.1.36.Final.jar;D:\repository\org\apache\rocketmq\rocketmq-logging\4.3.0\rocketmq-logging-4.3.0.jar;D:\repository\io\netty\netty-tcnative-boringssl-static\2.0.25.Final\netty-tcnative-boringssl-static-2.0.25.Final.jar;D:\repository\com\zys\zys-store-api\0.0.1-SNAPSHOT\zys-store-api-0.0.1-SNAPSHOT.jar;D:\repository\org\springframework\boot\spring-boot-starter\2.1.6.RELEASE\spring-boot-starter-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot\2.1.6.RELEASE\spring-boot-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter-logging\2.1.6.RELEASE\spring-boot-starter-logging-2.1.6.RELEASE.jar;D:\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\repository\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;D:\repository\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;D:\repository\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;D:\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;D:\repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;D:\idea\IntelliJ IDEA 2019.2\lib\idea_rt.jar 2019-11-20 10:18:58.930 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.library.path=C:\Program Files\Java\jdk1.8.0_211\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:\idea\IntelliJ IDEA 2019.2\jbr\\bin;D:\idea\IntelliJ IDEA 2019.2\jbr\\bin\server;D:\oracleClient\product\11.2.0\client_1\bin;D:\xshell\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Java\jdk1.8.0_211;D:\Git\cmd;C:\Program Files\MySQL\MySQL Server 5.7\bin;D:\TortoiseSVN1.10\bin;D:\apache-maven-idea\bin;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;;. 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.io.tmpdir=C:\Users\ADMINI~1\AppData\Local\Temp\ 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:java.compiler=<NA> 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:os.name=Windows 10 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:os.arch=amd64 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:os.version=10.0 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:user.name=Administrator 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:user.home=C:\Users\Administrator 2019-11-20 10:18:58.931 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Client environment:user.dir=D:\ideaworkspace\zys-project 2019-11-20 10:18:58.932 INFO 48096 --- [ main] org.apache.zookeeper.ZooKeeper : Initiating client connection, connectString=192.168.146.132:2181,192.168.146.131:2181,192.168.146.133:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionState@5a3a1bf9 2019-11-20 10:18:58.942 INFO 48096 --- [8.146.132:2181)] org.apache.zookeeper.ClientCnxn : Opening socket connection to server 192.168.146.132/192.168.146.132:2181. Will not attempt to authenticate using SASL (unknown error) 2019-11-20 10:18:58.942 INFO 48096 --- [8.146.132:2181)] org.apache.zookeeper.ClientCnxn : Socket connection established to 192.168.146.132/192.168.146.132:2181, initiating session 2019-11-20 10:18:58.953 INFO 48096 --- [8.146.132:2181)] org.apache.zookeeper.ClientCnxn : Session establishment complete on server 192.168.146.132/192.168.146.132:2181, sessionid = 0x200000235350000, negotiated timeout = 40000 2019-11-20 10:18:58.957 INFO 48096 --- [ain-EventThread] o.a.c.f.state.ConnectionStateManager : State change: CONNECTED 2019-11-20 10:18:59.030 INFO 48096 --- [ main] c.a.d.c.s.b.f.a.ReferenceBeanBuilder : <dubbo:reference object="com.alibaba.dubbo.common.bytecode.proxy0@3b5c665c" singleton="true" interface="com.zys.store.service.api.HelloServiceApi" uniqueServiceName="com.zys.store.service.api.HelloServiceApi:1.0.0" generic="false" version="1.0.0" check="false" timeout="3000" id="com.zys.store.service.api.HelloServiceApi" /> has been built. 2019-11-20 10:18:59.242 INFO 48096 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2019-11-20 10:18:59.420 INFO 48096 --- [ main] com.zaxxer.hikari.HikariDataSource : MyHikariCP - Starting... 2019-11-20 10:18:59.592 INFO 48096 --- [ main] com.zaxxer.hikari.HikariDataSource : MyHikariCP - Start completed. _ _ |_ _ _|_. ___ _ | _ | | |\/|_)(_| | |_\ |_)||_|_\ / | 3.1.1 2019-11-20 10:18:59.836 INFO 48096 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator' 2019-11-20 10:18:59.897 INFO 48096 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8088 (http) with context path '' 2019-11-20 10:18:59.899 INFO 48096 --- [ main] com.zys.order.ZysOrderApplication : Started ZysOrderApplication in 12.907 seconds (JVM running for 13.464) 2019-11-20 10:18:59.956 INFO 48096 --- [-192.168.255.54] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 2019-11-20 10:18:59.956 INFO 48096 --- [-192.168.255.54] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2019-11-20 10:18:59.969 INFO 48096 --- [-192.168.255.54] o.s.web.servlet.DispatcherServlet : Completed initialization in 13 ms ```
我想通过cmd命令行去调一个jar包的bat脚本怎么写?
RT: 我想启动一个cmd命令行窗口执行命令调用F:\TEST\test.jar,脚本应该怎么写? 1、启动一个cmd控制台 2、可以在任意目录执行:java -jar test.jar 3、打开的cmd控制台不关闭,可以实时打印输出信息(如截图cmd.png) 另外帮忙写个停止执行该jar包的java进程的bat脚本,谢谢!
关于线程上下文类加载器的疑问?
## 看了很多博客都会这样写: 在Java应用中存在着很多服务提供者接口(Service Provider Interface,SPI),这些接口允许第三方为它们提供实现,如常见的 SPI 有 JDBC、JNDI等,这些 SPI 的接口属于 Java 核心库,一般存在rt.jar包中,由Bootstrap类加载器加载,而 SPI 的第三方实现代码则是作为Java应用所依赖的 jar 包被存放在classpath路径下,由于SPI接口中的代码经常需要加载具体的第三方实现类并调用其相关方法,但SPI的核心接口类是由引导类加载器来加载的,而Bootstrap类加载器无法直接加载SPI的实现类,同时由于双亲委派模式的存在,Bootstrap类加载器也无法反向委托AppClassLoader加载器SPI的实现类。在这种情况下,我们就需要一种特殊的类加载器来加载第三方的类库,而线程上下文类加载器就是很好的选择。 ## 我的疑惑: 类加载器的双亲委派机制就是向上委派给父加载器去加载,父加载器不能加载的才让子加载器加载。Bootstrap类加载器无法加载的类会让ext类加载器加载,ext类加载器无法加载的类会让app类加载器加载。。。_**所以为什么Bootstrap类加载器也无法反向委托AppClassLoader加载器SPI的实现类**_??
mybatis中mapper配置问题
第一次创建,报一下这些错误,求解决!求解决!不知道usermapper哪里出问题 D:\Java\jdk1.8.0_172\bin\java.exe "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2018.1.5\lib\idea_rt.jar=58476:C:\Program Files\JetBrains\IntelliJ IDEA 2018.1.5\bin" -Dfile.encoding=UTF-8 -classpath D:\Java\jdk1.8.0_172\jre\lib\charsets.jar;D:\Java\jdk1.8.0_172\jre\lib\deploy.jar;D:\Java\jdk1.8.0_172\jre\lib\ext\access-bridge-64.jar;D:\Java\jdk1.8.0_172\jre\lib\ext\cldrdata.jar;D:\Java\jdk1.8.0_172\jre\lib\ext\dnsns.jar;D:\Java\jdk1.8.0_172\jre\lib\ext\jaccess.jar;D:\Java\jdk1.8.0_172\jre\lib\ext\jfxrt.jar;D:\Java\jdk1.8.0_172\jre\lib\ext\localedata.jar;D:\Java\jdk1.8.0_172\jre\lib\ext\nashorn.jar;D:\Java\jdk1.8.0_172\jre\lib\ext\sunec.jar;D:\Java\jdk1.8.0_172\jre\lib\ext\sunjce_provider.jar;D:\Java\jdk1.8.0_172\jre\lib\ext\sunmscapi.jar;D:\Java\jdk1.8.0_172\jre\lib\ext\sunpkcs11.jar;D:\Java\jdk1.8.0_172\jre\lib\ext\zipfs.jar;D:\Java\jdk1.8.0_172\jre\lib\javaws.jar;D:\Java\jdk1.8.0_172\jre\lib\jce.jar;D:\Java\jdk1.8.0_172\jre\lib\jfr.jar;D:\Java\jdk1.8.0_172\jre\lib\jfxswt.jar;D:\Java\jdk1.8.0_172\jre\lib\jsse.jar;D:\Java\jdk1.8.0_172\jre\lib\management-agent.jar;D:\Java\jdk1.8.0_172\jre\lib\plugin.jar;D:\Java\jdk1.8.0_172\jre\lib\resources.jar;D:\Java\jdk1.8.0_172\jre\lib\rt.jar;D:\workplace\webssm\target\classes;D:\mavenRepository\jstl\jstl\1.2\jstl-1.2.jar;D:\mavenRepository\javax\javaee-api\7.0\javaee-api-7.0.jar;D:\mavenRepository\com\sun\mail\javax.mail\1.5.0\javax.mail-1.5.0.jar;D:\mavenRepository\javax\activation\activation\1.1\activation-1.1.jar;D:\mavenRepository\org\mybatis\mybatis\3.3.0\mybatis-3.3.0.jar;D:\mavenRepository\mysql\mysql-connector-java\5.1.29\mysql-connector-java-5.1.29.jar;D:\mavenRepository\commons-dbcp\commons-dbcp\1.2.2\commons-dbcp-1.2.2.jar;D:\mavenRepository\commons-pool\commons-pool\1.3\commons-pool-1.3.jar;D:\mavenRepository\com\alibaba\fastjson\1.1.41\fastjson-1.1.41.jar;D:\mavenRepository\log4j\log4j\1.2.17\log4j-1.2.17.jar;D:\mavenRepository\org\slf4j\slf4j-api\1.7.18\slf4j-api-1.7.18.jar;D:\mavenRepository\org\slf4j\slf4j-log4j12\1.7.18\slf4j-log4j12-1.7.18.jar;D:\mavenRepository\org\codehaus\jackson\jackson-mapper-asl\1.9.13\jackson-mapper-asl-1.9.13.jar;D:\mavenRepository\org\codehaus\jackson\jackson-core-asl\1.9.13\jackson-core-asl-1.9.13.jar;D:\mavenRepository\com\fasterxml\jackson\core\jackson-core\2.8.0\jackson-core-2.8.0.jar;D:\mavenRepository\com\fasterxml\jackson\core\jackson-databind\2.8.0\jackson-databind-2.8.0.jar;D:\mavenRepository\com\fasterxml\jackson\core\jackson-annotations\2.8.0\jackson-annotations-2.8.0.jar;D:\mavenRepository\commons-fileupload\commons-fileupload\1.3.1\commons-fileupload-1.3.1.jar;D:\mavenRepository\commons-io\commons-io\2.4\commons-io-2.4.jar;D:\mavenRepository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar com.controller.test Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### The error may exist in com/mapper/UserMapper.java (best guess) ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 43; 文档根元素 "mapper" 必须匹配 DOCTYPE 根 "null"。 at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:54) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:38) at com.controller.test.main(test.java:25) Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 43; 文档根元素 "mapper" 必须匹配 DOCTYPE 根 "null"。 at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:115) at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:95) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:52) ... 2 more Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 43; 文档根元素 "mapper" 必须匹配 DOCTYPE 根 "null"。 at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:259) at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:125) at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:78) at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:73) at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.loadXmlResource(MapperAnnotationBuilder.java:166) at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.parse(MapperAnnotationBuilder.java:118) at org.apache.ibatis.binding.MapperRegistry.addMapper(MapperRegistry.java:72) at org.apache.ibatis.session.Configuration.addMapper(Configuration.java:671) at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:348) at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:113) ... 4 more Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 43; 文档根元素 "mapper" 必须匹配 DOCTYPE 根 "null"。 <mapper namespace="com.mapper.UserMapper"> <resultMap type="com.pojo.User" id="userResultMap"> <id property="id" colum="id"/> <result property="username" column="username"/> <result property="sex" column="sex"/> <result property="age" column="age"/> <result property="loginname" column="loginname"/> <result property="password" column="password"/> <result property="phone" column="phone"/> <result property="address" column="address"/> <!-- 一对多关联映射--> <collection property="orders" javaType="ArrayList" column="id" ofType="com.pojo.User" select="com.mapper.OrderMapper.selectOrderByUserId" fetchType="lazy"> <id property="id" colum="id"></id> <result property="code" column="code"></result> <result property="total" column="total"></result> </collection> </resultMap> <select id="selectUserById" parameterType="int" resultMap="userResultMap"> SELECT * FROM user WHERE id = #{id} </select> </mapper> package com.controller; import com.mapper.OrderMapper; import com.mapper.UserMapper; import com.pojo.Order; import com.pojo.User; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.*; //import org.mybatis.spring.SqlSessionFactoryBean; //import org.springframework.aop.scope.ScopedProxyUtils; import java.io.IOException; //import java.io.InputStream; import java.io.Reader; import java.util.List; public class test { public static void main(String[] args) throws IOException { //读取mybatis-config.xml文件 //InputStream inputStream= Resources.getResourceAsStream("mybatis-config.xml"); Reader reader=Resources.getResourceAsReader("mybatis-config.xml"); //初始化mybatis,创建sqlsessionfactory类的实例 SqlSessionFactory sqlSessionFactory=new SqlSessionFactoryBuilder().build(reader); //创建Session实例 SqlSession session=sqlSessionFactory.openSession(); test t=new test(); t.testSelectUserById(session); t.testSelectOrderById(session); session.commit(); session.close(); } //测试一对多关系 public void testSelectUserById(SqlSession session){ //获得usermapper接口的代理对象 UserMapper um=session.getMapper(UserMapper.class); //调用selectUserById方法 User user=um.selectUserById(1); //查询user的对象信息 System.out.println(user.getId()+""+user.getUsername()); List<Order> orders=user.getOrders(); for (Order order:orders ) { System.out.println(order); } } //测试多对多的关系,查询订单Order的时候级联查询订单的商品 public void testSelectOrderById(SqlSession session){ //获得OrderMapper接口的代理对象 OrderMapper om=session.getMapper(OrderMapper.class); //调用selectOrderById方法 Order order=om.selectOrderById(2); //查看查询到的信息 System.out.println(order.getId()+""+order.getCode()+""+order.getTotal()); User user=order.getUser(); System.out.println(user); } }
请教大家一些ClassLoader的问题
Thread t = new Thread() { public void run() { try { Class.forName("test.User"); } catch (ClassNotFoundException e) { e.printStackTrace(); } System.out.println("child thread:" + Thread.currentThread().getContextClassLoader()); } }; t.setContextClassLoader(null); t.start(); 我在这个线程启动之前把context类加载器设置为bootstrap了,那么run方法第一句加载test。User为什么会成功呢?bootstrap加载器没有父加载器了,它尝试加载User类,而这个类是我自己写的,不是在rt.jar中的,那么为什么会成功加载呢?User类不应该由应用加载类加载的吗? 2.还有一个问题,是core java下册中的内容,我不清楚是不是译者的翻译没有到位的问题,他说: 偶尔,你也会需要干涉和指定类加载器,考虑下面的例子: *你的应用代码包含一个助手方法,他要调用Class.forName(classNameString) *这个方法是从一个插件类中被调用的。 *而classNameString指定的正是一个包含在这个插件的jar中的类。 我想象的代码结构可能是这样的。 Class Test{ main(){ Util.foo(); } } class Util{ public static void foo(){ Class.forName(classNameString); } } 然后他说,插件的作者很合理的期望这个类应该被加载,但是,助手方法的类是由系统类加载器(即应用类加载器)加载的。这正是Class.forName所使用的类加载器。而对于他来说,在插件JAR中的类是不可视的,这种现象称为类加载器倒置。 我最后一句话没读懂,如果在eclipse下把插件的jar build进来,不就可以访问到插件中的类了吗?为什么要干涉和指定类加载器?
Spring Boot + Spring Cloud + cxf + maven 启动报错
Springboot+SpringCloud微服务框架上用cxf搭建webservice服务端,启动时报NoSuchMethodError错误。 ``` org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cxf' defined in class path resource [cn/ffcs/geye/crm/webService/server/ServiceConfig.class]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.apache.cxf.bus.spring.SpringBeanLocator.<init>(Lorg/springframework/context/ApplicationContext;Lorg/apache/cxf/Bus;)V 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.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134) at cn.ffcs.StartApplication.main(StartApplication.java:26) Caused by: java.lang.NoSuchMethodError: org.apache.cxf.bus.spring.SpringBeanLocator.<init>(Lorg/springframework/context/ApplicationContext;Lorg/apache/cxf/Bus;)V at org.apache.cxf.bus.spring.SpringBus.setApplicationContext(SpringBus.java:81) at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:121) at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:97) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ... 14 common frames omitted ``` 代码参考 [http://blog.csdn.net/hj7jay/article/details/51130386 ](http://blog.csdn.net/hj7jay/article/details/51130386 "") 添加maven依赖cxf版本是3.1.6。webservice实现类中用@Resource注解注入MyBatis数据库模块(数据库调用在另一个micro server)。 查看错误栈发现,问题在于启动过程中初始化cxf对象,SpringBus类setApplicationContext方法调用SpringBeanLocator类构造方法SpringBeanLocator(ApplicationContext, Bus)。该版本的cxf依赖jar包cxf-rt-core-2.3.1.jar中只有单个参数的构造方法SpringBeanLocator(ApplicationContext)。 换较高和较低的cxf版本,报同样的错误,下载的jar包cxf-rt-core依然是2.3.1版本的。 之前单单搭webservice框架,没有自动注入和处理逻辑时曾经启动成功过并可以访问wsdl,现在怎么弄都启动不成功。大神帮忙。
hdfs 上传/下载文件报错
上传 不报错。但是hdfs 上面的文件大小为0. 下载的时候 org.apache.hadoop.hdfs.BlockMissingException: Could not obtain block: BP-127181180-172.17.0.2-1526283881280:blk_1073741825_1001 file=/wing/LICENSE.txt at org.apache.hadoop.hdfs.DFSInputStream.chooseDataNode(DFSInputStream.java:946) at org.apache.hadoop.hdfs.DFSInputStream.blockSeekTo(DFSInputStream.java:604) at org.apache.hadoop.hdfs.DFSInputStream.readWithStrategy(DFSInputStream.java:844) at org.apache.hadoop.hdfs.DFSInputStream.read(DFSInputStream.java:896) at java.io.DataInputStream.read(DataInputStream.java:100) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:85) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:59) at org.apache.hadoop.io.IOUtils.copyBytes(IOUtils.java:119) at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:366) at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:338) at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:289) at org.apache.hadoop.fs.FileSystem.copyToLocalFile(FileSystem.java:2030) at hadoop.hdfs.HdfsTest.testDownLoad(HdfsTest.java:76) 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.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) 求各位大佬帮忙看看。环境是在docker 上部署的, 1主2丛。jps查看 datanode和nameNode 都是活的。 网页访问50070 也能进入web 也,里面显示的节点也是活的。 在服务器上用 hdfs dfs -put /get 操作可以成功。 java 代码如下: private FileSystem createClient() throws IOException { //设置程序执行的用户为root System.setProperty("HADOOP_USER_NAME","root"); //指定NameNode的地址 Configuration conf = new Configuration(); conf.set("fs.defaultFS","hdfs://Master:9000"); //创建hdfs客户端 return FileSystem.get(conf); } @Test public void testMkdir() throws IOException { FileSystem client = createClient(); //创建目录 client.mkdirs(new Path(PATH)); //关闭客户端 client.close(); } @Test public void testUpload() throws Exception{ FileSystem client = createClient(); //构造输入流 InputStream in = new FileInputStream("d:\\bcprov-jdk16-1.46.jar"); //构造输出流 OutputStream out = client.create(new Path(PATH +"/bcprov.jar")); //上传 IOUtils.copyBytes(in, out ,1024); //关闭客户端 client.close(); } @Test public void testDownLoad() throws Exception{ FileSystem client = createClient(); //构造输入流 FSDataInputStream in = client.open(new Path("hdfs://Master:9000/wing/LICENSE.txt")); //构造输出流 OutputStream out = new FileOutputStream("d:\\hello.txt"); //下载 IOUtils.copyBytes(in, System.out, 1024, false); IOUtils.closeStream(in); IOUtils.closeStream(out); //关闭客户端 client.close(); } 其他api 调用是可以的,比如创建目录。
为什么调用Mapper或者service时,报空指针错误
代码如下 ``` @Autowired InformationMapper mapper; @Test public void test01(){ System.out.println(mapper.selectByPrimaryKey(1)); } ``` 报错信息如下 ``` java.lang.NullPointerException at com.viready.socket.test.test01(test.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) 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.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) ```
idea配置mybits generate时报错,请问是哪配错了吗?
报错说找不到driver-class-name核对了很多次都没问题啊 报错: ``` D:\jdk1.8.0_121\bin\java.exe -Dmaven.multiModuleProjectDirectory=D:\mycode\demo_mybits\demo "-Dmaven.home=D:\software\idea\IntelliJ IDEA 2018.2.6\plugins\maven\lib\maven3" "-Dclassworlds.conf=D:\software\idea\IntelliJ IDEA 2018.2.6\plugins\maven\lib\maven3\bin\m2.conf" "-javaagent:D:\software\idea\IntelliJ IDEA 2018.2.6\lib\idea_rt.jar=7115:D:\software\idea\IntelliJ IDEA 2018.2.6\bin" -Dfile.encoding=UTF-8 -classpath "D:\software\idea\IntelliJ IDEA 2018.2.6\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2018.2.6 mybatis-generator:generate -e [INFO] Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building demo 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- mybatis-generator-maven-plugin:1.3.2:generate (default-cli) @ demo --- [INFO] Connecting to the Database [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.637 s [INFO] Finished at: 2019-11-11T09:52:35+08:00 [INFO] Final Memory: 14M/245M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project demo: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Exception getting JDBC Driver: {spring.datasource.driver-class-name} -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project demo: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Exception getting JDBC Driver at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) at org.codehaus.classworlds.Launcher.main(Launcher.java:47) Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Exception getting JDBC Driver at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) ... 21 more Caused by: java.lang.RuntimeException: Exception getting JDBC Driver at org.mybatis.generator.internal.db.ConnectionFactory.getDriver(ConnectionFactory.java:85) at org.mybatis.generator.internal.db.ConnectionFactory.getConnection(ConnectionFactory.java:54) at org.mybatis.generator.config.Context.getConnection(Context.java:526) at org.mybatis.generator.config.Context.introspectTables(Context.java:436) at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:222) at org.mybatis.generator.maven.MyBatisGeneratorMojo.execute(MyBatisGeneratorMojo.java:203) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) ... 22 more Caused by: java.lang.ClassNotFoundException: {spring.datasource.driver-class-name} at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.mybatis.generator.internal.ObjectFactory.internalClassForName(ObjectFactory.java:150) at org.mybatis.generator.internal.ObjectFactory.externalClassForName(ObjectFactory.java:121) at org.mybatis.generator.internal.db.ConnectionFactory.getDriver(ConnectionFactory.java:82) ... 28 more [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException Process finished with exit code 1 ``` application.properties ``` ## 服务器端口,如果不配置默认是8080端口 server.port=9090 ## 数据库设置 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/boot_demo?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8 spring.datasource.username=root spring.datasource.password=x5 ## mybatis配置 # 参数类型的包别名设置 mybatis.typeAliasesPackage=com.example.demo.model # 指向映射xml文件目录 mybatis.mapperLocations=classpath:mapper/*.xml pagehelper.helperDialect=mysql pagehelper.reasonable=true pagehelper.supportMethodsArguments=true pagehelper.params=count=countSql ``` pom.xml ``` <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.0.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.example</groupId> <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <name>demo</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.3.2</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.2.10</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.7</version> <configuration> <verbose>true</verbose> <overwrite>true</overwrite> </configuration> <dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.18</version> <scope>runtime</scope> </dependency> </dependencies> </plugin> </plugins> </build> </project> ``` generatorConfig.xml ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> <generatorConfiguration> <!--导入配置文件--> <properties resource="application.properties"></properties> <!-- 一个数据库一个context --> <context id="default"> <!-- 注释生成设置 --> <commentGenerator> <!-- 是否生成注释代时间戳--> <property name="suppressDate" value="true" /> <!-- 是否取消注释 --> <property name="suppressAllComments" value="true" /> </commentGenerator> <!--jdbc的数据库连接--> <jdbcConnection driverClass="{spring.datasource.driver-class-name}" connectionURL="{spring.datasource.url}" userId="{spring.datasource.username}" password="{spring.datasource.password}"> <property name="nullCatalogMeansCurrent" value="true" /> </jdbcConnection> <!-- 类型转换 --> <javaTypeResolver> <!-- 是否使用bigDecimal, false可自动转化以下类型(Long, Integer, Short, etc.) --> <property name="forceBigDecimals" value="false" /> </javaTypeResolver> <!-- targetPackage:生成的实体类所在的包 --> <!-- targetProject:生成的实体类所在的硬盘位置 --> <javaModelGenerator targetPackage="com.example.demo.model" targetProject="src/main/java"> <!-- 是否允许子包 --> <property name="enableSubPackages" value="false" /> <!-- 是否对modal添加构造函数 --> <property name="constructorBased" value="true" /> <!-- 是否清理从数据库中查询出的字符串左右两边的空白字符 --> <property name="trimStrings" value="true" /> <!-- 建立modal对象是否不可改变 即生成的modal对象不会有setter方法,只有构造方法 --> <property name="immutable" value="false" /> </javaModelGenerator> <!-- targetPackage 和 targetProject:生成的 mapper xml 文件的包和位置 --> <sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources"> <!-- 是否在当前路径下新加一层schema,ex:false路径com.qikegu.demo.model, com.qikegu.demo.model.[schemaName] --> <property name="enableSubPackages" value="false" /> <!-- 是否针对string类型的字段在set的时候进行trim调用 --> <property name="trimStrings" value="true"/> </sqlMapGenerator> <!-- targetPackage 和 targetProject:生成的 java interface 文件的包和位置 --> <javaClientGenerator type="XMLMAPPER" targetPackage="com.example.demo.repository" targetProject="src/main/java"> <!-- 是否在当前路径下新加一层schema,ex:false路径com.qikegu.demo.model, com.qikegu.demo.model.[schemaName] --> <property name="enableSubPackages" value="false" /> </javaClientGenerator> <!-- 配置表信息 --> <!-- schema即为数据库名 tableName为对应的数据库表 domainObjectName是要生成的实体类 enable*ByExample, 是否生成 example类 --> <!-- 不同的表,修改tableName和domainObjectName就可以 --> <table tableName="user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> </table> </context> </generatorConfiguration> ```
EJB3 编写 WebService 的返回列表的问题.
服务端的 EJB 代码如下: <br /> <br /> <br /><pre name="code" class="java">@WebService(name = "TravelAgent", serviceName = "TravelAgentService") @Stateless public class TravelAgentBean implements TravelAgentRemote { ...... @WebMethod @WebResult(name = "List") public List test(@WebParam(name = "name") String name) { System.out.println("name : ");System.out.println(name); Query query = manager.createQuery("from Cabin c"); List list = query.getResultList(); return list; } ...... } </pre> <br /> <br />客户端的 PHP 代码如下: <br /><pre name="code" class="php">$client = new SoapClient($wsdl_url); $username = $client-&gt;test(array('name'=&gt;'asdfhasldfjl')); var_dump($username); </pre> <br />如果服务端是 @Stateless . 使用 Java 客户端调用是没有问题的, <br /> <br />服务端是 @WebService 时, 使用 new ArrayList 实现返回也是没有问题. 唯有 query.getResultList(); 返回时, 出现 WebServiceException 异常. <br />那位高手有空, 请指点下小弟. 小弟是新手. 3 个月前刚买了几本 java 的书看看. <br /> <br />QQ : 280016524 <br />Email : degui.chen@qq.com <br /> <br />如下是服务器端抛出的异常: <br />22:44:45,127 INFO  [EJB3Deployer] Deployed: file:/C:/jboss-4.2.3.GA/server/defau <br />lt/deploy/WebServicesDemo.jar/ <br />22:44:45,228 INFO  [DefaultEndpointRegistry] register: jboss.ws:context=WebServi <br />cesDemo,endpoint=TravelAgentBean <br />22:44:51,086 INFO  [WSDLFilePublisher] WSDL published to: file:/C:/jboss-4.2.3.G <br />A/server/default/data/wsdl/WebServicesDemo.jar/TravelAgentService55191.wsdl <br />22:44:51,396 INFO  [TomcatDeployer] deploy, ctxPath=/WebServicesDemo, warUrl=... <br />/tmp/deploy/WebServicesDemo.jar55190.war/ <br />22:44:53,570 INFO  [STDOUT] name : <br />22:44:53,570 INFO  [STDOUT] asdfhasldfjl <br />22:44:54,691 INFO  [STDOUT] list : <br />22:44:54,691 INFO  [STDOUT] [chen.degui.domain.Cabin@1681460] <br />22:44:54,711 ERROR [RequestHandlerImpl] Error processing web service request <br />org.jboss.ws.WSException: javax.xml.ws.WebServiceException: javax.xml.bind.Marsh <br />alException <br /> - with linked exception: <br />[javax.xml.bind.JAXBException: class chen.degui.domain.Cabin nor any of its supe <br />r class is known to this context.] <br />        at org.jboss.ws.WSException.rethrow(WSException.java:68) <br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHand <br />lerImpl.java:325) <br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl <br />.java:201) <br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(Request <br />HandlerImpl.java:134) <br />        at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java <br />:84) <br />        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) <br />        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl <br />icationFilterChain.java:290) <br />        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF <br />ilterChain.java:206) <br />        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi <br />lter.java:96) <br />        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl <br />icationFilterChain.java:235) <br />        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF <br />ilterChain.java:206) <br />        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV <br />alve.java:230) <br />        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV <br />alve.java:175) <br />        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit <br />yAssociationValve.java:182) <br />        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv <br />e.java:84) <br />        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j <br />ava:127) <br />        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j <br />ava:102) <br />        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC <br />onnectionValve.java:157) <br />        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal <br />ve.java:109) <br />        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav <br />a:262) <br />        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java <br />:844) <br />        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce <br />ss(Http11Protocol.java:583) <br />        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44 <br />6) <br />        at java.lang.Thread.run(Thread.java:619) <br />Caused by: javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException <br /> - with linked exception: <br />[javax.xml.bind.JAXBException: class chen.degui.domain.Cabin nor any of its supe <br />r class is known to this context.] <br />        at org.jboss.ws.core.jaxws.JAXBSerializer.handleMarshallException(JAXBSe <br />rializer.java:124) <br />        at org.jboss.ws.core.jaxws.JAXBSerializer.serialize(JAXBSerializer.java: <br />87) <br />        at org.jboss.ws.core.binding.SerializerSupport.serialize(SerializerSuppo <br />rt.java:57) <br />        at org.jboss.ws.core.soap.ObjectContent.marshallObjectContents(ObjectCon <br />tent.java:159) <br />        at org.jboss.ws.core.soap.ObjectContent.transitionTo(ObjectContent.java: <br />72) <br />        at org.jboss.ws.core.soap.SOAPContentElement.transitionTo(SOAPContentEle <br />ment.java:141) <br />        at org.jboss.ws.core.soap.SOAPBodyElementDoc.transitionTo(SOAPBodyElemen <br />tDoc.java:85) <br />        at org.jboss.ws.core.soap.SOAPContentElement.writeElement(SOAPContentEle <br />ment.java:547) <br />        at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElemen <br />tImpl.java:840) <br />        at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.j <br />ava:825) <br />        at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElemen <br />tImpl.java:840) <br />        at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.j <br />ava:825) <br />        at org.jboss.ws.core.soap.SOAPElementWriter.writeElementInternal(SOAPEle <br />mentWriter.java:149) <br />        at org.jboss.ws.core.soap.SOAPElementWriter.writeElement(SOAPElementWrit <br />er.java:130) <br />        at org.jboss.ws.core.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:3 <br />25) <br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.sendResponse(RequestHandl <br />erImpl.java:392) <br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHand <br />lerImpl.java:321) <br />        ... 22 more <br />Caused by: javax.xml.bind.MarshalException <br /> - with linked exception: <br />[javax.xml.bind.JAXBException: class chen.degui.domain.Cabin nor any of its supe <br />r class is known to this context.] <br />        at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java: <br />320) <br />        at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.jav <br />a:246) <br />        at org.jboss.ws.core.jaxws.JAXBSerializer.serialize(JAXBSerializer.java: <br />81) <br />        ... 37 more <br />Caused by: javax.xml.bind.JAXBException: class chen.degui.domain.Cabin nor any o <br />f its super class is known to this context. <br />        at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.j <br />ava:240) <br />        at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.j <br />ava:255) <br />        at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerialize <br />r.java:647) <br />        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.seriali <br />zeItem(ArrayElementNodeProperty.java:65) <br />        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeLi <br />stBody(ArrayElementProperty.java:168) <br />        at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(Ar <br />rayERProperty.java:152) <br />        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBean <br />InfoImpl.java:322) <br />        at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerialize <br />r.java:679) <br />        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(Eleme <br />ntBeanInfoImpl.java:151) <br />        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(Eleme <br />ntBeanInfoImpl.java:185) <br />        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(Element <br />BeanInfoImpl.java:305) <br />        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(Element <br />BeanInfoImpl.java:312) <br />        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(Element <br />BeanInfoImpl.java:71) <br />        at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.j <br />ava:488) <br />        at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java: <br />317) <br />        ... 39 more <br />Caused by: javax.xml.bind.JAXBException: class chen.degui.domain.Cabin nor any o <br />f its super class is known to this context. <br />        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextIm <br />pl.java:556) <br />        at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerialize <br />r.java:642) <br />        ... 51 more <br />22:44:54,861 ERROR [[TravelAgentBean]] Servlet.service() for servlet TravelAgent <br />Bean threw exception <br />javax.xml.bind.JAXBException: class chen.degui.domain.Cabin nor any of its super <br /> class is known to this context. <br />        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextIm <br />pl.java:556) <br />        at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerialize <br />r.java:642) <br />        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.seriali <br />zeItem(ArrayElementNodeProperty.java:65) <br />        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeLi <br />stBody(ArrayElementProperty.java:168) <br />        at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(Ar <br />rayERProperty.java:152) <br />        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBean <br />InfoImpl.java:322) <br />        at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerialize <br />r.java:679) <br />        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(Eleme <br />ntBeanInfoImpl.java:151) <br />        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(Eleme <br />ntBeanInfoImpl.java:185) <br />        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(Element <br />BeanInfoImpl.java:305) <br />        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(Element <br />BeanInfoImpl.java:312) <br />        at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(Element <br />BeanInfoImpl.java:71) <br />        at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.j <br />ava:488) <br />        at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java: <br />317) <br />        at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.jav <br />a:246) <br />        at org.jboss.ws.core.jaxws.JAXBSerializer.serialize(JAXBSerializer.java: <br />81) <br />        at org.jboss.ws.core.binding.SerializerSupport.serialize(SerializerSuppo <br />rt.java:57) <br />        at org.jboss.ws.core.soap.ObjectContent.marshallObjectContents(ObjectCon <br />tent.java:159) <br />        at org.jboss.ws.core.soap.ObjectContent.transitionTo(ObjectContent.java: <br />72) <br />        at org.jboss.ws.core.soap.SOAPContentElement.transitionTo(SOAPContentEle <br />ment.java:141) <br />        at org.jboss.ws.core.soap.SOAPBodyElementDoc.transitionTo(SOAPBodyElemen <br />tDoc.java:85) <br />        at org.jboss.ws.core.soap.SOAPContentElement.writeElement(SOAPContentEle <br />ment.java:547) <br />        at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElemen <br />tImpl.java:840) <br />        at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.j <br />ava:825) <br />        at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElemen <br />tImpl.java:840) <br />        at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.j <br />ava:825) <br />        at org.jboss.ws.core.soap.SOAPElementWriter.writeElementInternal(SOAPEle <br />mentWriter.java:149) <br />        at org.jboss.ws.core.soap.SOAPElementWriter.writeElement(SOAPElementWrit <br />er.java:130) <br />        at org.jboss.ws.core.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:3 <br />25) <br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.sendResponse(RequestHandl <br />erImpl.java:392) <br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHand <br />lerImpl.java:321) <br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl <br />.java:201) <br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(Request <br />HandlerImpl.java:134) <br />        at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java <br />:84) <br />        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) <br />        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl <br />icationFilterChain.java:290) <br />        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF <br />ilterChain.java:206) <br />        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi <br />lter.java:96) <br />        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl <br />icationFilterChain.java:235) <br />        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF <br />ilterChain.java:206) <br />        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV <br />alve.java:230) <br />        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV <br />alve.java:175) <br />        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit <br />yAssociationValve.java:182) <br />        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv <br />e.java:84) <br />        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j <br />ava:127) <br />        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j <br />ava:102) <br />        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC <br />onnectionValve.java:157) <br />        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal <br />ve.java:109) <br />        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav <br />a:262) <br />        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java <br />:844) <br />        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce <br />ss(Http11Protocol.java:583) <br />        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44 <br />6) <br />        at java.lang.Thread.run(Thread.java:619) <br /><br /><strong>问题补充</strong><br />多谢 Anatorian 的建议. :<br />下面是我添加的修改后的结果:<br /><br /><pre name="code" class="java">@Entity @XmlRootElement public class Cabin implements java.io.Serializable { private int id; private String name; private int deckLevel; private int shipId; private int bedCount; @Id @Column(name = "CABIN_ID") public int getId() { ............... </pre><br /><br />异常为:<br />23:59:14,985 INFO  [WSDLFilePublisher] WSDL published to: file:/C:/jboss-4.2.3.G<br />A/server/default/data/wsdl/WebServicesDemo.jar/TravelAgentService64072.wsdl<br />23:59:15,496 INFO  [TomcatDeployer] deploy, ctxPath=/WebServicesDemo, warUrl=...<br />/tmp/deploy/WebServicesDemo.jar64071.war/<br />23:59:43,506 INFO  [STDOUT] name :<br />23:59:43,506 INFO  [STDOUT] asdfhasldfjl<br />23:59:45,689 INFO  [STDOUT] list :<br />23:59:45,689 INFO  [STDOUT] [chen.degui.domain.Cabin@175beef]<br />23:59:45,729 ERROR [RequestHandlerImpl] Error processing web service request<br />org.jboss.ws.WSException: javax.xml.ws.WebServiceException: javax.xml.bind.Marsh<br />alException<br /> - with linked exception:<br />[javax.xml.bind.JAXBException: class chen.degui.domain.Cabin nor any of its supe<br />r class is known to this context.]<br />        at org.jboss.ws.WSException.rethrow(WSException.java:68)<br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHand<br />lerImpl.java:325)<br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl<br />.java:201)<br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(Request<br />HandlerImpl.java:134)<br />        at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java<br />:84)<br />        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)<br />        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl<br />icationFilterChain.java:290)<br />        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF<br />ilterChain.java:206)<br />        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi<br />lter.java:96)<br />        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl<br />icationFilterChain.java:235)<br />        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF<br />ilterChain.java:206)<br />        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV<br />alve.java:230)<br />        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV<br />alve.java:175)<br />        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit<br />yAssociationValve.java:182)<br />        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv<br />e.java:84)<br />        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j<br />ava:127)<br />        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j<br />ava:102)<br />        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC<br />onnectionValve.java:157)<br />        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal<br />ve.java:109)<br />        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav<br />a:262)<br />        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java<br />:844)<br />        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce<br />ss(Http11Protocol.java:583)<br />        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44<br />6)<br />        at java.lang.Thread.run(Thread.java:619)<br />Caused by: javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException<br /> - with linked exception:<br />[javax.xml.bind.JAXBException: class chen.degui.domain.Cabin nor any of its supe<br />r class is known to this context.]<br />        at org.jboss.ws.core.jaxws.JAXBSerializer.handleMarshallException(JAXBSe<br />rializer.java:124)<br />        at org.jboss.ws.core.jaxws.JAXBSerializer.serialize(JAXBSerializer.java:<br />87)<br />        at org.jboss.ws.core.binding.SerializerSupport.serialize(SerializerSuppo<br />rt.java:57)<br />        at org.jboss.ws.core.soap.ObjectContent.marshallObjectContents(ObjectCon<br />tent.java:159)<br />        at org.jboss.ws.core.soap.ObjectContent.transitionTo(ObjectContent.java:<br />72)<br />        at org.jboss.ws.core.soap.SOAPContentElement.transitionTo(SOAPContentEle<br />ment.java:141)<br />        at org.jboss.ws.core.soap.SOAPBodyElementDoc.transitionTo(SOAPBodyElemen<br />tDoc.java:85)<br />        at org.jboss.ws.core.soap.SOAPContentElement.writeElement(SOAPContentEle<br />ment.java:547)<br />        at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElemen<br />tImpl.java:840)<br />        at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.j<br />ava:825)<br />        at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElemen<br />tImpl.java:840)<br />        at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.j<br />ava:825)<br />        at org.jboss.ws.core.soap.SOAPElementWriter.writeElementInternal(SOAPEle<br />mentWriter.java:149)<br />        at org.jboss.ws.core.soap.SOAPElementWriter.writeElement(SOAPElementWrit<br />er.java:130)<br />        at org.jboss.ws.core.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:3<br />25)<br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.sendResponse(RequestHandl<br />erImpl.java:392)<br />        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHand<br />lerImpl.java:321)<br />        ... 22 more<br />Caused by: javax.xml.bind.MarshalException<br /> - with linked exception:<br />[javax.xml.bind.JAXBException: class chen.degui.domain.Cabin nor any of its supe<br />r class is known to this context.]<br />        at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:<br />320)<br />        at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.jav<br />a:246)<br />        at org.jboss.ws.core.jaxws.JAXBSerializer.serialize(JAXBSerializer.java:<br />81)<br /><br /><strong>问题补充</strong><br />没有高手有空?
kettle的JOB互相嵌套的作业,在windows上正常运行,迁移到Linux服务器就报错了
windows系统运行正常: ![图片说明](https://img-ask.csdn.net/upload/201907/29/1564389024_347344.png) Linux系统下运行报错: ``` /usr/local/kettle/data-integration/spoon.sh: line 140: ldconfig: command not found ####################################################################### WARNING: no libwebkitgtk-1.0 detected, some features will be unavailable Consider installing the package with apt-get or yum. e.g. 'sudo apt-get install libwebkitgtk-1.0-0' ####################################################################### Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0 log4j:WARN Continuable parsing error 45 and column 76 log4j:WARN Element type "rollingPolicy" must be declared. log4j:WARN Continuable parsing error 52 and column 14 log4j:WARN The content of element type "appender" must match "(errorHandler?,param*,layout?,filter*,appender-ref*)". log4j:WARN Please set a rolling policy for the RollingFileAppender named 'pdi-execution-appender' 16:11:29,469 INFO [KarafBoot] Checking to see if org.pentaho.clean.karaf.cache is enabled 16:11:29,646 INFO [KarafInstance] ******************************************************************************* *** Karaf Instance Number: 1 at /usr/local/kettle/data-integration/./system *** *** /karaf/caches/kitchen/data-1 *** *** FastBin Provider Port:52901 *** *** Karaf Port:8802 *** *** OSGI Service Port:9051 *** ******************************************************************************* Jul 29, 2019 4:11:32 PM org.apache.karaf.main.Main$KarafLockCallback lockAquired INFO: Lock acquired. Setting startlevel to 100 2019/07/29 16:11:36 - Kitchen - Start of run. 2019/07/29 16:11:36 - RepositoriesMeta - Reading repositories XML file: /usr/local/kettle/.kettle/repositories.xml 2019-07-29 16:11:53.034:INFO:oejs.Server:jetty-8.1.15.v20140411 2019-07-29 16:11:53.106:INFO:oejs.AbstractConnector:Started NIOSocketConnectorWrapper@0.0.0.0:9051 Jul 29, 2019 4:11:58 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/blueprint/core Jul 29, 2019 4:11:58 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/configuration/beans Jul 29, 2019 4:11:58 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/configuration/parameterized-types Jul 29, 2019 4:11:58 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/configuration/security Jul 29, 2019 4:11:58 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://schemas.xmlsoap.org/wsdl/ Jul 29, 2019 4:11:58 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://www.w3.org/2005/08/addressing Jul 29, 2019 4:11:58 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://schemas.xmlsoap.org/ws/2004/08/addressing Jul 29, 2019 4:11:58 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-management (195) [org.apache.cxf.management.InstrumentationManager] Jul 29, 2019 4:11:59 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-wsdl (198) [org.apache.cxf.wsdl.WSDLManager] Jul 29, 2019 4:11:59 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-bindings-xml (200) [org.apache.cxf.binding.xml.XMLBindingFactory, org.apache.cxf.binding.xml.wsdl11.XMLWSDLExtensionLoader] Jul 29, 2019 4:11:59 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-bindings-soap (201) [org.apache.cxf.binding.soap.SoapBindingFactory, org.apache.cxf.binding.soap.SoapTransportFactory] Jul 29, 2019 4:11:59 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/blueprint/bindings/soap Jul 29, 2019 4:11:59 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-transports-http (202) [org.apache.cxf.transport.http.HTTPTransportFactory, org.apache.cxf.transport.http.HTTPWSDLExtensionLoader, org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder, org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder, org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider] Jul 29, 2019 4:11:59 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-ws-policy (220) [org.apache.cxf.ws.policy.PolicyEngine, org.apache.cxf.policy.PolicyDataEngine, org.apache.cxf.ws.policy.AssertionBuilderRegistry, org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry, org.apache.cxf.ws.policy.PolicyBuilder, org.apache.cxf.ws.policy.PolicyAnnotationListener, org.apache.cxf.ws.policy.attachment.ServiceModelPolicyProvider, org.apache.cxf.ws.policy.attachment.external.DomainExpressionBuilderRegistry, org.apache.cxf.ws.policy.attachment.external.EndpointReferenceDomainExpressionBuilder, org.apache.cxf.ws.policy.attachment.external.URIDomainExpressionBuilder, org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider, org.apache.cxf.ws.policy.mtom.MTOMAssertionBuilder, org.apache.cxf.ws.policy.mtom.MTOMPolicyInterceptorProvider] Jul 29, 2019 4:11:59 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/transports/http/configuration Jul 29, 2019 4:11:59 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/blueprint/simple Jul 29, 2019 4:11:59 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-frontend-jaxws (204) [org.apache.cxf.jaxws.context.WebServiceContextResourceResolver] Jul 29, 2019 4:11:59 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/blueprint/jaxws Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/blueprint/jaxrs Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/blueprint/jaxrs-client Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/binding/coloc Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-transports-local (216) [org.apache.cxf.transport.local.LocalTransportFactory] Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-bindings-object (217) [org.apache.cxf.binding.object.ObjectBindingFactory] Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/blueprint/binding/object Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/policy Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://www.w3.org/ns/ws-policy Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://www.w3.org/2006/07/ws-policy Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://schemas.xmlsoap.org/ws/2004/09/policy Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://www.w3.org/2000/09/xmldsig# Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702 Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-ws-addr (237) [org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder, org.apache.cxf.ws.addressing.policy.UsingAddressingAssertionBuilder, org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorProvider, org.apache.cxf.ws.addressing.impl.AddressingWSDLExtensionLoader, org.apache.cxf.ws.addressing.WSAddressingFeature$WSAddressingFeatureApplier, org.apache.cxf.ws.addressing.MAPAggregator$MAPAggregatorLoader] Jul 29, 2019 4:12:00 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/ws/addressing Jul 29, 2019 4:12:01 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-ws-security (239) [org.apache.cxf.ws.security.policy.WSSecurityPolicyLoader, org.apache.cxf.ws.security.cache.CacheCleanupListener] Jul 29, 2019 4:12:01 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-ws-rm (241) [org.apache.cxf.ws.rm.RMManager, org.apache.cxf.ws.rm.policy.RMPolicyInterceptorProvider, org.apache.cxf.ws.rm.policy.RM10AssertionBuilder, org.apache.cxf.ws.rm.policy.RM12AssertionBuilder, org.apache.cxf.ws.rm.policy.WSRMP12PolicyLoader, org.apache.cxf.ws.rm.policy.MC11PolicyLoader, org.apache.cxf.ws.rm.policy.RSPPolicyLoader] Jul 29, 2019 4:12:01 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://cxf.apache.org/ws/rm/manager Jul 29, 2019 4:12:01 PM org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer register INFO: Registered blueprint namespace handler for http://schemas.xmlsoap.org/ws/2005/02/rm/policy Jul 29, 2019 4:12:01 PM org.apache.cxf.bus.osgi.CXFExtensionBundleListener addExtensions INFO: Adding the extensions from bundle org.apache.cxf.cxf-rt-javascript (242) [org.apache.cxf.javascript.JavascriptServerListener] Jul 29, 2019 4:12:01 PM org.pentaho.caching.impl.PentahoCacheManagerFactory$RegistrationHandler$1 onSuccess INFO: New Caching Service registered SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/local/kettle/data-integration/launcher/../lib/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/local/kettle/data-integration/plugins/pentaho-big-data-plugin/lib/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 2019/07/29 16:12:08 - test - Start of job execution log4j:ERROR No output stream or file set for the appender named [pdi-execution-appender]. 2019/07/29 16:12:08 - test - Starting entry [job1] 2019/07/29 16:12:08 - test - Launched job entry [job1] in parallel. 2019/07/29 16:12:08 - test - Starting entry [job2] 2019/07/29 16:12:08 - test - Launched job entry [job2] in parallel. 2019/07/29 16:12:08 - job2 - ERROR (version 8.2.0.0-342, build 8.2.0.0-342 from 2018-11-14 10.30.55 by buildguy) : Error running job entry 'job' : 2019/07/29 16:12:08 - job1 - ERROR (version 8.2.0.0-342, build 8.2.0.0-342 from 2018-11-14 10.30.55 by buildguy) : Error running job entry 'job' : 2019/07/29 16:12:08 - job2 - ERROR (version 8.2.0.0-342, build 8.2.0.0-342 from 2018-11-14 10.30.55 by buildguy) : org.pentaho.di.core.exception.KettleException: 2019/07/29 16:12:08 - job2 - Unexpected error during job metadata load 2019/07/29 16:12:08 - job2 - at java.lang.Thread.run (Thread.java:748) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.Job$1.run (Job.java:798) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.Job.access$000 (Job.java:121) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.Job.execute (Job.java:680) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.entries.job.JobEntryJob.execute (JobEntryJob.java:667) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMeta (JobEntryJob.java:1343) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMeta (JobEntryJob.java:1381) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMetaFromRepository (JobEntryJob.java:1353) 2019/07/29 16:12:08 - job2 - 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMeta(JobEntryJob.java:1421) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMeta(JobEntryJob.java:1343) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.entries.job.JobEntryJob.execute(JobEntryJob.java:667) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.Job.execute(Job.java:680) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.Job.access$000(Job.java:121) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.Job$1.run(Job.java:798) 2019/07/29 16:12:08 - job2 - at java.lang.Thread.run(Thread.java:748) 2019/07/29 16:12:08 - job2 - Caused by: java.lang.NullPointerException 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMetaFromRepository(JobEntryJob.java:1353) 2019/07/29 16:12:08 - job2 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMeta(JobEntryJob.java:1381) 2019/07/29 16:12:08 - job2 - ... 6 more 2019/07/29 16:12:08 - job1 - ERROR (version 8.2.0.0-342, build 8.2.0.0-342 from 2018-11-14 10.30.55 by buildguy) : org.pentaho.di.core.exception.KettleException: 2019/07/29 16:12:08 - job1 - Unexpected error during job metadata load 2019/07/29 16:12:08 - job1 - at java.lang.Thread.run (Thread.java:748) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.Job$1.run (Job.java:798) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.Job.access$000 (Job.java:121) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.Job.execute (Job.java:680) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.entries.job.JobEntryJob.execute (JobEntryJob.java:667) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMeta (JobEntryJob.java:1343) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMeta (JobEntryJob.java:1381) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMetaFromRepository (JobEntryJob.java:1353) 2019/07/29 16:12:08 - job1 - 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMeta(JobEntryJob.java:1421) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMeta(JobEntryJob.java:1343) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.entries.job.JobEntryJob.execute(JobEntryJob.java:667) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.Job.execute(Job.java:680) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.Job.access$000(Job.java:121) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.Job$1.run(Job.java:798) 2019/07/29 16:12:08 - job1 - at java.lang.Thread.run(Thread.java:748) 2019/07/29 16:12:08 - job1 - Caused by: java.lang.NullPointerException 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMetaFromRepository(JobEntryJob.java:1353) 2019/07/29 16:12:08 - job1 - at org.pentaho.di.job.entries.job.JobEntryJob.getJobMeta(JobEntryJob.java:1381) 2019/07/29 16:12:08 - job1 - ... 6 more 2019/07/29 16:12:08 - test - Job execution finished 2019/07/29 16:12:08 - Kitchen - Finished! 2019/07/29 16:12:08 - Kitchen - ERROR (version 8.2.0.0-342, build 8.2.0.0-342 from 2018-11-14 10.30.55 by buildguy) : Finished with errors 2019/07/29 16:12:08 - Kitchen - Start=2019/07/29 16:11:36.193, Stop=2019/07/29 16:12:08.071 2019/07/29 16:12:08 - Kitchen - Processing ended after 31 seconds. ``` Linux环境运行作业调用转换的就没问题,作业调用作业的就报错,望大神指点,哪儿有问题。 kettle版本为8.2,jdk版本为 java version "1.8.0_171" 如果需要什么其他的参数,我再上传
Mybatis小练习 报错 求大神指导,信息详尽
# UserMapper ``` public interface UserMapper { //根据id查询用户信息 public User findUserById(int id) throws Exception; //根据用户名列查询用户列表 public List<User> findUserByName(String name)throws Exception; //插入用户 public void insertUser(User user)throws Exception; } ``` # UserMapper.xml ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!-- namespace命名空间,作用就是对sql进行分类化管理,理解sql隔离 注意:使用mapper代理方法开发,namespace有特殊重要的作用,namespace等于mapper接口地址 --> <mapper namespace="com.neuedu.mapper.UserMapper"> <!-- 在 映射文件中配置很多sql语句 --> <!-- 需求:通过id查询用户表的记录 --> <!-- 通过 select执行数据库查询 id:标识 映射文件中的 sql 将sql语句封装到mappedStatement对象中,所以将id称为statement的id parameterType:指定输入 参数的类型,这里指定int型 #{}表示一个占位符号 #{id}:其中的id表示接收输入 的参数,参数名称就是id,如果输入 参数是简单类型,#{}中的参数名可以任意,可以value或其它名称 resultType:指定sql输出结果 的所映射的java对象类型,select指定resultType表示将单条记录映射成的java对象。 --> <select id="findUserById" parameterType="int" resultType="user"> SELECT * FROM user WHERE id=#{value} </select> <!-- 根据用户名称模糊查询用户信息,可能返回多条 resultType:指定就是单条记录所映射的java对象 类型 ${}:表示拼接sql串,将接收到参数的内容不加任何修饰拼接在sql中。 使用${}拼接sql,引起 sql注入 ${value}:接收输入 参数的内容,如果传入类型是简单类型,${}中只能使用value --> <select id="findUserByName" parameterType="java.lang.String" resultType="com.neuedu.pojo.User"> SELECT * FROM user WHERE username LIKE '%${value}%' </select> <!-- 添加用户 parameterType:指定输入 参数类型是pojo(包括 用户信息) #{}中指定pojo的属性名,接收到pojo对象的属性值,mybatis通过OGNL获取对象的属性值 --> <insert id="insertUser" parameterType="com.neuedu.pojo.User"> <!-- 将插入数据的主键返回,返回到user对象中 SELECT LAST_INSERT_ID():得到刚insert进去记录的主键值,只适用与自增主键 keyProperty:将查询到主键值设置到parameterType指定的对象的哪个属性 order:SELECT LAST_INSERT_ID()执行顺序,相对于insert语句来说它的执行顺序 resultType:指定SELECT LAST_INSERT_ID()的结果类型 --> insert into user(id,username,birthday,sex,address) values (seq_user.nextval,#{username},#{birthday},#{sex},#{address}) <!-- 插入数据后,返回自动增长列的ID值,将sql语句的返回值赋给parameterType绑定对象的ID属性 MySQL中使用: select LAST_INSERT_ID() --> <selectKey keyProperty="id" order="AFTER" resultType="int"> SELECT LAST_INSERT_ID() <!--select seq_user.currval from dual--> </selectKey> <!-- 使用mysql的uuid()生成主键 执行过程: 首先通过uuid()得到主键,将主键设置到user对象的id属性中 其次在insert执行时,从user对象中取出id属性值 --> <!-- <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String"> SELECT uuid() </selectKey> insert into user(id,username,birthday,sex,address) value(#{id},#{username},#{birthday},#{sex},#{address}) --> </insert> <!-- 删除 用户 根据id删除用户,需要输入 id值 --> <delete id="deleteUser" parameterType="java.lang.Integer"> delete from user where id=#{id} </delete> <!-- 根据id更新用户 分析: 需要传入用户的id 需要传入用户的更新信息 parameterType指定user对象,包括 id和更新信息,注意:id必须存在 #{id}:从输入 user对象中获取id属性值 --> <update id="updateUser" parameterType="com.neuedu.pojo.User"> update user set username=#{username},birthday=#{birthday},sex=#{sex},address=#{address} where id=#{id} </update> </mapper> ``` # Tset ``` public class UserMapperTest { private SqlSessionFactory sqlSessionFactory; // 此方法是在执行testFindUserById之前执行 @Before public void setUp() throws Exception { // 创建sqlSessionFactory // mybatis配置文件 String resource = "config/SqlMapConfig.xml"; // 得到配置文件流 InputStream inputStream = Resources.getResourceAsStream(resource); // 创建会话工厂,传入mybatis的配置文件信息 sqlSessionFactory = new SqlSessionFactoryBuilder() .build(inputStream); } @Test public void testFindUserById() throws Exception { SqlSession sqlSession = sqlSessionFactory.openSession(); //创建UserMapper对象,mybatis自动生成mapper代理对象 UserMapper userMapper = sqlSession.getMapper(UserMapper.class); //调用userMapper的方法 User user = userMapper.findUserById(1); System.out.println(user); } @Test public void testFindUserByName() throws Exception { SqlSession sqlSession = sqlSessionFactory.openSession(); //创建UserMapper对象,mybatis自动生成mapper代理对象 UserMapper userMapper = sqlSession.getMapper(UserMapper.class); //调用userMapper的方法 List<User> list = userMapper.findUserByName("袁超"); sqlSession.close(); System.out.println(list); } } ``` # 报错信息 ``` DEBUG [main] - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter. DEBUG [main] - Class not found: org.jboss.vfs.VFS DEBUG [main] - JBoss 6 VFS API is not available in this environment. DEBUG [main] - Class not found: org.jboss.vfs.VirtualFile DEBUG [main] - VFS implementation org.apache.ibatis.io.JBoss6VFS is not valid in this environment. DEBUG [main] - Using VFS adapter org.apache.ibatis.io.DefaultVFS DEBUG [main] - Find JAR URL: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/classes/com/neuedu/pojo DEBUG [main] - Not a JAR: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/classes/com/neuedu/pojo DEBUG [main] - Reader entry: User.class DEBUG [main] - Listing file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/classes/com/neuedu/pojo DEBUG [main] - Find JAR URL: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/classes/com/neuedu/pojo/User.class DEBUG [main] - Not a JAR: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/classes/com/neuedu/pojo/User.class DEBUG [main] - Reader entry: ���� 1 N DEBUG [main] - Checking to see if class com.neuedu.pojo.User matches criteria [is assignable to Object] DEBUG [main] - PooledDataSource forcefully closed/removed all connections. DEBUG [main] - PooledDataSource forcefully closed/removed all connections. DEBUG [main] - PooledDataSource forcefully closed/removed all connections. DEBUG [main] - PooledDataSource forcefully closed/removed all connections. DEBUG [main] - Find JAR URL: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/test-classes/com/neuedu/mapper DEBUG [main] - Not a JAR: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/test-classes/com/neuedu/mapper DEBUG [main] - Reader entry: UserMapperTest.class DEBUG [main] - Listing file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/test-classes/com/neuedu/mapper DEBUG [main] - Find JAR URL: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/test-classes/com/neuedu/mapper/UserMapperTest.class DEBUG [main] - Not a JAR: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/test-classes/com/neuedu/mapper/UserMapperTest.class DEBUG [main] - Reader entry: ���� 1 a DEBUG [main] - Find JAR URL: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/classes/com/neuedu/mapper DEBUG [main] - Not a JAR: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/classes/com/neuedu/mapper DEBUG [main] - Reader entry: UserMapper.class DEBUG [main] - Reader entry: UserMapper.xml DEBUG [main] - Listing file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/classes/com/neuedu/mapper DEBUG [main] - Find JAR URL: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/classes/com/neuedu/mapper/UserMapper.class DEBUG [main] - Not a JAR: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/classes/com/neuedu/mapper/UserMapper.class DEBUG [main] - Reader entry: ���� 1    findUserById (I)Lcom/neuedu/pojo/User; DEBUG [main] - Find JAR URL: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/classes/com/neuedu/mapper/UserMapper.xml DEBUG [main] - Not a JAR: file:/C:/Users/95638/Desktop/mybatis/ch02-mybatis01/ch02-mybatis01/target/classes/com/neuedu/mapper/UserMapper.xml DEBUG [main] - Reader entry: <?xml version="1.0" encoding="UTF-8" ?> DEBUG [main] - Checking to see if class com.neuedu.mapper.UserMapperTest matches criteria [is assignable to Object] DEBUG [main] - Checking to see if class com.neuedu.mapper.UserMapper matches criteria [is assignable to Object] DEBUG [main] - Opening JDBC Connection DEBUG [main] - Created connection 209833425. DEBUG [main] - Setting autocommit to false on JDBC Connection [com.mysql.jdbc.JDBC4Connection@c81cdd1] DEBUG [main] - ==> Preparing: SELECT * FROM T_USER WHERE username LIKE '%袁超%' DEBUG [main] - ==> Parameters: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mybatis.t_user' doesn't exist ### The error may exist in com/neuedu/mapper/UserMapper.xml ### The error may involve com.neuedu.mapper.UserMapper.findUserByName-Inline ### The error occurred while setting parameters ### SQL: SELECT * FROM T_USER WHERE username LIKE '%袁超%' ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mybatis.t_user' doesn't exist at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) at com.sun.proxy.$Proxy3.findUserByName(Unknown Source) at com.neuedu.mapper.UserMapperTest.testFindUserByName(UserMapperTest.java:68) 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:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mybatis.t_user' doesn't exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:400) at com.mysql.jdbc.Util.getInstance(Util.java:383) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:980) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1193) 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.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) at com.sun.proxy.$Proxy5.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) ... 29 more ``` # SqlMapConfig.xml ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <!-- 加载属性文件 --> <properties resource="db.properties"> <!--properties中还可以配置一些属性名和属性值 --> <!-- <property name="jdbc.driver" value=""/> --> </properties> <!-- 全局配置参数,需要时再设置 --> <!-- <settings> </settings> --> <!-- 别名定义 --> <typeAliases> <!-- 针对单个别名定义 type:类型的路径 alias:别名 --> <!-- <typeAlias type="com.neuedu.mybatis.po.User" alias="user"/> --> <!-- 批量别名定义 指定包名,mybatis自动扫描包中的po类,自动定义别名,别名就是类名(首字母大写或小写都可以) --> <package name="com.neuedu.pojo"/> </typeAliases> <!-- 和spring整合后 environments配置将废除--> <environments default="development"> <environment id="development"> <!-- 使用jdbc事务管理,事务控制由mybatis--> <transactionManager type="JDBC" /> <!-- 数据库连接池,由mybatis管理--> <dataSource type="POOLED"> <property name="driver" value="${jdbc.driver}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> </dataSource> </environment> </environments> <!-- 加载 映射文件 --> <mappers> <mapper resource="sqlmap/User.xml"/> <!--通过resource方法一次加载一个映射文件 --> <!-- <mapper resource="sqlmap/User.xml"/> --> <!-- 通过mapper接口加载单个 映射文件 遵循一些规范:需要将mapper接口类名和mapper.xml映射文件名称保持一致,且在一个目录 中 上边规范的前提是:使用的是mapper代理方法 --> <!-- <mapper class="com.neuedu.mapper.UserMapper"/> --> <!-- 批量加载mapper 指定mapper接口的包名,mybatis自动扫描包下边所有mapper接口进行加载 遵循一些规范:需要将mapper接口类名和mapper.xml映射文件名称保持一致,且在一个目录 中 上边规范的前提是:使用的是mapper代理方法 --> <package name="com.neuedu.mapper"/> </mappers> </configuration> ``` # User ``` public class User { //属性名和数据库表的字段对应 private int id; private String username;// 用户姓名 private String sex;// 性别 private Date birthday;// 生日 private String address;// 地址 public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public Date getBirthday() { return birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } @Override public String toString() { return "User [id=" + id + ", username=" + username + ", sex=" + sex + ", birthday=" + birthday + ", address=" + address + "]"; } } ``` 也不知道为什么,明明已经在UserMapper.xml里面把表名改了,但是报错信息里查找的还是T-user表 求大神指导!感恩! # 问题已解决 在maven文件里加上下面的代码 ``` <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*Mapper.xml</include> </includes> </resource> </resources> ```
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载 点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。 ...
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
Elastic:菜鸟上手指南
您们好,我是Elastic的刘晓国。如果大家想开始学习Elastic的话,那么这里将是你理想的学习园地。在我的博客几乎涵盖了你想学习的许多方面。在这里,我来讲述一下作为一个菜鸟该如何阅读我的这些博客文章。 我们可以按照如下的步骤来学习: 1)Elasticsearch简介:对Elasticsearch做了一个简单的介绍 2)Elasticsearch中的一些重要概念:cluster, n...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看...
Java知识体系最强总结(2020版)
更新于2019-12-15 10:38:00 本人从事Java开发已多年,平时有记录问题解决方案和总结知识点的习惯,整理了一些有关Java的知识体系,这不是最终版,会不定期的更新。也算是记录自己在从事编程工作的成长足迹,通过博客可以促进博主与阅读者的共同进步,结交更多志同道合的朋友。特此分享给大家,本人见识有限,写的博客难免有错误或者疏忽的地方,还望各位大佬指点,在此表示感激不尽。 文章目录...
计算机专业的书普遍都这么贵,你们都是怎么获取资源的?
介绍几个可以下载编程电子书籍的网站。 1.Github Github上编程书资源很多,你可以根据类型和语言去搜索。推荐几个热门的: free-programming-books-zh_CN:58K 星的GitHub,编程语言、WEB、函数、大数据、操作系统、在线课程、数据库相关书籍应有尽有,共有几百本。 Go语言高级编程:涵盖CGO,Go汇编语言,RPC实现,Protobuf插件实现,Web框架实...
卸载 x 雷某度!GitHub 标星 1.5w+,从此我只用这款全能高速下载工具!
作者 | Rocky0429 来源 | Python空间 大家好,我是 Rocky0429,一个喜欢在网上收集各种资源的蒟蒻… 网上资源眼花缭乱,下载的方式也同样千奇百怪,比如 BT 下载,磁力链接,网盘资源等等等等,下个资源可真不容易,不一样的方式要用不同的下载软件,因此某比较有名的 x 雷和某度网盘成了我经常使用的工具。 作为一个没有钱的穷鬼,某度网盘几十 kb 的下载速度让我...
复习一周,京东+百度一面,不小心都拿了Offer
京东和百度一面都问了啥,面试官百般刁难,可惜我全会。
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
一文带你看清 HTTP 所有概念
上一篇文章我们大致讲解了一下 HTTP 的基本特征和使用,大家反响很不错,那么本篇文章我们就来深究一下 HTTP 的特性。我们接着上篇文章没有说完的 HTTP 标头继续来介绍(此篇文章会介绍所有标头的概念,但没有深入底层) HTTP 标头 先来回顾一下 HTTP1.1 标头都有哪几种 HTTP 1.1 的标头主要分为四种,通用标头、实体标头、请求标头、响应标头,现在我们来对这几种标头进行介绍 通用...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东...
【综合篇】浏览器的工作原理:浏览器幕后揭秘
web(给达达前端加星标,提升前端技能)了解浏览器是如何工作的,能够让你站在更高的角度去理解前端浏览器的发展历程的三大路线,第一是应用程序web化,第二是web应用移动化,第三是web操...
破14亿,Python分析我国存在哪些人口危机!
一、背景 二、爬取数据 三、数据分析 1、总人口 2、男女人口比例 3、人口城镇化 4、人口增长率 5、人口老化(抚养比) 6、各省人口 7、世界人口 四、遇到的问题 遇到的问题 1、数据分页,需要获取从1949-2018年数据,观察到有近20年参数:LAST20,由此推测获取近70年的参数可设置为:LAST70 2、2019年数据没有放上去,可以手动添加上去 3、将数据进行 行列转换 4、列名...
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。 再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。 下文是原回答,希望能对你能有所启发。 如果我说,这个世界上人真的分三六九等,...
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合...
死磕Lambda表达式(二):Lambda的使用
在哪使用Lambda表达式?怎么样正确的使用Lambda表达式?
史上最牛逼的 Eclipse 快捷键,提高开发效率!
如果你在使用IDEA,请参考博主另外的一篇idea快捷键的博客。
在三线城市工作爽吗?
我是一名程序员,从正值青春年华的 24 岁回到三线城市洛阳工作,至今已经 6 年有余。一不小心又暴露了自己的实际年龄,但老读者都知道,我驻颜有术,上次去看房子,业务员肯定地说:“小哥肯定比我小,我今年还不到 24。”我只好强颜欢笑:“你说得对。” 从我拥有记忆到现在进入而立之年,我觉得,我做过最明智的选择有下面三个: 1)高中三年,和一位女同学保持着算不上朋友的冷淡关系;大学半年,把这位女同学追到...
CSS操作之你不得不知的一些小技巧(一)ヾ(Ő∀Ő๑)ノ太棒了!!
目录 CSS单行/多行文本,超出隐藏并显示省略号 1. CSS单行/多行文本,超出隐藏并显示省略号 方法一:使用CSS属性 单行文本溢出显示省略号 width: 100px; overflow: hidden; text-overflow:ellipsis; //文本溢出显示省略号 white-space: nowrap; //文本不会换...
强烈推荐 10 款珍藏的 Chrome 浏览器插件
Firebug 的年代,我是火狐(Mozilla Firefox)浏览器的死忠;但后来不知道为什么,该插件停止了开发,导致我不得不寻求一个新的网页开发工具。那段时间,不少人开始推荐 Chrome 浏览器,我想那就试试吧,期初我觉得用起来很别扭,毕竟我不是一个“喜新厌旧”的人。但用的次数越来越多,也就习惯了。 Chrome 浏览器有一个好处,就是插件极其丰富,只有你想不到的,没有你找不到的,这恐怕是...
我以为我对数据库索引十分了解,直到我遇到了阿里面试官。
索引的数据结构分析,数据库面试到索引最常见的问题分析,我总结了一下。
Java程序员都需要懂的「反射」
前言 只有光头才能变强。 文本已收录至我的GitHub精选文章,欢迎Star:https://github.com/ZhongFuCheng3y/3y 今天来简单写一下Java的反射。本来没打算写反射这个知识点的,只是不少的读者都问过我:“你的知识点好像缺了反射阿。能不能补一下?” 这周末也有点空了,所以来写写我对反射的简单理解。这篇是入门文章,没有高深的知识点,希望能对新人有帮助。如果...
相关热词 c# singleton c#中类的默认值是 c#各种进制之间的转换 c# 正则表达式保留汉字 c#后台跨域 c#基础代码大全 c#指定combox选择 c#关系 mono c# 相差毫秒 用c#做一个简易计算器
立即提问