小编chr*_*din的帖子

Chrome更新减慢了Ajax/Angular Network的渲染和加载速度

大约两周前,Chrome更新导致我的角度应用的用户瘫痪.我加载了大量数据,但整个单页应用程序在< 4几秒钟内加载,但每个用户> 40在2周前更新Chrome后几秒钟.我没有经历过这个问题,但是当我升级浏览器,以64.0.3282.16763.0.3239.132,问题也开始对我来说.

在Chrome 63.0.3239.132和之间的某个地方64.0.3282.167,有一个变化基本上减慢了我的Angular应用程序的爬行速度.它影响了整个电路板的加载和渲染,使整个应用程序几乎无法使用.我一直在寻找这个问题几天没有快乐.

有没有人对可能导致性能下降的原因有任何见解或建议?

这是我的网络选项卡的屏幕截图.所有这些在Chrome更新之前都非常快,现在它只是抓取.

在此输入图像描述

如果我设置:

httpProvider.useApplyAsync(true),它减轻了问题,但我的应用程序是巨大的,这在一个5岁的应用程序中导致了很多不稳定的行为.

ajax performance google-chrome angularjs

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

SpringData JPA Repository方法查询有哪些?

在Spring-data JPA中,无论如何都要创建一个方法查询,实际上是通过像?

我有以下方法查询

public MakeModel findByModelIgnoreCase(String model);
Run Code Online (Sandbox Code Playgroud)

我真正想要的是一个表达方式.我是否需要创建Criteria或@Query注释?我问得太多了吗?

   //Stupid example of what I want to be able to do

    public MakeModel findByFuzzyModelIgnoreCase(String model);
Run Code Online (Sandbox Code Playgroud)

真的,我猜它的核心,我想做一个表搜索.我在Spring Data下面使用了Hibernate,所以我想我可以使用像Hibernate Search这样的搜索api.我愿意接受这里的建议.

spring hibernate jpa spring-data

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

Jackson 2.0忽略了课堂上的所有属性

我需要与之相反@JsonIgnore,我需要告诉杰克逊忽略对象上的所有属性,除了我注释的对象.我不小心想要有人添加一个属性而忘记添加一个@JsonIgnore然后我将它暴露在我不想要的地方.

谁知道如何实现这一目标?

java jackson

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

Spring Data JPA Meta JpaMetamodelMappingContext内存消耗

我的Spring Data JPA/Hibernate应用程序在启动时消耗超过2GB的内存,而没有一个用户点击它.我使用Hazelcast作为二级缓存,但是当我使用ehCache时我遇到了同样的问题,这可能不是导致问题的原因.

我在Visual VM中运行了一个带有堆转储的配置文件,我看到JpaMetamodelMappingContext正在消耗大量内存,并且是大量的Map对象.我只需要帮助破译我所看到的内容,如果这实际上是一个问题.我在模型中有一百个课程,所以这可能是正常的,但我没有参考点.这看起来有点过分了.

一旦我获得100个并发用户的负载,我的内存消耗增加到6-7 GB.对于我推送和缓存的数据量来说这是很正常的,但我觉得如果我可以减少初始内存,我会有更多的增长空间.

Visual VM的屏幕截图

在此输入图像描述

spring hibernate hazelcast spring-data-jpa

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

Maven-code-formatter 插件忽略我的 java 文件

我在 Maven 中有以下配置,但它只是一直忽略我的源文件。调试日志显示 Eclipse Code Formatter 由于合规性级别而为空。我查了一下,所有级别都是1.8。完整日志如下...

输出:

[INFO] --- maven-java-formatter-plugin:0.4:format (format) @ AIM ---
[INFO] Using 'UTF-8' encoding to format source files.
[INFO] Number of files to be formatted: 67
[INFO] Successfully formatted: 0 file(s)
[INFO] Fail to format        : 0 file(s)
[INFO] Skipped               : 67 file(s)
[INFO] Approximate time taken: 0s
[INFO] 


    <plugin>
  <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
  <artifactId>maven-java-formatter-plugin</artifactId>
  <version>0.4</version>

   <executions>
          <execution>
          <id>format</id> 
          <phase>process-resources</phase> 
             <goals>
              <goal>format</goal>
            </goals>
          </execution>
        </executions>
  <configuration>
   <complianceLevel>${maven.compiler.source}</complianceLevel>
    <sourceLevel>${maven.compiler.source}</sourceLevel>
