<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Backend Troubleshooting on LOCRIAN_V Blog</title>
    <link>https://lv-blog.pages.dev/en/tags/backend-troubleshooting/</link>
    <description>Recent content in Backend Troubleshooting on LOCRIAN_V Blog</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sat, 25 Oct 2025 12:55:49 +0800</lastBuildDate>
    <atom:link href="https://lv-blog.pages.dev/en/tags/backend-troubleshooting/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>The Incompatibility Between PostgreSQL and Java&#39;s LocalDateTime</title>
      <link>https://lv-blog.pages.dev/en/posts/programming/backend/bugs-solutions/postgresql-java-localdatetime-incompatibility/</link>
      <pubDate>Sat, 25 Oct 2025 12:55:49 +0800</pubDate>
      <guid>https://lv-blog.pages.dev/en/posts/programming/backend/bugs-solutions/postgresql-java-localdatetime-incompatibility/</guid>
      <description>&lt;p&gt;&lt;strong&gt;Java&amp;rsquo;s &lt;code&gt;LocalDateTime&lt;/code&gt; and PostgreSQL&amp;rsquo;s time types &amp;ldquo;aren&amp;rsquo;t talking about the same kind of time.&amp;rdquo;&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;first-get-clear-on-postgresqls-two-time-types&#34;&gt;First, get clear on PostgreSQL&amp;rsquo;s two time types&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;TIMESTAMP           → without time zone, just a bare time &amp;#34;2026-06-25 10:00:00&amp;#34;
TIMESTAMPTZ         → with time zone, stored internally as UTC, converted to the session time zone on query
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;
&lt;h2 id=&#34;on-the-java-side&#34;&gt;On the Java side&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LocalDateTime       → no concept of a time zone, just a bare time
ZonedDateTime       → with time zone
OffsetDateTime      → with an offset (e.g. +08:00)
Instant             → a UTC timestamp
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;
&lt;h2 id=&#34;why-the-error-happens&#34;&gt;Why the error happens&lt;/h2&gt;
&lt;p&gt;The PostgreSQL JDBC driver (especially newer versions 42.x+) is &lt;strong&gt;very strict&lt;/strong&gt; about type matching:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Swagger 2 vs. Swagger 3 Annotation Comparison Table</title>
      <link>https://lv-blog.pages.dev/en/posts/programming/backend/bugs-solutions/swagger-2-3-annotation-comparison/</link>
      <pubDate>Thu, 25 Sep 2025 09:06:35 +0800</pubDate>
      <guid>https://lv-blog.pages.dev/en/posts/programming/backend/bugs-solutions/swagger-2-3-annotation-comparison/</guid>
      <description>&lt;p&gt;In the Spring Boot ecosystem, the annotations changed a great deal between Swagger 2.0 (typically using the &lt;code&gt;Springfox&lt;/code&gt; dependency) and Swagger 3.0 (typically using the &lt;code&gt;Springdoc-openapi&lt;/code&gt; dependency, based on the OpenAPI 3 spec).&lt;/p&gt;
