springboot的restcontroller与resteasy之类的JAX-RS实现有何不同?

最近在学习restful风格的接口发布,看了基于JAX-RS的方案有resteasy、jersey等,
那么我想请教下各位老司机,这些实现方案与springboot自带的restcontroller实现有何不同?分别有什么优缺点?
个人感觉使用springboot就能搞定restful接口,为啥还要引入resteasy去做这个事情?

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
JAX-RS 2.0的一个问题
说一下场景,我的每一个XXXResource的每一个API基本上都需要一个用户ID, 因为client的每一次请求只会带来一个Token 现在我的做法是,在ContainerRequestFilter中做鉴权,然后鉴权完成后会手动的网HTTP头里面塞进去一个UID,然后在XXXResource的方法参数中中通过@HeaderParam("uid")的方式获取用户id,但是这样做,会导致每一个方法中都有一个这个uid参数,我想问一下有什么更加简便的方式去做这个事情 下面是我在ContainerRequestFilter中塞入UID的逻辑 ``` @Override public void filter(ContainerRequestContext requestContext) throws IOException { String auth = requestContext.getHeaderString(HttpHeaders.AUTHORIZATION); if (StringUtils.isEmpty(auth)) { LOG.debug("HTTP Header Authorization not found."); throw new WebApplicationException(HttpStatus.SC_UNAUTHORIZED); } String userID = validateToken(auth); requestContext.getHeaders().putSingle("UID", userID); } ```
springboot和resteasy集成时 怎么用swagger看resteasy的接口
https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-RESTEasy-2.X-Project-Setup-1.5 按照这个写的 ,但好像仅仅初始化并没有启动起来 访问不到![图片说明](https://img-ask.csdn.net/upload/201704/21/1492765649_419318.png)
resteasy 集成spring 导致 springmvc拦截器失效
C币不足 sorry... 问题描述:spring springmvc resteasy 集成之后,自定义springmvc拦截器就失效了。控制台能输出--HelloController.hello--,就是进不去拦截器,不知道什么原因,求大佬指教。不甚感激 ``` 控制器类 @Controller @Path("/ws/a") public class HelloController { @POST @Path("/aa") @Produces(MediaType.APPLICATION_JSON) public String hello() { System.out.println("--HelloController.hello--"); return "Hello";// 返回视图组件的名字 } } ``` ``` 拦截器类 public class SimpleInterceptor extends HandlerInterceptorAdapter { public SimpleInterceptor() { System.out.println("=============================================="); } @Override public void afterCompletion(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, Exception arg3) throws Exception { System.out.println("--页面渲染之后我来处理--"); } @Override public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView arg3) throws Exception { System.out.println("--返回响应之后我来处理--"); } @Override public boolean preHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2) throws Exception { System.out.println("--方法执行之前我来处理--"); return true;// 继续执行流程 } } ``` ``` web.xml <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springmvc-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> ``` ``` servlet.xml <!-- 拦截器 --> <mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/**" /> <bean class="com.xx.xx.xx.interceptor.SimpleInterceptor" /> </mvc:interceptor> </mvc:interceptors> ```
求助!!wildfly单机部署war包时启动失败,报错。
我是在idea把正常运行的项目打成war包放在了wildfly(10和17两个版本都试了)的standalone\deployments目录下,然后直接运行standalone.bat的。启动时报错,无法加载bean。但是放到tomcat可以正常启动运行。 查遍中外文档和提问,还是没有解决。日志信息如下。 ``` 2019-06-13 14:20:54,155 INFO [org.jboss.modules] (main) JBoss Modules version 1.9.1.Final 2019-06-13 14:20:54,643 INFO [org.jboss.msc] (main) JBoss MSC version 1.4.7.Final 2019-06-13 14:20:54,653 INFO [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final 2019-06-13 14:20:54,752 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 17.0.0.Final (WildFly Core 9.0.1.Final) starting 2019-06-13 14:20:54,753 DEBUG [org.jboss.as.config] (MSC service thread 1-2) Configured system properties: awt.toolkit = sun.awt.windows.WToolkit file.encoding = GBK file.encoding.pkg = sun.io file.separator = \ java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment java.awt.printerjob = sun.awt.windows.WPrinterJob java.class.path = D:\widefly\wildfly-17.0.0.Final\jboss-modules.jar java.class.version = 52.0 java.endorsed.dirs = D:\jdk1.8\jre\lib\endorsed java.ext.dirs = D:\jdk1.8\jre\lib\ext;C:\Windows\Sun\Java\lib\ext java.home = D:\jdk1.8\jre java.io.tmpdir = C:\Users\Lenovo\AppData\Local\Temp\ java.library.path = D:\jdk1.8\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;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\;D:\jdk1.8\bin;D:\jdk1.8\jre\bin;C:\Program Files\TortoiseSVN\bin;D:\Maven\apache-maven-3.3.9\bin;D:\widefly\wildfly-17.0.0.Final\bin;C:\Users\Lenovo\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\Lenovo\AppData\Local\Programs\Python\Python37\;C:\Users\Lenovo\AppData\Local\Microsoft\WindowsApps;;. java.net.preferIPv4Stack = true java.runtime.name = Java(TM) SE Runtime Environment java.runtime.version = 1.8.0_211-b12 java.specification.name = Java Platform API Specification java.specification.vendor = Oracle Corporation java.specification.version = 1.8 java.util.logging.manager = org.jboss.logmanager.LogManager java.vendor = Oracle Corporation java.vendor.url = http://java.oracle.com/ java.vendor.url.bug = http://bugreport.sun.com/bugreport/ java.version = 1.8.0_211 java.vm.info = mixed mode java.vm.name = Java HotSpot(TM) 64-Bit Server VM java.vm.specification.name = Java Virtual Machine Specification java.vm.specification.vendor = Oracle Corporation java.vm.specification.version = 1.8 java.vm.vendor = Oracle Corporation java.vm.version = 25.211-b12 javax.management.builder.initial = org.jboss.as.jmx.PluggableMBeanServerBuilder jboss.home.dir = D:\widefly\wildfly-17.0.0.Final jboss.host.name = desktop-e1tfeli jboss.modules.dir = D:\widefly\wildfly-17.0.0.Final\modules jboss.modules.system.pkgs = org.jboss.byteman jboss.node.name = desktop-e1tfeli jboss.qualified.host.name = desktop-e1tfeli jboss.server.base.dir = D:\widefly\wildfly-17.0.0.Final\standalone jboss.server.config.dir = D:\widefly\wildfly-17.0.0.Final\standalone\configuration jboss.server.data.dir = D:\widefly\wildfly-17.0.0.Final\standalone\data jboss.server.deploy.dir = D:\widefly\wildfly-17.0.0.Final\standalone\data\content jboss.server.log.dir = D:\widefly\wildfly-17.0.0.Final\standalone\log jboss.server.name = desktop-e1tfeli jboss.server.persist.config = true jboss.server.temp.dir = D:\widefly\wildfly-17.0.0.Final\standalone\tmp line.separator = logging.configuration = file:D:\widefly\wildfly-17.0.0.Final\standalone\configuration/logging.properties module.path = D:\widefly\wildfly-17.0.0.Final\modules org.jboss.boot.log.file = D:\widefly\wildfly-17.0.0.Final\standalone\log\server.log org.jboss.resolver.warning = true os.arch = amd64 os.name = Windows 10 os.version = 10.0 path.separator = ; program.name = standalone.bat sun.arch.data.model = 64 sun.boot.class.path = D:\jdk1.8\jre\lib\resources.jar;D:\jdk1.8\jre\lib\rt.jar;D:\jdk1.8\jre\lib\sunrsasign.jar;D:\jdk1.8\jre\lib\jsse.jar;D:\jdk1.8\jre\lib\jce.jar;D:\jdk1.8\jre\lib\charsets.jar;D:\jdk1.8\jre\lib\jfr.jar;D:\jdk1.8\jre\classes sun.boot.library.path = D:\jdk1.8\jre\bin sun.cpu.endian = little sun.cpu.isalist = amd64 sun.desktop = windows sun.io.unicode.encoding = UnicodeLittle sun.java.command = D:\widefly\wildfly-17.0.0.Final\jboss-modules.jar -mp D:\widefly\wildfly-17.0.0.Final\modules org.jboss.as.standalone -Djboss.home.dir=D:\widefly\wildfly-17.0.0.Final sun.java.launcher = SUN_STANDARD sun.jnu.encoding = GBK sun.management.compiler = HotSpot 64-Bit Tiered Compilers sun.os.patch.level = sun.stderr.encoding = ms936 sun.stdout.encoding = ms936 user.country = CN user.dir = D:\widefly\wildfly-17.0.0.Final\bin user.home = C:\Users\Lenovo user.language = zh user.name = Lenovo user.script = user.timezone = Asia/Shanghai user.variant = 2019-06-13 14:20:54,754 DEBUG [org.jboss.as.config] (MSC service thread 1-2) VM Arguments: -Dprogram.name=standalone.bat -Xms128M -Xmx2048M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=512m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Dorg.jboss.boot.log.file=D:\widefly\wildfly-17.0.0.Final\standalone\log\server.log -Dlogging.configuration=file:D:\widefly\wildfly-17.0.0.Final\standalone\configuration/logging.properties 2019-06-13 14:20:55,611 INFO [org.wildfly.security] (ServerService Thread Pool -- 28) ELY00001: WildFly Elytron version 1.9.1.Final 2019-06-13 14:20:56,314 INFO [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation. 2019-06-13 14:20:56,336 INFO [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 11) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation. 2019-06-13 14:20:57,497 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http) 2019-06-13 14:20:57,511 INFO [org.xnio] (MSC service thread 1-6) XNIO version 3.7.2.Final 2019-06-13 14:20:57,518 INFO [org.xnio.nio] (MSC service thread 1-6) XNIO NIO Implementation Version 3.7.2.Final 2019-06-13 14:20:57,546 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 51) WFLYCLINF0001: Activating Infinispan subsystem. 2019-06-13 14:20:57,550 INFO [org.wildfly.extension.microprofile.config.smallrye._private] (ServerService Thread Pool -- 60) WFLYCONF0001: Activating WildFly MicroProfile Config Subsystem 2019-06-13 14:20:57,559 INFO [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 63) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem 2019-06-13 14:20:57,560 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 72) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique. 2019-06-13 14:20:57,589 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 74) WFLYWS0002: Activating WebServices Extension 2019-06-13 14:20:57,595 INFO [org.wildfly.extension.io] (ServerService Thread Pool -- 52) WFLYIO001: Worker 'default' has auto-configured to 16 core threads with 128 task threads based on your 8 available processors 2019-06-13 14:20:57,598 INFO [org.wildfly.extension.microprofile.health.smallrye] (ServerService Thread Pool -- 61) WFLYHEALTH0001: Activating Eclipse MicroProfile Health Subsystem 2019-06-13 14:20:57,599 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 64) WFLYNAM0001: Activating Naming Subsystem 2019-06-13 14:20:57,611 INFO [org.jboss.as.security] (ServerService Thread Pool -- 70) WFLYSEC0002: Activating Security Subsystem 2019-06-13 14:20:57,621 INFO [org.jboss.as.jaxrs] (ServerService Thread Pool -- 53) WFLYRS0016: RESTEasy version 3.7.0.Final 2019-06-13 14:20:57,626 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 58) WFLYJSF0007: Activated the following JSF Implementations: [main] 2019-06-13 14:20:57,635 INFO [org.jboss.as.connector] (MSC service thread 1-7) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.16.Final) 2019-06-13 14:20:57,637 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 43) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4) 2019-06-13 14:20:57,639 INFO [org.jboss.as.security] (MSC service thread 1-3) WFLYSEC0001: Current PicketBox version=5.0.3.Final 2019-06-13 14:20:57,645 INFO [org.wildfly.extension.microprofile.metrics.smallrye] (ServerService Thread Pool -- 62) WFLYMETRICS0001: Activating Eclipse MicroProfile Metrics Subsystem 2019-06-13 14:20:57,719 INFO [io.smallrye.metrics] (MSC service thread 1-2) Converted [2] config entries and added [4] replacements 2019-06-13 14:20:57,727 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0003: Undertow 2.0.21.Final starting 2019-06-13 14:20:57,730 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0018: Started Driver service with driver-name = h2 2019-06-13 14:20:57,735 INFO [io.smallrye.metrics] (MSC service thread 1-2) Converted [3] config entries and added [14] replacements 2019-06-13 14:20:57,755 INFO [org.jboss.as.naming] (MSC service thread 1-4) WFLYNAM0003: Starting Naming Service 2019-06-13 14:20:57,786 INFO [org.jboss.remoting] (MSC service thread 1-6) JBoss Remoting version 5.0.12.Final 2019-06-13 14:20:57,786 INFO [org.jboss.as.mail.extension] (MSC service thread 1-4) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default] 2019-06-13 14:20:57,871 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 73) WFLYUT0014: Creating file handler for path 'D:\widefly\wildfly-17.0.0.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]'] 2019-06-13 14:20:57,930 INFO [org.jboss.as.ejb3] (MSC service thread 1-4) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 32 (per class), which is derived from the number of CPUs on this host. 2019-06-13 14:20:57,930 INFO [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing. 2019-06-13 14:20:57,962 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0012: Started server default-server. 2019-06-13 14:20:57,970 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0018: Host default-host starting 2019-06-13 14:20:58,046 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080 2019-06-13 14:20:58,105 INFO [org.jboss.as.ejb3] (MSC service thread 1-7) WFLYEJB0493: EJB subsystem suspension complete 2019-06-13 14:20:58,173 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS] 2019-06-13 14:20:58,278 INFO [org.jboss.as.patching] (MSC service thread 1-8) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none 2019-06-13 14:20:58,294 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) WFLYDS0013: Started FileSystemDeploymentService for directory D:\widefly\wildfly-17.0.0.Final\standalone\deployments 2019-06-13 14:20:58,303 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0027: Starting deployment of "jeeplus.war" (runtime-name: "jeeplus.war") 2019-06-13 14:20:58,561 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443 2019-06-13 14:20:58,636 INFO [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBossWS 5.3.0.Final (Apache CXF 3.3.2) 2019-06-13 14:22:01,638 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry xbean.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/batik-js-1.7.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,652 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry avalon-framework-4.2.0.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,652 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry batik-all-1.6.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,653 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry commons-io-1.3.1.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,654 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry commons-logging-1.0.4.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,655 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry fop-hyph.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,655 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry jai_codec.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,656 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry jai_core.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,656 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry jimi.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,657 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry serializer-2.7.0.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,657 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry servlet-2.2.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,658 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry xalan-2.7.0.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,662 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry xercesImpl-2.7.1.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,664 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry xml-apis-1.3.02.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,664 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry xmlunit1.0.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/fop-0.94.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,676 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry ridl.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/juh-2.3.0.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,676 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry jurt.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/juh-2.3.0.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,677 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry ridl.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/jurt-2.3.0.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,678 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry unoloader.jar in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/jurt-2.3.0.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,678 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry ../../lib/ in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/jurt-2.3.0.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:01,679 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry ../bin/ in /D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/lib/jurt-2.3.0.jar does not point to a valid jar for a Class-Path reference. 2019-06-13 14:22:03,113 WARN [org.jboss.as.ee] (MSC service thread 1-7) WFLYEE0007: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause) 2019-06-13 14:22:03,113 WARN [org.jboss.as.ee] (MSC service thread 1-7) WFLYEE0007: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause) 2019-06-13 14:22:03,151 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-8) ISPN000128: Infinispan version: Infinispan 'Infinity Minus ONE +2' 9.4.14.Final 2019-06-13 14:22:03,202 WARN [org.jboss.as.jaxrs] (MSC service thread 1-7) WFLYRS0018: Explicit usage of Jackson annotation in a JAX-RS deployment; the system will disable JSON-B processing for the current deployment. Consider setting the 'resteasy.preferJacksonOverJsonB' property to 'false' to restore JSON-B. 2019-06-13 14:22:03,206 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0004: Deploying JDBC-compliant driver class com.alibaba.druid.proxy.DruidDriver (version 4.0) 2019-06-13 14:22:03,213 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0004: Deploying JDBC-compliant driver class com.alibaba.druid.mock.MockDriver (version 0.0) 2019-06-13 14:22:03,214 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3) 2019-06-13 14:22:03,216 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0005: Deploying non-JDBC-compliant driver class net.sourceforge.jtds.jdbc.Driver (version 1.3) 2019-06-13 14:22:03,224 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.cj.jdbc.Driver (version 8.0) 2019-06-13 14:22:03,228 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0005: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 42.1) 2019-06-13 14:22:03,229 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0005: Deploying non-JDBC-compliant driver class org.apache.solr.client.solrj.io.sql.DriverImpl (version 1.0) 2019-06-13 14:22:03,269 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0018: Started Driver service with driver-name = jeeplus.war_org.h2.Driver_1_3 2019-06-13 14:22:03,270 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0018: Started Driver service with driver-name = jeeplus.war_net.sourceforge.jtds.jdbc.Driver_1_3 2019-06-13 14:22:03,270 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = jeeplus.war_com.alibaba.druid.proxy.DruidDriver_4_0 2019-06-13 14:22:03,271 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0018: Started Driver service with driver-name = jeeplus.war_com.mysql.cj.jdbc.Driver_8_0 2019-06-13 14:22:03,270 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0018: Started Driver service with driver-name = jeeplus.war_com.alibaba.druid.mock.MockDriver_0_0 2019-06-13 14:22:03,271 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = jeeplus.war 2019-06-13 14:22:03,276 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6) WFLYJCA0018: Started Driver service with driver-name = jeeplus.war_org.apache.solr.client.solrj.io.sql.DriverImpl_1_0 2019-06-13 14:22:03,277 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6) WFLYJCA0018: Started Driver service with driver-name = jeeplus.war_org.postgresql.Driver_42_1 2019-06-13 14:22:03,471 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 78) WFLYCLINF0002: Started client-mappings cache from ejb container 2019-06-13 14:22:03,586 INFO [io.undertow.servlet] (ServerService Thread Pool -- 111) No Spring WebApplicationInitializer types detected on classpath 2019-06-13 14:22:03,600 INFO [io.undertow.servlet] (ServerService Thread Pool -- 111) Set web app root system property: 'webapp.root' = [D:\widefly\wildfly-17.0.0.Final\standalone\tmp\vfs\temp\temp5858f9dbed7b899b\content-8652ab40c8a74b5c] 2019-06-13 14:22:03,603 INFO [io.undertow.servlet] (ServerService Thread Pool -- 111) Initializing log4j from [classpath:properties/log4j.properties] 2019-06-13 14:22:08,112 WARN [org.springframework.beans.factory.support.DefaultListableBeanFactory] (ServerService Thread Pool -- 111) Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actMapper' defined in VFS resource ["/D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/classes/com/jeeplus/modules/act/mapper/ActMapper.class"]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException 2019-06-13 14:22:09,473 WARN [org.springframework.beans.factory.support.DefaultListableBeanFactory] (ServerService Thread Pool -- 111) Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actNodeSetingInfoMapper' defined in VFS resource ["/D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/classes/com/jeeplus/modules/act/mapper/ActNodeSetingInfoMapper.class"]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException 2019-06-13 14:22:10,806 WARN [org.springframework.beans.factory.support.DefaultListableBeanFactory] (ServerService Thread Pool -- 111) Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actSetingInfoMapper' defined in VFS resource ["/D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/classes/com/jeeplus/modules/act/mapper/ActSetingInfoMapper.class"]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException 2019-06-13 14:22:11,979 WARN [org.springframework.beans.factory.support.DefaultListableBeanFactory] (ServerService Thread Pool -- 111) Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testPieClassMapper' defined in VFS resource ["/D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/classes/com/jeeplus/modules/echarts/mapper/other/TestPieClassMapper.class"]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException 2019-06-13 14:22:13,133 WARN [org.springframework.beans.factory.support.DefaultListableBeanFactory] (ServerService Thread Pool -- 111) Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'TExamQusetionUserMapper' defined in VFS resource ["/D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/classes/com/jeeplus/modules/examque/mapper/TExamQusetionUserMapper.class"]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException 2019-06-13 14:22:14,159 WARN [org.springframework.beans.factory.support.DefaultListableBeanFactory] (ServerService Thread Pool -- 111) Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'examQuestionMapper' defined in VFS resource ["/D:/widefly/wildfly-17.0.0.Final/bin/content/jeeplus.war/WEB-INF/classes/com/jeeplus/modules/examquestion/mapper/ExamQuestionMapper.class"]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-context.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException ``` ![报错信息1](https://img-ask.csdn.net/upload/201906/13/1560407452_637434.png) ![报错信息2](https://img-ask.csdn.net/upload/201906/13/1560407517_691665.png)
service利用注解注入,会空指针异常。而用getBean方式则可以获取到service。
**spring配置文件如下:** <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <bean id="placeholderProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:conf/config.properties</value> </list> </property> <property name="fileEncoding" value="utf-8" /> </bean> <import resource="spring-hibernate.xml" /> <!-- Import basic SpringMVC Resteasy integration --> <import resource="classpath:springmvc-resteasy.xml" /> <!-- 扫描文件 --> <context:component-scan base-package="com.sinopec.carlife" /> </beans> **service接口如下:** package com.sinopec.carlife.service.api; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import com.sinopec.carlife.model.Region; @Path("/regions") @Consumes({MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_JSON}) public interface RegionService { /** * 获取所有城市 * @return * @throws Exception */ @POST @Path("/all") public List<Region> findRegions() throws Exception; } **service实现类如下:** package com.sinopec.carlife.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.sinopec.carlife.dao.RegionDAO; import com.sinopec.carlife.model.Region; import com.sinopec.carlife.service.api.RegionService; @Service("regionService") public class RegionServiceImpl implements RegionService { @Autowired private RegionDAO regionDAO; @Override public List<Region> findRegions() throws Exception { return regionDAO.findRegions(); } } **junit测试如下:** package test.com.sinopec.carlife; import java.util.List; import javax.annotation.Resource; import junit.framework.TestCase; import org.junit.Test; import com.sinopec.carlife.model.Region; import com.sinopec.carlife.service.api.RegionService; public class RegionServiceTest extends TestCase { @Resource(name="regionService") private RegionService regionService; @Test public void testFindRegions() { try { /*ApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring/spring.xml"); regionService = (RegionService) context.getBean("regionService");*/ List<Region> regions = regionService.findRegions(); System.out.println(regions.size()); } catch (Exception e) { e.printStackTrace(); } } }
求助大神!使用java发送post请求到后台Resteasy总是报400错误
# 1. 描述问题 使用java发送post请求到后台Resteasy总是报400错误,使用get是没有问题的,我前端用angularjs发送post到后台也是可以的 # 2. 相关截图代码 发送post请求的代码 ![图片说明](https://img-ask.csdn.net/upload/201811/29/1543452878_548880.png) ![图片说明](https://img-ask.csdn.net/upload/201811/29/1543453334_427298.png) 后台接收post请求 ![图片说明](https://img-ask.csdn.net/upload/201811/29/1543453383_888561.png) 使用angularjs发送post是成功的 ![图片说明](https://img-ask.csdn.net/upload/201811/29/1543453319_67754.png) ![图片说明](https://img-ask.csdn.net/upload/201811/29/1543453197_182424.png) ## 3. 报错信息 使用java的post请求去发送总是报400错误,get请求就不会报错,使用angularjs发送post也不会报错 ![图片说明](https://img-ask.csdn.net/upload/201811/29/1543453510_263730.png) ## 4. 尝试过的方法 试着调试跟进去,发现根本没有进到后台的接收程序中。请求头和接收格式也调整了很多,但是我还是是一直报400,试着直接用postman发送post请求也是会报400错误,也想过是不是跨域的问题,但是get请求可以请求到,应该不会是跨域的问题把。 我把angularjs绑定了一个方法post请求到后台发现可以行的通。 求助大神,帮忙解决一下问题,谢谢啦 补充一下我调试时候的httppost的内容,感觉也找不出来错误 ![图片说明](https://img-ask.csdn.net/upload/201811/29/1543476039_109135.png) ![图片说明](https://img-ask.csdn.net/upload/201811/29/1543476049_916715.png)
关于resteasy框架的事务的回滚时间设置
在项目中有查询的逻辑,数据太多,导致事务回滚,有大神说说在哪改事务回滚的时间不?
哪位大神指导下,这个错到底是怎么回事?
我的dubbo服务已经启了,zookeeper地址也对,dubbo-consunmer也配置了,求大神分析下还有哪方面原因 ``` 2016-08-01 14:18:40,633 ERROR [http-bio-8080-exec-9] integration.RegistryDirectory (RegistryDirectory.java:398) - [DUBBO] Failed to refer invoker for interface:interface com.ai.baas.amc.api.deposit.interfaces.IDepositSV,url:(rest://10.1.130.84:10883/com.ai.baas.amc.api.deposit.interfaces.IDepositSV?anyhost=true&application=citic-billing-web&check=false&default.retries=0&default.timeout=1200000&dubbo=2.8.3&generic=false&interface=com.ai.baas.amc.api.deposit.interfaces.IDepositSV&methods=depositFund&pid=6680&revision=1.0-SNAPSHOT&side=consumer&timestamp=1470032318569)You must use at least one, but no more than one http method annotation on: public abstract com.ai.baas.amc.api.deposit.param.DepositResponse com.ai.baas.amc.api.deposit.interfaces.IDepositSV.depositFund(com.ai.baas.amc.api.deposit.param.DepositRequest) throws com.ai.opt.base.exception.BusinessException,com.ai.opt.base.exception.SystemException, dubbo version: 2.8.3, current host: 10.1.64.190 java.lang.RuntimeException: You must use at least one, but no more than one http method annotation on: public abstract com.ai.baas.amc.api.deposit.param.DepositResponse com.ai.baas.amc.api.deposit.interfaces.IDepositSV.depositFund(com.ai.baas.amc.api.deposit.param.DepositRequest) throws com.ai.opt.base.exception.BusinessException,com.ai.opt.base.exception.SystemException at org.jboss.resteasy.client.jaxrs.ProxyBuilder.createClientInvoker(ProxyBuilder.java:76) ~[resteasy-client-3.0.11.Final.jar:?] at org.jboss.resteasy.client.jaxrs.ProxyBuilder.proxy(ProxyBuilder.java:52) ~[resteasy-client-3.0.11.Final.jar:?] at org.jboss.resteasy.client.jaxrs.ProxyBuilder.build(ProxyBuilder.java:120) ~[resteasy-client-3.0.11.Final.jar:?] at org.jboss.resteasy.client.jaxrs.internal.ClientWebTarget.proxy(ClientWebTarget.java:72) ~[resteasy-client-3.0.11.Final.jar:?] at com.alibaba.dubbo.rpc.protocol.rest.RestProtocol.doRefer(RestProtocol.java:161) ~[dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol.refer(AbstractProxyProtocol.java:88) ~[dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:62) ~[dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:65) ~[dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.rpc.Protocol$Adpative.refer(Protocol$Adpative.java) ~[dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.registry.integration.RegistryDirectory.toInvokers(RegistryDirectory.java:395) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.registry.integration.RegistryDirectory.refreshInvoker(RegistryDirectory.java:224) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.registry.integration.RegistryDirectory.notify(RegistryDirectory.java:195) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.registry.support.AbstractRegistry.notify(AbstractRegistry.java:449) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.registry.support.FailbackRegistry.doNotify(FailbackRegistry.java:273) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.registry.support.FailbackRegistry.notify(FailbackRegistry.java:259) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doSubscribe(ZookeeperRegistry.java:170) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:189) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:133) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:271) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:254) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:60) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:63) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.rpc.Protocol$Adpative.refer(Protocol$Adpative.java) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:392) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:300) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:138) [dubbox-2.8.3.1.jar:2.8.3] at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:65) [dubbox-2.8.3.1.jar:2.8.3] at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168) [spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103) [spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1523) [spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251) [spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:217) [spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:350) [spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:331) [spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:968) [spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE] at com.ai.opt.sdk.dubbo.util.DubboConsumerFactory.getServiceId(DubboConsumerFactory.java:79) [opt-sdk-2.1-SNAPSHOT.jar:?] at com.ai.opt.sdk.dubbo.util.DubboConsumerFactory.getService(DubboConsumerFactory.java:46) [opt-sdk-2.1-SNAPSHOT.jar:?] at com.ai.citic.billing.web.controller.deposit.DepositController.toDeposit(DepositController.java:90) [DepositController.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_51] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_51] 2016-08-01 14:18:40,717 ERROR [http-bio-8080-exec-9] integration.RegistryDirectory (RegistryDirectory.java:229) - urls to invokers error .invokerUrls.size :1, invoker.size :0. urls :[rest://10.1.130.84:10883/com.ai.baas.amc.api.deposit.interfaces.IDepositSV?anyhost=true&application=baas-amc&default.retries=0&default.threads=300&default.timeout=200000&dubbo=2.8.3&generic=false&interface=com.ai.baas.amc.api.deposit.interfaces.IDepositSV&methods=depositFund&pid=26073&revision=1.0-SNAPSHOT&side=provider&timestamp=1470019657025] java.lang.IllegalStateException: urls to invokers error .invokerUrls.size :1, invoker.size :0. urls :[rest://10.1.130.84:10883/com.ai.baas.amc.api.deposit.interfaces.IDepositSV?anyhost=true&application=baas-amc&default.retries=0&default.threads=300&default.timeout=200000&dubbo=2.8.3&generic=false&interface=com.ai.baas.amc.api.deposit.interfaces.IDepositSV&methods=depositFund&pid=26073&revision=1.0-SNAPSHOT&side=provider&timestamp=1470019657025] ctory.refreshInvoker(RegistryDirectory.java:229) [dubbox-2.8.3.1.jar:2.8.3] stryProtocol.doRefer(RegistryProtocol.java:271) [dubbox-2.8.3.1.jar:2.8.3] 八月 01, 2016 2:18:41 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [springmvc] in context with path [/citic-billing-web] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'IDepositSV': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.ai.baas.amc.api.deposit.interfaces.IDepositSV. No provider available for the service com.ai.baas.amc.api.deposit.interfaces.IDepositSV from the url zookeeper://10.1.130.84:39181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=citic-billing-web&check=false&default.retries=0&default.timeout=1200000&dubbo=2.8.3&generic=false&interface=com.ai.baas.amc.api.deposit.interfaces.IDepositSV&methods=depositFund&pid=6680&revision=1.0-SNAPSHOT&side=consumer&timestamp=1470032318569 to the consumer 10.1.64.190 use dubbo version 2.8.3] with root cause java.lang.IllegalStateException: Failed to check the status of the service com.ai.baas.amc.api.deposit.interfaces.IDepositSV. No provider available for the service com.ai.baas.amc.api.deposit.interfaces.IDepositSV from the url zookeeper://10.1.130.84:39181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=citic-billing-web&check=false&default.retries=0&default.timeout=1200000&dubbo=2.8.3&generic=false&interface=com.ai.baas.amc.api.deposit.interfaces.IDepositSV&methods=depositFund&pid=6680&revision=1.0-SNAPSHOT&side=consumer&timestamp=1470032318569 to the consumer 10.1.64.190 use dubbo version 2.8.3 at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:420) at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:300) ```
急急急!!!银联app支付接收时接收后台商户通知识报错,求大神指教
我的代码: */ @Path("paymentcallback") public class UnionpayCallbackServiceBean extends AbstractPaymentCallbackService { private static Logger logger = LoggerFactory.getLogger(UnionpayCallbackServiceBean.class); @Autowired public UnionpayCallbackServiceBean(ApplicationContext appContext) { super(appContext); } @Override @POST @Path("unionpay") @RequestMapping(value = "/ContentType", method = RequestMethod.POST, headers = "Content-Type=application/x-www-form-urlencoded") public void run(@Context HttpServletRequest req, @Context HttpServletResponse resp) { String responseBody = "ok"; logger.info("接受银联后台通知开始!!!"); SDKConfig.getConfig().loadPropertiesFromSrc(); try { req.setCharacterEncoding("ISO-8859-1"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } String encoding = req.getParameter(SDKConstants.param_encoding); // 获取银联通知服务器发送的后台通知参数 Map<String, String> reqParam = MapParserUtils.getAllRequestParam(req); // Map<String, String> reqParam = SDKUtil.convertResultStringToMap(req.getQueryString()); logger.info("BackRcvResponse接收后台通知入参: " + reqParam); //String reqReserved = URLDecoder.decode(reqParam.get("signature"), "UTF-8"); //reqParam.put("signature", reqReserved); //logger.info("reqReserved: " + reqParam); /*Map<String, String> valideData = null; if (null != reqParam && !reqParam.isEmpty()) { Iterator<Entry<String, String>> it = reqParam.entrySet().iterator(); valideData = new HashMap<String, String>(reqParam.size()); while (it.hasNext()) { Entry<String, String> e = it.next(); String key = (String) e.getKey(); String value = (String) e.getValue(); value = new String(value.getBytes("ISO-8859-1"), encoding); valideData.put(key, value); } } logger.info("valideData: " + valideData);*/ //重要!验证签名前不要修改reqParam中的键值对的内容,否则会验签不过 if (!SDKUtil.validate(reqParam, encoding)) { logger.info("银联后台通知验证签名结果[失败]."); UnionpayPlatformOrderInfo orderInfo = new UnionpayPlatformOrderInfo(); orderInfo.setPayMethod(97); orderInfo.setOrderNo(reqParam.get("orderId")); orderInfo.setTradeStatus("failed"); PayMethodEnum payMethodEnum = PayMethodEnum.getPayMethodEnum(orderInfo.getPayMethod()); PaymentService paymentService = appContext.getBean(payMethodEnum.getTxCode(), PaymentService.class); paymentService.informPaymentResult(orderInfo); responseBody = "failed"; //验签失败,需解决验签问题 } else { logger.info("银联后台通知验证签名结果[成功]."); //【注:为了安全验签成功才应该写商户的成功处理逻辑】交易成功,更新商户订单状态 String orderId = reqParam.get("orderId"); //获取后台通知的数据,其他字段也可用类似方式获取 String respCode = reqParam.get("respCode"); //获取应答码,收到后台通知了respCode的值一般是00,可以不需要根据这个应答码判断。 logger.info("商户后台通知相关业务开始处理!!!"); UnionpayPlatformOrderInfo orderInfo = new UnionpayPlatformOrderInfo(); orderInfo.setPayMethod(97); orderInfo.setOrderNo(orderId); orderInfo.setTradeStatus("SUCCESS"); orderInfo.setTransactionNo(reqParam.get("queryId")); orderInfo.setPaymentDatetime(new Date().toLocaleString()); PayMethodEnum payMethodEnum = PayMethodEnum.getPayMethodEnum(orderInfo.getPayMethod()); PaymentService paymentService = appContext.getBean(payMethodEnum.getTxCode(), PaymentService.class); logger.info("开始处理!!!!!!!!!!!!!!!!"); paymentService.informPaymentResult(orderInfo); logger.info("商户后台通知相关业务处理完毕!!!"); logger.info("银联接收后台通知结束"); //返回给银联服务器http 200 状态码 logger.info("成功打印ok!!!"); logger.info("resp.getStatus() : " + resp.getStatus()); } // 设置接口返回信息 super.setResponseBody(resp, responseBody); } } 错误: javax.ws.rs.NotSupportedException: Cannot consume content type at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:380) at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:114) at org.jboss.resteasy.core.registry.RootNode.match(RootNode.java:43) at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:48) at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:444) at org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:234) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:171) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at com.alibaba.dubbo.rpc.protocol.rest.DubboHttpServer$RestHandler.handle(DubboHttpServer.java:86) at com.alibaba.dubbo.remoting.http.servlet.DispatcherServlet.service(DispatcherServlet.java:64) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
maven老是报编译错误,但是在idea工具上没有编译错误,求高人!!!!!!!
用maven 打install命令时总是出现编译错误,但是在我idea中是没有编译错误,很奇怪的问题,之前在网上有社区的说是因为maven2与maven3的版本问题,后面发现不是这个原因,不管我用maven2还是maven3都出一这个问题,求高手解决,因了我三天了!!以下为maven错误信息: Its dependencies (if any) will NOT be available to the current build. [WARNING] POM for 'org.jboss.resteasy:resteasy-jaxb-provider:pom:2.1.0.GA:compile' is invalid. Its dependencies (if any) will NOT be available to the current build. [INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 79 source files to D:\Workspaces\jje\admin\target\classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] \Workspaces\jje\admin\src\main\java\com\jje\admin\permission\form\InitializationSystemFunctionForm.java:[3,30] 软件包 com.sun.istack.internal 不存在 [ERROR] \Workspaces\jje\admin\src\main\java\com\jje\admin\permission\form\InitializationSystemFunctionForm.java:[9,5] 找不到符号 符号: 类 NotNull 位置: 类 com.jje.admin.permission.form.InitializationSystemFunctionForm [INFO] 2 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure \Workspaces\jje\admin\src\main\java\com\jje\admin\permission\form\InitializationSystemFunctionForm.java:[3,30] 软件包 com.sun.istack.internal 不存在 \Workspaces\jje\admin\src\main\java\com\jje\admin\permission\form\InitializationSystemFunctionForm.java:[9,5] 找不到符号 符号: 类 NotNull 位置: 类 com.jje.admin.permission.form.InitializationSystemFunctionForm 下面是我idea的这个类,是没有问题的: [code="java"] import com.sun.istack.internal.NotNull; import javax.validation.constraints.Size; public class InitializationSystemFunctionForm { @NotNull @Size(min = 10) private String xml; public String getXml() { return xml; } public void setXml(String xml) { this.xml = xml; } [/code]
关于dubbox rest服务 cxf 调用时类型转换的错误
这边搭建了一个dubbox rest的服务端,通过浏览器请求返回正常,客户端通过访问webservice,webservice接口实现类中调用dubbox服务,dubbox方法有参数,结果报错如下: Caused by: java.lang.ClassCastException: org.apache.cxf.jaxrs.impl.UriBuilderImpl cannot be cast to org.jboss.resteasy.specimpl.ResteasyUriBuilder at org.jboss.resteasy.client.jaxrs.internal.ClientWebTarget.queryParamNoTemplate(ClientWebTarget.java:287) at org.jboss.resteasy.client.jaxrs.internal.proxy.processors.webtarget.QueryParamProcessor.apply(QueryParamProcessor.java:23) at org.jboss.resteasy.client.jaxrs.internal.proxy.processors.webtarget.QueryParamProcessor.apply(QueryParamProcessor.java:12) at org.jboss.resteasy.client.jaxrs.internal.proxy.processors.AbstractCollectionProcessor.buildIt(AbstractCollectionProcessor.java:76) at org.jboss.resteasy.client.jaxrs.internal.proxy.processors.webtarget.AbstractWebTargetCollectionProcessor.build(AbstractWebTargetCollectionProcessor.java:22) at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.createRequest(ClientInvoker.java:115) at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:101) at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:62) at com.sun.proxy.$Proxy30.sayHello(Unknown Source) at com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java) at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46) at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72) at com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol$2.doInvoke(AbstractProxyProtocol.java:93) at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:144) at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) at com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:53) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) at com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:48) at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) at com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:74) at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53) at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:77) at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:227) at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:72) at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52) at com.alibaba.dubbo.common.bytecode.proxy0.sayHello(proxy0.java) at com.nssc.dubbox.ws.server.QueryServerImpl.test(QueryServerImpl.java:46) at com.nssc.dubbox.ws.server.QueryServerImpl.doBiz(QueryServerImpl.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:188) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:104) ... 36 more 这是什么原因造成的
mybatis使用insert的时候出现错误
Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.baosight.webapp.sqlmap.addPro ### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.baosight.webapp.sqlmap.addPro
关于Mysql + Hibernate (JPA)高并发的性能问题
最近在做系统性能调优的问题。大家帮我分析一下可能的瓶颈吧?谢谢各位了。 [b]先说一下我的测试环境:[/b] App Server: Window 2008 Server + Tomcat 6 , 4 cpu core, 8G mem, 500Mbps, 最大连接4000,Accept 4000, 用了 APR connector。Heap Size 4G DB Server: Window 2008 Server + Mysql 5.5, 4 cpu core, 8G mem, 500Mbps, 最大并发连接 1000, innodb, buffer pool 4G JMeter client: Window 2008 Server + JMeter 5.1, 4 cpu core, 8G mem, 500Mbps 也许大家会建议我用Linux系统,我知道那样肯定会好一点。但是没有办法,公司就要求这样的平台。 [b]然后就是我的应用:[/b] Spring MVC + Resteasy + HIbernate (JPA) + DBCP (连接池500) + 30多张表  [b]看看我的Test Case:[/b] 用JMeter录制了用户访问我的应用的大多数功能。 并发数为1000, ramp-up时间为1000s,因为我的一个线程执行时间也差不多是1000s。所以用JMeter看下来可以达到1000个实际并发用户。case中80%的insert。插入的是30张不同的表。关联很少。我的调用都是rest服务调用。 [b]测试结果[/b] 访问数据库的service响应时间相当慢,在并发数上升到100的时候相应还挺快,大概500毫秒,一旦并发达到800的时候,相应时间可以达到30s。 [b]我的Monitor情况[/b] App Server 和 DB Server的cpu都是小于10%,内存都只用了1G多,我配置了4G。 用YourKIT看下来的结果,有大量线程都block在了MySQLIO的read。是在block在prepareStatement的jdbc操作上。 请各位给点建议吧。谢谢
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入  假设现有4个人
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
【图解经典算法题】如何用一行代码解决约瑟夫环问题
约瑟夫环问题算是很经典的题了,估计大家都听说过,然后我就在一次笔试中遇到了,下面我就用 3 种方法来详细讲解一下这道题,最后一种方法学了之后保证让你可以让你装逼。 问题描述:编号为 1-N 的 N 个士兵围坐在一起形成一个圆圈,从编号为 1 的士兵开始依次报数(1,2,3…这样依次报),数到 m 的 士兵会被杀死出列,之后的士兵再从 1 开始报数。直到最后剩下一士兵,求这个士兵的编号。 1、方
致 Python 初学者
文章目录1. 前言2. 明确学习目标,不急于求成,不好高骛远3. 在开始学习 Python 之前,你需要做一些准备2.1 Python 的各种发行版2.2 安装 Python2.3 选择一款趁手的开发工具3. 习惯使用IDLE,这是学习python最好的方式4. 严格遵从编码规范5. 代码的运行、调试5. 模块管理5.1 同时安装了py2/py35.2 使用Anaconda,或者通过IDE来安装模
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下
日均350000亿接入量,腾讯TubeMQ性能超过Kafka
整理 | 夕颜出品 | AI科技大本营(ID:rgznai100) 【导读】近日,腾讯开源动作不断,相继开源了分布式消息中间件TubeMQ,基于最主流的 OpenJDK8开发的
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
so easy! 10行代码写个"狗屁不通"文章生成器
前几天,GitHub 有个开源项目特别火,只要输入标题就可以生成一篇长长的文章。背后实现代码一定很复杂吧,里面一定有很多高深莫测的机器学习等复杂算法不过,当我看了源代码之后这程序不到50
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
MySQL数据库总结
文章目录一、数据库简介二、MySQL数据类型(5.5版本)三、Sql语句(1)Sql语句简介(2)数据定义语言DDLcreate,alter,drop(3)数据操纵语言DMLupdate,insert,delete(4)数据控制语言DCLgrant,revoke(5)数据查询语言DQLselect(6)分组查询与分页查询group by,limit四、完整性约束(单表)五、多表查询六、MySQL数
记一次腾讯面试:进程之间究竟有哪些通信方式?如何通信? ---- 告别死记硬背
有一次面试的时候,被问到进程之间有哪些通信方式,不过由于之前没深入思考且整理过,说的并不好。想必大家也都知道进程有哪些通信方式,可是我猜很多人都是靠着”背“来记忆的,所以今天的这篇文章,讲给大家详细着讲解他们是如何通信的,让大家尽量能够理解他们之间的区别、优缺点等,这样的话,以后面试官让你举例子,你也能够顺手拈来。 1、管道 我们来看一条 Linux 的语句 netstat -tulnp | gr...
20行Python代码爬取王者荣耀全英雄皮肤
引言 王者荣耀大家都玩过吧,没玩过的也应该听说过,作为时下最火的手机MOBA游戏,咳咳,好像跑题了。我们今天的重点是爬取王者荣耀所有英雄的所有皮肤,而且仅仅使用20行Python代码即可完成。 准备工作 爬取皮肤本身并不难,难点在于分析,我们首先得得到皮肤图片的url地址,话不多说,我们马上来到王者荣耀的官网: 我们点击英雄资料,然后随意地选择一位英雄,接着F12打开调试台,找到英雄原皮肤的图片
走进高并发(二)Java并行程序基础
一、进程和线程 在操作系统这门课程中,对进程的定义是这样的: 进程是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位,是操作系统结构的基础。在早期面向进程设计的计算机结构中,进行是程序的基本执行实体;在当代面向线程设计的计算机结构中,进程是线程的容器。 上面的定义很完整,对进程进行了全方面的定义,但是貌似进程是看不见摸不着的一个东西,实际上,我们可以通过查看计算...
相关热词 c# plc s1200 c#里氏转换原则 c# 主界面 c# do loop c#存为组套 模板 c# 停掉协程 c# rgb 读取图片 c# 图片颜色调整 最快 c#多张图片上传 c#密封类与密封方法
立即提问