bestlong 怕失憶筆記

當健忘由隨機逐漸趨向常態時,作筆記是非常必要的

Grails: Error occurred running Grails CLI: No profile found for name [web].


1
2
3
4
5
6
7
8
9
> sdk env

Using java version 8.0.352-tem in this shell.

Using gradle version 5.1.1 in this shell.

Using grails version 4.0.3 in this shell.
> grails
| Error Error occurred running Grails CLI: No profile found for name [web]. (Use --stacktrace to see the full trace)
砍掉 build 目錄再跑一次就過關

1
2
3
4
5
6
> rm -rf build
| Resolving Dependencies. Please wait...

| Starting interactive mode...
| Enter a command name to run. Use TAB for completion:
grails>

Leave a Comment

SEVERE: Problems copying method. Incompatible JVM?

接手幾個基於 Grails 2.3.11 的老專案,用 SDKMan 很方便的安裝好 OpenJDK 8 與 Grails 開發環境後,開始一陣操弄

grails clean

先碰到 Resolve error obtaining dependencies 錯誤,因為 maven repositories 網址都改變了需要手動替換 mavenRepo 設定

grails compile

相依性處理到沒問題後

grails run-app

炸了,錯誤訊息節錄如下:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Oct 05, 2022 8:06:32 PM org.springsource.loaded.jvm.JVM copyMethod
SEVERE: Problems copying method. Incompatible JVM?
java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springsource.loaded.jvm.JVM.copyMethod(JVM.java:134)
        at org.springsource.loaded.ri.OriginalClassInvoker.createJavaMethod(OriginalClassInvoker.java:68)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlClassGetMethods(ReflectiveInterceptor.java:168)
        at org.springframework.beans.ExtendedBeanInfoFactory.supports(ExtendedBeanInfoFactory.java:53)
        at org.springframework.beans.ExtendedBeanInfoFactory.getBeanInfo(ExtendedBeanInfoFactory.java:45)
        at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:270)
        at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:186)
        at org.springframework.beans.BeanUtils.getPropertyDescriptors(BeanUtils.java:360)
        at org.codehaus.groovy.grails.commons.ClassPropertyFetcher.init(ClassPropertyFetcher.java:193)
        at org.codehaus.groovy.grails.commons.ClassPropertyFetcher.<init>(ClassPropertyFetcher.java:91)
        at org.codehaus.groovy.grails.commons.ClassPropertyFetcher.forClass(ClassPropertyFetcher.java:82)
        at org.codehaus.groovy.grails.commons.ClassPropertyFetcher.forClass(ClassPropertyFetcher.java:63)
        at org.codehaus.groovy.grails.commons.AbstractGrailsClass.<init>(AbstractGrailsClass.java:84)
        at org.codehaus.groovy.grails.plugins.AbstractGrailsPlugin$GrailsPluginClass.<init>(AbstractGrailsPlugin.java:65)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.initialisePlugin(DefaultGrailsPlugin.java:138)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.<init>(DefaultGrailsPlugin.java:117)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.<init>(DefaultGrailsPlugin.java:264)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.createGrailsPlugin(DefaultGrailsPluginManager.java:412)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.findUserPlugins(DefaultGrailsPluginManager.java:437)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.attemptLoadPlugins(DefaultGrailsPluginManager.java:349)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.loadPlugins(DefaultGrailsPluginManager.java:257)
        at org.codehaus.groovy.grails.project.plugins.GrailsProjectPluginLoader$_loadPlugins_closure2.doCall(GrailsProjectPluginLoader.groovy:95)
        at org.codehaus.groovy.grails.project.plugins.GrailsProjectPluginLoader$_loadPlugins_closure2.doCall(GrailsProjectPluginLoader.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1086)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:910)
        at groovy.lang.Closure.call(Closure.java:411)
        at groovy.lang.Closure.call(Closure.java:405)
        at org.codehaus.groovy.grails.cli.api.BaseSettingsApi.profile(BaseSettingsApi.java:342)
        at org.codehaus.groovy.grails.project.plugins.GrailsProjectPluginLoader.loadPlugins(GrailsProjectPluginLoader.groovy:91)
        at org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean.afterPropertiesSet(GrailsPluginManagerFactoryBean.java:74)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:615)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
        at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:70)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Can not copy a non-root Method
        at java.lang.reflect.Method.copy(Method.java:151)
        ... 65 more

搜尋網路後發現最低從 1.8.0_40 版本開始碰到相同問題

只好到 Oracle Java archive 去下載舊版 JDK

https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html

下載使用 Java SE Development Kit 8u40 版本測試確實會碰到問題

接著使用 Java SE Development Kit 8u31 版本可以讓 grails run-app 正常啟動,不過這樣的選擇是否能穩定運作無法保證。有疑慮可考慮改用 JDK 7 的最終版本。

Leave a Comment

Graylog: Indexer failures

查看 System/Overview 頁面,在 Indexer failures 有大量的失敗訊息:

錯誤訊息重點如下:

{“type”:”cluster_block_exception”,”reason”:”blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];”}

這是 Elasticsearch 服務的問題

先檢查儲存空間是否太少,使用空間超過 95% 就會 read-only

df -h

不過我遇到的狀況是使用空間不到 50% 後來猜測但會不會是記憶體容量問題 (雖然日誌都沒相關資訊),將原本總量 8G 使用量在 4G 上下,停機增加到 16G 重啟後問題就消失了。

Leave a Comment

Home Assistant 一般設定無法編輯

Editor disabled because config stored in configuration.yaml.
由於 configuration.yaml 內已儲存設定,編輯功能已關閉

這是因為在 configuration.yaml 設定檔中有做 homeassistant 的設定,所以 Web UI 的編輯功能就鎖起來了。

可以參考官方說明來修改所需的屬性設定或是將設定檔內 homeassistant 的設定清除,然後重啟 Home Assistant 就可以在 Web UI 上直接編輯。

Leave a Comment

Windows 7 進行 Windows Update 出現 80072EFE 錯誤訊息

安裝 KB3138612:x64 系統的 Windows 7 更新KB3138612:Windows 7 更新 就可以修復

Leave a Comment

  • 工商服務

    廣告讀取中...
  • 近期留言

  • 標籤

  • 彙整