Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AOT doesn't work with Logstash Logback Encoder #33387

Closed
toellrich opened this issue Nov 28, 2022 · 0 comments
Closed

AOT doesn't work with Logstash Logback Encoder #33387

toellrich opened this issue Nov 28, 2022 · 0 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@toellrich
Copy link

toellrich commented Nov 28, 2022

I'm trying out the new AOT feature in Spring Boot 3.0.0 GA. We're using the 3rd Party LogstashTcpSocketAppender in order to log JSON to a socket. This works fine when doing an old school Maven build. When using the new execution goal process-aot however, the build fails with the following error message:

Exception in thread "main" java.lang.IllegalStateException: Invalid class name '[Ljava.net.InetSocketAddress;'
	at org.springframework.aot.hint.SimpleTypeReference.of(SimpleTypeReference.java:47)
	at org.springframework.aot.hint.TypeReference.of(TypeReference.java:84)
	at org.springframework.boot.logging.logback.SpringBootJoranConfigurator$ModelWriter.lambda$writeTo$0(SpringBootJoranConfigurator.java:175)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at org.springframework.boot.logging.logback.SpringBootJoranConfigurator$ModelWriter.writeTo(SpringBootJoranConfigurator.java:174)
	at org.springframework.boot.logging.logback.SpringBootJoranConfigurator$LogbackConfigurationAotContribution.applyTo(SpringBootJoranConfigurator.java:142)
	at org.springframework.context.aot.BeanFactoryInitializationAotContributions.applyTo(BeanFactoryInitializationAotContributions.java:78)
	at org.springframework.context.aot.ApplicationContextAotGenerator.lambda$processAheadOfTime$0(ApplicationContextAotGenerator.java:58)
	at org.springframework.context.aot.ApplicationContextAotGenerator.withCglibClassHandler(ApplicationContextAotGenerator.java:67)
	at org.springframework.context.aot.ApplicationContextAotGenerator.processAheadOfTime(ApplicationContextAotGenerator.java:53)
	at org.springframework.context.aot.ContextAotProcessor.performAotProcessing(ContextAotProcessor.java:106)
	at org.springframework.context.aot.ContextAotProcessor.doProcess(ContextAotProcessor.java:84)
	at org.springframework.context.aot.ContextAotProcessor.doProcess(ContextAotProcessor.java:49)
	at org.springframework.context.aot.AbstractAotProcessor.process(AbstractAotProcessor.java:82)
	at org.springframework.boot.SpringApplicationAotProcessor.main(SpringApplicationAotProcessor.java:76)

Our logging config is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>[%d][%-5level] %m%n</pattern>
    </encoder>
  </appender>
  <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
    <destination>localhost:4445</destination>
    <encoder class="net.logstash.logback.encoder.LogstashEncoder">
      <includeContext>false</includeContext>
    </encoder>
  </appender>
  <logger name="test.Application" level="INFO">
    <appender-ref ref="CONSOLE"/>
  </logger>
  <root level="INFO">
    <appender-ref ref="LOGSTASH"/>
  </root>
</configuration>

I've attached a small sample application that reproduces the problem.

test.zip

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 28, 2022
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 28, 2022
@wilkinsona wilkinsona self-assigned this Nov 28, 2022
@wilkinsona wilkinsona added this to the 3.0.x milestone Nov 28, 2022
@wilkinsona wilkinsona modified the milestones: 3.0.x, 3.0.1 Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants