Comments (11)
I was just notified that the problem reported in #8265 (comment) will be fixed as part of the 23.4 release of the Oracle JDBC Driver jar. The “Missing character set id 560 not loaded at image build time” error should disappear when users switche to the latest version after 23.4 releases.
from graal.
What happens if you add -H:+AddAllCharsets
to your list of build options? Does that fix your problem?
from graal.
Hi @fniephaus , thanks for the quick revert
Adding -H:+AddAllCharsets
causes build failure with reference to CharacterSet classes
from graal.
After adding -H:+AddAllCharsets
Error: An object of type 'oracle.i18n.text.OraCharsetWithConverter' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.
You now have two options to resolve this:
1) If it is intended that objects of type 'oracle.i18n.text.OraCharsetWithConverter' are persisted in the image heap, add
'--initialize-at-build-time=oracle.i18n.text.OraCharsetWithConverter'
to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'oracle.i18n.text.OraCharsetWithConverter' to see if they are safe for build-time initialization, and that they do not contain any sensitive data that should not become part of the image.
2) If these objects should not be stored in the image heap, you can use
'--trace-object-instantiation=oracle.i18n.text.OraCharsetWithConverter'
to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with
'--initialize-at-run-time=<culprit>'
to prevent the instantiation of the object.
If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=oracle.i18n.text.OraCharsetWithConverter' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.
The following detailed trace displays from which field in the code the object was reached.
Trace: Object was reached by
reading field java.util.HashMap$Node.value of constant
java.util.HashMap$Node@1315a658: x-oracle-th8macthai=X-ORACLE-TH8MACTHAI
indexing into array java.util.HashMap$Node[]@60e0c6b4: [Ljava.util.HashMap$Node;@60e0c6b4
reading field java.util.HashMap.table of constant
java.util.HashMap@4c1e5755: {csibm290=IBM290, ms-874=x-windows-874, x-oracle-i7siemens9780x=X-ORACLE-I7SIEME...
scanning root java.util.HashMap@4c1e5755: {csibm290=IBM290, ms-874=x-windows-874, x-oracle-i7siemens9780x=X-ORACLE-I7SIEME... embedded in
com.oracle.svm.core.jdk.localization.substitutions.Target_java_nio_charset_Charset.lookup2(Target_java_nio_charset_Charset.java:82)
parsing method com.oracle.svm.core.jdk.localization.substitutions.Target_java_nio_charset_Charset.lookup2(Target_java_nio_charset_Charset.java:76) reachable via the parsing context
at java.nio.charset.Charset.lookup(Charset.java:476)
at java.nio.charset.Charset.forName(Charset.java:540)
at jdk.internal.util.xml.impl.XMLStreamWriterImpl.getCharset(XMLStreamWriterImpl.java:575)
at jdk.internal.util.xml.impl.XMLStreamWriterImpl.writeStartDocument(XMLStreamWriterImpl.java:158)
at jdk.internal.util.xml.impl.XMLStreamWriterImpl.writeStartDocument(XMLStreamWriterImpl.java:131)
at jdk.internal.util.xml.impl.XMLStreamWriterImpl.writeStartDocument(XMLStreamWriterImpl.java:107)
at jdk.internal.util.xml.PropertiesDefaultHandler.store(PropertiesDefaultHandler.java:103)
at java.util.Properties.storeToXML(Properties.java:1132)
at java.util.Properties.storeToXML(Properties.java:1083)
at root method.(Unknown Source)
from graal.
Hi @syedyusufh, thank you for sharing with us your issue. We will be taking a look at it shortly.
from graal.
@fniephaus / @kassifar any other option to try, please.
Thanks
from graal.
While we are still investigating this, we can unfortunately only provide you with workarounds. At this point, you could
- follow the instructions in the error message, adding
--initialize-at-build-time=oracle.i18n.text.OraCharsetWithConverter
to the list of your build option, re-build, repeat in case of more such errors - Build with
-H:-StrictImageHeap
. Note that this option is only functional in GraalVM for JDK 21. It no longer works in JDK 22.
from graal.
Hi @fniephaus
Resolved all the build errors reported for -H:+AddAllCharsets
via --initialize-at-build-time
, however the below error is again reported during application startup
Missing character set id 560 not loaded at image build time at oracle.sql.CharacterSet.make(CharacterSet.java:114)
from graal.
Ok, so I cannot reproduce the original issue with your reproducer repository and using Oracle GraalVM 21.0.2+13.1
on Linux x64. Also, I just realized your reproducer uses --strict-image-heap
and marks two classes for build-time init. So this probably causes the build error that you are seeing.
from graal.
@fniephaus does the database you're using to reproduce has multilingual support enabled like both English & Arabic?
The below error is thrown only for multilingual enabled DB which requires orai18n dependency, otherwise it works perfectly fine
Missing character set id 560 not loaded at image build time at oracle.sql.CharacterSet.make(CharacterSet.java:114)
from graal.
does the database you're using to reproduce has multilingual support enabled like both English & Arabic?
Nope, I wasn't aware that is a requirement. Is there an easy way to set this up, for example with test containers or so?
from graal.
Related Issues (20)
- Runtime reflection is not supported for public javax.ws.rs.core.Response$StatusType org.jboss.resteasy.specimpl.AbstractBuiltResponse.getStatusInfo() HOT 3
- Runtime reflection is not supported for public javax.ws.rs.core.Response$StatusType org.jboss.resteasy.specimpl.AbstractBuiltResponse.getStatusInfo() HOT 3
- Statically Linked native image does not produce/embed all the needed .so next to the executable HOT 2
- Add support for JCMD and the Attach API HOT 6
- How to configure Gradle to initialize specific modules at runtime when generating a native image with GraalVM? HOT 2
- [GR-54108] Polyglot memory leak on simple python execution HOT 1
- objectInputStream.readObject() issue with springboot 3.3.0 + graalvm22 as native image HOT 11
- Call for Lead Maintainers – GraalVM Backports Repositories HOT 4
- Future proposal: have "javac" directly support graalvm + (static) native image creation HOT 2
- Using native-image and Android apk files. HOT 3
- [GR-54193] Improve docs on JSON config files HOT 1
- What would be your recommendation to native compile a simple Java library and then call this native compiled library from another Java program? HOT 19
- native-image build error in graal-22.0.1
- jdk.VirtualThreadPinned JFR event NOT supported in native-image HOT 2
- jdk.graal.compiler.debug.GraalError: should not reach here: kind=V256_QWORD input=xmm6|V256_QWORD result=xmm0|V256_QWORD HOT 1
- epsilon and G1 seem not to work with JFR in NI HOT 2
- JFR CPU profiler does not respect the configured sampling period HOT 1
- Error encountered while parsing com.sun.glass.ui.mac.MacVariant.toString (MacVariant.java:193)
- problem running compiled file when I have @Qualifier annotation in my code
- native-image swing program in linux cannot switch to Chinese IME in the JTextField component
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graal.