这个问题是由我的pom.xml [cxf-bundle-jaxrs]中的一个依赖项引起的,它在内部使用较低版本的slf4j.我设法通过将此依赖项升级到最新版本来解决此问题.感谢大家.
我正在尝试将Apache Shiro添加到我的CXF Spring Web应用程序中.当我启动我的tomcat 7时,我收到以下错误
Caused by: java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254)
at org.apache.shiro.spring.LifecycleBeanPostProcessor.<clinit>(LifecycleBeanPostProcessor.java:51)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
... 25 more
Run Code Online (Sandbox Code Playgroud)
我的shiro和slf4j的pom.xml是
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>runtime</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我通过谷歌搜索尝试了所有可能的解决方案,但没有运气.
我的应用程序是一个 springboot gradle 应用程序。我的应用程序的一部分涉及使用 gradle 进行旧版 gwt 编译。它工作正常,但今天当我运行下面的 gradle 任务时,它显示 CreateProcess error=206,文件名或扩展名太长。可能出了什么问题?因为它以前有效。是否建议更改以下代码以解决此问题?
task compileGwt(dependsOn: classes, type: JavaExec) {
//ext.buildDir = "${project.buildDir}/resources/main/static"
ext.buildDir = "${project.rootDir}/src/main/webapp"
//ext.buildDir = "${project.buildDir}"
ext.extraDir = "${project.buildDir}/extra"
ext.generatedDir = "${project.buildDir}/generated"
inputs.source sourceSets.main.java.srcDirs
inputs.dir sourceSets.main.output.resourcesDir
outputs.dir buildDir
// Workaround for incremental build (GRADLE-1483)
outputs.upToDateSpec = new org.gradle.api.specs.AndSpec()
doFirst {
file(buildDir).mkdirs()
//classpath.each { println it.name}
}
main = 'com.google.gwt.dev.Compiler'
classpath {
[
sourceSets.main.java.srcDirs, // Java source
sourceSets.main.output.resourcesDir, // Generated resources
sourceSets.main.output.classesDir, // Generated classes
sourceSets.main.compileClasspath, // Deps
]
} …Run Code Online (Sandbox Code Playgroud) 我们在客户端和 REST 服务(两者都在 Windows 上本地运行)之间使用 Spring Boot + RestTemplate。我测量了服务调用的时间,很好,但是结果准备好从服务器返回和客户端得到响应之间的时间很慢。
ResponseEntity<PageResult<MyPOJO>> response = restTemplate.exchange(url, HttpMethod.POST, request, typeRef);
return response;
Run Code Online (Sandbox Code Playgroud)
数据并不大(大约50条记录),花9秒将结果返回给客户端是没有意义的。如何排查哪个部分花费的时间最长?RestTemplate 的任何性能调整或配置技巧?
我正在尝试将以下Json数组响应解组为RestTemplate中的pojos集合.
[{
"client":{
"id": 6364,
"name": "7Seven7 Insurance Inc",
"email": "donna@7seven7ins.com",
"currency": {"name":"United States of America, Dollars","symbol":"$"},
"address": "941 Elm Ave. #5 ",
"city": "Long Beach",
"province": "CA",
"zip_code": "90813",
"country": "United States",
"full_address_with_comma": "941 Elm Ave. #5, Long Beach, CA, 90813, United States",
"phone": "562-556-4035",
"fax":"562-381-7500",
"custom_field_name": "listed",
"custom_field_value": "false",
"created_at": "2010-07-18T00:08:10Z",
"updated_at": "2010-07-21T11:04:58Z",
}
},
{
"client":{
"id":6365,
"name": "Affinity",
"email":"CGregory@affinitygroup.com",
"address":"2575 Vista Del Mar ",
"city":"Ventura",
"province":"California",
"zip_code":"93001",
"country":"United States",
"full_address_with_comma":"2575 Vista Del Mar, Ventura, California, 93001, …Run Code Online (Sandbox Code Playgroud) 我在Sybase中有一个简单的sql,
select user_name(uid), type, name
from sysobjects
Run Code Online (Sandbox Code Playgroud)
我想知道DB2中的等价sql是什么?