WASdev / ci.docker.websphere-traditional

Dockerfiles for WebSphere Application Server traditional
Apache License 2.0
171 stars 192 forks source link

Running Jython script file from host to execute on WAS docker container #93

Closed mattadamson closed 6 years ago

mattadamson commented 6 years ago

Hi

I'm trying to execute a jy jython script which interacts with the WAS instance from the host ( a Mac ). What's the recommend approach to do this please?

I thought running the following would allow this

docker exec 1c844d674320 wsadmin.sh -lang jython -port 9443 -user wsadmin -password a3qJEo0O

However I get exceptions when starting

PC05249s-MacBook-Pro:~ madamson$ docker exec 1c844d674320 wsadmin.sh -lang jython -port 9443 -user wsadmin -password a3qJEo0O WASX7023E: Error creating "SOAP" connection to host "localhost"; exception information: com.ibm.websphere.management.exception.ConnectorNotAvailableException: [SOAPException: faultCode=SOAP-ENV:Protocol; msg=Unsupported response content type "text/html; charset=utf-8", must be: "text/xml". Response was: Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: / ]

So perhaps this approach isn't even valid.

Many thanks

arthurdm commented 6 years ago

Hi @mattadamson - did you copy the jython script into the container prior to executing it?

YuLimin commented 6 years ago
  1. Copy jython script to WAS instance container docker cp GetInfo.py :/tmp/

  2. The default port of SOAP on WAS is 8879, please check SOAP_CONNECTOR_ADDRESS on ports via console, Not 9443 which is default host https port (WC_defaulthost_secure)

  3. Then run script will get the correct result docker exec wsadmin.sh -port 8879 -user wsadmin -password CHANGEME -lang jython -f /tmp/GetInfo.py

mattadamson commented 6 years ago

thanks all! I actually found the issue was simply the port. It seems 8880 was the port required for the SOAP connector by default.

Mr-H commented 5 years ago

8880 is the default for standalone SOAP port, 8879 is the default for WAS ND cluster SOAP port