WASdev / ci.docker.websphere-traditional

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

How to link eclipse with WAS for developers ? #71

Closed celada closed 5 years ago

celada commented 6 years ago

Hi,

I have build and run WAS traditional for developers image on docker container in a Mac device. I want to link eclipse installed in the Mac device to this WAS in a container. I have done this before using IBM WAS developer tools addon for eclipse, but WAS was installed directly into the laptop using other OS.

Do you know how to do it?

Thanks in advance.

ernani commented 6 years ago

Hey, I am glad you were able to get WAS running with Docker on your machine.

I do think that a specific port must be exposed to the local machine to be able to make Eclipse communicate with WAS, that's the JVM debug port I guess as per digging into this thread here:

https://stackoverflow.com/questions/9028984/how-do-you- connect-an-eclipse-to-a-websphere-application-server-hosted-on-remote

Best Regards!

On Wed, Nov 1, 2017 at 10:02 PM, celada notifications@github.com wrote:

Hi,

I have build and run WAS traditional for developers image on docker container in a Mac device. I want to link eclipse installed in the Mac device to this WAS in a container. I have done this before using IBM WAS developer tools addon for eclipse, but WAS was installed directly into the laptop using other OS.

Do you know how to do it?

Thanks in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WASdev/ci.docker.websphere-traditional/issues/71, or mute the thread https://github.com/notifications/unsubscribe-auth/AAG_W96pK7Gi18Qy3K15dVWKNzX63Uwcks5syQaBgaJpZM4QO_aT .

celada commented 6 years ago

Hi @ernani , thanks for the link. I follow its instructions but I couldn't connect the eclipse to docker WAS. I got below error:

Failed to connect to remote VM

com.sun.jdi.connect.spi.ClosedConnectionException at org.eclipse.jdi.internal.connect.SocketTransportService.readHandshake(SocketTransportService.java:219) at org.eclipse.jdi.internal.connect.SocketTransportService.access$1(SocketTransportService.java:211) at org.eclipse.jdi.internal.connect.SocketTransportService$3.run(SocketTransportService.java:182) at java.lang.Thread.run(Thread.java:748)

eclipse.buildId=4.7.1.M20171009-0410 java.version=1.8.0_144 java.vendor=Oracle Corporation BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US Framework arguments: -product org.eclipse.epp.package.jee.product -keyring /Users/celada/.eclipse_keyring Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring /Users/celada/.eclipse_keyring

I use the default port in the WAS (7777). I also test it with a telnet but couldn't connect.

armandos-mbp:~ celada$ telnet localhost 7777 Trying ::1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host.

Another option was drop the container and run it again mapping 7777 port but with same result.

docker run --name dev -h dev -p 9043:9043 -p 9443:9443 -p 7777:7777 -d websphere-traditional:profile

That is what I got at this moment.

ernani commented 6 years ago

Apparently your telnet connected fine.

I'd check the log in eclipse to see more details of this problem.

I am also not sure if the plugin requires another PORT to be exposed, it would be worth looking at that piece as well.

Best Regards,

Ernani

On Fri, Nov 3, 2017 at 6:43 PM, celada notifications@github.com wrote:

Hi @ernani https://github.com/ernani , thanks for the link. I follow its instructions but I couldn't connect the eclipse to docker WAS. I got below error:

Failed to connect to remote VM

com.sun.jdi.connect.spi.ClosedConnectionException at org.eclipse.jdi.internal.connect.SocketTransportService.readHandshake( SocketTransportService.java:219) at org.eclipse.jdi.internal.connect.SocketTransportService.access$ 1(SocketTransportService.java:211) at org.eclipse.jdi.internal.connect.SocketTransportService$3.run( SocketTransportService.java:182) at java.lang.Thread.run(Thread.java:748)

eclipse.buildId=4.7.1.M20171009-0410 java.version=1.8.0_144 java.vendor=Oracle Corporation BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US Framework arguments: -product org.eclipse.epp.package.jee.product -keyring /Users/celada/.eclipse_keyring Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring /Users/celada/.eclipse_keyring

I use the default port in the WAS (7777). I also test it with a telnet but couldn't connect.

armandos-mbp:~ celada$ telnet localhost 7777 Trying ::1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host.

Another option was drop the container and run it again mapping 7777 port but with same result.

docker run --name dev -h dev -p 9043:9043 -p 9443:9443 -p 7777:7777 -d websphere-traditional:profile

That is what I got at this moment.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/WASdev/ci.docker.websphere-traditional/issues/71#issuecomment-341821796, or mute the thread https://github.com/notifications/unsubscribe-auth/AAG_WwOMVHzaCrICcMcGLqWrTPvHThDBks5sy3rYgaJpZM4QO_aT .

dcarlon commented 6 years ago

@celada did you were able to get this working? we are trying to do the same. We know we should open the boostrap and RMI ports as well, but we don't know the ports in advance until we get to the WAS Console

mattadamson commented 6 years ago

Hi I'm also facing the issue of simply debugging the WAS image on docker from the hosts eclipse. I didn't want to hijack this thread but it seems related and not resolved.

Note you have to make sure the debug check box is enabled as well as the JVM arguments set up for the port. I also used -p 12004:12004 to expose my debug port. I still couldn't connect from the host to the docker JVM. Are there any other approaches to debug? How do others do this?

Many thanks

arturdzm commented 5 years ago

You could try mounting entire WAS directory /opt/IBM/WebSphere/AppServer as a folder on Host machine using volumes (docker run -v option). This will let you have access to all WAS files for networking I would recommend --net=host option instead of port-forward which basically will remove NAT layer

arturdzm commented 5 years ago

Closing this issue, re-open if you have further questions