無法執行java -jar app-0.51.jar 

17market 2021-8-5 222

application.properties

spring.message.encoding=UTF-8 server.port=8888

短信服务提供商,1是腾讯,2是阿里云

sms.verdor=1

在没有短信服务器时可以使用super code进行登录,上线时需要删除掉,或者改为较为严格的密码。

sms.super_code=66666

h2适合开发使用,上线时请切换到mysql。切换时把下面h2部分配置注释掉,打开mysql部署配置。

* h2 DB begin *****

spring.datasource.url=jdbc:h2:file:./appdata

spring.datasource.username=sa

spring.datasource.password=

spring.datasource.driver-class-name=org.h2.Driver

spring.jpa.hibernate.ddl-auto=update

*** h2 DB end **

mysql默认配置

mysql需要手动创建数据库,mysql命令行下执行 create database appdata; appdata可以换为别的库名,但注意不能使用IM服务器使用的数据库"wfchat",否则会引起冲突。

* mysql DB begin ***

spring.datasource.url=jdbc:mysql://localhost:3306/appdata?serverTimezone=UTC&useSSL=false spring.datasource.username=imdate spring.datasource.password=17M@rket spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.database=imdate spring.jpa.hibernate.ddl-auto=update

* mysql DB end *****

PC快速登录兼容旧的版本。仅当已经有未支持PC快速登录的移动端上线了,需要兼容时打开此开关。

wfc.compat_pc_quick_login=false

用户上传协议日志存放目录,上线时请修改可用路径

logs.user_logs_path=/wildfire_user_logs/

* 上线必看 ***

demo工程为了方便大家运行测试,使用了数据库作为SessionDao的缓存,上线后,当用户较多时会是一个瓶颈,请在上线前切换成redis的缓存。

细节请参考 https://www.baidu.com/s?wd=shiro+redis&tn=84053098_3_dg&ie=utf-8

小程序不能播放amr格式的音频,需要将amr转化成mp3格式

amr转mp3缓存目录,本目录会存储转换后的mp3文件,可以定时清理

wfc.audio.cache.dir=/data/wfc/audio/cache

是否支持SSL,如果所有客户端调用appserver都支持https,请把下面开关设置为true,否则为false。

如果为false,在Web端和wx端的appserve的群公告等功能将不可用。

详情请参考 https://www.baidu.com/s?wd=cookie+SameSite&ie=utf-8

wfc.all_client_support_ssl=false

iOS系统使用share extension来处理分享,客户端无法调用SDK发送消息和文件,只能通过应用服务来进行。

这里配置为了满足iOS设备在share extension中进行上传文件的需求。

存储使用类型,0使用内置文件服务器(这里无法使用),1使用七牛云存储,2使用阿里云对象存储,3野火私有对象存储。

默认的七牛/阿里OSS/野火私有存储账户信息不可用,请按照下面说明配置

https://docs.wildfirechat.cn/server/media_server.html

media.server.media_type=1

使用这个目录作为临时目录,必须配置有效目录。

local.media.temp_storage=/wildfire_upload_tmp/

OSS配置,可以是七牛/阿里云OSS/野火私有OSS。

注意与IM服务的配置格式不太一样,这里是用"Key=Vaue"的格式,IM服务配置里是"Key Value",拷贝粘贴时要注意修改。

配置请参考IM服务

media.server_url=http://up.qbox.me media.access_key=tU3vdBK5BL5j4N7jI5N5uZgq_HQDo170w5C9Amnn media.secret_key=YfQIJdgp5YGhwEw14vGpaD2HJZsuJldWtqens7i5

bucket名字及Domain

