I have inherited a web-service that was written in Netbeans and runs on Glassfish (version 3) and used to talk between a Redhat server and a Windows7 machine.
These can be started manually, by using Netbeans (6.9) to start the Glassfish Server and deploy the Java script, and they communicate securely quite happily
Of course, manually deploying the system like this is far from ideal, so I have arranged for Glassfish to be deployed via the command line interface of Redhat;
Create a user
groupadd glassfish
useradd -s /bin/bash -d /home/glassfish -m -g glassfish glassfish
Copy from CD to glassfish directory
mkdir 开发者_StackOverflow社区cdrom
chmod 777 /cdrom
mount /dev/cd0 /cdrom
cp glassfish-v3.zip /home/glassfish/glassfish-v3.zip
Login as the new user in a terminal window
sudo -i -u glassfish
Install GlassFish V3 using user glassfish
cd ~
unzip glassfish-v3.zip
rm glassfish-v3.zip
Exit the shell from step 2
Then the .war file (as in the Java script) is put into
glassfish/glassfishv3/glassfish/domains/domain1/autodeploy/CommandAndControlService.war
(As described in; http://download.oracle.com/docs/cd/E19798-01/821-1757/geyvr/index.html)
Then to run Glassfish I just log in as glassfish user, and launch glassfish
sudo -i -u glassfish
sudo glassfishv2/glassfish/bin/asadmin start-domain
(Which automatically deploys the .war file from earlier, as it’s in the “auto-deploy” directory)
Then for the Windows 7 machine…
Glassfishv3 is unpacked to
C:\glassfishv3
Then to start it I type;
C:\glassfishv3\glassfish\bin\asadmin.bat start-domain
All of the above works without any problems at all, the two machines chatter away happily over a non-secure connection.
The problem is that a secure connection is required, and this has been put in the script, and it works perfectly fine when glassfish is started through Netbeans on both machines.
However, when using the above procedure to start Glassfish, the secure link doesn’t work due to the certificates being “self signed” (the code uses “Mutual Certificates Security”).
I would say that this must be something in the code, but as it works fine when started through Netbeans I’d say that it was something to do with how I’m starting Glassfish, and deploying the .war file.
(I have tried started just one service automatically, and the other through Netbeans, but I get the same issue; the communication link started via the command line cannot connect due to self-signed certificates)
Any ideas?
Many Thanks
精彩评论