You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by eddie johnston <ed...@ucd.ie> on 2003/05/04 15:28:28 UTC

servlets and services - desperate!

Aargh!!! 
	I've tried all of the suggestions from those who replied (thanks very
much by the way, I do appreciate the help and pointers!), but
unfortunately I'm still getting the error - "Unable to locate a valid
EngineConfigurationFactory" in my logs. There were some suggestions that
tomcat might not be able to find some classes, but I'm pretty sure that
it's something different thats the matter. The init methods below looks
like it should create that EngineConfigurationFactory, and I think that
its probably similar to what I should have, but I don't want to deploy a
service, just use one! Is there something obvious I'm missing (I'm quite
new to axis) - the code below points to a deploy.wsdd file, should I be
pointing to a similar file, only one used for consuming services that
are already deployed (I tried substituting the file below with the
client-deploy.wsdd but it still didn't work :-(

yours in frustration!
Eddie

On Fri, 2003-05-02 at 20:19, Sree Pillai wrote:
> Well.. I took the same code from the archives (thanks
> to somebody!) and was able to deploy a webservice as
> part of the init method. 
> 
> Here it goes - part of my DeploymentServlet.
> 
>     /** Initializes the servlet.
>      */
>     public void init(ServletConfig sconfig) throws
> ServletException {
>        super.init(sconfig);
> 		AxisServlet axisServlet = new AxisServlet();
>        ServletConfig sc = getServletConfig();
>        ServletContext context =
> this.getServletContext();
>        try {
>            axisServlet.init( sc );
>        } catch (ServletException e) {
> 		   getServletContext().log( "Exception " +
> e.toString() );
>        }
>        try {
>            AxisEngine engine =
> axisServlet.getEngine();
> 
>            String[] services = {"EnrollmentService"};
> 
>            for(int i=0; i<services.length; i++)
>            {
>                URL deployURL =
> context.getResource("/wsdd/"+services[i]+"-deploy.wsdd");
> 
> 				DocumentBuilderFactory dfactory =
> DocumentBuilderFactory.newInstance();
> 				DocumentBuilder docBuilder =
> dfactory.newDocumentBuilder();
> 				dfactory.setNamespaceAware(true);
> 				Document doc = docBuilder.parse(new InputSource(
> deployURL.toExternalForm()) );
> 
>                Element element =
> doc.getDocumentElement();
>                WSDDDocument wsddDoc = new
> WSDDDocument(element);
>                EngineConfiguration config =
> (EngineConfiguration)engine.getConfig();
> 
>                if ( config instanceof
> WSDDEngineConfiguration) {
>                    WSDDDeployment deployment =
> ((WSDDEngineConfiguration)config).getDeployment();
>                    wsddDoc.deploy(deployment);
>                }
>                engine.refreshGlobalOptions();
>                engine.saveConfiguration();
>            }
>        }
>        catch (Exception e) {
> 		   getServletContext().log( "Exception " +
> e.toString() );
>        }
>     }
> 
> 
> 
> 
> 
> 
> --- eddie johnston <ed...@ucd.ie> wrote:
> > I found something that may be relevant to the
> > problem I'm having in the archives.
> > As far as I can piece together, I have to use or
> > create an engine configuration when using 
> > axis with a servlet.I thought perhaps that the
> > adding the init method below to my servlet might
> > create an engine, but I'm stabbing blindly at this!
> > It doesn't work either. Would anyone 
> > know how I should go about creating (or retrieving)
> > an engine configuration for axis
> > so that I can use it with my servlet ? 
> > 
> > 
> > public void init(ServletConfig sconfig) throws
> > ServletException {
> >         super.init(sconfig);
> >         AxisServlet axisServlet = new AxisServlet();
> >         ServletConfig sC = getServletConfig();
> >         ServletContext context =
> > this.getServletContext();
> >         try{axisServlet.init(sC);}
> > catch(ServletException e){ e.printStackTrace(); }
> >         try{
> >             AxisEngine engine =
> > axisServlet.getEngine();
> >             EngineConfiguration config =
> > (EngineConfiguration)engine.getConfig();
> >             engine.refreshGlobalOptions();
> >             engine.saveConfiguration();
> >         }
> >         catch(Exception e){
> >             e.printStackTrace();
> >         }
> >     }
> > }
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
-- 
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Once in a while you get shown the Light,
In the Strangest of places if you look at it right
Grateful Dead, Scarlet Begonias