小编Las*_*o B的帖子

Eclipse Luna调试仅缓慢到第一个断点

阅读Eclipse调试主题我没有找到我的具体问题的答案.我想知道是否还有其他人看过它.我只是在切换到Luna之后才体验到这一点,之前我使用过Kepler和Indigo.

我通常调试Tomcat,但它适用于任何一类测试应用程序.当应用程序到达第一个断点时,会显示Debug视图,然后我必须等待20-30秒才能使调试器初始化,然后才会在编辑器中突出显示代码行.从那时起,每一次休息都是立即的.没有经历其他类型的缓慢.在Tomcat中,任何后续请求都会很快停止.问题是当热代码替换不可行时,它经常重启.

有谁知道如何调整它?当时没有构建或验证过程,我试图为Eclipse分配不同数量的内存.-Xms256m,-Xmx2048m通常对我很有用.

java eclipse debugging tomcat

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

带区域设置的DecimalFormatSymbols

对于下面的代码,当我像这样运行它时,当我在Tomcat Web应用程序中运行它时,我会得到不同的结果.

public static void main(String[] args)
{
    System.out.println(System.getProperty("user.language"));
    System.out.println(System.getProperty("user.country"));
    System.out.println(Locale.getDefault(Category.DISPLAY));
    System.out.println(Locale.getDefault(Category.FORMAT));

    Locale l = new Locale("de", "DE");
    System.out.println(l.getDisplayLanguage());
    DecimalFormatSymbols dfs = new DecimalFormatSymbols(l);
    System.out.println(dfs.getDecimalSeparator());

    l = new Locale.Builder().setLanguage("de").setRegion("DE").build();
    System.out.println(l.getDisplayLanguage());
    dfs = new DecimalFormatSymbols(l);
    System.out.println(dfs.getDecimalSeparator());
}
Run Code Online (Sandbox Code Playgroud)

独立结果(预期):

en
US
en_US
en_US
German
,
German
,
Run Code Online (Sandbox Code Playgroud)

在Tomcat中:

en
US
en_US
en_US
German
.
German
.
Run Code Online (Sandbox Code Playgroud)

有人可以建议还有什么影响DecimalFormatSymbols(和NumberFormat),它不使用提供的语言环境.我正在使用JDK 1.8,语言级别为1.7.

编辑:这只发生在Tomcat在Eclipse中运行时.Eclipse/OSGi似乎干扰了基于语言环境的格式,但仅限于特定情况.

java eclipse tomcat locale

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

Angular + Jasmine:beforeEach() 语法与 module()

您能解释一下这条线是如何工作的吗:

beforeEach(模块('phonecatApp'));

beforeEach() 期望在每次测试之前调用一个回调函数。module() 返回一个 angular.Module 对象。

beforeEach() 对对象做什么?

jasmine angularjs

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

Lucene:使用DocValues添加字段时为null值

我通过搜索更改了文档字段以使其可排序,但现在addDocument()抛出一个异常,说明字段值为空,尽管我在添加字段时验证了该电子邮件是非空字符串.在异常之前Lucene代码binaryValue()从字段中获取.怀疑StringField构造函数不接受自定义FieldType.我可以使用String字段进行排序吗?如何解决这个问题?

Lucene 5.3.1

    private static final FieldType EMAIL_FIELD_TYPE = new FieldType(StringField.TYPE_STORED);
    static
    {
        EMAIL_FIELD_TYPE.setDocValuesType(DocValuesType.SORTED);
        EMAIL_FIELD_TYPE.freeze();
    }

    ...
        doc.add(new Field("email", email, EMAIL_FIELD_TYPE));
    ...
        writer.addDocument(doc);
        writer.commit();

java.lang.IllegalArgumentException: field "email": null value not allowed
    at org.apache.lucene.index.SortedDocValuesWriter.addValue(SortedDocValuesWriter.java:65)
    at org.apache.lucene.index.DefaultIndexingChain.indexDocValue(DefaultIndexingChain.java:435)
    at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:376)
    at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:300)
    at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:234)
    at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:450)
    at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1475)
    at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1254)
Run Code Online (Sandbox Code Playgroud)

编辑:

此代码用于搜索:

Query q = new WildcardQuery(new Term("email", "*"));
Sort sort = new Sort(new SortField("email", SortField.Type.STRING));
TopDocs res = searcher.search(q, Integer.MAX_VALUE, sort);
Run Code Online (Sandbox Code Playgroud)

java lucene

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

标签 统计

java ×3

eclipse ×2

tomcat ×2

angularjs ×1

debugging ×1

jasmine ×1

locale ×1

lucene ×1