Weblogic Image: t3 to the admin port takes significant time if the Admin Container doesnt map the same port as the docker host
Hi,
Current setup I am able to build the 12C(12.2.1) weblogic docker image and then create a sample domain 1221-domain:latest extending the oracle/weblogic :12.2.1-developer image. The resulting image is given below REPOSITORY TAG IMAGE ID CREATED SIZE 1221-domain latest 595c72b4ce39 7 hours ago 1.29GB
I was also able to do port mappings to a different host port and the console was accessible on the mapped port. I then deployed one of our internal application which sets up some jms and jdbc resources and then deployed the application itself without any issues. Note that I am only doing everything on just the AdminServer and not using the node manager and managed server domain.
The issue The problem comes when I try to connect to the t3 protocol from a remote machine when the exposed port inside the container is different from the published port on the docker host. eg:- I spun up a sample container like this -
docker run -it --name WLS -p 8047:7001 -p 8048:8453 -e JAVA_OPTIONS="-Dweblogic.rjvm.enableprotocolswitch=true" myapp:v1
I can successfully login to the console using http://
I then spun up another container mapping exactly the same ports as the container exposes. docker run -it --name SAMEPORT -p 7001:7001 -p 8453:8453 -e JAVA_OPTIONS="-Dweblogic.rjvm.enableprotocolswitch=true" myapp:v1
and then my test framework was able to immediately connect to through the t3 protocol to the AdminServer on 7001. I am not sure what is special about t3 ports vs the http ports. The console access works absolutely fine, but t3 needs the exact same port on the docker host as the container exposes.
my workaround As a workaround, I am spinning up containers like below docker run -it --name WLS -p 8047:8047 -p 8048:8453 -e JAVA_OPTIONS="-Dweblogic.rjvm.enableprotocolswitch=true" myapp:v1
and then 'exec' into the container and change the port in config.xml to 8047 and restart the container.
I am unable to pin point if this is a weblogic docker issue or something to do with the docker-proxy or my local set up.
Please help!!
Regards, Vipin
Hi, It would be great if someone can look and provide a resolution to this issue.
regards, Vipin
Hey @mriccell, mind to review this one please?
Its a very interesting issue and your workaround matches a known behavior when using OTD to balance t3 connections (not sure if you have seen this article, but here it goes: http://pauldone.blogspot.co.nz/2013/04/load-balancing-t3-initial-context.html) and it might be the way to go.
Just one more interested in it and wanting to follow the update from the product perspective.
The problem relates to t3 using the default channel to connect to the servers in the container where the internal server port and the external host port are different.
currently the workaround is to configure a channel and specify the external address and external port and then use the channel to make your t3 connection.
@vipinponnarath make reference to the documentation https://docs.oracle.com/cd/E72987_01/wls/WLACH/taskhelp/channels/ConfigureCustomNetworkChannelsForNonclusteredServers.html leave the address blank and only configure your port to the host port that you are mapping. Can you please try it and let me know the results?
@mriccell - thanks for the response, I will try this and post the results here.
@mriccell I tried to configure a Custom Channel, but no luck here. I am not sure if I am doing anything wrong here. Here is a snapshot of the channel configuration. My admin server is accessible on the docker host port 9001. The container has the default port 7001.

The Channel External port must match the port you are mapping the internal 7001 port of the WLS server to host. Example in your run -p 8047:7001, the internal port is 7001 the external port is 8047. The listen address is correct it should be blank.
Hello @mriccell ,
If you mean, I should use 8047 instead of 9001 for the Public port in the above snapshot, i just chose this time to spin up the container to publish the internal port 7001 on the host port 9001, like -p 9001:7001.
Do you also mean that I should configure the Listen Port in the above snapshot to also 7001? Note that this doesnt work due to a port conflict. I have attached a snapshot here.

@mriccell, do you have some time to check my updates above? I appreciate the help you are providing.
Hello @mriccell
Please can you check the above update and provide a resolution?
Regards, Vipin
Could you post the WebLogic config.xml and the related docker config regarding network setup?
Beside that we can tell the above "Channel-t3" configuration you have it listening on 7001 and the weblogic server has so called default channel which is the port the server is listening on and by default it is using 7001 also so if you did not customize it then your weblogic server already configured to listening on port 7001 and that is why you are getting the error message. So, send the above info and describe what port you want the weblogic server to listen on and what port you want those ports to map out.
Configure a t3 channel with ListenPort set to 8002 ( other than Server Listen Port) and Public Port set to any valid Port e.g. 9002. See the snippet from config.xml file
<server>
<name>AdminServer</name>
<listen-port>8001</listen-port>
<listen-address></listen-address>
<network-access-point>
<name>Channel-0</name>
<protocol>t3</protocol>
<listen-port>8002</listen-port>
<public-port>9002</public-port>
<http-enabled-for-this-protocol>true</http-enabled-for-this-protocol>
<tunneling-enabled>false</tunneling-enabled>
<outbound-enabled>false</outbound-enabled>
<enabled>true</enabled>
<two-way-ssl-enabled>false</two-way-ssl-enabled>
<client-certificate-enforced>false</client-certificate-enforced>
</network-access-point>
</server>
Use the following Docker run command
docker run --name WLS -p 8001:8001 -p 3098:8002
@vipinponnarath have you tried this configuration?
@mriccell @shean-guangchang @anpanigr ,
I tried this configuration and it is quite similar to the workaround that I posted while raising the issue itself. It works for only that specific listen port mapping(-p 3098:8002). The moment I spin up a second container and configure a channel again with another port mapping (say -p 4098:6002) my test suite gets stuck at this t3 connection stage and then it waits and waits and after a really long time (~20mins) it proceeds successfully. Just as reported in my original issue. What is it doing these minutes(just thinking loud)
Just that we all understand the use case here. I have a small docker server that can spin up several containers from the same weblogic image template. All these different weblogic containers, runs on the same docker host and they just maps to different host ports. But with our current situation, it seems I can only spin up one container from one docker host.
Again - note that it is only a problem if I use t3. Otherwise, I can run as many weblogic containers as i want and they all map to different ports on the same host and runs tests without any problem.
the config.xml from both the containers that i used for today's test is attached herewith. Also the docker container network inspect for one of the container is given here, actually even if I use the default network, its still the same - so not sure if this file is of any help. Additionally, the docker info results are also attached - if that helps. Please let me know what additonal config you'd like to check.
regards, Vipin
@vipinponnarath This is probably because you are using the 12.2.1 domain sample image where the domain is created at build time of the image. How are you changing the configuration when you spin a new container (managed server)?
In the 12.2.1.3 domain sample image the domain is externalized to a volume and the domain is created at run time. Any changes such as creating a new port or channel for a managed server will be reflected in the domain configuration for all servers running in the domain.
The default channel does not work when the host port is different from the server port, this is why you need the channel for t3.
Hello @mriccell - Not sure if you closed this because of not receiving a response from me for the question in your above email. Would you be kind enough to reopen this? ---->How are you changing the configuration when you spin a new container (managed server)? Ans: I am not using managed server. I am only using AdminServer for my development purpose.
I have the prebuilt 12.2.1 domain image from which i am spinning up 2 containers as below:
Admin container1 docker run -it --name WLS1 -p 8047:7001 myapp:v1
Admin container 2 docker run -it --name WLS2 -p 8048:7001 myapp:v1
myapp:v1 is just extending 1221-domain in the samples folder and deploying my application to the server.
my expectation is that without any additional configuration both ports 8047 and 8048 should act like two different AdminServers. Infact it does that decently because i can access the console of both 8047 and 8048 successfully at the same time. the problem is only t3. As I wrote above, once I configure the t3 channel, to use a port other than server default port, it then only works with that port. If i configure a second t3 channel - the issue is same. So I am back to the problem of one docker host machine not being able to effectively serve two AdminServer containers with different t3 ports.
@mriccell I wanted to try the 12.2.1.3 domain sample, but I cant find a way to extend the Dockerfile because of the fact that the domain is created at runtime. If I want to make an app deployment, i need to have a domain as pre-requisite. So I need to manually commit after creating the domain at runtime. This is not very efficient. Could you kindly reopen this issue?