我正在使用以下任一命令通过 Maven 运行 Thorntail 2.2.1.Final 微服务
mvn thorntail:start
mvn thorntail:run
Run Code Online (Sandbox Code Playgroud)
它运行良好,但当我点击Ctrl-C它时并没有退出应用程序,即控制台返回,但应用程序在后台运行。我试图阻止它
mvn thorntail:stop
Run Code Online (Sandbox Code Playgroud)
但这不起作用。我必须去杀死这个过程。我正在使用 Windows 10。
我正在从带注释的 Java 代码生成 OpenAPI 3.0 文档。但问题是,当我添加 @Schema 注释来枚举所有值时,所有值都消失了。我正在使用带有 microprofile-openapi 分数的 Thorntail 2.3.0.Final。
我知道我可以只更改 .yaml 文件,但我需要直接从 Java 代码生成我的 yaml。
这是我在 github 上的最小示例:https : //github.com/pkristja/openApiEnumSchema
枚举的源代码:
package com.example.openapiexample.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
@Schema(description = "<div class=\\\"renderedMarkdown\\\"><p>Rank of developer.</p>\\n\" +\n" +
" \"<p>Valid values are:</p>\\n\" +\n" +
" \"<ul>\\n\" +\n" +
" \"<li>'JUNIOR_DEVELOPER_1': Text for junior 1.\\n\" +\n" +
" \"<li>'JUNIOR_DEVELOPER_2': Text for junior 2.\\n\" +\n" +
" \"<li>'JUNIOR_DEVELOPER_3': Text for junior 3.\\n\" +\n" +
" \"<li>'SENIOR_DEVELOPER_1': Text for senior …Run Code Online (Sandbox Code Playgroud) 我在为我所做的项目设置 Keycloak 时遇到问题。Keycloak 正在运行http://localhost:8180。Thorntail 服务器正在运行,http://localhost:8080/users为 Angular 前端提供数据http://localhost:4200/*。我想要做的是用户只能在http://localhost:4200/sign-in不登录的情况下查看。登录后他们可以访问例如http://localhost:4200/list-user。
我正在使用本指南来设置 Keycloak,但我不确定我的客户端设置应该是什么。这就是我的想法:
根网址:http://localhost:4200/sign-in
*有效的重定向 URI:http://localhost:4200/list-user
基本网址:http://localhost:4200/sign-in
管理员网址:http://localhost:8080
当我难以理解时,请有人解释这些设置的目的。
我在 docker 容器中运行 Spring Boot 和 Keycloak 时遇到问题。
我从 Keycloak 开始,mysql 作为 db 在 docker 中运行。
services:
mysql:
image: mysql:5.7
container_name: mysql
volumes:
- mysql_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: keycloak
MYSQL_USER: keycloak
MYSQL_PASSWORD: password
networks:
- testNetwork
keycloak:
image: jboss/keycloak
container_name: keycloak
restart: on-failure
volumes:
- ./config:/config/
environment:
DB_VENDOR: MYSQL
DB_ADDR: mysql
DB_DATABASE: keycloak
DB_USER: keycloak
DB_PASSWORD: password
KEYCLOAK_USER: xxx
KEYCLOAK_PASSWORD: yyy
KEYCLOAK_IMPORT_REALM: /keycloak/import/realm-import.json
ports:
- 8180:8080
depends_on:
- mysql
networks:
- testNetwork
Run Code Online (Sandbox Code Playgroud)
然后我添加了我的领域(SpringBootKeycloak)、我的客户端(testclient)和一个角色为“user”的用户。之后,我将 spring-security 添加到我的 Spring-boot-application 中。并编辑了我的 application.yml
spring: …Run Code Online (Sandbox Code Playgroud) 我正在使用 Wildfly Swarm 2018.5.0 构建一个应用程序。
当我设置应用程序测试时,“Hello World”应用程序中的一切都工作正常,但是当我将其添加到具有所有依赖项的应用程序时,会出现很多错误,例如:Unsatisfied dependency for type LoggingFraction with qualifiers @Any
如何解决此错误并正确设置我的测试的最佳方法?这是野蝇群错误吗?有什么办法让它发挥作用吗?为了澄清起见,我已更新到 Thorntail 2.1.0.Final,并且我在jandex依赖性方面也有类似的问题。在“Hello World”中工作,但是当我添加一些依赖项时出现错误。现在我正在没有测试的情况下进行开发,我不喜欢这样做!:(
2018-08-27 10:20:48,696 WARN [org.jboss.weld.Validator] (MSC service thread 1-2) WELD-001471: Interceptor method setupFactories defined on class org.wildfly.swarm.container.runtime.xmlconfig.StandaloneXMLParserProducer is not defined according to the specification. It should not throw java.lang.Exception, which is a checked exception.
at org.wildfly.swarm.container.runtime.xmlconfig.StandaloneXMLParserProducer.setupFactories(StandaloneXMLParserProducer.java:0)
StackTrace
2018-08-27 10:20:48,698 WARN [org.jboss.weld.Validator] (MSC service thread 1-2) WELD-001471: Interceptor method postConstruct defined on class org.wildfly.swarm.container.runtime.wildfly.ShrinkWrapFileSystem is not defined according to the specification. …Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的 Thorntail 应用程序从 java 8 迁移到 java 11,但我遇到了实体关系问题。使用的映射在 java 8 上工作正常,但在 java 11 中我有这个错误:
2019-07-03 15:48:12,713 ERROR [stderr] (main) Exception Description:
Predeployment of PersistenceUnit [p-unit] failed.
2019-07-03 15:48:12,713 ERROR [stderr] (main) Internal Exception:
Exception [EclipseLink-7250] (Eclipse Persistence Services -
2.7.3.v20180807-4be1041):
org.eclipse.persistence.exceptions.ValidationException
2019-07-03 15:48:12,713 ERROR [stderr] (main) Exception Description:
[class com.mytest.data.specific.entities.Table3] uses a non-entity
[class com.mytest.data.specific.entities.Table2] as target entity
in the relationship attribute [field table2].
Run Code Online (Sandbox Code Playgroud)
我的实体映射是这样的:
2019-07-03 15:48:12,713 ERROR [stderr] (main) Exception Description:
Predeployment of PersistenceUnit [p-unit] failed.
2019-07-03 15:48:12,713 ERROR …Run Code Online (Sandbox Code Playgroud) 尝试在 github 上打包thorntail-examples 项目时,在几个示例上构建失败,说明出现类似于此的 API 不兼容错误...
[ERROR] Failed to execute goal io.thorntail:thorntail-maven-plugin:2.3.0.Final-SNAPSHOT:package (package) on project example-stm: Execution package of goal io.thorntail:thorntail-maven-plugin:2.3.0.Final-SNAPSHOT:package failed: An API incompatibility was encountered while executing io.thorntail:thorntail-maven-plugin:2.3.0.Final-SNAPSHOT:package: java.lang.AbstractMethodError: null
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>io.thorntail:thorntail-maven-plugin:2.3.0.Final-SNAPSHOT
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/<user>/.m2/repository/io/thorntail/thorntail-maven-plugin/2.3.0.Final-SNAPSHOT/thorntail-maven-plugin-2.3.0.Final-SNAPSHOT.jar
[ERROR] urls[1] = file:/home/<user>/.m2/repository/io/thorntail/fraction-metadata/2.3.0.Final-SNAPSHOT/fraction-metadata-2.3.0.Final-SNAPSHOT.jar
[ERROR] urls[2] = file:/home/<user>/.m2/repository/io/thorntail/meta-spi/2.3.0.Final-SNAPSHOT/meta-spi-2.3.0.Final-SNAPSHOT.jar
[ERROR] urls[3] = file:/home/<user>/.m2/repository/org/jboss/shrinkwrap/descriptors/shrinkwrap-descriptors-impl-javaee/2.0.0/shrinkwrap-descriptors-impl-javaee-2.0.0.jar
...
Run Code Online (Sandbox Code Playgroud)
如果我删除其中一个依赖项,问题就会消失,例如对于jpa/jpa示例,当我尝试按原样构建时收到 API 不兼容错误,但是如果我删除 h2 依赖项,它会清除错误。
我自己的项目也有类似的问题,添加 h2 或 hibernate 会导致 API 不兼容错误,但如果我省略这两个,应用程序运行良好。
有没有其他人遇到过这个问题?
带有JSF的Quarkus JVM模式
我有一个使用JSF和JEE(CDI / EJB)构建的基于thorntail 2.4的Web应用程序。
对于我上面的技术堆栈,如果我仅使用JVM模式而不是纯模式,是否可以使用运行时打包应用程序?
我知道EJB规范不是用quarkus实现的,我可以将EJB重写为CDI + JTA服务,但是我想知道是否可以在quarkus中使用JSF。