<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Java on 魔都水滴</title>
    <link>https://blog.margrop.net/tag/java/</link>
    <description>Recent content in Java on 魔都水滴</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-CN</language>
    <lastBuildDate>Wed, 01 May 2024 13:34:09 +0800</lastBuildDate>
    <atom:link href="https://blog.margrop.net/tag/java/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>IDEA激活服务器搜索方法</title>
      <link>https://blog.margrop.net/post/activate-jetbrains-intellij-idea/</link>
      <pubDate>Wed, 01 May 2024 13:34:09 +0800</pubDate>
      <guid>https://blog.margrop.net/post/activate-jetbrains-intellij-idea/</guid>
      <description>&lt;h1 id=&#34;请自行通过下面搜索引擎和关键字进行搜索&#34;&gt;请自行通过下面搜索引擎和关键字进行搜索&lt;/h1&gt;&#xA;&lt;h2 id=&#34;fofahttpsenfofainfo&#34;&gt;&lt;a href=&#34;https://en.fofa.info/&#34;&gt;Fofa&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;header=&amp;#34;https://account.jetbrains.com/fls-auth&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;shodanhttpswwwshodanio&#34;&gt;&lt;a href=&#34;https://www.shodan.io/&#34;&gt;Shodan&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;Location&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;https://account.jetbrains.com/fls-auth&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;censyshttpscensyscom&#34;&gt;&lt;a href=&#34;https://censys.com/&#34;&gt;Censys&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;services.http.response.headers.location&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;account.jetbrains.com/fls-auth&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>修复 Spring 2.3.x 升级到更新版本出现的跨域问题</title>
      <link>https://blog.margrop.net/post/fix-spring2-allowed-origins-error/</link>
      <pubDate>Sun, 12 Mar 2023 20:20:01 +0800</pubDate>
      <guid>https://blog.margrop.net/post/fix-spring2-allowed-origins-error/</guid>
      <description>&lt;h1 id=&#34;异常提示&#34;&gt;异常提示：&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;p&gt;#解决办法：&#xA;跨域配置报错，将&lt;code&gt;.allowedOrigins&lt;/code&gt;替换成&lt;code&gt;.allowedOriginPatterns&lt;/code&gt;即可。&lt;/p&gt;</description>
    </item>
    <item>
      <title>修复 SpringFox 3.0.0 不兼容 SpringBoot 2.6.4 的问题</title>
      <link>https://blog.margrop.net/post/fix-springfox-documentation-plugins-bootstrapper-npe/</link>
      <pubDate>Sun, 12 Mar 2023 17:56:57 +0800</pubDate>
      <guid>https://blog.margrop.net/post/fix-springfox-documentation-plugins-bootstrapper-npe/</guid>
      <description>&lt;h1 id=&#34;异常提示&#34;&gt;异常提示：&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;原因分析&#34;&gt;原因分析：&lt;/h1&gt;&#xA;&lt;p&gt;&lt;code&gt;SpringFox&lt;/code&gt; 3.0.0 不兼容 &lt;code&gt;SpringBoot&lt;/code&gt; 2.6.4&lt;/p&gt;&#xA;&lt;h1 id=&#34;解决方案&#34;&gt;解决方案：&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;参考链接&#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>Java基于 SpringBoot 的 JNI 本地方法库加载器</title>
      <link>https://blog.margrop.net/post/java-spring-boot-jni-java-native-interface-library-loader/</link>
      <pubDate>Sat, 27 Mar 2021 16:37:31 +0800</pubDate>
      <guid>https://blog.margrop.net/post/java-spring-boot-jni-java-native-interface-library-loader/</guid>
      <description>&lt;p&gt;由于Java跨平台需要，自行写了一个跨平台的 JNI 本地方法库加载器。&lt;/p&gt;&#xA;&lt;h1 id=&#34;简单实现逻辑&#34;&gt;简单实现逻辑&lt;/h1&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;根据环境变量&lt;code&gt;os.name&lt;/code&gt;，判断当前系统属于&lt;code&gt;Windows&lt;/code&gt;,&lt;code&gt;Linux&lt;/code&gt;还是&lt;code&gt;MacOS&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;如果是&lt;code&gt;Linux&lt;/code&gt;，继续判断是&lt;code&gt;CentOS&lt;/code&gt;还是&lt;code&gt;Debian&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;读取 jar 包中的库文件&lt;/li&gt;&#xA;&lt;li&gt;根据文件名后缀&lt;code&gt;dll&lt;/code&gt;、&lt;code&gt;so&lt;/code&gt;、&lt;code&gt;jnilib&lt;/code&gt;和&lt;code&gt;dylib&lt;/code&gt;，过滤符合当前平台的库文件&lt;/li&gt;&#xA;&lt;li&gt;将当前平台的库文件复制到系统临时目录&lt;code&gt;java.io.tmpdir&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;使用&lt;code&gt;System.load&lt;/code&gt;加载库文件&lt;/li&gt;&#xA;&lt;/ol&gt;</description>
    </item>
    <item>
      <title>Spring Boot &#43; Undertow上传文件找不到临时目录</title>
      <link>https://blog.margrop.net/post/spring-boot-undertow-upload-file-not-found-temp-folder/</link>
      <pubDate>Sat, 27 Mar 2021 11:17:26 +0800</pubDate>
      <guid>https://blog.margrop.net/post/spring-boot-undertow-upload-file-not-found-temp-folder/</guid>
      <description>&lt;h1 id=&#34;问题出现&#34;&gt;问题出现&lt;/h1&gt;&#xA;&lt;p&gt;前2天，公司的 SpringBoot 项目突然出现了，无法上传 Excel 文件的问题。&lt;/p&gt;&#xA;&lt;p&gt;经过查看 Java 日志，发现出现了大量的异常：&lt;code&gt;java.nio.file.NoSuchFileException: /tmp/undertow.12020.9432679758080410942/undertow17157208698492118168upload&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>MySQL中Date，夏令时时间转换引发的错误HOUR_OF_DAY: 0 -&gt; 1，及解决办法</title>
      <link>https://blog.margrop.net/post/mysql-exception-hour-of-day-0-1-solution/</link>
      <pubDate>Thu, 25 Mar 2021 10:53:15 +0800</pubDate>
      <guid>https://blog.margrop.net/post/mysql-exception-hour-of-day-0-1-solution/</guid>
      <description>&lt;h1 id=&#34;做用户导出的功能代码报错hour_of_day-0---1&#34;&gt;做用户导出的功能，代码报错HOUR_OF_DAY: 0 -&amp;gt; 1&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Exception in thread &amp;ldquo;main&amp;rdquo; java.lang.IllegalArgumentException: HOUR_OF_DAY: 0 -&amp;gt; 1&#xA;详细报错内容如下：&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>SpringBoot DevTools的大坑，没有之一</title>
      <link>https://blog.margrop.net/post/springboot-devtools-terrible/</link>
      <pubDate>Wed, 03 Mar 2021 18:23:39 +0800</pubDate>
      <guid>https://blog.margrop.net/post/springboot-devtools-terrible/</guid>
      <description>&lt;p&gt;最近在SpringBoot的项目中新增了不少改动，然后就碰到了一个非常奇怪的问题。&lt;/p&gt;&#xA;&lt;h1 id=&#34;hibernate数据库查询报错&#34;&gt;&lt;code&gt;Hibernate&lt;/code&gt;数据库查询报错&lt;/h1&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;2021&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;03&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;03 17:08:28.&lt;span style=&#34;color:#a6e22e&#34;&gt;016&lt;/span&gt; ERROR 36216 &lt;span style=&#34;color:#f92672&#34;&gt;---&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;  XNIO&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;2 task&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;1&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt; o.&lt;span style=&#34;color:#a6e22e&#34;&gt;h&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;p&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;access&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;spi&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;SetterMethodImpl&lt;/span&gt;        : HHH000123: IllegalArgumentException in &lt;span style=&#34;color:#66d9ef&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;net&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;margrop&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;racentity&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;entity&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Race&lt;/span&gt;, setter method of property: raceType&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;2021&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;03&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;03 17:08:28.&lt;span style=&#34;color:#a6e22e&#34;&gt;016&lt;/span&gt; ERROR 36216 &lt;span style=&#34;color:#f92672&#34;&gt;---&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;  XNIO&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;2 task&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;1&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt; o.&lt;span style=&#34;color:#a6e22e&#34;&gt;h&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;p&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;access&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;spi&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;SetterMethodImpl&lt;/span&gt;        : HHH000091: Expected type: net.&lt;span style=&#34;color:#a6e22e&#34;&gt;margrop&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;raceapi&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;entity&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;permanent&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;RaceType&lt;/span&gt;, actual value: net.&lt;span style=&#34;color:#a6e22e&#34;&gt;margrop&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;raceapi&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;entity&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;permanent&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;RaceType&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;这简直就是奇了怪了&#xA;&lt;code&gt;Expected type&lt;/code&gt;和&lt;code&gt;actual value&lt;/code&gt;完全是一模一样，可&lt;code&gt;Hibernate&lt;/code&gt;认为不一样，这可咋整。&lt;/p&gt;</description>
    </item>
    <item>
      <title>如何使用通用的Hibernate类型映射JSON对象</title>
      <link>https://blog.margrop.net/post/how-to-map-json-collections-using-jpa-and-hibernate/</link>
      <pubDate>Fri, 29 Jan 2021 16:06:09 +0800</pubDate>
      <guid>https://blog.margrop.net/post/how-to-map-json-collections-using-jpa-and-hibernate/</guid>
      <description>&lt;h1 id=&#34;介绍&#34;&gt;介绍&lt;/h1&gt;&#xA;&lt;p&gt;在本文中，我们将看到如何使用&lt;a href=&#34;http://www.google.com/&#34; title=&#34;Hibernate Types&#34;&gt;Hibernate Types&lt;/a&gt;开源项目将JSON列映射到JPA实体属性。&lt;/p&gt;&#xA;&lt;p&gt;虽然您可以创建自己的自定义Hibernate类型，但可以在Oracle，SQL Server，PostgreSQL或MySQL上映射JSON列类型，但是由于&lt;a href=&#34;http://www.google.com/&#34; title=&#34;Hibernate Types&#34;&gt;Hibernate Types&lt;/a&gt;项目已经提供了此功能，因此您无需实现自己的Hibernate Type 。&lt;/p&gt;</description>
    </item>
    <item>
      <title>使用SpringFox 3.0.0版本出现NumberFormatException的解决办法 </title>
      <link>https://blog.margrop.net/post/java-springfox-number-format-exception/</link>
      <pubDate>Mon, 18 Jan 2021 16:39:34 +0800</pubDate>
      <guid>https://blog.margrop.net/post/java-springfox-number-format-exception/</guid>
      <description>&lt;p&gt;最近升级了SpringFox至3.0.0版本，访问接口文档，出现了一堆异常&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Illegal DefaultValue null for parameter type integer&lt;/code&gt;&#xA;&lt;code&gt;java.lang.NumberFormatException: For input string: &amp;quot;&amp;quot;&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>【转】Spring AOP 拦截指定注解标识的类或方法</title>
      <link>https://blog.margrop.net/post/spring-aop-annotation-and-within/</link>
      <pubDate>Thu, 14 Jan 2021 15:29:41 +0800</pubDate>
      <guid>https://blog.margrop.net/post/spring-aop-annotation-and-within/</guid>
      <description>&lt;p&gt;AOP中扫描指定注解相关说明&#xA;（1）@annotation：用来拦截所有被某个注解修饰的方法&#xA;（2）@within：用来拦截所有被某个注解修饰的类&#xA;（3）within：用来指定扫描的包的范围&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
