Code Monkey home page Code Monkey logo

Comments (11)

fniephaus avatar fniephaus commented on June 3, 2024 1

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.

fniephaus avatar fniephaus commented on June 3, 2024

What happens if you add -H:+AddAllCharsets to your list of build options? Does that fix your problem?

from graal.

syedyusufh avatar syedyusufh commented on June 3, 2024

Hi @fniephaus , thanks for the quick revert

Adding -H:+AddAllCharsets causes build failure with reference to CharacterSet classes

from graal.

MoSehsah avatar MoSehsah commented on June 3, 2024

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.

kassifar avatar kassifar commented on June 3, 2024

Hi @syedyusufh, thank you for sharing with us your issue. We will be taking a look at it shortly.

from graal.

syedyusufh avatar syedyusufh commented on June 3, 2024

@fniephaus / @kassifar any other option to try, please.
Thanks

from graal.

fniephaus avatar fniephaus commented on June 3, 2024

While we are still investigating this, we can unfortunately only provide you with workarounds. At this point, you could

  1. 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
  2. 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.

syedyusufh avatar syedyusufh commented on June 3, 2024

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.

fniephaus avatar fniephaus commented on June 3, 2024

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.

syedyusufh avatar syedyusufh commented on June 3, 2024

@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.

fniephaus avatar fniephaus commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.