Glassfish 3.1 remote deploy not working
Hello,
I'm using a glassfish instance on a remote linux server with the following configuration (german):
Installationsverzeichnis: |
/usr/local/glassfish3/glassfish |
Installierte Version: |
Oracle GlassFish Server 3.1 (build 43) |
Debug: |
Am folgenden Port aktiviert: 9009 |
HTTP-Anschluss/-Anschlüsse: |
4848,8080,8181 |
IIOP-Anschluss/-Anschlüsse |
3820,3920,3700 |
Now I'd like to deploy my app using IntelliJ IDEA 10 - local glassfish deployment works fine but the attempt to connect to the remote glassfish instance fails with the message:
Error running Glassfish Remote v3.1:
Unable to connect to the <myserver.domain>:4848
The admin password is the same for the AS instance and the IDE configuration. I can connect to 4848 using the browser and 8080 resp.
The IDEA 10 log file only states that the artifact has been created successfully and that the compilation process has been completed. I also tried to disable any running firewalls but that didn't show any effect. Do I miss something?
Greetings
- Marcel Karras
Please sign in to leave a comment.
Hello,
Currently IDEA connects to remote GF only if it has remote admin enabled.
Please try to perform the following steps to connect
1) execute on your server the following commands:
asadmin disable-secure-admin
asadmin restart-domain <your domain name>
asadmin enable-secure-admin
2) restart the IDEA (if it was running)
Regards,
Michael
This worked for me until I did another restart of the domain. When this happens, IntelliJ cannot connect anymore. I did a trace on port 4848 and I found this:
GET /__asadmin/version HTTP/1.1
Content-type: application/octet-stream
Connection: Keep-Alive
Authorization: Basic YWRtaW46YWRtaW4=
User-Agent: hk2-agent
Cache-Control: no-cache
Pragma: no-cache
Host: 192.168.51.71:4848
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
HTTP/1.1 302 Moved Temporarily
Location: https://192.168.51.71:4848/__asadmin/version
Connection:close
Cache-control: private
It appears IntelliJ will not work with the HTTP redirect. Do you have any suggestions?
It looks like you have enabled secured (SSL) connection to the asadmin- note 's' in your 'https' part of the redirect response.
At the moment, GlassFish integration in the Intellij IDEA does not support secured connection.
So, to be able to connect to GlassFish with Intellij, you should disable SSL first.
The following command should do it for you:
If you feel strongly about the SSL, plase submit youtrack for that.
Regards,
Michael
Thank you, but it's the same. In fact I don't need SSL, but it seems that a "enable-secure-admin" will turn it on and "security-enabled = false" will not turn it off. I'm running a default installation of Glassfish 3.1 and I've executed the following commands:
asadmin disable-secure-admin
asadmin restart-domain [mydomain]
asadmin enable-secure-admin
asadmin set server-config.network-config.protocols.protocol.admin-listener.security-enabled=false
Then, after:
asadmin restart-domain [mydomain]
it's the same problem. If you don't have any ideas, I'll just put the above four lines in a restart script and use that for restarting.
Hello,
Commands I've suggested above have different influence on the server state:
asadmin enable-secure-admin
- enables remote administration service (asadmin via http)
asadmin set server-config.network-config.protocols.protocol.admin-listener.security-enabled=true
Both commands should set some flags in the <GlassFish home>\glassfish\domains\domain1\config\domain.xml
XPath for the flag of [asadmin enable(disable)-secure-admin] is
/domain/secure-admin/@enabled (absense of the "enabled" attribute means "false", "true" should be specified)
XPath for the flag of [server-config.network-config.protocols.protocol.admin-listener.security-enabled]
is /domain/configs/config[@name="server-config"]/network-config/protocols/protocol[@name="admin-listener"]/@security-enabled
(absense of the "security-enabled" attribute means "false", "true" should be specified).
I suspect you might have not enough rights to write the domain.xml, this would give the reason why the configuration isn't kept after the domain restart.
Hope that helps,
Regards,
Michael
Michael, thanks for your effort, but even with security-enabled = false, and enabled secure-admin (all this is verified through domain.xml), SSL is still used. In fact, I've found an open issue about this on Glassfish Jira.
Let's take some time to get the facts straight.
Real Solution?!
IntelliJ should support Glassfish remote deploy over SSL.
Quick Fix?
**CAUTION** Applying this fix will transmit your Glassfish password unencrypted! **CAUTION**
Notes
I did notice that the following Wiki documented features that currently don't exist in the Glassfish 3.1.1 build 12 that are important for remote deployments and IntelliJ.
Hello,
Support for the connection to the GF over SSL (http://youtrack.jetbrains.net/issue/IDEA-70519) had been recently added and will be available in IDEA-XI for GF 3.1
Regards,
Michael