Jython 2.7.2 prompts URI is not hierarchical what to do
This article mainly shows you the "Jython 2.7.2 tips URI is not hierarchical how to do", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "Jython 2.7.2 tips URI is not hierarchical how to do" this article.
1. Background
Due to the need to use Jython. But found a strange phenomenon that there is no problem with the use of IDE, but packaging jar reported an error.
Properties props = new Properties (); props.put ("python.home", "D:\\ jython2.7.2"); props.put ("python.path", "D:\ jython2.7.2\\ Lib\\ site-packages"); props.put ("python.console.encoding", "UTF-8"); / / Used to prevent: console: Failed to install': java.nio.charset.UnsupportedCharsetException: cp0. Props.put ("python.security.respectJavaAccessibility", "false"); / / don't respect java accessibility, so that we can access protected members on subclasses props.put ("python.import.site", "false"); / / props.put ("python.cachedir.skip", "true"); props.put ("org.python.netty.noUnsafe", "true"); Properties preprops = System.getProperties () PythonInterpreter.initialize (preprops, props, new String [0]); / / an exception PythonInterpreter pyInterp = new PythonInterpreter () is reported here Java.lang.IllegalArgumentException: URI is not hierarchical at java.io.File. (File.java:418) at org.python.core.PrePy.getJarFileNameFromURL (PrePy.java:427) at org.python.core.PrePy._getJarFileName (PrePy.java:362) at org.python.core.PrePy.getJarFileName (PrePy.java:345) at org.python.core.PySystemState.doInitialize (PySystemState.java:1195) at org.python .core.PySystemState.initialize (PySystemState.java:1130) at org.python.core.PySystemState.initialize (PySystemState.java:1085) at org.python.core.PySystemState.initialize (PySystemState.java:1080) at org.python.util.PythonInterpreter.initialize (PythonInterpreter.java:63) at com.langtutu.ncs.api.robot.core.Test. (Test.java:34) at com.langtutu.ncs.api.service.impl.HomestaySchedulingServiceImpl DownOrderTest (HomestaySchedulingServiceImpl.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethod) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.springframework.scheduling.support.ScheduledMethodRunnable.run (ScheduledMethodRunnable.java:84) at org.springframework.scheduling.support. DelegatingErrorHandlingRunnable.run (DelegatingErrorHandlingRunnable.java:54) at org.springframework.scheduling.concurrent.ReschedulingRunnable.run (ReschedulingRunnable.java:93) at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511) at java.util.concurrent.FutureTask.run (FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201 (ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:293) At java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142) 2. Problem finding
Debug and trace the jython using IDE and remote calls, respectively, and locate the error line of the code:
IDE debugging shows that the url is as follows: the JarJV filebank DGV is as follows: the JarJV fileLay DGV is as follows: the JarJV filebank DGV is as follows: the JarVera filebank DGV is as follows: the JarJV filebank D
Remote debugging
Nesting cannot be used.
3. Solution:
Jython is removed when maven is packaged; external jar packages are loaded at run time.
Culling:
Org.springframework.boot spring-boot-maven-plugin 2.2.10.RELEASE ZIP Org.python
Run:
Java-Dloader.path= "lib/"-jar.\ ncsapi-0.0.1-SNAPSHOT.jar
Inside the lib is the jar package. The operation is completely normal at this time.
The above is all the contents of the article "what to do with URI is not hierarchical in Jython 2.7.2". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!