0

I am a beginner in Java programming and I did a lot of research but still need assistance. I am trying to add proxy settings to my JVM Launcher but I do not know how to do this.

I have read responses to other questions stating it can be done in the CMD using below

java -Djava.net.useSystemProxies=true

OR

java -Dhttp.proxyHost=Host -Dhttp.proxyPort=Port -Dhttp.proxyUser=Username -Dhttp.proxyPassword=Password

But I need to end them with a Java class or .Jar file. The problem is I do not know the class or the .jar file the application is running off of. I need to do this for Pentaho Data Integration(PDI) and it runs off on Javaw.exe which is all I know.

I have seen other responses where people have coded in Java using eclipse, to add proxy settings will i need to go that route?

Basically I am trying to connect to Salesforce using PDI but my companies proxy settings are stopping me. PDI runs off of Java so I need to set up the proxy setting in Java but do not know where to start.

Any assistance is greatly appreciated. Thank you.


java.lang.Exception: Error connecting to Salesforce! Failed to send request to https://test.salesforce.com/services/Soap/u/37.0

at org.pentaho.di.ui.trans.steps.salesforce.SalesforceStepDialog.test(SalesforceStepDialog.java:97)
at org.pentaho.di.ui.trans.steps.salesforceupsert.SalesforceUpsertDialog.access$1700(SalesforceUpsertDialog.java:87)
at org.pentaho.di.ui.trans.steps.salesforceupsert.SalesforceUpsertDialog$10.handleEvent(SalesforceUpsertDialog.java:679)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.pentaho.di.ui.trans.steps.salesforceupsert.SalesforceUpsertDialog.open(SalesforceUpsertDialog.java:723)
at org.pentaho.di.ui.spoon.delegates.SpoonStepsDelegate.editStep(SpoonStepsDelegate.java:127)
at org.pentaho.di.ui.spoon.Spoon.editStep(Spoon.java:8766)
at org.pentaho.di.ui.spoon.trans.TransGraph.editStep(TransGraph.java:3217)
at org.pentaho.di.ui.spoon.trans.TransGraph.mouseDoubleClick(TransGraph.java:783)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1366)
at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:8022)
at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:9277)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:692)
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)
  • Don't know much about PDI, but if its Java based, there must be some script which starts the PDI process. Look for that script and this is where you can inject parameters. – Himanshu Bhardwaj Oct 08 '18 at 07:06
  • Check the documentation of your software on how to pass options to the JVM. – Holger Oct 08 '18 at 10:33

1 Answers1

0

The answer i found on the web states that to run PDI through a proxy it must be done through the batch file that launches PDI, thats Spoon.bat, this is the link i found. If your trasformation runs through CMD, and uses a .KJB, you'll want to add this parameter to Kitchen.bat ... likewise if you run a KTR through CMD you'll need to add this parameter to the Pan.bat

EDIT:

The set line in your Spoon.bat should like look this

-Dhttp.proxyHost=https://your.proxy -Dhttp.proxyPort=PORT NUMBER -Dhttp.proxyUser= USER -Dhttp.proxyPassword= PASSWORD

So the entire line should be something like

set OPT=%OPT% %PENTAHO_DI_JAVA_OPTIONS% "-Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2" "-Djava.library.path=%LIBSPATH%" "-DKETTLE_HOME=%KETTLE_HOME%" "-DKETTLE_REPOSITORY=%KETTLE_REPOSITORY%" "-DKETTLE_USER=%KETTLE_USER%" "-DKETTLE_PASSWORD=%KETTLE_PASSWORD%" "-DKETTLE_PLUGIN_PACKAGES=%KETTLE_PLUGIN_PACKAGES%" "-DKETTLE_LOG_SIZE_LIMIT=%KETTLE_LOG_SIZE_LIMIT%" "-DKETTLE_JNDI_ROOT=%KETTLE_JNDI_ROOT%"-Dhttp.proxyHost=https://your.proxy -Dhttp.proxyPort=PORT NUMBER -Dhttp.proxyUser= USER -Dhttp.proxyPassword= PASSWORD

Cristian Curti
  • 1,004
  • 1
  • 7
  • 13
  • So the JVM Launcher is the .bat file? Yeah I have tried this before but it still did not work. I am entering my password in plain text? – user10471443 Oct 08 '18 at 16:54
  • Tried it and its still giving me the same error. I edited my original post with the error message. Maybe its not the proxy? – user10471443 Oct 09 '18 at 02:21
  • You are altering the Salesforce Webservice URL in the step correct ? https://test.salesforce.com/services/Soap/u/37.0 is the default that comes with the step. – Cristian Curti Oct 09 '18 at 13:36
  • Yeah thats correct. I am using the salesforce upsert output option. The default is https://login.salesforce.com/services/soap/u/37.0 – user10471443 Oct 09 '18 at 20:25