小编hel*_*one的帖子

如何为Primefaces GraphicImage设置图像目录

我有一个graphicImage组件,但我看不到我的loading.gif文件.我认为文件路径有问题.我的图片位于"Web Pages/Resources/images/loading.gif"下.

我正在使用Netbeans,这是我的页面"Web Pages/Pages/customPages/index.xhtml";

<p:blockUI block="myDataTable" trigger="myDataTable">  
            Loading<br />  
            <p:graphicImage library="images" value="loading.gif"/>  
        </p:blockUI
Run Code Online (Sandbox Code Playgroud)

编辑:这些也没有用:)

library="images" value="loading.gif"
library="resources/images" value="loading.gif"
value="loading.gif"
library="resources" value="loading.gif"
Run Code Online (Sandbox Code Playgroud)

EDIT2:这是我解决这个问题的方法,但我认为这不是一个好的解决方案.还有其他方法吗?

value="#{FacesContext.getCurrentInstance().getExternalContext()}/resources/images/loading.gif"
Run Code Online (Sandbox Code Playgroud)

jsf primefaces jsf-2

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

无法启动节点管理器

当我尝试启动节点管理器时,我遇到了错误.我在远程计算机上收到此错误.顺便说一下,节点管理器在我的本地机器上运行没有任何问题.两台机器都配置相同.有什么想法吗?

<SEVERE> <Fatal error in node manager server>
weblogic.nodemanager.common.ConfigException: Unknown key store identity alias or not a key entry alias: DemoIdentity
at weblogic.nodemanager.server.SSLConfig.loadKeyStoreConfig(SSLConfig.java:175)
at weblogic.nodemanager.server.SSLConfig.<init>(SSLConfig.java:100)
at weblogic.nodemanager.server.NMServer.init(NMServer.java:185)
at weblogic.nodemanager.server.NMServer.<init>(NMServer.java:147)
at weblogic.nodemanager.server.NMServer.main(NMServer.java:353)
at weblogic.NodeManager.main(NodeManager.java:31)
Run Code Online (Sandbox Code Playgroud)

weblogic weblogic12c

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

如何使用wmi连接远程机器?

我正在尝试使用 wmi4j 连接远程 Windows Server 2012 计算机,但出现“访问被拒绝”错误。但我可以使用 WMI Explorer 2016 程序成功连接这台远程计算机。

这是代码;

private static String server = "****";
private static String username = "**\\Administrator";
private static String password = "pass";
private static String namespace = "root\\cimv2";

SWbemLocator locator = new SWbemLocator(server,username,password,namespace);
SWbemServices services = locator.connectServer(); //this line throws exception
Run Code Online (Sandbox Code Playgroud)

