小编ndr*_*one的帖子

Spring Profile包含yaml文件的问题

当团队设置websphere配置文件激活时,我正在尝试完成云配置文件也已激活.

yaml文件

   ---
    spring:
      application:
        name: kicapp
      output:
        ansi:
          enabled: ALWAYS
      profiles:
        active: local
    #server:
      #context-path: /
      #port: 8080
    #logging:
      #level:
        #org.springframework.security: DEBUG
    ---
    spring:
      profiles: local
    ---
    spring:
      profiles: unittest
    ---
    spring:
      profiles: cloud
      test: loaded
    ---
    spring:
      profiles: websphere
        include: cloud
Run Code Online (Sandbox Code Playgroud)

当我设置时,--spring.profiles.active=websphere我收到以下错误

引起:'读者',第28行,第12栏中不允许使用映射值:include:cloud

java spring snakeyaml spring-boot

7
推荐指数
2
解决办法
3363
查看次数

WebSphere Liberty Profile:未找到上下文根

我似乎无法在本地工作,即使相同的 WAR 在远程服务器上工作。当我在本地访问我的应用程序时,出现“找不到上下文根”错误。Liberty 配置文件版本为 8.5.5.5。

以下是相关文件:

服务器.xml

<?xml version="1.0" encoding="UTF-8"?>
<server description="tlc server">
  <!-- Enable features -->
  <featureManager>
    <feature>jsp-2.2</feature>
    <feature>ssl-1.0</feature>
    <feature>localConnector-1.0</feature>
    <feature>restConnector-1.0</feature>
    <feature>json-1.0</feature>
    <feature>jaxrs-1.1</feature>
    <feature>servlet-3.0</feature>
    <feature>jpa-2.0</feature>
    <feature>beanValidation-1.0</feature>
    <feature>jndi-1.0</feature>
    <feature>jdbc-4.0</feature>
    <feature>monitor-1.0</feature>
  </featureManager>
  <httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9080" httpsPort="9443" virtualHost="default_host" />
  <jdbcDriver id="DerbyJDBCDriver">
    <library name="DerbyLib">
      <fileset dir="C:\tools\servers\wlp\lib" includes="derbyclient-10.6.1.0.jar" />
    </library>
  </jdbcDriver>
  <dataSource jndiName="jdbc/TLCDataSource" id="derbyDataSource" jdbcDriverRef="DerbyJDBCDriver">
    <properties.derby.client databaseName="TLC" password="APP" user="APP" />
  </dataSource>
  <applicationMonitor updateTrigger="mbean" />
  <application id="TLC_war" context-root="/TLC" location="C:\Users\nd26434\gitrepos\tlc\target\TLC-1.0.0-SNAPSHOT.war" name="TLC_war" type="war">
    <classloader delegation="parentLast">
      <privateLibrary>
        <fileset dir="C:\tools\servers\wlp\lib" includes="aspectjweaver-1.8.0.jar" />
      </privateLibrary>
    </classloader>
  </application>
</server>
Run Code Online (Sandbox Code Playgroud)

消息日志

[3/18/15 …
Run Code Online (Sandbox Code Playgroud)

websphere-liberty

6
推荐指数
1
解决办法
4万
查看次数

使用Spring Boot和AOP进行性能记录

我正在尝试根据这篇文章实现性能日志记录:http : //www.baeldung.com/spring-performance-logging。我想记录每个控制器端点和每个数据库请求。如果您想查看整个项目,可以在这里找到。当我命中端点时,什么都没有记录。在拦截器类中放置一个断点也不会停止。我已经将软件包的日志记录设置为跟踪级别。我想念什么?我相信这是与之相关的,@PointCut但是在查看了文档之后,我相信我是正确的。

拦截器

public class PerformanceMonitorInterceptor extends AbstractMonitoringInterceptor
{
    @Override
    protected Object invokeUnderTrace(MethodInvocation methodInvocation, Log log) throws Throwable
    {
        String name = createInvocationTraceName(methodInvocation);
        StopWatch stopWatch = new StopWatch();
        stopWatch.start();
        log.trace(String.format("Method %s execution start at %s", name, LocalDateTime.now()));

        try
        {
            return methodInvocation.proceed();
        }
        finally
        {
            stopWatch.stop();
            log.trace(String.format("Method %s execution took %dms (%s)", name,
                stopWatch.getTotalTimeMillis(), DurationFormatUtils
                    .formatDurationWords(stopWatch.getTotalTimeMillis(), true, true)));
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

组态

@Configuration
@EnableAspectJAutoProxy
@Aspect
public class ContactControllerPerfLogConfig
{
    @Bean
    public PerformanceMonitorInterceptor performanceMonitorInterceptor()
    { …
Run Code Online (Sandbox Code Playgroud)

java spring spring-aop spring-boot

5
推荐指数
2
解决办法
5736
查看次数