It is better You follow whatever Srinivas has told in his mail.
deploy once (thru the command line utility), that will generate
server-config.wsdd in WEB-INF folder. copy that file into your codebase in
WEB-INF folder. In this way when ever you create your war or ear, that file be
loaded and will be deployed when you deploy your application. this
server-config.wsdd file is independent of the location. i.e. you can generate
on on machine and you can deploy on other machine with out changing any content
in the file.
still if you want to deploy at startup(in the servlet init) by giving delay
You can do it by using TimerTask
Servlet.init(){
...
Timer timer = new Timer();
timer.schedule(new WebserviceDeployer(), <delay time in milli secs>);
..
}
You can write WebserviceDeployer class that extends TimerTask and implement
run method, in that you can write your code which will deploy webservice.
<delay time in milli secs> depends on time that will take starting up the
server from that point.
Thanks, Venu
-----Original Message-----
From: Daniel (EXT), Dinu [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 01, 2005 11:51 PM
To: [email protected]; [EMAIL PROTECTED]
Subject: RE: WebService Deployment Programmatically
Hi Venu, Srinivas,
Thanks for the feedback. Could you please explain how you wait for the
webserver to get started before the deployment of webservice.
I was trying to do it through my servlet's init() method, and add
<load-on startup> tag entry for this servlet in my web.xml.
Regards
Dinu
-----Original Message-----
From: Pasula, Venugopal (Consultant) [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 01, 2005 8:27 PM
To: [email protected]; [EMAIL PROTECTED]
Subject: RE: WebService Deployment Programmatically
Thanks Sreenivas,
We were doing the same thing earlier, by maintaining a copy of
server-config.wsdd file in WEB-INF folder in our code base. But problem
with that is whenever you upgrade axis version or webservice
class(changing method signature or adding/removing methods) then we need
to re-generate and update code base. due to that mainatainance issue we
thoght of deploying the webservice at startup time.Is there any better
way of doing in that case??
Thak You
- Venu
-----Original Message-----
From: Davanum Srinivas [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 01, 2005 10:31 AM
To: [email protected]
Subject: Re: WebService Deployment Programmatically
Guys,
just run "java org.apache.axis.utils.Admin -server deploy.wsdd" on the
command line. This will create a server-config.wsdd. drop that into
your WAR under WEB-INF and you are all set!!!
-- dims
On 9/1/05, Pasula, Venugopal (Consultant) <[EMAIL PROTECTED]>
wrote:
>
> Hi Dinu,
> I had this same issue, but I resolved that by doing this task in
> separate thread by giving some delay(till the server started). I This
You
> can deploy the webservice only after the server has started. please
let me
> know if you have already found the better solution.
>
> Thanks, Venu
>
> -----Original Message-----
> From: Daniel (EXT), Dinu [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 30, 2005 8:56 AM
> To: [email protected]
> Subject: WebService Deployment Programmatically
>
>
>
>
> Hi,
>
>
>
> I would like to deploy my webservice programmatically when the
Web/Appserver
> gets started. This I do in the init() method of my servlet
> (TCEntIntegrationServlet). I have added all the axis libraries (jars)
in my
> web application's (Testapp\WEB-INF\lib) lib folder. In
Testapp\WEB-INF\
> folder I have placed the axis's server-config.wsdd.
>
>
>
> The wsdd file (Testapp )is placed in Testapp\ folder
>
>
>
> Attached are the entries I have made in my
Testapp\WEB-INF\lib\web.xml.
> Invoking the servlets sequentially via <load-onstartup> tags
>
>
>
> In my TCEntIntegrationServlet::init()
>
> {
>
> AdminClient ac = new AdminClient();
>
>
>
> String [] deployargs = new String[3];
>
>
>
> deployargs [0] = "-l" ;
>
> deployargs [1] = "http://localhost:9999/
Testapp/services/AdminService";
>
>
> deployargs [2] =
> getServletContext().getRealPath("deploy.wsdd");
>
>
>
> try
>
> {
>
> // Deploy the Service
>
> ac.process(deployargs);
>
> }
>
> catch (Exception e)
>
> {
>
> e.printStackTrace();
>
> }
>
> }
>
> Am getting the error attached after ac.process(deployargs); is
executed. It
> seems the AxisEngine (& AdminServices) is not initialized successfully
when
> the thread comes to my servlet's init() method. Is there any way to
overcome
> this
>
>
>
> If I put the same code in a doget() method in the above Servlet class
and
> invoke the servlet via http://localhost:9999/ Testapp/
> TCEntIntegrationServlet the above code executes fine and the
webservice
> gets deployed properyly.
>
>
>
> Could you please advice on this issue
>
>
>
> Thanks In Advance,
>
> Dinu
>
> ________________________________
>
>
>
>
> This email may contain confidential and privileged material for the
> sole use of the intended recipient(s). Any review, use, retention,
> distribution or disclosure by others is strictly prohibited. If you
are
> not the intended recipient (or authorized to receive for the
> recipient), please contact the sender by reply email and delete all
> copies of this message. Also, email is susceptible to data corruption,
> interception, tampering, unauthorized amendment and viruses. We only
> send and receive emails on the basis that we are not liable for any
> such corruption, interception, tampering, amendment or viruses or any
> consequence thereof.
--
Davanum Srinivas : http://wso2.com/ - Oxygenating The Web Service
Platform
-----------------------------------------
This email may contain confidential and privileged material for the
sole use of the intended recipient(s). Any review, use, retention,
distribution or disclosure by others is strictly prohibited. If you are
not the intended recipient (or authorized to receive for the
recipient), please contact the sender by reply email and delete all
copies of this message. Also, email is susceptible to data corruption,
interception, tampering, unauthorized amendment and viruses. We only
send and receive emails on the basis that we are not liable for any
such corruption, interception, tampering, amendment or viruses or any
consequence thereof.