users@glassfish.java.net

Re: Deploy EJB Module project to virtual server

From: Ryan de Laplante <ryan_at_ijws.com>
Date: Fri, 14 Sep 2007 17:19:45 -0400

>> I have several projects.
>>
>> 1) Servlet endpoint web service (WAR)
>> 2) EJB endpoint web service (JAR)
>> 3) An enterprise application that contains EJBs and a web app (EAR)
>>
>> I have deployed all three into my app server. For the WAR and EAR I
>> was able to select a specific virtual server within the target. For
>> the JAR, there is no option to choose a virtual server within the
>> target.
>>
>> Is this by design or a bug?
>>
>>
>> Also I noticed that when I do operations related to virtual servers I
>> have to restart glassfish. The change either doesn't take effect at
>> all until restart, or Glassfish might give me a blank screen when
>> trying to access it from a web browser.
Does anyone have an answer for this? Do I really need to convert my EJB
web service to a servlet web service so that I can put it into a virtual
server?

>
> About the latter ("operations related to virtual servers"): Which
> version of GlassFish are
> you using? Please provide exact sequence of steps that would allow us
> to reproduce the problem.
>
Here is an example I ran into just now. I deployed a web project (that
contains only a web service) from NetBeans 5.5.1 into Glassfish V2 RC8
(58g). I logged into the web admin console and selected my web project
from the tree on the left. I went to the target tab and clicked "Manage
Virtual Servers" for the "server" target. I selected my virtual server
from the list on the left and added it to the list on the right, clicked
OK. Next I tried to go to the URL of my web service's WSDL. I get a
blank screen. Back in the web admin console tab in Firefox I clicked my
web project from the tree on the left, and was brought to the login
screen!

After restarting glassfish I went back to the URL of my web service URL
and this time I see an HTTP 404 error. It turns out I was trying to
access the wrong URL (typo). Wanting to try the experiment again, I
undeployed the web project from the runtime tab in Netbeans. Next I
redeployed it from NetBeans. Immediately I was able to access the WSDL
on my virtual server's port. I was not expecting this since I have not
yet told the web project to use the virtual server from the admin
console. I logged into the admin console to check if the virtual
server was added to this web project. It is not.

I decided to restart Glassfish again to see if it would still let me
access the WSDL after. I can still see the WSDL using the virtual
server's port # in the URL. This does not make sense. FYI - I am
pressing CTRL-F5 to force firefox to refresh. I even opened IE to see
if it would show in there, and it does. I logged into the admin console
and again confirmed that no virtual servers have been selected for this
web project.

While I was doing these tests, there was an other web project that I had
deployed earlier that is configured to use the virtual server. My
virtual server has its own http listener using port 8443, and SSL enabled.


Thanks,
Ryan