Hello Axis Users!

I have run into a bit of a wall here and desperately need to some advice
on how to fix it. I have been looking through the archives quite a bit
and haven't found anything "quite" like this problem. I have done the
basic axis install to the tomcat webapp directories, I am using the
latest version of xerces (2.4) with tomcat 4.1.3. My "happy" page comes
up just fine:

##################BEGIN HAPPY.JSP

Found SAAJ API (javax.xml.soap.SOAPMessage) at
/home/tomcat/jakarta-tomcat-4.1.3/common/lib/saaj.jar
Found JAX-RPC API (javax.xml.rpc.Service) at
/home/tomcat/jakarta-tomcat-4.1.3/common/lib/jaxrpc-api.jar
Found Apache-Axis (org.apache.axis.transport.http.AxisServlet) at
/home/tomcat/jakarta-tomcat-4.1.3/webapps/axis/WEB-INF/lib/axis.jar
Found Jakarta-Commons Discovery (org.apache.commons.discovery.Resource)
at
/home/tomcat/jakarta-tomcat-4.1.3/webapps/axis/WEB-INF/lib/commons-disco
very.jar
Found Jakarta-Commons Logging (org.apache.commons.logging.Log) at
/home/tomcat/jakarta-tomcat-4.1.3/webapps/axis/WEB-INF/lib/commons-loggi
ng.jar
Found Log4j (org.apache.log4j.Layout) at
/home/tomcat/jakarta-tomcat-4.1.3/webapps/axis/WEB-INF/lib/log4j-1.2.4.j
ar
Found IBM's WSDL4Java (com.ibm.wsdl.factory.WSDLFactoryImpl) at
/home/tomcat/jakarta-tomcat-4.1.3/webapps/axis/WEB-INF/lib/wsdl4j.jar
Found JAXP implementation (javax.xml.parsers.SAXParserFactory)
Found Activation API (javax.activation.DataHandler) at
/home/tomcat/jakarta-tomcat-4.1.3/common/lib/activation.jar

################END HAPPY.JSP

And I have uncommented the administration servlet lines from web.xml
because I want to be able to deploy using wsdd.

So this all sounds like goodness right? 

The problem is when I attempt to click on the Administer Axis link on
the main axis page (axis webapp) the following exeption is printed. This
seems like the most basic functionality, the link is on the main page
for goodness sake!

org.apache.axis.deployment.wsdd.WSDDException: Invalid WSDD element
'service' (wanted 'deployment')

I have attempted to use the basic deployment.wsdd that is in the user
guide and I get the exact same error. 

################BEGIN DEPLOYMENT.WSDD

<deployment
    name="FirstService"
    xmlns="http://xml.apache.org/axis/wsdd/"; 
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"; 
    xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"; 
    xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance";> 
    
    <service name="MyService" provider="java:RPC">
        <namespace>http://meis/mailservlet/</namespace> 
        <parameter name="className"
value="com.noi.web.services.MyService"/>
        <parameter name="allowedMethods" value="*"/>
    </service>

</deployment>

################END DEPLOYMENT.WSDD

So when this didn't work I went to a programattic approach thinking, hey
I have heard rumblings about people who don't like the administrator, so
why not use the servlet init approach:

################BEGIN ServicesDeploymentServlet.java

/*
 * ServicesDeploymentServlet.java
 *
 * Created on April 1, 2003, 5:39 PM
 */

package com.noi.web.servlet;

import java.io.*;
import java.net.*;

import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.axis.transport.http.*;
import org.apache.axis.*;
import org.apache.axis.deployment.wsdd.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.*;

import com.noi.utility.data.*;


/**
 *
 * @author  clay
 * @version
 */
public class ServicesDeploymentServlet extends HttpServlet {
    
    /** 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) { 
           e.printStackTrace(); 
       } 
       try { 
           AxisEngine engine = axisServlet.getEngine(); 
           DocumentBuilderFactory fact =
DocumentBuilderFactory.newInstance(); 
           Document doc = null; 
           //this should be a resource
           DocumentBuilder builder = fact.newDocumentBuilder(); 
           fact.setNamespaceAware(true);
           URL deployURL = context.getResource("/wsdd/deploy.wsdd"); 
           XMLDocumentReader reader = new XMLDocumentReader();
           reader.parse(deployURL);          
           doc = reader.getDocument();
           
           Element element = doc.getDocumentElement(); 
           System.out.println ( "Element: " + element.getNodeName() ); 
            //-- prints out 'deployment' 
           WSDDDocument wsddDoc = new WSDDDocument(element);
           //--  EXCEPTION BEING THROWN HERE 
           EngineConfiguration config =
(EngineConfiguration)engine.getConfig(); 
           
           if ( config instanceof WSDDEngineConfiguration) { 
               WSDDDeployment deployment =
((WSDDEngineConfiguration)config).getDeployment(); 
               wsddDoc.deploy(deployment); 
           } 
           engine.refreshGlobalOptions(); 
           engine.saveConfiguration();
       }
        catch (IOException e) { 
               e.printStackTrace(); 
       } catch (ParserConfigurationException e) { 
           e.printStackTrace(); 
       } 
        
        
    }
    
    /** Destroys the servlet.
     */
    public void destroy() {
        
    }
    
    /** Processes requests for both HTTP <code>GET</code> and
<code>POST</code> methods.
     * @param request servlet request
     * @param response servlet response
     */
    protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
    throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.close();
    }
    
    /** Handles the HTTP <code>GET</code> method.
     * @param request servlet request
     * @param response servlet response
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse
response)
    throws ServletException, IOException {
        processRequest(request, response);
    }
    
    /** Handles the HTTP <code>POST</code> method.
     * @param request servlet request
     * @param response servlet response
     */
    protected void doPost(HttpServletRequest request,
HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    }
    
    /** Returns a short description of the servlet.
     */
    public String getServletInfo() {
        return "The Service Deployment Servlet";
    }
    
}
################END ServicesDeploymentServlet.java

EXACT SAME ERROR. I have tried so many things now I am at wit's end on
getting a wsdd to work. It seems that it barfing on the first tag, and
never even seing the deployment tag, so it gets lost. I guess I will
just have to use .jws files (that works) until this gets resovlved but
it seems to me to be a bad solution.

 
-----------------------------------------
Clay Graham
President
newObjectivity, Inc.
making the mobile-world-office
http://www.newobjectivity.com/


Reply via email to