小编Luk*_*ler的帖子

如何使用properties-maven-plugin?

我想使用properties-maven-plugin.我阅读了http://mojohaus.org/properties-maven-plugin/usage.html的用法,但它对我不起作用.

我创建了一个非常简单的项目来测试它.这是我的pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>test</groupId>
  <artifactId>MavenTest</artifactId>
  <version>1.0.0</version>
  <name>MavenTest</name>

  <properties>
    <prop1>2.2</prop1>
  </properties>

  <dependencies>
    <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j.version}</version>
        </dependency>
  </dependencies>

  <build>
    <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>properties-maven-plugin</artifactId>
                <version>1.0-alpha-2</version>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>read-project-properties</goal>
                        </goals>
                        <configuration>
                            <files>
                                <file>${basedir}/my.properties</file>
                            </files>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution> …
Run Code Online (Sandbox Code Playgroud)

java maven

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

Kubernetes 在节点上达到 100% CPU,但在 Pod 上却未达到 100% CPU 使用率

我的 Kubernetes 集群(在 1.18 上运行)每天都会遇到一个问题,其中一个节点的 CPU 利用率将超过 100%,并且 Kubernetes 将无法将外部访问者连接到我的 Pod。(基本上是网站中断)

奇怪的是,Pod 始终处于舒适的 30%(或更低!)CPU 状态。所以应用程序本身看起来还不错。

当我访问describe有问题的节点时,我看到提到超时node-problem-detector

Events:
  Type     Reason                  Age                      From                                     Message
  ----     ------                  ---                      ----                                     -------
  Normal   NodeNotSchedulable      10m                      kubelet                                  Node nodepoo1-vmss000007 status is now: NodeNotSchedulable
  Warning  KubeletIsDown           9m44s (x63 over 5h21m)   kubelet-custom-plugin-monitor            Timeout when running plugin "/etc/node-problem-detector.d/plugin/check_kubelet.s"
  Warning  ContainerRuntimeIsDown  9m41s (x238 over 5h25m)  container-runtime-custom-plugin-monitor  Timeout when running plugin "/etc/node-problem-detector.d/plugin/check_runtime.s"
Run Code Online (Sandbox Code Playgroud)

我当前的方法是在节点池上运行三个节点,并通过在监控中断期间封锁有问题的节点并将所有 pod 移至其他节点之一来有效地照顾 Kubernetes。15 分钟后,一旦一切恢复正常,我将解除受影响节点的封锁并再次开始循环。

这个周末我特别不幸,24 小时内出现了 3 个 CPU 峰值。

CPU 图表显示来自三个节点之一的峰值

我该如何解决这个问题?我似乎无法找到有关Timeout when running …

kubernetes azure-aks

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

获取返回StreamedContent的<p:graphicImage>的具体URL

为了使用灯箱,我需要一个指向生成的图像的链接<p:graphicImage>.

最终,HTML应如下所示:

<a href="image.jpg" data-lightbox="bilder">
  <img src="image.jpg" />
</a>
Run Code Online (Sandbox Code Playgroud)

到目前为止,这是我的JSF尝试:

<h:outputLink data-lightbox="bilder" value="???">
  <p:graphicImage value="#{imageStreamer.image}">
    <f:param name="imageId" value="#{gameReader.game.cover.id}"/>
  </p:graphicImage>
</h:outputLink>
Run Code Online (Sandbox Code Playgroud)

如何获取<p:graphicImage>返回的具体URL,StreamedContent以便我可以在链接中使用它?

url jsf primefaces graphicimage

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

无法提取AttributeConverter定义的ParameterizedType表示

我想使用新的JPA 2.1功能来创建自定义通用枚举转换器.但在部署时,我收到此错误:Caused by: org.hibernate.AssertionFailure: Could not extract ParameterizedType representation of AttributeConverter definition from AttributeConverter implementation class [de.lukaseichler.pomodoro.task.entity.converter.PriorityConverter]

我在Wildfly 8.0.0.Beta1和JPA 2.1上使用Hibernate 4.3.0.我是在做什么,或者这是休眠中的错误?

Enumconverter.java

public abstract class EnumConverter<T extends Enum> implements AttributeConverter<T, String> {

private Class<T> type;

@Override
public String convertToDatabaseColumn(T attribute) {
    return attribute.name();
}

@Override
public T convertToEntityAttribute(String name) {
    if (type == null) {
        getType();
    }
    return (T)Enum.valueOf(type, name);
}

private void getType() {
    Class<?> converterClass = getClass();
    while (true) {
        Class<?> baseClass = converterClass.getSuperclass();
        assert baseClass != …
Run Code Online (Sandbox Code Playgroud)

java jboss hibernate jpa java-ee

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

如何在远程机器中生成 docker 容器

是否可以使用适用于 Python 的 docker SDK在远程计算机中启动容器?

import docker
client = docker.from_env()

client.containers.run("bfirsh/reticulate-splines", detach=True)
# I'd like to run this container ^^^ in a machine that I have ssh access to.
Run Code Online (Sandbox Code Playgroud)

通过查看文档,这种类型的管理似乎超出了上述 SDK 的范围,因此在网上搜索时我得到提示,Python 的 kubernetes 客户端可能会有所帮助,但不知道从哪里开始。

python docker

5
推荐指数
2
解决办法
1791
查看次数

标签 统计

java ×2

azure-aks ×1

docker ×1

graphicimage ×1

hibernate ×1

java-ee ×1

jboss ×1

jpa ×1

jsf ×1

kubernetes ×1

maven ×1

primefaces ×1

python ×1

url ×1