You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/03/02 00:58:03 UTC

[GitHub] [incubator-shardingsphere] kimmking opened a new issue #4547: YamlConfigurationExampleMain can't running with maven-exec in Example.

kimmking opened a new issue #4547: YamlConfigurationExampleMain can't running with maven-exec in Example.
URL: https://github.com/apache/incubator-shardingsphere/issues/4547
 
 
   When we launch YamlConfigurationExampleMain in command line :
   ```
   cd  \examples\sharding-jdbc-example\orchestration-example\orchestration-raw-jdbc-example
   
   mvn exec:java -Dexec.mainClass="org.apache.shardingsphere.example.orchestration.raw.jdbc.YamlConfigurationExampleMain"  -Dexec.classpathScope=runtime -Dexec.cleanupDaemonThreads=false
   ```
   
   Error occurs : 
   ```
   [INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ orchestration-raw-jdbc-example ---
   [WARNING]
   java.lang.NullPointerException
       at org.apache.shardingsphere.example.orchestration.raw.jdbc.YamlConfigurationExampleMain.getFile (YamlConfigurationExampleMain.java:79)
       at org.apache.shardingsphere.example.orchestration.raw.jdbc.YamlConfigurationExampleMain.getDataSource (YamlConfigurationExampleMain.java:66)
       at org.apache.shardingsphere.example.orchestration.raw.jdbc.YamlConfigurationExampleMain.main (YamlConfigurationExampleMain.java:53)
       at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
       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.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:282)
       at java.lang.Thread.run (Thread.java:748)
   ```
   
   Cause Thread.currentThread().getClass() belong to super classloader in 
   ```
   return new File(Thread.currentThread().getClass().getResource(fileName).getFile());
   ```
   
   It should be instead of current bootstrap class.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] dongzl closed issue #4547: YamlConfigurationExampleMain can't running with maven-exec in Example.

Posted by GitBox <gi...@apache.org>.
dongzl closed issue #4547: YamlConfigurationExampleMain can't running with maven-exec in Example.
URL: https://github.com/apache/incubator-shardingsphere/issues/4547
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services