&lt;p&gt;Below is a complete correspondence table of the common annotations in Swagger 2.0 vs. Swagger 3.0 (OpenAPI 3):&lt;/p&gt;
&lt;h3 id=&#34;1-core-annotation-correspondence-table&#34;&gt;1. Core annotation correspondence table&lt;/h3&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Description&lt;/th&gt;
					&lt;th&gt;Swagger 2.0 annotation (io.swagger.annotations)&lt;/th&gt;
					&lt;th&gt;Swagger 3.0 annotation (io.swagger.v3.oas.annotations)&lt;/th&gt;
					&lt;th&gt;Notes&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Mark a controller class&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;@Api(tags = &amp;quot;User API&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;@Tag(name = &amp;quot;User API&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;3.0 removed the &lt;code&gt;description&lt;/code&gt; attribute; use &lt;code&gt;name&lt;/code&gt; uniformly&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Mark an API method&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;@ApiOperation(value = &amp;quot;Get user&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;@Operation(summary = &amp;quot;Get user&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;In 3.0 &lt;code&gt;value&lt;/code&gt; became &lt;code&gt;summary&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Request/entity class&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;@ApiModel(value = &amp;quot;User object&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;@Schema(description = &amp;quot;User object&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;3.0 greatly simplified this; use &lt;code&gt;@Schema&lt;/code&gt; uniformly&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Entity class property&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;@ApiModelProperty(value = &amp;quot;Name&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;@Schema(description = &amp;quot;Name&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;As above, merged into &lt;code&gt;@Schema&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Ignore a property&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;@ApiModelProperty(hidden = true)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;@Schema(hidden = true)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Ignore a whole class/method&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;@ApiIgnore&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;@Hidden&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;For endpoints or parameters you don&amp;rsquo;t want exposed in docs&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;hr&gt;
&lt;h3 id=&#34;2-request-parameter-annotation-correspondence-table&#34;&gt;2. Request-parameter annotation correspondence table&lt;/h3&gt;
&lt;p&gt;For method parameters (URL path parameters, query parameters, etc.), 3.0 introduced a more structured configuration:&lt;/p&gt;</description>
    </item>
    <item>
      <title>SCA 2023.X — Troubleshooting and Fixing the Nacos Bootstrap Config Failure</title>
      <link>https://lv-blog.pages.dev/en/posts/programming/backend/bugs-solutions/sca-nacos-bootstrap-bug/</link>
      <pubDate>Thu, 24 Jul 2025 22:40:26 +0800</pubDate>
      <guid>https://lv-blog.pages.dev/en/posts/programming/backend/bugs-solutions/sca-nacos-bootstrap-bug/</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Issue source&lt;/strong&gt;: &lt;a href=&#34;https://github.com/alibaba/spring-cloud-alibaba/issues/3931&#34;&gt;spring-cloud-alibaba#3931&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Affected versions&lt;/strong&gt;: &lt;code&gt;spring-cloud-alibaba 2023.0.1.3+&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id=&#34;1-problem-description&#34;&gt;1. Problem Description&lt;/h2&gt;
&lt;p&gt;In Spring Cloud Alibaba 2023.X, placing Nacos config (including &lt;code&gt;extension-configs&lt;/code&gt;, &lt;code&gt;shared-configs&lt;/code&gt;, etc.) in &lt;code&gt;bootstrap.yml&lt;/code&gt; / &lt;code&gt;bootstrap.properties&lt;/code&gt; causes &lt;strong&gt;the config center&amp;rsquo;s content to fail to load properly&lt;/strong&gt;, even though the logs show the &lt;code&gt;bootstrap&lt;/code&gt; file itself was read.&lt;/p&gt;
&lt;p&gt;Moving the same config to &lt;code&gt;application.yml&lt;/code&gt; makes everything work again.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;2-root-cause&#34;&gt;2. Root Cause&lt;/h2&gt;
&lt;pre class=&#34;mermaid&#34;&gt;flowchart TD
    A[bootstrap.yml is read] --&gt; B{SCA version check}
    B -- 2023.0.1.2 and earlier --&gt; C[✅ Nacos config center loads normally]
    B -- 2023.0.1.3 and later --&gt; D[❌ extension-configs / shared-configs fail]
    D --&gt; E[Root cause: SCA 2023.0.1.3 changed the config-load priority mechanism]
    E --&gt; F[Nacos PropertySource registered in the bootstrap phase is overwritten or discarded by later steps]
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;In short:&lt;/strong&gt;&lt;br&gt;
SCA &lt;code&gt;2023.0.1.3&lt;/code&gt; made a &lt;strong&gt;backward-incompatible internal change&lt;/strong&gt;, causing the Nacos extension config in &lt;code&gt;bootstrap.yml&lt;/code&gt; to be &amp;ldquo;dropped&amp;rdquo; in the loading chain, while config in &lt;code&gt;application.yml&lt;/code&gt; takes the new path and is unaffected.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
