草庐IT

generation_config

全部标签

java - 由 Typesafe Config 支持的 Spring 环境

我想在我的项目中使用类型安全配置(HOCON配置文件),这有助于轻松和有组织的应用程序配置。目前我使用的是普通的Java属性文件(application.properties),在大型项目中很难处理。我的项目是SpringMVC(不是SpringBoot项目)。有没有办法支持我的Spring环境(我被注入(inject)到我的服务中)由类型安全配置支持。这不应该破坏我现有的环境使用,如@Value注释、@AutowiredEnvironment等。我怎样才能以最小的努力和对我的代码的更改来做到这一点。这是我目前的解决方案:寻找有没有其他更好的方法@Configurationpublic

Spring Boot Java Config 设置 session 超时

如何在SpringBoot应用程序中配置我的(嵌入式)Tomcatsession超时?publicclassSessionListenerimplementsHttpSessionListener{@OverridepublicvoidsessionCreated(HttpSessionEventse){se.getSession().setMaxInactiveInterval(5*60);}@OverridepublicvoidsessionDestroyed(HttpSessionEventse){}}我有一个SessionListener,但我不知道必须在哪个类中将此Liste

xml - 找不到元素 'context:annotation-config' 的声明

Spring,每当我写在我的spring.xml中,我收到了这个错误:-Exceptioninthread"main"org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:Line81inXMLdocumentfromclasspathresource[spring.xml]isinvalid;nestedexceptionisorg.xml.sax.SAXParseException;lineNumber:81;columnNumber:30;cvc-complex-type.2.4.c:Thema

java - spring security : NoSuchBeanDefinitionException: No qualifying bean of type [org. springframework.security.config.annotation.ObjectPostProcessor] 找到

我正在尝试将spring-security添加到我的休息应用程序中。我按照spring网站上的教程(https://spring.io/guides/tutorials/spring-security-and-angular-js/)来做,但是它使用了我不想使用的spring-boot组件,也许问题就在这里。我的安全配置在这里:@Configuration@Order(2147483636)publicclassSecurityConfigurationextendsWebSecurityConfigurerAdapter{@Overrideprotectedvoidconfigure

java - 使用 Java Config 的 Spring Security 自定义身份验证过滤器

我正在尝试在基本Web应用程序中使用Java配置配置SpringSecurity,以使用URL请求参数中提供的加密token对外部Web服务进行身份验证。我希望(我认为)有一个安全过滤器来拦截来自登录门户的请求(它们都转到/authenticate),过滤器将使用AuthenticationProvider来处理身份验证过程的业务逻辑。LoginPortal-->Redirect'\authenticate'(+Token)-->AuthenticateToken返回到LoginPortal(WS)-->如果成功获取角色和设置用户。我已经创建了一个过滤器..@Componentpubl

java - Spring Data MongoDB : How to Dump Raw Query/Commands generated through QueryDsl?

我正在使用SpringData'sQuerydslintegration使用谓词执行我的查询。findAll(predicate,pageable)有没有办法转储实际执行的原始查询/命令?我也看过这个问题的答案,但它对我不起作用..ConfigureloggingfortheMongoDBJavadriver--更新--我设法通过添加logging.level.org.mongodb.driver=DEBUG来使日志记录工作在application.properties(不是log4j.properties)中但是,我仍然看不到正在执行的原始查询:2016-03-2321:50:56D

java - Spring Data MongoDB : How to Dump Raw Query/Commands generated through QueryDsl?

我正在使用SpringData'sQuerydslintegration使用谓词执行我的查询。findAll(predicate,pageable)有没有办法转储实际执行的原始查询/命令?我也看过这个问题的答案,但它对我不起作用..ConfigureloggingfortheMongoDBJavadriver--更新--我设法通过添加logging.level.org.mongodb.driver=DEBUG来使日志记录工作在application.properties(不是log4j.properties)中但是,我仍然看不到正在执行的原始查询:2016-03-2321:50:56D

python - Mac OS X - 环境错误 : mysql_config not found

首先,是的,我已经看过了:pipinstallmysql-pythonfailswithEnvironmentError:mysql_confignotfound问题我正在尝试在GoogleAppEngine项目中使用Django。但是,由于以下原因导致服务器无法正常启动,我一直无法启动:ImproperlyConfigured("ErrorloadingMySQLdbmodule:%s"%e)ImproperlyConfigured:ErrorloadingMySQLdbmodule:NomodulenamedMySQLdb我做了一些研究,结果都表明必须安装Mysql-python,

java - @Generated 注解使用 gradlew + dagger

我在使用gradlew(4.10.2)+dagger(2.18)时遇到了一个奇怪的问题。问题是当我打电话时:./gradlew:app:compileDebugAndroidTestKotlin构建失败:Task:Common:compileDebugJavaWithJavacFAILED/CommonModule_ProvidesGsonFactory.java:6:error:packagejavax.annotation.processingdoesnotexistimportjavax.annotation.processing.Generated;/CommonModule_

java - Android Studio - java.io.IOException : Failed to generate v1 signature

在将我的AndroidStudio更新到3.0Canary4之后的所有新版本后,我收到此错误。(我使用的是v3.0,因为它要快得多,并且不需要为Kotlin安装插孔。)构建流程似乎存在问题,它无法为调试和发布版本生成或签署我的APK文件。我也尝试删除我的debug.keystore,重新启动AndroidStudio和系统(!!!)但没有解决。这是完整的Gradle日志:FAILURE:Buildfailedwithanexception.*Whatwentwrong:Executionfailedfortask':chris-app:packageDemoDebug'.java.io