<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Springfox on Margrop Blog</title>
    <link>https://blog.margrop.net/en/tag/springfox/</link>
    <description>Recent content in Springfox on Margrop Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <lastBuildDate>Sun, 12 Mar 2023 20:20:01 +0800</lastBuildDate>
    <atom:link href="https://blog.margrop.net/en/tag/springfox/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Fixing CORS Issues When Upgrading from Spring 2.3.x to a Newer Version</title>
      <link>https://blog.margrop.net/en/post/fix-spring2-allowed-origins-error/</link>
      <pubDate>Sun, 12 Mar 2023 20:20:01 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/fix-spring2-allowed-origins-error/</guid>
      <description>&lt;h1 id=&#34;exception-message&#34;&gt;Exception Message:&lt;/h1&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;When allowCredentials is true, allowedOrigins cannot contain the special value &amp;#34;*&amp;#34; since that cannot be set on the &amp;#34;Access-Control-Allow-Origin&amp;#34; response header. To allow credentials to a set of origins, list them explicitly or consider using &amp;#34;allowedOriginPatterns&amp;#34; instead.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=&#34;solution&#34;&gt;Solution:&lt;/h1&gt;&#xA;&lt;p&gt;CORS configuration error, simply replace &lt;code&gt;.allowedOrigins&lt;/code&gt; with &lt;code&gt;.allowedOriginPatterns&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fixing SpringFox 3.0.0 Incompatibility with SpringBoot 2.6.4</title>
      <link>https://blog.margrop.net/en/post/fix-springfox-documentation-plugins-bootstrapper-npe/</link>
      <pubDate>Sun, 12 Mar 2023 17:56:57 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/fix-springfox-documentation-plugins-bootstrapper-npe/</guid>
      <description>&lt;h1 id=&#34;error-message&#34;&gt;Error Message:&lt;/h1&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Failed to start bean &amp;#39;documentationPluginsBootstrapper&amp;#39;; nested exception is java.lang.NullPointerException&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h1 id=&#34;root-cause-analysis&#34;&gt;Root Cause Analysis:&lt;/h1&gt;&#xA;&lt;p&gt;&lt;code&gt;SpringFox&lt;/code&gt; 3.0.0 is not compatible with &lt;code&gt;SpringBoot&lt;/code&gt; 2.6.4&lt;/p&gt;&#xA;&lt;h1 id=&#34;solution&#34;&gt;Solution:&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Reference Links&#xA;&lt;a href=&#34;https://stackoverflow.com/questions/40241843/failed-to-start-bean-documentationpluginsbootstrapper-in-spring-data-rest&#34;&gt;https://stackoverflow.com/questions/40241843/failed-to-start-bean-documentationpluginsbootstrapper-in-spring-data-rest&lt;/a&gt;&#xA;&lt;a href=&#34;https://github.com/springfox/springfox/issues/3462#issuecomment-1010721223&#34;&gt;https://github.com/springfox/springfox/issues/3462#issuecomment-1010721223&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Solution to NumberFormatException when using SpringFox 3.0.0 version</title>
      <link>https://blog.margrop.net/en/post/java-springfox-number-format-exception/</link>
      <pubDate>Mon, 18 Jan 2021 16:39:34 +0800</pubDate>
      <guid>https://blog.margrop.net/en/post/java-springfox-number-format-exception/</guid>
      <description>I recently upgraded SpringFox to version 3.0.0, and a bunch of exceptions occurred when accessing the interface documentation.&#xA;The detailed exception stack is as follows&#xA;2021-01-18 16:25:35.824 WARN 62082 --- [ XNIO-2 task-1] i.s.m.p.AbstractSerializableParameter : Illegal DefaultValue null for parameter type integer java.lang.NumberFormatException: For input string: &amp;#34;&amp;#34; at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.base/java.lang.Long.parseLong(Long.java:702) at java.base/java.lang.Long.valueOf(Long.java:1144) at io.swagger.models.parameters.AbstractSerializableParameter.getExample(AbstractSerializableParameter.java:412) at jdk.internal.reflect.GeneratedMethodAccessor220.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:689) at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755) at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119) at com.</description>
    </item>
  </channel>
</rss>
