小编Gui*_*ges的帖子

在 Docker 容器中以非 root 用户身份运行 Selenium + geckodriver + firefox 时“无法读取 marionette 端口”

我正在使用 Firefox 和 Geckodriver 在 docker 容器内运行 selenium 测试。当以 root 身份运行该容器时,一切正常。

当以非 root 用户 (USER 1000) 运行容器时,驱动程序无法初始化:

[[1;31mERROR[m] test01_WO_default_dashboard  Time elapsed: 132.6 s  <<< ERROR!
org.openqa.selenium.TimeoutException: 
Failed to read marionette port
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'testrunner-cockpit-3--1-mdbwj', ip: '10.130.2.18', os.name: 'Linux', os.arch: 'amd64', os.version: '4.18.0-305.28.1.el8_4.x86_64', java.version: '11.0.15'
Driver info: driver.version: FirefoxDriver
remote stacktrace: 
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57)
    at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104)
    at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:122)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
    at java.base/java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
    at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127) …
Run Code Online (Sandbox Code Playgroud)

firefox selenium docker geckodriver

10
推荐指数
2
解决办法
1万
查看次数

JHipster和数据库连接

我正在使用JHipster,当我运行时,sudo mvn liquibase:diff我得到以下错误

[INFO] Settings
----------------------------
[INFO]     driver: org.postgresql.Driver
[INFO]     url: jdbc:postgresql://localhost/gastos8
[INFO]     username: gastos8
[INFO]     password: *****
[INFO]     use empty password: false
[INFO]     properties file: null
[INFO]     properties file will override? false
[INFO]     prompt on non-local database? true
[INFO]     clear checksums? false
[INFO]     changeLogFile: src/main/resources/config/liquibase/master.xml
[INFO]     context(s): null
[INFO]     label(s): null
[INFO]     referenceDriver: null
[INFO]     referenceUrl: hibernate:spring:com.cboujon.domain?dialect=org.hibernate.dialect.PostgreSQL82Dialect
[INFO]     referenceUsername: null
[INFO]     referencePassword: null
[INFO]     referenceDefaultSchema: null
[INFO]     diffChangeLogFile: src/main/resources/config/liquibase/changelog/20150807132702_changelog.xml
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] …
Run Code Online (Sandbox Code Playgroud)

liquibase maven jhipster

7
推荐指数
1
解决办法
1万
查看次数

Vue.js:如何使用自定义过滤器过滤表

表有两列NameAge。按名称搜索作品。当您键入用户名时,表格将缩减为特定的用户名。

但我希望使用比较运算符<>.

码笔链接

html

<div id="demo" class="container">
  <div class="row">
    <div class="col-md-6">
      <input v-model="search" class="form-control" placeholder="Username to search">
    </div>
    <div class="col-md-1">
      <select class="form-control" v-model="searchOperator">
        <option value=">">></option>
        <option value="<"><</option>
      </select>
    </div>
    <div class="col-md-5">
      <input v-model="searchName" class="form-control" placeholder="Age">
    </div>
  </div>
  <table class="table table-striped">
    <thead>
      <tr>
        <th v-repeat="column: columns">
          <a href="#" v-on="click: sortBy(column)" v-class="active: sortKey == column">
            {{ column | capitalize }}
          </a>
        </th>
      </tr>
    </thead>

    <tbody>
      <tr v-repeat="users | filterBy search | orderBy sortKey reverse"> …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js

6
推荐指数
1
解决办法
5291
查看次数

使用单个请求发送 JSON 和图像。角 + 弹簧靴

弹簧座控制器

@PostMapping(
    value = "/post",
    produces = MediaType.APPLICATION_JSON_VALUE,
    consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE}
)
public ResponseEntity<User> handleFileUpload(@RequestParam("user") User user, @RequestPart("file") MultipartFile file) {
    // do something with User and file
    return ResponseEntity.ok().build();
}
Run Code Online (Sandbox Code Playgroud)

角度服务

@Injectable()
export class UploadFileService {

  constructor(private http: HttpClient) { }
  pushFileToStorage(file: File): Observable<HttpEvent<{}>> {
    let formdata: FormData = new FormData();
    formdata.append('file', file);
    formdata.append('user', JSON.stringify(new User('John', 12)))

    const req = new HttpRequest('POST', '/post', formdata, {
      reportProgress: true,
    });

    return this.http.request(req);
  }
}
Run Code Online (Sandbox Code Playgroud)

当我尝试发送请求时,我得到 500 Internal Server Error.

这是一个请求头 …

spring typescript spring-boot angular

5
推荐指数
1
解决办法
9552
查看次数

Spring Data Rest - 如何从页面中删除元素?

我的项目中有以下 REST 控制器方法

@RequestMapping(method = GET, value = "applications", produces = {MediaType.APPLICATION_JSON_VALUE})
public @ResponseBody
ResponseEntity<?> getApplications(@QuerydslPredicate(root = Application.class) Predicate predicate,
        PersistentEntityResourceAssembler resourceAssembler, Pageable page) {

    Page<ApplicationProjection> applications = appRepo.findAll(predicate, page).
            map(item -> projectionFactory.createProjection(ApplicationProjection.class, item));

    return new ResponseEntity<>(pagedResourcesAssembler.toResource(applications), HttpStatus.OK);

}
Run Code Online (Sandbox Code Playgroud)

现在我想根据条件删除页面的一些元素。如何在 Spring Data Rest 中实现?

java spring querydsl spring-data-rest

1
推荐指数
1
解决办法
3501
查看次数