Thingsboard Windows 安装错误

Thingsboard Windows Installation Error

当我 运行 install.bat 文件在 windows 7 机器上时。我收到以下错误:

Detecting Java version installed. Detecting if it is 64 bit machine CurrentVersion Detecting if it is 32 bit machine CurrentVersion 1.8 Java 1.8 found! Installing thingsboard ... Error: Could not find or load main class Files\thingsboard\lib\thingsboard.jar ThingsBoard installation failed!

我以为它读取的 BASE 文件目录不正确。所以我把它放到绝对目录位置如下图:

SET BASE="C:\Program Files\thingsboard"
SET LOADER_PATH=%BASE%\conf,%BASE%\extensions
SET SQL_DATA_FOLDER=%BASE%\data\sql
SET jarfile=%BASE%\lib\thingsboard.jar
SET installDir=%BASE%\data

我收到以下错误:

Detecting Java version installed. Detecting if it is 64 bit machine CurrentVersion Detecting if it is 32 bit machine CurrentVersion 1.8 Java 1.8 found! Installing thingsboard ... Logging system failed to initialize using configuration from 'C:\Program Files\thingsboard\install\logback.xml' java.lang.IllegalStateException: Logback configuration error detected: ERROR in ch.qos.logback.core.rolling.RollingFileAppender[fileLogAppender] - Failed to create parent directories for [C:\ Program Files\thingsboard\conf\"C:\Program Files\thingsboard"\logs\install.log] ERROR in ch.qos.logback.core.rolling.RollingFileAppender[fileLogAppender] - openFile("C:\Program Files\thingsboard"\logs /install.log,true) call failed. java.io.FileNotFoundException: "C:\Program Files\thingsboard"\logs\install.log (The file name, directory name, or volume label syntax is incorrect) at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:161 ) at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.jav a:57) at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:47) at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:114) at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java: 304) at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:272) at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingAppl icationListener.java:235) at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.jav a:208) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMult icaster.java:166) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMult icaster.java:138) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMult icaster.java:121) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListe ner.java:68) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java :54) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:337) at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) at org.thingsboard.server.ThingsboardInstallApplication.main(ThingsboardInstallApplication.java:42) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:521) java.lang.IllegalStateException: Logback configuration error detected: ERROR in ch.qos.logback.core.rolling.RollingFileAppender[fileLogAppender] - Failed to create parent directories for [C:\ Program Files\thingsboard\conf\"C:\Program Files\thingsboard"\logs\install.log] ERROR in ch.qos.logback.core.rolling.RollingFileAppender[fileLogAppender] - openFile("C:\Program Files\thingsboard"\logs /install.log,true) call failed. java.io.FileNotFoundException: "C:\Program Files\thingsboard"\logs\install.log (The file name, directory name, or volume label syntax is incorrect) ThingsBoard installation failed!

我做错了什么?

引号似乎有问题。

C:\ Program Files\thingsboard\conf\"C:\Program Files\thingsboard"\logs\install.log java.io.FileNotFoundException: "C:\Program Files\thingsboard"\logs\install.log

您是否尝试过使用 SET BASE=%ProgramFiles%\thingsboard 或使用 ^ SET BASE=C:\Program^ Files\thingsboard 转义路径中的 space?

编辑:

问题是因为安装目录中的space。

我尝试在 "c:\test folder" 中安装它,但遇到了同样的问题。 在像"c:\test"

这样没有space的文件夹中安装时没有问题

我更改了 install.bat 文件中的以下部分,并且能够将其安装在带有 space 的文件夹中。

SET "BASE=%~dp0"
SET "LOADER_PATH=%BASE%conf,%BASE%extensions"
SET "SQL_DATA_FOLDER=%BASE%data\sql"
SET "jarfile=%BASE%lib\thingsboard.jar"
SET "installDir=%BASE%data"

PUSHD %BASE%conf

java -cp "%jarfile%" -Dloader.main=org.thingsboard.server.ThingsboardInstallApplication "-Dinstall.data_dir=%installDir%" -Dinstall.load_demo=%loadDemo% -Dspring.jpa.hibernate.ddl-auto=none -Dinstall.upgrade=false "-Dlogging.config=%BASE%install\logback.xml" org.springframework.boot.loader.PropertiesLauncher

if errorlevel 1 (
   @echo ThingsBoard installation failed!
   POPD
   exit /b %errorlevel%
)
POPD

"%BASE%thingsboard.exe" install

当我收到这个错误时,我 运行 使用 Run as Administrator 命令,我的问题就解决了。

如果您收到相同的结果:

  1. 安装 JRE
  2. 删除安装目录下的space
  3. 运行 命令与 Run as Administrator