media.bucket_general_name=media media.bucket_general_domain=http://cdn.wildfirechat.cn media.bucket_image_name=media media.bucket_image_domain=http://cdn.wildfirechat.cn media.bucket_voice_name=media media.bucket_voice_domain=http://cdn.wildfirechat.cn media.bucket_video_name=media media.bucket_video_domain=http://cdn.wildfirechat.cn media.bucket_file_name=media media.bucket_file_domain=http://cdn.wildfirechat.cn media.bucket_sticker_name=media media.bucket_sticker_domain=http://cdn.wildfirechat.cn media.bucket_moments_name=media media.bucket_moments_domain=http://cdn.wildfirechat.cn media.bucket_portrait_name=storage media.bucket_portrait_domain=http://cdn2.wildfirechat.cn media.bucket_favorite_name=storage media.bucket_favorite_domain=http://cdn2.wildfirechat.cn

报警发送邮件配置

当IM服务异常时,会把异常信息推送到应用服务,由应用服务来给运维人员发送邮件,建议上线时调通次功能

spring.mail.host=smtp.wildfirechat.com spring.mail.username=admin@wildfirechat.cn

注意有些邮件服务商会提供客户端授权码,不能用邮箱账户密码。

spring.mail.password=xxxxxxxx spring.mail.port=465 spring.mail.protocol=smtp spring.mail.default-encoding=UTF-8 spring.mail.test-connection=false spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.ssl.enable=true spring.mail.properties.mail.smtp.starttls.enable=true spring.mail.properties.mail.smtp.starttls.required=true spring.mail.properties.mail.imap.ssl.socketFactory.fallback=false

邮箱必须是有效邮箱,如果是无效邮箱可能会发送失败

spring.mail.to_lists=admin1@wildfirechat.cn,admin2@wildfirechat.cn,admin3@wildfirechat.cn spring.mail.subject_prefix=IM服务报警通知

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

執行app-server-release-0.51>java -jar app-0.51.jar 

C:\Users\Administrator\Desktop\app-server-release-0.51>java -jar app-0.51.jar  SLF4J: Class path contains multiple SLF4J bindings.  SLF4J: Found binding in [jar:file:/C:/Users/Administrator/Desktop/app-server-release-0.51/app-0.51.jar!/BOOT-INF/lib/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]  SLF4J: Found binding in [jar:file:/C:/Users/Administrator/Desktop/app-server-release-0.51/app-0.51.jar!/BOOT-INF/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaicLoggerBinder.class]  SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 

SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder] 

 .   _                      _   /\ / '_ ()   \ \ \ \  ( ( )\ | ' | '| | ' \/ ` | \ \ \ \  \/  _)| |)| | | | | || (| |  ) ) ) )   '  |__| .|| ||| |\, | / / / /  =========|_|==============|__/=////  :: Spring Boot ::       (v2.2.10.RELEASE) 

2021-08-05 16:08:36.477  INFO 4736 --- [           main] cn.wildfirechat.app.Application          : Starting Application v0.51 on iZj6cci77g4mwqZ with PID 4736  (C:\Users\Administrator\Desktop\app-server-release-0.51\app-0.51.jar started by Administrator in C:\Users\Administrator\Desktop\app-server-release-0.51)  2021-08-05 16:08:36.492  INFO 4736 --- [           main] cn.wildfirechat.app.Application          : No active profile set, falling back to default profiles: default  2021-08-05 16:08:39.522  INFO 4736 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.  2021-08-05 16:08:39.865  INFO 4736 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 322ms. Found 4 J  PA repository interfaces.  2021-08-05 16:08:40.880  INFO 4736 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#4470f8a6' of type [org.springframework.beans.factory.config.PropertiesFactoryBean] is not eligible for getting processed  by all BeanPostProcessors (for example: not eligible for auto-proxying)  2021-08-05 16:08:40.880  INFO 4736 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#4470f8a6' of type [java.util.Properties]  is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)  2021-08-05 16:08:40.880  INFO 4736 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#fd07cbb' of type [org.springframework.dat  a.repository.core.support.PropertiesBasedNamedQueries] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)  2021-08-05 16:08:40.896  INFO 4736 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#f2ff811' of type [org.springframework.dat  a.repository.core.support.RepositoryFragmentsFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)  2021-08-05 16:08:40.896  INFO 4736 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean '(inner bean)#f2ff811' of type [org.springframework.dat  a.repository.core.support.RepositoryComposition$RepositoryFragments] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible  for auto-proxying)  2021-08-05 16:08:40.912  INFO 4736 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSource  Configuration$Hikari' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari] is not eligible for getting processed by all BeanPost  Processors (for example: not eligible for auto-proxying)  2021-08-05 16:08:40.974  INFO 4736 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource-org.springframework.boot.autoconfigu  re.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)  2021-08-05 16:08:41.052  INFO 4736 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [com.zaxxer.hikari.HikariDataSourc  e] is not eligible for getting processed by all BeanPostProcessors (for example:not eligible for auto-proxying)  2021-08-05 16:08:41.083  INFO 4736 --- [           main] trationDelegate$BeanPos  tProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSource  InitializerInvoker' of type [org.springframework.boot.autoconfigure.jdbc.DataSou  rceInitializerInvoker] is not eligible for getting processed by all BeanPostProc  essors (for example: not eligible for auto-proxying)  2021-08-05 16:08:41.099  WARN 4736 --- [           main] ConfigServletWebServerA  pplicationContext : Exception encountered during context initialization - cancel  ling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyExc  eption: Error creating bean with name 'shiroConfig': Unsatisfied dependency expr  essed through field 'dbSessionDao'; nested exception is org.springframework.bean  s.factory.UnsatisfiedDependencyException: Error creating bean with name 'DBSessi  onDao': Unsatisfied dependency expressed through field 'shiroSessionRepository';  nested exception is org.springframework.beans.factory.BeanCreationException: Er  ror creating bean with name 'shiroSessionRepository': Cannot create inner bean '  (inner bean)#3943a2be' of type [org.springframework.orm.jpa.SharedEntityManagerC  reator] while setting bean property 'entityManager'; nested exception is org.spr  ingframework.beans.factory.BeanCreationException: Error creating bean with name  '(inner bean)#3943a2be': Cannot resolve reference to bean 'entityManagerFactory'  while setting constructor argument; nested exception is org.springframework.bea  ns.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sp  ringframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied  dependency expressed through constructor parameter 1; nested exception is org.s  pringframework.boot.context.properties.ConfigurationPropertiesBindException: Err  or creating bean with name 'spring.jpa-org.springframework.boot.autoconfigure.or  m.jpa.JpaProperties': Could not bind properties to 'JpaProperties' : prefix=spri  ng.jpa, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is  org.springframework.boot.context.properties.bind.BindException: Failed to bind  properties under 'spring.jpa.database' to org.springframework.orm.jpa.vendor.Dat  abase  2021-08-05 16:08:41.115  INFO 4736 --- [           main] ConditionEvaluationRepo  rtLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your  application with 'debug' enabled.  2021-08-05 16:08:41.130 ERROR 4736 --- [           main] o.s.b.d.LoggingFailureA  nalysisReporter   : 

  APPLICATION FAILED TO START   

Description: 

Failed to bind properties under 'spring.jpa.database' to org.springframework.orm  .jpa.vendor.Database: 

   Property: spring.jpa.database     Value: imdate     Origin: URL [file:./config/application.properties]:25:21     Reason: failed to convert java.lang.String to org.springframework.orm.jpa.ve  ndor.Database 

Action: 

Update your application's configuration. The following values are valid: 

   DB2     DEFAULT     DERBY     H2     HANA     HSQL     INFORMIX     MYSQL     ORACLE     POSTGRESQL     SQL_SERVER     SYBASE 

C:\Users\Administrator\Desktop\app-server-release-0.51>

最新回复 (1)
  • HeavyRain 2021-8-6
    引用 2
    mysql和h2db只能用一个,如果打开了mysql就需要把h2db注释掉。这个服务是全部开源的,你们也可以debug看一下
返回