Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat cannot find gdk_custom.jar, Oracle cannot create it?

Tags:

oracle

tomcat

Starting Tomcat 8, I get a warning:

02-Aug-2017 11:14:21.363 WARNING [RMI TCP Connection(5)-127.0.0.1]
org.apache.tomcat.util.scan.StandardJarScanner.scan
Failed to scan 
[file:/C:/Users/543829657/HomeTomcat/tomcat/lib/gdk_custom.jar] from
classloader hierarchy java.io.FileNotFoundException: 
C:\Users\543829657\HomeTomcat\tomcat\lib\gdk_custom.jar 
(The system cannot find the file specified)

All answers that I have found, advice to create the gdk_custom.jar file by Oracle ginstall. I have limited the Google search to the last two years, and the answers are as here:

java -classpath $ORACLE_HOME/jlib/orai18n.jar:$ORACLE_HOME/lib/xmlparserv2.jar ginstall -add <Name of NLT file>

But launching the line:

>java -classpath c:/Oracle/jlib/orai18n.jar:c:/Oracle/lib/xmlparserv2.jar ginstall -add lx2dddd.nlt

results in message:

Error: Could not find or load main class ginstall

I have looked into orai18n.jar. Really, there is not ginstall in it! Ginstall is in orai18n-tools.jar.

>java -classpath orai18n-tools.jar Ginstall -add lx2dddd.nlt

Usage: Ginstall [-dOutputDir] <NLT file> ...
-d: indicates the directory where the output file is written to
    do not specify 'd' for UDC, a zip file gdk_custom.zip will be
    written to the current directory

Ok, the text on Oracle docs is deprecated, it seems.

>java -classpath orai18n-tools.jar Ginstall -d. lx2dddd.nlt

Now it goes further, but again fails:

Exception in thread "main"
java.lang.NoClassDefFoundError:oracle/xml/parser/v2/DOMParser
    at oracle.i18n.util.builder.NLTParser.<init>(NLTParser.java:72)
    at oracle.i18n.util.builder.CharSetParser.<init>(CharSetParser.java:44)
    at oracle.i18n.util.builder.CharSetParser.getInstance(CharSetParser.java:64)
    at oracle.i18n.util.builder.CharDataTypeParser.<init>(CharDataTypeParser.java:123)
    at oracle.i18n.util.builder.CharConvBuilder.buildGLB(CharConvBuilder.java:95)
    at Ginstall.main(Ginstall.java:96)
Caused by: java.lang.ClassNotFoundException: oracle.xml.parser.v2.DOMParser
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 6 more

Maybe, that parser was necessary? But

>java -cp orai18n-tools.jar;c:/Oracle/lib/xmlparserv2.jar Ginstall -d. lx2dddd.nlt

has the same result.

And no gdk_custom.jar (nor zip) is created....

What is interesting, according to http://www.findjar.com/jar/com.oracle/oc4j/11/jars/xmlparserv2.jar.html?all=true, xmlparserv2.jar must contain the DOMParser class.

How can I get that gdk_custom.jar?

Oracle is 12.

like image 964
Gangnus Avatar asked Aug 02 '17 12:08

Gangnus


1 Answers

We needn't to create gdk_custom.jar.

All we need is to prevent Tomcat from looking for it. Since Tomcat 8.0.38 it is scanning by default. We should turn the scan off. Thus you won't see many excessive warnings and the launch of server will go faster.

add the following line in tomcat/conf/context.xml:

<Context>
  ...
  <JarScanner scanManifest="false"/>
</Context>
like image 70
Gangnus Avatar answered Sep 29 '22 18:09

Gangnus