Thingsboard Windows安装错误

时间:2018-06-24 11:56:44

标签: java windows installation thingsboard

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

  

检测到已安装的Java版本。检测是否为64位计算机   CurrentVersion检测是否为32位计算机CurrentVersion 1.8   找到Java 1.8!正在安装Thingsboard ...错误:找不到或   加载主类Files \ thingsboard \ lib \ thingsboard.jar ThingsBoard   安装失败!

我认为它正在错误地读取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

我收到以下错误:

  

检测到已安装的Java版本。检测是否为64位计算机   CurrentVersion检测是否为32位计算机CurrentVersion 1.8   找到Java 1.8!正在安装Thingsboard ...记录系统无法执行   使用“ C:\ Program”中的配置进行初始化   Files \ thingsboard \ install \ logback.xml'   java.lang.IllegalStateException:检测到Logback配置错误:   发生错误   ch.qos.logback.core.rolling.RollingFileAppender [fileLogAppender]-   无法为[C:\程序创建父目录   Files \ thingsboard \ conf \“ C:\ Program   Files \ thingsboard“ \ logs \ install.log]中的错误   ch.qos.logback.core.rolling.RollingFileAppender [fileLogAppender]-   openFile(“ C:\ Program Files \ thingsboard” \ logs /install.log,true)调用   失败了java.io.FileNotFoundException:“ C:\ Program   Files \ thingsboard“ \ logs \ install.log(文件名,目录名或   卷标语法不正确)           在org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:161   )           在org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.jav   a:57)           在org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:47)           在org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:114)           在org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:   304)           在org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:272)           在org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingAppl   icationListener.java:235)           在org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.jav   a:208)           在org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMult   icaster.java:166)           在org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMult   icaster.java:138)           在org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMult   icaster.java:121)           在org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListe   ner.java:68)           在org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java   :54)           在org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:337)           在org.springframework.boot.SpringApplication.run(SpringApplication.java:308)           在org.thingsboard.server.ThingsboardInstallApplication.main(ThingsboardInstallApplication.java:42)           在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处           在sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)           在sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)           在java.lang.reflect.Method.invoke(未知来源)           在org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)           在org.springframework.boot.loader.Launcher.launch(Launcher.java:87)           在org.springframework.boot.loader.Launcher.launch(Launcher.java:50)           在org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:521)   java.lang.IllegalStateException:检测到Logback配置错误:   发生错误   ch.qos.logback.core.rolling.RollingFileAppender [fileLogAppender]-   无法为[C:\程序创建父目录   Files \ thingsboard \ conf \“ C:\ Program   Files \ thingsboard“ \ logs \ install.log]中的错误   ch.qos.logback.core.rolling.RollingFileAppender [fileLogAppender]-   openFile(“ C:\ Program Files \ thingsboard” \ logs /install.log,true)调用   失败了java.io.FileNotFoundException:“ C:\ Program   Files \ thingsboard“ \ logs \ install.log(文件名,目录名或   卷标语法不正确)ThingsBoard安装失败!

我在做什么错?

2 个答案:

答案 0 :(得分:1)

引号似乎是一个问题。

  

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转义路径中的空格?

编辑:

问题是由于安装目录中的空间。

我尝试将其安装在“ c:\ test文件夹”中,并遇到相同的问题。 在没有“ c:\ test”等空间的文件夹中安装时没有问题

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

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

答案 1 :(得分:0)

收到此错误后,我用Run as Administrator运行了命令,问题解决了。

如果收到相同的结果:

  1. 安装JRE
  2. 删除安装目录中的空间
  3. 使用Run as Administrator运行命令