Feedback running a spring boot application without modification to use value class
Brian Goetz
brian.goetz at oracle.com
Sat Aug 3 00:23:08 UTC 2024
ehcache has several tactics for estimating the size of cached objects,
which it uses for eviction calculations. One of them uses Unsafe, and
it appears to be using calls that don't work on value objects (and these
calls are deprecated.) It claims these tactics are pluggable.
The solution is to reconfigure ehcache to use a better-behaved sizeof
estimator. There's some documentation (not much, though) here:
https://github.com/ehcache/sizeof?tab=readme-ov-file
On 8/2/2024 4:36 PM, Anderson Vasconcelos Pires wrote:
> Hi guys,
>
> I just ran a spring boot application without modification to use the
> value class.
>
> The application runs normally. I just found the error below. I am not
> saying that this should not happen. Specifically because the method is
> marked for removal (https://openjdk.org/jeps/471).
>
> Caused by: java.lang.UnsupportedOperationException: can't get field
> offset on a value class: private final strictfp long java.lang.Long.value
> at
> jdk.unsupported at 23-valhalla/sun.misc.Unsafe.objectFieldOffset(Unsafe.java:659)
> ~[?:?]
> at org.ehcache.sizeof.impl.UnsafeSizeOf.sizeOf(UnsafeSizeOf.java:120)
> ~[ehcache-3.10.8-jakarta.jar:3.10.8]
>
> OS: Windows Server
> Compiled with Jdk 17
> Run with --enable-preview
>
> Dependencies:
> org.springframework:spring-jdbc:6.1.3
> org.springframework.security:spring-security-test:6.2.1
> org.springframework.security:spring-security-ldap:6.2.1
> org.springframework.ldap:spring-ldap-core:3.2.1
> org.springframework.boot:spring-boot-starter-web:3.2.2
> org.springframework.boot:spring-boot-starter-tomcat:3.2.2
> org.springframework.boot:spring-boot-starter-test:3.2.2
> org.springframework.boot:spring-boot-starter-security:3.2.2
> org.springframework.boot:spring-boot-starter-mail:3.2.2
> org.springframework.boot:spring-boot-starter-log4j2:3.2.2
> org.springframework.boot:spring-boot-starter-data-jpa:3.2.2
> org.springframework.boot:spring-boot-starter-cache:3.2.2
> org.springframework.boot:spring-boot-starter:3.2.2
> org.springframework.boot:spring-boot-starter
> org.hibernate.orm:hibernate-core:6.4.1.Final
> org.hibernate.orm:hibernate-jcache:6.4.1.Final
> org.hibernate.orm:hibernate-envers:6.4.1.Final
> org.snmp4j:snmp4j:3.7.7
> org.samba.jcifs:jcifs:1.3.18-kohsuke-1
> org.openjdk.nashorn:nashorn-core:15.4
> org.glassfish.jaxb:txw2:4.0.4
> org.glassfish.jaxb:jaxb-runtime:4.0.4
> org.ehcache:ehcache:3.10.8
> org.apache.tomcat:annotations-api:6.0.53
> org.apache.poi:poi-ooxml:5.3.0
> junit:junit:4.13.2
> javax.cache:cache-api:1.1.1
> io.grpc:grpc-stub:1.61.1
> io.grpc:grpc-protobuf:1.61.1
> io.grpc:grpc-netty-shaded:1.61.1
> com.oracle.database.jdbc:ojdbc11:21.9.0.0
> com.microsoft.sqlserver:mssql-jdbc:12.4.2.jre11
> com.lmax:disruptor:3.4.4
> com.h2database:h2:2.2.224
> com.google.zxing:javase:3.5.3
> com.google.zxing:core:3.5.3
> com.google.guava:guava:33.0.0-jre
>
> Best regards,
> Anderson.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-dev/attachments/20240802/a3b147bd/attachment.htm>
More information about the valhalla-dev
mailing list