我还授予所有权限(https://social.technet.microsoft.com/Forums/office/en-US/4f33837b-1cb1-4648-85b1-3ba87cbfe93e/wmi-remote-access-denied?forum=winserverManagement

编辑:堆栈跟踪;

cn.chenlichao.wmi4j.WMIException: Access is denied, please check whether the [domain-username-password] are correct. Also, if not already done please check the GETTING STARTED and FAQ sections in readme.htm. …
Run Code Online (Sandbox Code Playgroud)

java wmi j-interop windows-server-2012

6
推荐指数
0
解决办法
909
查看次数

如何强制转换 lambda 方法参数?

我有一个如下所示的 lambda 表达式。我想问的是是否有任何简单的方法或最佳实践来转换方法参数?

        results.forEach(
            (result) ->
            {
                ((JSONObject)result).put("test", "test"); 
                ((JSONObject)result).put("time", System.currentTimeMillis());  
                otherList.add(((JSONObject)result));
            }
    );
Run Code Online (Sandbox Code Playgroud)

当我尝试更改输入类型时

(JSONObject result) ->
Run Code Online (Sandbox Code Playgroud)

我遇到以下错误;

incompatible types: Consumer<JSONObject> cannot be converted to Consumer<? super Object>
Run Code Online (Sandbox Code Playgroud)

java lambda java-8

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

如何使用 Elasticsearch Java API 创建通配符查询?

如何使用 Elasticsearch 创建通配符查询?我尝试了下面的方法,但我认为它不起作用(我的意思是它不过滤)。

BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
boolQueryBuilder.must(QueryBuilders.wildcardQuery("message", "ANG*"));
Run Code Online (Sandbox Code Playgroud)

我也尝试过 prefixQuery 方法,但它也没有过滤任何结果。

boolQueryBuilder.must(QueryBuilders.prefixQuery("message", "ANG"));
Run Code Online (Sandbox Code Playgroud)

编辑:

        "_index": "log4j_2017",
        "_type": "log4j",
        "_id": "fd23123122",
        "_score": null,
        "_source": {
           "date": "2017-03-10T19:04:50.049Z",
           "contextStack": [],
           "level": "INFO",
           "marker": null,
           "thrown": null,
           "message": "ANGServlet 'spring': initialization completed in 2314 ms",
           "millis": 1489151090049,
           "contextMap": {},
           "threadName": "http-apr-8080-exec-77"
         }
Run Code Online (Sandbox Code Playgroud)

elasticsearch

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

JAXB 异常:编组时此上下文不知道类

我在编组时遇到错误。我从模式生成了 xml。

[javax.xml.bind.MarshalException
- with linked exception:
[com.sun.istack.internal.SAXException2: class org.com.AccountsComplexType nor any of its super class is known to this context.
Run Code Online (Sandbox Code Playgroud)

经过一番研究,有人说“尝试添加@XmlSeeAlso(...class)”,但问题是 AccountsComplexType 类不是 XmlRootElement。

知道我做错了什么吗?

java jaxb marshalling jaxb2

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

如何在Windows 7上为Tomcat添加JVM选项

如何在Windows 7上的Tomcat中添加jvm选项?顺便说一下,我正在使用Tomcat7。我在catalina.bat文件的第一行中添加了我的jvm选项,但是它没有用。我想我做错了。有什么主意吗

java tomcat

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

如何设置iframe高度以适应内容?

我想从Iframe中删除滚动条.当我手动设置Iframe的高度时它可以工作,但Iframe大小可以改变,我不知道如何在页面加载时获得Iframe高度.

有没有办法删除滚动条并适合iframe内容?

<div class="portlet" id="pageContainer">
    <iframe id="frame" width="100%" frameborder="0" height="2000" scrolling="false" allowfullscreen="" src="/app/mytestapp" style="overflow: hidden"></iframe>
</div>
Run Code Online (Sandbox Code Playgroud)

当我尝试低于功能时,它不会返回正确的高度.(它返回2000px,但我的Iframe高度接近3000px)

$('iframe').load(function() {        
    this.contentWindow.document.body.offsetHeight + 'px';
});
Run Code Online (Sandbox Code Playgroud)

html javascript iframe jquery

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

Spring @Autowired没有在新线程上工作

当我运行TaskJob时,我得到空指针异常,因为Spring没有自动装配serviceJob服务.新线程是否导致此问题,因为Spring自动连接mysqlService没有任何问题?

public class TaskJob implements Runnable {
    @Autowired
    private ServiceJob serviceJob;

    String name;
    String source;

    public TaskJob(String name, String source) {
        this.name = name;
        this.source = source;
    }

    public void run() {
        serviceJob.run();
    }
}

@Service
public class ServiceJob extends BaseJob{

    @Autowired
    private MysqlService mysqlService;

    public void run(){
    ....
    }
}

@Service
public class MysqlService {
...
}
Run Code Online (Sandbox Code Playgroud)

我的applicationContext.xml;

<context:component-scan base-package="cm.*" /> 
Run Code Online (Sandbox Code Playgroud)

我的课程是;

cm.tasks.jobs.TaskJob
cm.jobs.ServiceJob
cm.services.MysqlService;
Run Code Online (Sandbox Code Playgroud)

编辑: TaskJob实例化;

TaskJob taskJob = new TaskJob(name, source);
Thread taskThread = new Thread(taskJob);
taskThread.start();
Run Code Online (Sandbox Code Playgroud)

java spring autowired

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

如何在Java中设置当前目录的类路径?

如何将当前文件夹包含为类路径?我有一个实用程序和一个主类,例如;

/home/project/Main.class
/home/project/libs/com/fr/Utility.class
Run Code Online (Sandbox Code Playgroud)

当我尝试运行主类时(在 /home/project/ dir 下);

java -cp "libs/*;" Main
Run Code Online (Sandbox Code Playgroud)

我遇到以下错误。

Error: Could not find or load main class Main
Run Code Online (Sandbox Code Playgroud)

编辑:

主班;

import com.fr.Utility;

public class Main{
 ....
}
Run Code Online (Sandbox Code Playgroud)

实用类;

package com.fr;

public class Utility{
 ....
}
Run Code Online (Sandbox Code Playgroud)

当我跑步时;

java -cp .:libs/* Main
Run Code Online (Sandbox Code Playgroud)

我遇到以下错误;

Exception in thread "main" java.lang.NoClassDefFoundError: com/fr/Utility
Caused by: java.lang.ClassNotFoundException: com.fr.Utility
Run Code Online (Sandbox Code Playgroud)

java

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