问题
I'm trying to run pan.bat through cmd from my windows os system,I have set the environment variable PENTAHO_JAVA_HOME,seeking help for the same , Thanking in advance.
I tried this command to run the .ktr
C:\pdi-ce-5.2.0.0-209\data-integration>pan.bat /file:E:\Practise_TRANSFORMATION OUTPUT\dynamic pivot\trying_pivot_with_2_billingid.ktr /level:Basic
and this is the error I'm getting
WARNING: Using java from path
DEBUG: _PENTAHO_JAVA_HOME= DEBUG: _PENTAHO_JAVA=java.exe C:\pdi-ce-5.2.0.0-209\data-integration The system cannot find the path specified. The system cannot find the path specified.
C:\pdi-ce-5.2.0.0-209\data-integration>"java.exe" "-Xmx1024m" "-XX:MaxPermSize=1024m" "-Djava.library.path=libswt\win64" "-DKETTLE_HOME=" "-DKETTLE_R EPOSITORY=" "-DKETTLE_USER=" "-DKETTLE_PASSWORD=" "-DKETTLE_PLUGIN_PACKAGES=" "-DKETTLE_LOG_SIZE_LIMIT=" "-DKETTLE_JNDI_ROOT=" -jar launcher\pentaho-a pplication-launcher-5.2.0.0-209.jar -lib ..\libswt\win64 -main org.pentaho.di.pan.Pan /file:E:\Practise_TRANSFORMATION OUTPUT\dynamic pivot\trying_pi vot_with_2_billingid.ktr /level:Basic Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024m; support was removed in 8.0 2016/03/03 16:46:55 - Pan - Logging is at level : Basic logging 2016/03/03 16:46:55 - Pan - Start of run. Processing has stopped because of an error: Unable to read file [file:///E:/Practise_TRANSFORMATION] Could not read from "file:///E:/Practise_TRANSFORMATION" because it is a not a file.
org.pentaho.di.core.exception.KettleXMLException: Unable to read file [file:///E:/Practise_TRANSFORMATION] Could not read from "file:///E:/Practise_TRANSFORMATION" because it is a not a file.
at org.pentaho.di.core.xml.XMLHandler.loadXMLFile(XMLHandler.java:559)
at org.pentaho.di.core.xml.XMLHandler.loadXMLFile(XMLHandler.java:538)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2660)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2628)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2605)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2585)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2550)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2513)
at org.pentaho.di.pan.Pan.main(Pan.java:380)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.pentaho.commons.launcher.Launcher.main(Launcher.java:92)
Caused by: org.apache.commons.vfs.FileNotFoundException: Could not read from "file:///E:/Practise_TRANSFORMATION" because it is a not a file. at org.apache.commons.vfs.provider.AbstractFileObject.getInputStream(Unknown Source) at org.apache.commons.vfs.provider.DefaultFileContent.getInputStream(Unknown Source) at org.pentaho.di.core.vfs.KettleVFS.getInputStream(KettleVFS.java:247) at org.pentaho.di.core.xml.XMLHandler.loadXMLFile(XMLHandler.java:557) ... 13 more Caused by: java.io.FileNotFoundException: E:\Practise_TRANSFORMATION (The system cannot find the file specified) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(Unknown Source) at java.io.FileInputStream.(Unknown Source) at org.apache.commons.vfs.provider.local.LocalFile.doGetInputStream(Unknown Source) ... 17 more
I have done echo %PENTAHO_JAVA_HOME% to verify
C:\pdi-ce-5.2.0.0-209\data-integration>echo %PENTAHO_JAVA_HOME%
%PENTAHO_JAVA_HOME%
C:\pdi-ce-5.2.0.0-209\data-integration>
回答1:
Low hanging fruit. Using a console command like:
C:\pdi-ce-5.2.0.0-209\data-integration>pan.bat /file:E:\Practise_TRANSFORMATION OUTPUT\dynamic pivot\trying_pivot_with_2_billingid.ktr /level:Basic
you are have folder name with spaces -
Practise_TRANSFORMATION OUTPUT
try
Practise_TRANSFORMATION^ OUTPUT
there is different approaches to deal with cmd and file names with spaces. See Executing cmd file contained in a folder with space as example.
来源:https://stackoverflow.com/questions/35770956/running-pan-bat-from-command-line