<!--     <includes> -->
<!--         <include>**/*.java</include> -->
<!--     </includes> -->
     <configFile>${project.basedir}/src/main/resources/eclipse-formatter.xml</configFile> …
Run Code Online (Sandbox Code Playgroud)

eclipse maven-plugin maven

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

Spring Boot 2.1 嵌入 Tomcat - 密钥库密码不正确

更新 -> 添加 Security.addProvider(new BouncyCastleProvider()); 修复了这个问题

以下错误是由于在我的配置中添加 ActiveMQ Broker 引起的。如果删除 JMS 配置,此错误就会消失。

 java.security.UnrecoverableKeyException: failed to decrypt safe contents entry:
    javax.crypto.BadPaddingException: pad block corrupted  
Run Code Online (Sandbox Code Playgroud)

Spring Boot 2.1.1.RELEASE 嵌入式 Tomcat 与 SSL ActiveMQ @EnableJMS

更新:我从应用程序中删除了 JMSConfiguration.class,一切都开始工作。@EnableJMS 必须做一些覆盖某些事情的事情。我将系统地注释掉该配置类中的 bean,直到找到确切的罪魁祸首。我从未想过我的 JMS Active MQ 配置会与嵌入式 Tomcat 服务器的 SSL 配置发生冲突。

我已将其范围缩小到以下与 JMS 相关的 bean,这就是原因。如果我完全删除 JMS 配置,那么我就不会收到密码错误。这些事情看似无关,但不知何故却有联系。

@Bean
public BrokerService broker() throws Exception {
    final BrokerService broker = new BrokerService();
Run Code Online (Sandbox Code Playgroud)

使用下面的配置,启动 Spring Boot 时出现错误。如果我删除所有 @Configuration 类并启动 Spring Boot,则此配置工作正常。我尝试过 PKCS、JKS,也尝试过 file:,我已经移动了文件,但没有任何乐趣。我知道密码是正确的,因为如果我删除我的配置类,它会正常启动,并且我可以使用 443/ssl 很好地访问服务器...

server.contextPath=/my
server.tomcat.additional-tld-skip-patterns=*.jar
server.compression.enabled=true
server.port=443
server.ssl.key-store:classpath:local-keystore.jks …
Run Code Online (Sandbox Code Playgroud)

java spring-boot embedded-tomcat-8

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

PushSharp Push在停止之前不会处理队列

PushSharp仅在调用stop时处理队列.有没有人知道push sharp会处理队列或刷新队列的频率?每次我想发送通知以节省资源时,我都不想打电话停止和启动.

            pushService = new PushService();
            pushService.StartApplePushService(new ApplePushChannelSettings(prod,  cert.InputStream.ReadToEnd(), passConfig.Value));
  pushService.QueueNotification(
                NotificationFactory.Apple().ForDeviceToken("mydeviceid").WithAlert("Notifications Started!").WithSound("default").WithBadge(7));


            pushService.StopAllServices(true);
Run Code Online (Sandbox Code Playgroud)

apple-push-notifications ios c#-4.0 pushsharp

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

Angular Prerendering延迟html页面加载,以便prerender加载Ajax

我正在使用Angular我需要延迟机器人页面输出的完整输出,以便在机器人停止处理HTML之前加载内容时间.我的整个页面将呈现,预渲染服务认为页面已完成,但ajax仍在加载数据.我只需要延迟内容刷新,直到完成ajax加载.Angular有一个很好的方法吗?

我正在使用Prerendering.io作为我的预呈现服务.

ajax seo angularjs

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

Spring Data JPA Custom Generic Repository Pattern问题

我在Spring中有以下配置,但由于缺少存储库的Impl类中的init方法,自动装配失败.Spring不应该尝试通过构造函数初始化bean,但它应该使用Factory ...我错过了一些简单的配置......或者我遇到了一个bug.

我正在尝试实现一个通用存储库,其中所有存储库可以共享特定于我的映射域类的方法和特定的存储库...

这是我的错误:

Error creating bean with name 'auditRepositoryImpl' defined in file AuditRepositoryImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.domain.biz.dao.impl.AuditRepositoryImpl]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.domain.biz.dao.impl.AuditRepositoryImpl.<init>()
Run Code Online (Sandbox Code Playgroud)

另一方面,看起来我的CustomFactory没有被选中.

2014-07-05 08:16:48,343 DEBUG  org.springframework.data.repository.config.RepositoryComponentProvider Identified candidate component class: file [InventoryRepository.class] 
Run Code Online (Sandbox Code Playgroud)

...

2014-07-05 08:16:48,366 DEBUG  org.springframework.data.repository.config.RepositoryBeanDefinitionBuilder Registering custom repository implementation: auditRepositoryImpl AuditRepositoryImpl 
2014-07-05 08:16:48,367 DEBUG  org.springframework.data.repository.config.RepositoryConfigurationDelegate Registering repository: auditRepository - Interface: AuditRepository - Factory: org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean 







    //Spring Java config
    @Configuration
    @EnableScheduling
    @EnableSpringConfigured
    @Import(EnvConfiguration.class)
    @EnableAspectJAutoProxy …
Run Code Online (Sandbox Code Playgroud)

spring jpa spring-data spring-data-jpa

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

找不到 Eclipse JDK 11 QName

无论我尝试什么,Eclipse 都会抱怨找不到 QName ......它确实在类路径上。它不会导致任何其他问题,我可以编译和运行,它只是总是显示找不到它。

Eclipse Java EE IDE for Web Developers.
Version: 2018-09 (4.9.0)
Build id: 20180917-1800
OS: Mac OS X, v.10.14, x86_64 / cocoa
Java version: 11
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

eclipse

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