Return-Path: Delivered-To: apmail-incubator-beehive-dev-archive@www.apache.org Received: (qmail 60055 invoked from network); 9 Sep 2004 20:12:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Sep 2004 20:12:17 -0000 Received: (qmail 45760 invoked by uid 500); 9 Sep 2004 20:12:15 -0000 Delivered-To: apmail-incubator-beehive-dev-archive@incubator.apache.org Received: (qmail 45652 invoked by uid 500); 9 Sep 2004 20:12:13 -0000 Mailing-List: contact beehive-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: list-id: beehive-dev.incubator.apache.org Reply-To: "Beehive Developers" Delivered-To: mailing list beehive-dev@incubator.apache.org Received: (qmail 45626 invoked by uid 99); 9 Sep 2004 20:12:13 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [63.96.162.5] (HELO ussjmh01.bea.com) (63.96.162.5) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 09 Sep 2004 13:12:10 -0700 Received: from ussjfe02.amer.bea.com (ussjfe02b.bea.com [172.16.120.56]) by ussjmh01.bea.com (Switch-3.0.5/Switch-3.0.0) with ESMTP id i89KC8ZL007066 for ; Thu, 9 Sep 2004 13:12:08 -0700 Received: from USBOEX01.amer.bea.com ([10.36.32.15]) by ussjfe02.amer.bea.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 9 Sep 2004 13:12:07 -0700 Received: from [10.36.35.104] ([10.36.35.104]) by USBOEX01.amer.bea.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 9 Sep 2004 14:12:05 -0600 Message-ID: <4140B914.2080607@bea.com> Date: Thu, 09 Sep 2004 14:12:04 -0600 From: "Eddie O'Neil" User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Beehive Developers Subject: Re: svn commit: rev 43630 - in incubator/beehive/trunk/wsm: . lib src/runtime/org/apache/beehive/wsm/axis src/runtime/org/apache/beehive/wsm/util test test/webapps test/webapps/AnnotatedAxis test/webapps/AnnotatedAxis/WEB-INF test/webapps/AnnotatedAxis/WE References: <4B2B4C417991364996F035E1EE39E2E101E43F5A@uskiex01.amer.bea.com> In-Reply-To: <4B2B4C417991364996F035E1EE39E2E101E43F5A@uskiex01.amer.bea.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 09 Sep 2004 20:12:05.0520 (UTC) FILETIME=[46D4B100:01C496A9] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Jonathan-- Very cool, thanks! Certainly not a huge deal; just a consistency thing. :) Eddie Jonathan Colwell wrote: >Hi Eddie, > >I'll ask Michael to rearrange the jars and switch over to the common >log4j jar. > >When I tossed all these jars in there together I had just grabbed them >from the AXIS build and it was just too easy to grab the big pile of >libraries that I knew played well together. > >thanks, > >Jonathan > >-----Original Message----- >From: Eddie O'Neil >Sent: Thursday, September 09, 2004 12:54 PM >To: Beehive Dev >Subject: Re: svn commit: rev 43630 - in incubator/beehive/trunk/wsm: . >lib src/runtime/org/apache/beehive/wsm/axis >src/runtime/org/apache/beehive/wsm/util test test/webapps >test/webapps/AnnotatedAxis test/webapps/AnnotatedAxis/WEB-INF >test/webapps/AnnotatedAxis/WE > >Michael-- > > Hey, a couple of comments about this change: > >1) we're trying to use /external as the location of >externally referenced JARs rather than /lib. So, at least >according to the project layout plan on the wiki, the Axis JARs would >live there. >2) there's a copy of Log4J 1.2.8 available in $BEEHIVE_HOME/external, >and Beehive as a whole (at least as far as I know) is using this >version, so maybe WSM's Axis snapshot can also use the same version. > > Anyway, my $0.02. > >Thanks! > >Eddie > > > >mmerz@apache.org wrote: > > > >>Author: mmerz >>Date: Thu Sep 9 12:43:48 2004 >>New Revision: 43630 >> >>Added: >> incubator/beehive/trunk/wsm/lib/axis-ant.jar (contents, props >> >> >changed) > > >> incubator/beehive/trunk/wsm/lib/axis.jar (contents, props changed) >> incubator/beehive/trunk/wsm/lib/commons-discovery.jar (contents, >> >> >props changed) > > >> incubator/beehive/trunk/wsm/lib/commons-logging.jar (contents, >> >> >props changed) > > >> incubator/beehive/trunk/wsm/lib/jaxrpc.jar (contents, props >> >> >changed) > > >> incubator/beehive/trunk/wsm/lib/log4j-1.2.8.jar (contents, props >> >> >changed) > > >> incubator/beehive/trunk/wsm/lib/log4j.properties >> incubator/beehive/trunk/wsm/lib/saaj.jar (contents, props changed) >> incubator/beehive/trunk/wsm/lib/wsdl4j.jar (contents, props >> >> >changed) > > >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/Anno >tatedJWSHandler.java > > >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/Axis >Hook.java > > >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/Depl >oymentDumper.java > > >> incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/util/ >> >> >> >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/util/Clas >spathUtils.java > > >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/util/Java >ArchiveFilter.java > > >> incubator/beehive/trunk/wsm/test/ >> incubator/beehive/trunk/wsm/test/webapps/ >> incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/ >> incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/Foo.jws >> incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/ >> >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/ > > >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/Bar.java > > >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/Foo.java > > >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/dump.bat > > >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/setEnv.bat > > >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/classes/ > > >> incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/lib/ >> >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/lib/log4j >.properties > > >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/server-co >nfig.wsdd > > >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/web.xml > > >> incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/happyaxis.jsp >> incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/index.html >>Modified: >> incubator/beehive/trunk/wsm/build.xml >>Log: >>Initial checkin of code connecting the JSR-181 object model to AXIS. >> >> >More details about AXIS WSM can be found on the Beehive Wiki: >http://wiki.apache.org/beehive/axis_2dspecific_20implementation > > >>Contributor: Jonathan Colwell >> >> >> >>Modified: incubator/beehive/trunk/wsm/build.xml >>======================================================================= >> >> >======= > > >>--- incubator/beehive/trunk/wsm/build.xml (original) >>+++ incubator/beehive/trunk/wsm/build.xml Thu Sep 9 12:43:48 2004 >>@@ -31,6 +31,11 @@ >> >> >> >>+ >>+ >>+ >>+ >>+ >> >> >> >>@@ -38,7 +43,11 @@ >> >> >> >>+ >>+ >> >>+ >>+ >> >> >> >>@@ -51,10 +60,28 @@ >> >> >> >>- >>- >>+ >>+ >>+ >> >> >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >> > > >> >> > > >>@@ -69,18 +96,26 @@ >> > >> >message="--------------------------------------------------------------- >-" /> > > >> > > >> > >> >message="--------------------------------------------------------------- >-" /> > > >>- >>+ > >> >/> > > >>+ > > >>+ >> >>- >>+ > > >>+ >> > > >> >>- > > >>+ > > >>+ >> >> > >> >message="--------------------------------------------------------------- >-" /> > > >> > > >> > >> >message="--------------------------------------------------------------- >-" /> > > >> > > >>- > > >>+ > > >>+ > > >>+ > > >>+ > > >>+ > > >> > >> >message="=============================================================== >=" /> > > >> > > >> > >> >message="=============================================================== >=" /> > > >>@@ -101,30 +136,43 @@ >> > > >> >> > > >>- >>- >>+ >>+ >>+ >>+ > >> >includes="**/*.template,**/*.vm,META-INF/**" /> > > >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >> >> > >> >source="1.5" debug="on" > > > >> >> >>+ >> >>+ >> >> > >> >classpathref="runtime.classpath" source="1.5" debug="on"> > > >> >>+ >> >>+ >> >>- >>- >>- > >> >includes="**/*.template,**/*.vm,META-INF/**" /> > > >>- >>+ >>+ >>+ > >> >source="1.5" debug="on"> > > >>+ >>+ >>+ >>+ >> >>- >>- >>- >>- >> >> >>- >> >> > > >> >>@@ -136,7 +184,9 @@ >> >> >> >>- >>+ >>+ >>+ >> >> >> > >> >/> > > >>@@ -145,12 +195,28 @@ >> >> >> >>+ >>+ > >> >/> > > >>+ > > >>+ > >> >/> > > >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ > >> >/> > > >>+ > > >>+ > >> >/> > > >>+ >>+ >>+ >> > > >> > > >> > > >>- >>- >>- >>+ >>+ >> >> > > >> >>@@ -188,13 +254,23 @@ >> > > >> >> > > >>- >>+ >> > >> >/> > > >> >> > >> >/> > > >>- > > >>- >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >+ todir="${webapps.dist.dir}/${axis.dir}/WEB-INF/lib"/> >> > >> >/> > > >> >> > >> >/> > > >>@@ -248,8 +324,8 @@ >> > > >> >> > > >>- >>- >>+ >>+ >> >> >> >> >>Added: incubator/beehive/trunk/wsm/lib/axis-ant.jar >>======================================================================= >> >> >======= > > >>Binary file. No diff available. >> >>Added: incubator/beehive/trunk/wsm/lib/axis.jar >>======================================================================= >> >> >======= > > >>Binary file. No diff available. >> >>Added: incubator/beehive/trunk/wsm/lib/commons-discovery.jar >>======================================================================= >> >> >======= > > >>Binary file. No diff available. >> >>Added: incubator/beehive/trunk/wsm/lib/commons-logging.jar >>======================================================================= >> >> >======= > > >>Binary file. No diff available. >> >>Added: incubator/beehive/trunk/wsm/lib/jaxrpc.jar >>======================================================================= >> >> >======= > > >>Binary file. No diff available. >> >>Added: incubator/beehive/trunk/wsm/lib/log4j-1.2.8.jar >>======================================================================= >> >> >======= > > >>Binary file. No diff available. >> >>Added: incubator/beehive/trunk/wsm/lib/log4j.properties >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ incubator/beehive/trunk/wsm/lib/log4j.properties Thu Sep 9 >> >> >12:43:48 2004 > > >>@@ -0,0 +1,20 @@ >>+# Set root category priority to INFO and its only appender to CONSOLE. >> >>+log4j.rootCategory=INFO, CONSOLE >> >>+#log4j.rootCategory=INFO, CONSOLE, LOGFILE >> >>+ >> >>+# Set the enterprise logger category to FATAL and its only appender to >> >> >CONSOLE. > > >>+log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE >> >>+ >> >>+# CONSOLE is set to be a ConsoleAppender using a PatternLayout. >> >>+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender >> >>+log4j.appender.CONSOLE.Threshold=INFO >> >>+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout >> >>+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n >> >>+ >> >>+# LOGFILE is set to be a File appender using a PatternLayout. >> >>+log4j.appender.LOGFILE=org.apache.log4j.FileAppender >> >>+log4j.appender.LOGFILE.File=axis.log >> >>+log4j.appender.LOGFILE.Append=true >> >>+log4j.appender.LOGFILE.Threshold=INFO >> >>+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout >> >>+log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - >> >> >%m%n > > >>Added: incubator/beehive/trunk/wsm/lib/saaj.jar >>======================================================================= >> >> >======= > > >>Binary file. No diff available. >> >>Added: incubator/beehive/trunk/wsm/lib/wsdl4j.jar >>======================================================================= >> >> >======= > > >>Binary file. No diff available. >> >>Added: >> >> >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/Anno >tatedJWSHandler.java > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/Anno >tatedJWSHandler.java Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,459 @@ >>+/* >> >>+ * Copyright 2001-2004 The Apache Software Foundation. >> >>+ * >> >>+ * Licensed under the Apache License, Version 2.0 (the "License"); >> >>+ * you may not use this file except in compliance with the License. >> >>+ * You may obtain a copy of the License at >> >>+ * >> >>+ * http://www.apache.org/licenses/LICENSE-2.0 >> >>+ * >> >>+ * Unless required by applicable law or agreed to in writing, software >> >>+ * distributed under the License is distributed on an "AS IS" BASIS, >> >>+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >> >> >implied. > > >>+ * See the License for the specific language governing permissions and >> >>+ * limitations under the License. >> >>+ */ >> >>+ >> >>+package org.apache.beehive.wsm.axis; >> >>+ >> >>+import org.apache.beehive.wsm.jsr181.model.WebServiceTYPEMetadata; >> >>+import org.apache.beehive.wsm.jsr181.model.WebServiceMETHODMetadata; >> >>+import >> >> >org.apache.beehive.wsm.jsr181.model.WebServicePARAMETERMetadata; > > >>+import >> >> >org.apache.beehive.wsm.jsr181.processor.reflection.WsmReflectionAnnotati >onProcessor; > > >>+ >> >>+import java.io.File; >> >>+import java.io.FileFilter; >> >>+import java.io.FileInputStream; >> >>+import java.io.FileReader; >> >>+import java.io.FileWriter; >> >>+import java.io.IOException; >> >>+import java.io.InputStream; >> >>+import java.io.FileNotFoundException; >> >>+import java.net.URL; >> >>+import java.net.URLClassLoader; >> >>+import java.net.URLDecoder; >> >>+import java.util.HashMap; >> >>+import java.util.Iterator; >> >>+import java.util.List; >> >>+import java.util.StringTokenizer; >> >>+import java.util.jar.Attributes; >> >>+import java.util.jar.JarFile; >> >>+import java.util.jar.JarInputStream; >> >>+import java.util.jar.Manifest; >> >>+ >> >>+import org.apache.axis.AxisFault; >> >>+import org.apache.axis.AxisProperties; >> >>+import org.apache.axis.Constants; >> >>+import org.apache.axis.MessageContext; >> >>+import org.apache.axis.components.compiler.Compiler; >> >>+import org.apache.axis.components.compiler.CompilerError; >> >>+import org.apache.axis.components.compiler.CompilerFactory; >> >>+import org.apache.axis.components.logger.LogFactory; >> >>+import org.apache.axis.description.ServiceDesc; >> >>+import org.apache.axis.handlers.JWSHandler; >> >>+import org.apache.axis.handlers.soap.SOAPService; >> >>+import org.apache.axis.providers.java.RPCProvider; >> >>+import org.apache.axis.transport.http.HTTPConstants; >> >>+import org.apache.axis.utils.ClassUtils; >> >>+import org.apache.axis.utils.JWSClassLoader; >> >>+import org.apache.axis.utils.Messages; >> >>+import org.apache.axis.utils.XMLUtils; >> >>+import org.apache.beehive.wsm.util.ClasspathUtils; >> >>+import org.apache.commons.logging.Log; >> >>+import org.w3c.dom.Document; >> >>+import org.w3c.dom.Element; >> >>+ >> >>+/********************************************************************* >> >> >********** > > >>+ * A few annotation specific things added and lots of code copied >> >>+ * from the JWSHandler base class by >> >>+ * >> >>+ * @author Jonathan Colwell (jcolwell@bea.com) >> >>+ * >> >>+ * but most of the code was written by: >> >>+ * @author Glen Daniels (gdaniels@allaire.com) >> >>+ * @author Doug Davis (dug@us.ibm.com) >> >>+ * @author Sam Ruby (rubys@us.ibm.com) >> >>+ * >> >>+ */ >> >>+public class AnnotatedJWSHandler extends JWSHandler { >> >>+ >> >>+ >> >>+ /** >> >>+ * If our path ends in the right file extension (*.jws), handle all >> >> >the > > >>+ * work necessary to compile the source file if it needs it, and set >> >>+ * up the "proxy" RPC service surrounding it as the MessageContext's >> >>+ * active service. >> >>+ * >> >>+ */ >> >>+ protected void setupService(MessageContext msgContext) throws >> >> >Exception { > > >>+ // FORCE the targetService to be JWS if the URL is right. >> >>+ String realpath = msgContext.getStrProp(Constants.MC_REALPATH); >> >>+ String extension = (String)getOption(OPTION_JWS_FILE_EXTENSION); >> >>+ if (extension == null) extension = DEFAULT_JWS_FILE_EXTENSION; >> >>+ >> >>+ if ((realpath!=null) && (realpath.endsWith(extension))) { >> >>+ /* Grab the *.jws filename from the context - should have been >> >> >*/ > > >>+ /* placed there by another handler (ie. HTTPActionHandler) >> >> >*/ > > >>+ >> >> >/***************************************************************/ > > >>+ String jwsFile = realpath; >> >>+ String rel = msgContext.getStrProp(Constants.MC_RELATIVE_PATH); >> >>+ >> >>+ // Check for file existance, report error with >> >>+ // relative path to avoid giving out directory info. >> >>+ File f2 = new File( jwsFile ); >> >>+ if (!f2.exists()) { >> >>+ throw new FileNotFoundException(rel); >> >>+ } >> >>+ >> >>+ if (rel.charAt(0) == '/') { >> >>+ rel = rel.substring(1); >> >>+ } >> >>+ >> >>+ int lastSlash = rel.lastIndexOf('/'); >> >>+ String dir = null; >> >>+ >> >>+ if (lastSlash > 0) { >> >>+ dir = rel.substring(0, lastSlash); >> >>+ } >> >>+ >> >>+ String file = rel.substring(lastSlash + 1); >> >>+ >> >>+ String outdir = msgContext.getStrProp( Constants.MC_JWS_CLASSDIR >> >> >); > > >>+ if ( outdir == null ) outdir = "." ; >> >>+ >> >>+ // Build matching directory structure under the output >> >>+ // directory. In other words, if we have: >> >>+ // /webroot/jws1/Foo.jws >> >>+ // >> >>+ // That will be compiled to: >> >>+ // .../jwsOutputDirectory/jws1/Foo.class >> >>+ if (dir != null) { >> >>+ outdir = outdir + File.separator + dir; >> >>+ } >> >>+ >> >>+ // Confirm output directory exists. If not, create it IF we're >> >>+ // allowed to. >> >>+ // !!! TODO: add a switch to control this. >> >>+ File outDirectory = new File(outdir); >> >>+ if (!outDirectory.exists()) { >> >>+ outDirectory.mkdirs(); >> >>+ } >> >>+ >> >>+ if (log.isDebugEnabled()) >> >>+ log.debug("jwsFile: " + jwsFile ); >> >>+ >> >>+ String jFile = outdir + File.separator + file.substring(0, >> >> >file.length()-3) + > > >>+ "java" ; >> >>+ String cFile = outdir + File.separator + file.substring(0, >> >> >file.length()-3) + > > >>+ "class" ; >> >>+ >> >>+ if (log.isDebugEnabled()) { >> >>+ log.debug("jFile: " + jFile ); >> >>+ log.debug("cFile: " + cFile ); >> >>+ log.debug("outdir: " + outdir); >> >>+ } >> >>+ >> >>+ File f1 = new File( cFile ); >> >>+ >> >>+ /* Get the class */ >> >>+ /*****************/ >> >>+ String clsName = null ; >> >>+ //clsName = msgContext.getStrProp(Constants.MC_RELATIVE_PATH); >> >>+ if ( clsName == null ) clsName = f2.getName(); >> >>+ if ( clsName != null && clsName.charAt(0) == '/' ) >> >>+ clsName = clsName.substring(1); >> >>+ >> >>+ clsName = clsName.substring( 0, clsName.length()-4 ); >> >>+ clsName = clsName.replace('/', '.'); >> >>+ >> >>+ if (log.isDebugEnabled()) >> >>+ log.debug("ClsName: " + clsName ); >> >>+ >> >>+ /* Check to see if we need to recompile */ >> >>+ /****************************************/ >> >>+ if ( !f1.exists() || f2.lastModified() > f1.lastModified() ) { >> >>+ /* If the class file doesn't exist, or it's older than the */ >> >>+ /* java file then recompile the java file. */ >> >>+ /* Start by copying the *.jws file to *.java */ >> >>+ /***********************************************************/ >> >>+ log.debug(Messages.getMessage("compiling00", jwsFile) ); >> >>+ log.debug(Messages.getMessage("copy00", jwsFile, jFile) ); >> >>+ FileReader fr = new FileReader( jwsFile ); >> >>+ FileWriter fw = new FileWriter( jFile ); >> >>+ char[] buf = new char[4096]; >> >>+ int rc ; >> >>+ while ( (rc = fr.read( buf, 0, 4095)) >= 0 ) >> >>+ fw.write( buf, 0, rc ); >> >>+ fw.close(); >> >>+ fr.close(); >> >>+ >> >>+ /* Now run javac on the *.java file */ >> >>+ /************************************/ >> >>+ log.debug("javac " + jFile ); >> >>+ // Process proc = rt.exec( "javac " + jFile ); >> >>+ // proc.waitFor(); >> >>+ Compiler compiler = CompilerFactory.getCompiler(); >> >>+ >> >>+ compiler.setClasspath(getDefaultClasspath(msgContext)); >> >>+ compiler.setDestination(outdir); >> >>+ compiler.addFile(jFile); >> >>+ >> >>+ boolean result = compiler.compile(); >> >>+ >> >>+ /* Delete the temporary *.java file and check return code */ >> >>+ /**********************************************************/ >> >>+ (new File(jFile)).delete(); >> >>+ >> >>+ if ( !result ) { >> >>+ /* Delete the *class file - sometimes it gets created even >> >> >*/ > > >>+ /* when there are errors - so erase it so it doesn't >> >> >*/ > > >>+ /* confuse us. >> >> >*/ > > >>+ >> >> >/***********************************************************/ > > >>+ (new File(cFile)).delete(); >> >>+ >> >>+ Document doc = XMLUtils.newDocument(); >> >>+ >> >>+ Element root = doc.createElementNS("", "Errors"); >> >>+ StringBuffer message = new StringBuffer("Error compiling "); >> >>+ message.append(jFile); >> >>+ message.append(":\n"); >> >>+ >> >>+ List errors = compiler.getErrors(); >> >>+ int count = errors.size(); >> >>+ for (int i = 0; i < count; i++) { >> >>+ CompilerError error = (CompilerError) errors.get(i); >> >>+ if (i > 0) message.append("\n"); >> >>+ message.append("Line "); >> >>+ message.append(error.getStartLine()); >> >>+ message.append(", column "); >> >>+ message.append(error.getStartColumn()); >> >>+ message.append(": "); >> >>+ message.append(error.getMessage()); >> >>+ } >> >>+ root.appendChild( doc.createTextNode( message.toString() ) >> >> >); > > >>+ throw new AxisFault( "Server.compileError", >> >>+ Messages.getMessage("badCompile00", >> >> >jFile), > > >>+ null, new Element[] { root } ); >> >>+ } >> >>+ ClassUtils.removeClassLoader( clsName ); >> >>+ // And clean out the cached service. >> >>+ soapServices.remove(clsName); >> >>+ } >> >>+ >> >>+ ClassLoader cl = ClassUtils.getClassLoader(clsName); >> >>+ if (cl == null) { >> >>+ cl = new JWSClassLoader(clsName, >> >>+ msgContext.getClassLoader(), >> >>+ cFile); >> >>+ } >> >>+ >> >>+ msgContext.setClassLoader(cl); >> >>+ >> >>+ WebServiceTYPEMetadata wsm = WsmReflectionAnnotationProcessor >> >>+ .getObjectModel(cl.loadClass(clsName)); >> >>+ >> >>+ /* Create a new RPCProvider - this will be the "service" */ >> >>+ /* that we invoke. >> >> >*/ > > >>+ >> >> >/******************************************************************/ > > >>+ // Cache the rpc service created to handle the class. The cache >> >>+ // is based on class name, so only one .jws/.jwr class can be >> >> >active > > >>+ // in the system at a time. >> >>+ SOAPService rpc = (SOAPService)soapServices.get(clsName); >> >>+ if (rpc == null) { >> >>+ rpc = new SOAPService(new RPCProvider()); >> >>+ rpc.setName(wsm.getWsName()); >> >>+ rpc.setOption(RPCProvider.OPTION_CLASSNAME, clsName ); >> >>+ rpc.setEngine(msgContext.getAxisEngine()); >> >>+ >> >>+ /* Support specification of "allowedMethods" as a parameter. >> >>+ String allowed = >> >> >(String)getOption(RPCProvider.OPTION_ALLOWEDMETHODS); > > >>+ if (allowed == null) allowed = "*"; >> >>+ */ >> >>+ >> >>+ >> >>+ // Take the setting for the scope option from the handler >> >>+ // parameter named "scope" >> >>+ String scope = (String)getOption(RPCProvider.OPTION_SCOPE); >> >>+ if (scope == null) scope = "Request"; >> >>+ rpc.setOption(RPCProvider.OPTION_SCOPE, scope); >> >>+ >> >>+ ServiceDesc sd = AxisHook.createServiceDesc(wsm, cl); >> >>+ rpc.setServiceDescription(sd); >> >>+ >> >>+ List allowedMethodNames = sd.getAllowedMethods(); >> >>+ Iterator allowIt = allowedMethodNames.iterator(); >> >>+ StringBuffer sb = new StringBuffer(); >> >>+ boolean firstPass = true; >> >>+ while (allowIt.hasNext()) { >> >>+ if (firstPass) { >> >>+ sb.append(' '); >> >>+ firstPass = false; >> >>+ } >> >>+ sb.append(((String)allowIt.next())); >> >>+ } >> >>+ rpc.setOption(RPCProvider.OPTION_ALLOWEDMETHODS, >> >> >sb.toString()); > > >>+ rpc.setOption(RPCProvider.OPTION_WSDL_PORTTYPE, >> >> >wsm.getWsName()); > > >>+ rpc.setOption(RPCProvider.OPTION_WSDL_SERVICEELEMENT, >> >>+ wsm.getWsServiceName()); >> >>+ rpc.setOption(RPCProvider.OPTION_WSDL_TARGETNAMESPACE, >> >>+ wsm.getWsTargetNamespace()); >> >>+ >> >>+ rpc.setStyle(sd.getStyle()); >> >>+ rpc.setUse(sd.getUse()); >> >>+ >> >>+ // NOTE jcolwell@bea.com 2004-Aug-16 -- not needed anymore I >> >> >think > > >>+ //rpc.getInitializedServiceDesc(msgContext); >> >>+ >> >>+ soapServices.put(clsName, rpc); >> >>+ } >> >>+ >> >>+ // Set engine, which hooks up type mappings. >> >>+ rpc.setEngine(msgContext.getAxisEngine()); >> >>+ >> >>+ rpc.init(); // ?? >> >>+ >> >>+ // OK, this is now the destination service! >> >>+ msgContext.setService( rpc ); >> >>+ } >> >>+ >> >>+ if (log.isDebugEnabled()) { >> >>+ log.debug("Exit: JWSHandler::invoke"); >> >>+ } >> >>+ } >> >>+ >> >>+ private String getDefaultClasspath(MessageContext msgContext) >> >>+ { >> >>+ StringBuffer classpath = new StringBuffer(); >> >>+ >> >>+ ClassLoader cl = Thread.currentThread().getContextClassLoader(); >> >>+ fillClassPath(cl, classpath); >> >>+ >> >>+ // Just to be safe (the above doesn't seem to return the webapp >> >>+ // classpath in all cases), manually do this: >> >>+ >> >>+ String webBase = (String)msgContext.getProperty( >> >>+ >> >> >HTTPConstants.MC_HTTP_SERVLETLOCATION); > > >>+ if (webBase != null) { >> >>+ classpath.append(webBase + File.separatorChar + "classes" + >> >>+ File.pathSeparatorChar); >> >>+ try { >> >>+ String libBase = webBase + File.separatorChar + "lib"; >> >>+ File libDir = new File(libBase); >> >>+ String [] jarFiles = libDir.list(); >> >>+ for (int i = 0; i < jarFiles.length; i++) { >> >>+ String jarFile = jarFiles[i]; >> >>+ if (jarFile.endsWith(".jar")) { >> >>+ classpath.append(libBase + >> >>+ File.separatorChar + >> >>+ jarFile + >> >>+ File.pathSeparatorChar); >> >>+ } >> >>+ } >> >>+ } catch (Exception e) { >> >>+ // Oh well. No big deal. >> >>+ } >> >>+ } >> >>+ >> >>+ // axis.ext.dirs can be used in any appserver >> >>+ getClassPathFromDirectoryProperty(classpath, "axis.ext.dirs"); >> >>+ >> >>+ // classpath used by Jasper >> >>+ getClassPathFromProperty(classpath, >> >> >"org.apache.catalina.jsp_classpath"); > > >>+ >> >>+ // websphere stuff. >> >>+ getClassPathFromProperty(classpath, "ws.ext.dirs"); >> >>+ getClassPathFromProperty(classpath, >> >> >"com.ibm.websphere.servlet.application.classpath"); > > >>+ >> >>+ // java class path >> >>+ getClassPathFromProperty(classpath, "java.class.path"); >> >>+ >> >>+ // Load jars from java external directory >> >>+ getClassPathFromDirectoryProperty(classpath, "java.ext.dirs"); >> >>+ >> >>+ // boot classpath isn't found in above search >> >>+ getClassPathFromProperty(classpath, "sun.boot.class.path"); >> >>+ >> >>+ return classpath.toString(); >> >>+ } >> >>+ >> >>+ private void getClassPathFromDirectoryProperty(StringBuffer >> >> >classpath, String property) { > > >>+ String dirs = AxisProperties.getProperty(property); >> >>+ String path = null; >> >>+ try { >> >>+ path = ClasspathUtils.expandDirs(dirs); >> >>+ } catch (Exception e) { >> >>+ // Oh well. No big deal. >> >>+ } >> >>+ if( path!= null) { >> >>+ classpath.append(path); >> >>+ classpath.append(File.pathSeparatorChar); >> >>+ } >> >>+ } >> >>+ >> >>+ private void getClassPathFromProperty(StringBuffer classpath, String >> >> >property) { > > >>+ String path = AxisProperties.getProperty(property); >> >>+ if( path != null) { >> >>+ classpath.append(path); >> >>+ classpath.append(File.pathSeparatorChar); >> >>+ } >> >>+ } >> >>+ >> >>+ /** >> >>+ * Walk the classloader hierarchy and add to the classpath >> >>+ * >> >>+ * @param cl >> >>+ * @param classpath >> >>+ */ >> >>+ private void fillClassPath(ClassLoader cl, StringBuffer classpath) { >> >>+ while (cl != null) { >> >>+ if (cl instanceof URLClassLoader) { >> >>+ URL[] urls = ((URLClassLoader) cl).getURLs(); >> >>+ for (int i = 0; (urls != null) && i < urls.length; i++) { >> >>+ String path = urls[i].getPath(); >> >>+ //If it is a drive letter, adjust accordingly. >> >>+ if (path.length() >= 3 && path.charAt(0) == '/' && >> >> >path.charAt(2) == ':') > > >>+ path = path.substring(1); >> >>+ classpath.append(URLDecoder.decode(path)); >> >>+ classpath.append(File.pathSeparatorChar); >> >>+ >> >>+ // if its a jar extract Class-Path entries from manifest >> >>+ File file = new File(urls[i].getFile()); >> >>+ if (file.isFile()) { >> >>+ FileInputStream fis = null; >> >>+ try { >> >>+ fis = new FileInputStream(file); >> >>+ >> >>+ if (isJar(fis)) { >> >>+ JarFile jar = new JarFile(file); >> >>+ Manifest manifest = jar.getManifest(); >> >>+ if (manifest != null) { >> >>+ Attributes attributes = >> >> >manifest.getMainAttributes(); > > >>+ if (attributes != null) { >> >>+ String s = >> >> >attributes.getValue(Attributes.Name.CLASS_PATH); > > >>+ String base = file.getParent(); >> >>+ >> >>+ if (s != null) { >> >>+ StringTokenizer st = new StringTokenizer(s, " >> >> >"); > > >>+ while (st.hasMoreTokens()) { >> >>+ String t = st.nextToken(); >> >>+ classpath.append(base + File.separatorChar + >> >> >t); > > >>+ classpath.append(File.pathSeparatorChar); >> >>+ } >> >>+ } >> >>+ } >> >>+ } >> >>+ } >> >>+ } catch (IOException ioe) { >> >>+ if (fis != null) >> >>+ try { >> >>+ fis.close(); >> >>+ } catch (IOException ioe2) { >> >>+ } >> >>+ } >> >>+ } >> >>+ } >> >>+ } >> >>+ cl = cl.getParent(); >> >>+ } >> >>+ } >> >>+} >> >> >>Added: >> >> >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/Axis >Hook.java > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/Axis >Hook.java Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,140 @@ >>+/* >> >>+ * Copyright 2001-2004 The Apache Software Foundation. >> >>+ * >> >>+ * Licensed under the Apache License, Version 2.0 (the "License"); >> >>+ * you may not use this file except in compliance with the License. >> >>+ * You may obtain a copy of the License at >> >>+ * >> >>+ * http://www.apache.org/licenses/LICENSE-2.0 >> >>+ * >> >>+ * Unless required by applicable law or agreed to in writing, software >> >>+ * distributed under the License is distributed on an "AS IS" BASIS, >> >>+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >> >> >implied. > > >>+ * See the License for the specific language governing permissions and >> >>+ * limitations under the License. >> >>+ */ >> >>+ >> >>+package org.apache.beehive.wsm.axis; >> >>+ >> >>+import java.lang.reflect.Method; >> >>+import java.util.ArrayList; >> >>+import java.util.Collection; >> >>+import java.util.List; >> >>+ >> >>+import javax.xml.namespace.QName; >> >>+ >> >>+import org.apache.axis.wsdl.fromJava.Emitter; >> >>+import org.apache.axis.encoding.DefaultSOAPEncodingTypeMappingImpl; >> >>+import org.apache.axis.description.ServiceDesc; >> >>+import org.apache.axis.description.JavaServiceDesc; >> >>+import org.apache.axis.description.ParameterDesc; >> >>+import org.apache.axis.description.OperationDesc; >> >>+import org.apache.beehive.wsm.jsr181.model.WebServiceTYPEMetadata; >> >>+import org.apache.beehive.wsm.jsr181.model.WebServiceMETHODMetadata; >> >>+import >> >> >org.apache.beehive.wsm.jsr181.model.WebServicePARAMETERMetadata; > > >>+ >> >>+import javax.jws.WebParam; >> >>+ >> >>+/********************************************************************* >> >> >********** > > >>+ * >> >>+ * >> >>+ * @author Jonathan Colwell >> >>+ */ >> >>+public class AxisHook { >> >>+ >> >>+ public static ServiceDesc createServiceDesc(WebServiceTYPEMetadata >> >> >wsm, > > >>+ ClassLoader cl) >> >>+ throws ClassNotFoundException, NoSuchMethodException >> >>+ { >> >>+ >> >>+ JavaServiceDesc sd = new JavaServiceDesc(); >> >>+ >> >>+ if (cl == null) { >> >>+ /* >> >>+ * NOTE jcolwell@bea.com 2004-Aug-30 -- if no classloader >> >>+ * was provided, use the one that loaded this Class >> >>+ */ >> >>+ cl = AxisHook.class.getClassLoader(); >> >>+ } >> >>+ >> >>+ Class serviceClass = cl.loadClass(wsm.getJavaFQClassName()); >> >>+ >> >>+ String portType = wsm.getWsName(); >> >>+ sd.setName(portType); >> >>+ sd.setImplClass(serviceClass); >> >>+ >> >>+ String targetNamespace = wsm.getWsTargetNamespace(); >> >>+ sd.setDefaultNamespace(targetNamespace); >> >>+ >> >>+ Collection methods = >> >> >wsm.getMethods(); > > >>+ List allowedMethods = new ArrayList(); >> >>+ for (WebServiceMETHODMetadata meth : methods) { >> >>+ >> >>+ String operationName = meth.getWmOperationName(); >> >>+ >> >>+ if (operationName != null && operationName.length() > 0) { >> >>+ >> >>+ OperationDesc od = new OperationDesc(); >> >>+ >> >>+ String javaMethodName = meth.getJavaMethodName(); >> >>+ od.setElementQName(new QName(operationName)); >> >>+ od.setName(javaMethodName); >> >>+ allowedMethods.add(javaMethodName); >> >>+ >> >>+ od.setSoapAction(meth.getWmAction()); >> >>+ >> >>+ od.setReturnQName(new QName(meth.getWrName())); >> >>+ >> >>+ od.setReturnClass(meth.getJavaReturnType()); >> >>+ // od.setReturnHeader( >> >>+ >> >>+ List parameters = >> >> >meth.getParams(); > > >>+ List paramClasses = new ArrayList(); >> >> > > > >>+ >> >>+ for (WebServicePARAMETERMetadata param : parameters) { >> >>+ >> >>+ ParameterDesc pd = new ParameterDesc(); >> >>+ pd.setName(param.getWpName()); >> >>+ Class paramType = param.getJavaType(); >> >>+ pd.setJavaType(paramType); >> >>+ paramClasses.add(paramType); >> >>+ >> >>+ WebParam.Mode mo = param.getWpMode(); >> >>+ switch (mo) { >> >>+ case OUT: >> >>+ pd.setMode(ParameterDesc.OUT); >> >>+ pd.setInHeader(false); >> >>+ pd.setOutHeader(param.isWpHeader()); >> >>+ break; >> >>+ >> >>+ case INOUT: >> >>+ pd.setMode(ParameterDesc.INOUT); >> >>+ boolean header = param.isWpHeader(); >> >>+ pd.setInHeader(header); >> >>+ pd.setOutHeader(header); >> >>+ break; >> >>+ >> >>+ case IN: >> >>+ default: >> >>+ pd.setMode(ParameterDesc.IN); >> >>+ pd.setInHeader(param.isWpHeader()); >> >>+ pd.setOutHeader(false); >> >>+ } >> >>+ od.addParameter(pd); >> >>+ } >> >>+ >> >>+ Method javaMethod = serviceClass >> >>+ .getMethod(meth.getJavaMethodName(), >> >>+ paramClasses.toArray(new >> >> >Class[paramClasses.size()])); > > >>+ >> >>+ od.setMethod(javaMethod); >> >>+ >> >>+ sd.addOperationDesc(od); >> >>+ } >> >>+ } >> >>+ sd.setAllowedMethods(allowedMethods); >> >>+ >> >>+ return sd; >> >>+ } >> >>+} >> >>+ >> >> >>Added: >> >> >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/Depl >oymentDumper.java > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/Depl >oymentDumper.java Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,200 @@ >>+/* >> >>+ * DeploymentDumper.java >> >>+ * >> >>+ * Copyright 2001-2004 The Apache Software Foundation. >> >>+ * >> >>+ * >> >>+ * Licensed under the Apache License, Version 2.0 (the "License"); >> >>+ * you may not use this file except in compliance with the License. >> >>+ * You may obtain a copy of the License at >> >>+ * >> >>+ * http://www.apache.org/licenses/LICENSE-2.0 >> >>+ * >> >>+ * Unless required by applicable law or agreed to in writing, software >> >>+ * distributed under the License is distributed on an "AS IS" BASIS, >> >>+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >> >> >implied. > > >>+ * See the License for the specific language governing permissions and >> >>+ * limitations under the License. >> >>+ * >> >>+ * >> >>+ * Original author: Jonathan Colwell >> >>+ */ >> >>+package org.apache.beehive.wsm.axis; >> >>+ >> >>+import com.sun.tools.apt.main.Main; >> >>+ >> >>+import java.lang.reflect.Method; >> >>+import java.io.FileOutputStream; >> >>+import java.io.OutputStreamWriter; >> >>+import java.io.Writer; >> >>+import java.util.ArrayList; >> >>+import java.util.Collection; >> >>+import java.util.List; >> >>+import java.util.Set; >> >>+ >> >>+import javax.xml.namespace.QName; >> >>+import javax.jws.WebParam; >> >>+ >> >>+import org.apache.axis.server.AxisServer; >> >>+import org.apache.axis.configuration.FileProvider; >> >>+import org.apache.axis.deployment.wsdd.WSDDDeployment; >> >>+import org.apache.axis.deployment.wsdd.WSDDOperation; >> >>+import org.apache.axis.deployment.wsdd.WSDDService; >> >>+import org.apache.axis.description.JavaServiceDesc; >> >>+import org.apache.axis.description.ServiceDesc; >> >>+import org.apache.axis.description.OperationDesc; >> >>+import org.apache.axis.description.ParameterDesc; >> >>+import org.apache.axis.encoding.SerializationContext; >> >>+import org.apache.axis.handlers.soap.SOAPService; >> >>+import org.apache.axis.providers.java.RPCProvider; >> >>+import org.apache.beehive.wsm.jsr181.model.WebServiceTYPEMetadata; >> >>+import org.apache.beehive.wsm.jsr181.model.WebServiceMETHODMetadata; >> >>+import >> >> >org.apache.beehive.wsm.jsr181.model.WebServicePARAMETERMetadata; > > >>+import >> >> >org.apache.beehive.wsm.jsr181.processor.apt.WsmAnnotationProcessor; > > >>+ >> >>+/********************************************************************* >> >> >********** > > >>+ * >> >>+ * >> >>+ * @author Jonathan Colwell >> >>+ */ >> >>+public class DeploymentDumper { >> >>+ >> >>+ /** >> >>+ * FIXME jcolwell@bea.com 2004-Sep-08 -- come up with a better >> >> >solution for > > >>+ * providing the args to APT as well as providing the WSDD file >> >> >names > > >>+ * >> >>+ * Currently, the usage is: >> >>+ * >> >> > > > >>+ */ >> >>+ public static void main(String[] args) throws Exception >> >>+ { >> >>+ if (args.length > 2) { >> >>+ String wsddOut = args[0]; >> >>+ String wsddIn = args[1]; >> >>+ int len = args.length - 2; >> >>+ String[] aptArgs = new String[len]; >> >>+ System.arraycopy(args, 2, aptArgs, 0, len); >> >>+ for (String arg : aptArgs) { >> >>+ System.out.println(arg); >> >>+ } >> >>+ >> >>+ Main apt = new Main("AxisApt"); >> >>+ >> >>+ if (0 == apt.compile(aptArgs)) { >> >>+ DeploymentDumper dd = new DeploymentDumper(); >> >>+ >> >> >dd.createAxisDeployment(dd.retrieveWebServiceMetadata(), > > >>+ wsddOut, >> >>+ wsddIn); >> >>+ >> >>+ } >> >>+ } >> >>+ } >> >>+ >> >>+ public void >> >> >createAxisDeployment(Collection wsms, > > >>+ String newConfigFilename, >> >>+ String existingConfigFilename) >> >>+ throws Exception >> >>+ { >> >>+ Writer fw = new OutputStreamWriter >> >>+ (new FileOutputStream(newConfigFilename), "UTF-8"); >> >>+ SerializationContext serial = new SerializationContext(fw); >> >>+ serial.setPretty(true); >> >>+ serial.writeString("> >> >encoding=\"UTF-8\"?>\n"); > > >>+ >> >>+ if (existingConfigFilename != null) { >> >>+ FileProvider fp = new >> >> >FileProvider(existingConfigFilename); > > >>+ >> >>+ /* >> >>+ * NOTE jcolwell@bea.com 2004-Sep-08 -- I don't really >> >> >want > > >>+ * to configure an engine here but I just need the >> >> >FileProvider > > >>+ * to process the loaded WSDD. Find out if there is a >> >> >more > > >>+ * "correct" way to accomplish this. >> >>+ * >> >>+ * an unfortunate side effect of using this default call >> >> >to > > >>+ * configureEngine is that a default server-config.wsdd >> >> >appears in > > >>+ * the current directory. >> >>+ */ >> >>+ fp.configureEngine(new AxisServer()); >> >>+ >> >>+ WSDDDeployment dep = fp.getDeployment(); >> >>+ >> >>+ if (dep != null) { >> >>+ >> >>+ for (WebServiceTYPEMetadata wsm : wsms) { >> >>+ WSDDService wsds = new WSDDService(); >> >>+ >> >>+ JavaServiceDesc sd = (JavaServiceDesc) >> >>+ AxisHook.createServiceDesc(wsm, getClass() >> >>+ .getClassLoader()); >> >>+ wsds.setName(sd.getName()); >> >>+ /* >> >>+ * NOTE jcolwell@bea.com 2004-Sep-08 -- >> >>+ * the default namespace needs to be spcified >> >> >somehow but > > >>+ * doing so here causes weirdness when the >> >> >webservice runs > > >>+ wsds.setQName(new >> >> >QName(sd.getDefaultNamespace(), > > >>+ sd.getName())); >> >>+ */ >> >>+ >> >> >wsds.setProviderQName(wsds.QNAME_JAVARPC_PROVIDER); > > >>+ wsds.setUse(sd.getUse()); >> >>+ wsds.setStyle(sd.getStyle()); >> >>+ >> >>+ /* >> >>+ * NOTE jcolwell@bea.com 2004-Sep-08 -- I want to >> >> >prevent > > >>+ * the JavaServiceDesc from introspecting itself >> >> >when I call > > >>+ * getOperations() but it complained when I tried >> >> >to set the > > >>+ * impl class back to null after having set it >> >> >when creating > > >>+ * the servicedesc. In any case the resulting >> >> >operations > > >>+ * shown in the resulting WSDD look correct. >> >>+ */ >> >>+ // sd.setImplClass(null); >> >>+ >> >>+ List ops = (List)sd >> >>+ .getOperations(); >> >>+ >> >>+ for (OperationDesc op : ops) { >> >>+ wsds.addOperation(new WSDDOperation(op)); >> >>+ } >> >>+ >> >>+ List allowedMethods = sd.getAllowedMethods(); >> >>+ StringBuffer allowedNames = new >> >> >StringBuffer(allowedMethods > > >>+ >> >> >.size()); > > >>+ boolean firstRun = true; >> >>+ for (Object methName : allowedMethods) { >> >>+ if (firstRun) { >> >>+ firstRun = false; >> >>+ } >> >>+ else { >> >>+ allowedNames.append(' '); >> >>+ } >> >>+ allowedNames.append((String)methName); >> >>+ } >> >>+ wsds.setParameter("allowedMethods", >> >> >allowedNames.toString()); > > >>+ wsds.setParameter("className", >> >> >sd.getImplClass().getName()); > > >>+ >> >>+ >> >>+ /* >> >>+ * NOTE jcolwell@bea.com 2004-Sep-08 -- addService >> >> >is > > >>+ * protected in WSDDDeployment, but deployService >> >>+ * appears to work for now. >> >>+ */ >> >>+ dep.deployService(wsds); >> >>+ } >> >>+ dep.writeToContext(serial); >> >>+ } >> >>+ } >> >>+ fw.close(); >> >>+ } >> >>+ >> >>+ protected Collection >> >> >retrieveWebServiceMetadata() > > >>+ { >> >>+ Collection meta = >> >>+ new ArrayList(); >> >>+ >> >>+ Set keys = >> >> >WsmAnnotationProcessor.getObjectModelNames(); > > >>+ for (String key : keys) { >> >>+ meta.add((WebServiceTYPEMetadata)WsmAnnotationProcessor >> >>+ .getObjectModel(key)); >> >>+ } >> >>+ return meta; >> >>+ } >> >>+} >> >> >>Added: >> >> >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/util/Clas >spathUtils.java > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/util/Clas >spathUtils.java Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,62 @@ >>+/* >> >>+ * ClasspathUtils.java >> >>+ * >> >>+ * Copyright 2001-2004 The Apache Software Foundation. >> >>+ * >> >>+ * >> >>+ * Licensed under the Apache License, Version 2.0 (the "License"); >> >>+ * you may not use this file except in compliance with the License. >> >>+ * You may obtain a copy of the License at >> >>+ * >> >>+ * http://www.apache.org/licenses/LICENSE-2.0 >> >>+ * >> >>+ * Unless required by applicable law or agreed to in writing, software >> >>+ * distributed under the License is distributed on an "AS IS" BASIS, >> >>+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >> >> >implied. > > >>+ * See the License for the specific language governing permissions and >> >>+ * limitations under the License. >> >>+ * >> >>+ */ >> >>+package org.apache.beehive.wsm.util; >> >>+ >> >>+import java.io.File; >> >>+import java.util.StringTokenizer; >> >>+ >> >>+import org.apache.beehive.wsm.util.JavaArchiveFilter; >> >>+ >> >>+/********************************************************************* >> >> >********** > > >>+ * >> >>+ * >> >>+ * @author Jonathan Colwell >> >>+ */ >> >>+public class ClasspathUtils { >> >>+ >> >>+ /** >> >>+ * Function borrowed from org.apache.axis.handlers.JWSHandler >> >>+ * >> >>+ * Expand a directory path or list of directory paths >> >> >(File.pathSeparator > > >>+ * delimited) into a list of file paths of all the jar files in >> >> >those > > >>+ * directories. >> >>+ * >> >>+ * @param dirPaths The string containing the directory path or list >> >> >of > > >>+ * directory paths. >> >>+ * @return The file paths of the jar files in the directories. This >> >> >is an > > >>+ * empty string if no files were found, and is terminated >> >> >by an > > >>+ * additional pathSeparator in all other cases. >> >>+ */ >> >>+ public static String expandDirs(String dirPaths) { >> >>+ StringTokenizer st = new StringTokenizer(dirPaths, >> >> >File.pathSeparator); > > >>+ StringBuffer buffer = new StringBuffer(); >> >>+ while (st.hasMoreTokens()) { >> >>+ String d = st.nextToken(); >> >>+ File dir = new File(d); >> >>+ if (dir.isDirectory()) { >> >>+ File[] files = dir.listFiles(new JavaArchiveFilter()); >> >>+ for (int i = 0; i < files.length; i++) { >> >>+ >> >> >buffer.append(files[i]).append(File.pathSeparator); > > >>+ } >> >>+ } >> >>+ } >> >>+ return buffer.toString(); >> >>+ } >> >>+} >> >> >>Added: >> >> >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/util/Java >ArchiveFilter.java > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/util/Java >ArchiveFilter.java Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,34 @@ >>+/* >> >>+ * JavaArchiveFilter.java >> >>+ * >> >>+ * Copyright 2001-2004 The Apache Software Foundation. >> >>+ * >> >>+ * >> >>+ * Licensed under the Apache License, Version 2.0 (the "License"); >> >>+ * you may not use this file except in compliance with the License. >> >>+ * You may obtain a copy of the License at >> >>+ * >> >>+ * http://www.apache.org/licenses/LICENSE-2.0 >> >>+ * >> >>+ * Unless required by applicable law or agreed to in writing, software >> >>+ * distributed under the License is distributed on an "AS IS" BASIS, >> >>+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >> >> >implied. > > >>+ * See the License for the specific language governing permissions and >> >>+ * limitations under the License. >> >>+ * >> >>+ */ >> >>+package org.apache.beehive.wsm.util; >> >>+ >> >>+import java.io.File; >> >>+import java.io.FileFilter; >> >>+ >> >>+/********************************************************************* >> >> >********** > > >>+ * This class stolen from an package private inner class of >> >>+ * org.apache.axis.handlers.JWSHandler >> >>+ */ >> >>+public class JavaArchiveFilter implements FileFilter { >> >>+ public boolean accept(File file) { >> >>+ String name = file.getName().toLowerCase(); >> >>+ return (name.endsWith(".jar") || name.endsWith(".zip")); >> >>+ } >> >>+} >> >> >>Added: incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/Foo.jws >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/Foo.jws >> >> >Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,46 @@ >>+/* >> >>+ * Copyright 2001-2004 The Apache Software Foundation. >> >>+ * >> >>+ * Licensed under the Apache License, Version 2.0 (the "License"); >> >>+ * you may not use this file except in compliance with the License. >> >>+ * You may obtain a copy of the License at >> >>+ * >> >>+ * http://www.apache.org/licenses/LICENSE-2.0 >> >>+ * >> >>+ * Unless required by applicable law or agreed to in writing, software >> >>+ * distributed under the License is distributed on an "AS IS" BASIS, >> >>+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >> >> >implied. > > >>+ * See the License for the specific language governing permissions and >> >>+ * limitations under the License. >> >>+ */ >> >>+ >> >>+ >> >>+import javax.jws.Oneway; >> >>+import javax.jws.WebMethod; >> >>+import javax.jws.WebParam; >> >>+import javax.jws.WebResult; >> >>+import javax.jws.WebService; >> >>+ >> >>+/********************************************************************* >> >> >********** > > >>+ * >> >>+ * >> >>+ * @author Jonathan Colwell >> >>+ */ >> >>+@WebService(name = "Abacus", >> >>+ serviceName = "Cheetorama", >> >>+ targetNamespace = >> >> >"http://www.superflaco.com/AnnotationTest") > > >>+ public class Foo { >> >>+ >> >>+ @WebMethod(operationName = "GoLoco", action="LocoAction") >> >>+ @WebResult >> >>+ public boolean getNutty(@WebParam int level, >> >>+ @WebParam(name="detail") String detail) >> >> >{ > > >>+ >> >>+ return (level > 5); >> >>+ } >> >>+ >> >>+ @WebMethod @Oneway public String goHome(@WebParam(name="when") >> >> >long time) > > >>+ { >> >>+ return "Now"; >> >>+ } >> >>+ } >> >> >>Added: >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/Bar.java > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/Bar.java Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,46 @@ >>+/* >> >>+ * Copyright 2001-2004 The Apache Software Foundation. >> >>+ * >> >>+ * Licensed under the Apache License, Version 2.0 (the "License"); >> >>+ * you may not use this file except in compliance with the License. >> >>+ * You may obtain a copy of the License at >> >>+ * >> >>+ * http://www.apache.org/licenses/LICENSE-2.0 >> >>+ * >> >>+ * Unless required by applicable law or agreed to in writing, software >> >>+ * distributed under the License is distributed on an "AS IS" BASIS, >> >>+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >> >> >implied. > > >>+ * See the License for the specific language governing permissions and >> >>+ * limitations under the License. >> >>+ */ >> >>+ >> >>+ >> >>+import javax.jws.Oneway; >> >>+import javax.jws.WebMethod; >> >>+import javax.jws.WebParam; >> >>+import javax.jws.WebResult; >> >>+import javax.jws.WebService; >> >>+ >> >>+/********************************************************************* >> >> >********** > > >>+ * >> >>+ * >> >>+ * @author Jonathan Colwell >> >>+ */ >> >>+@WebService(name = "Milk", >> >>+ serviceName = "Chocolate", >> >>+ targetNamespace = "http://www.superflaco.com/Cocoa") >> >>+ public class Bar { >> >>+ >> >>+ @WebMethod(operationName = "EatCookie", action="ChompChomp") >> >>+ @WebResult >> >>+ public String eatDough(@WebParam int chipCount, >> >>+ @WebParam String flavor) { >> >>+ >> >>+ return flavor + ((chipCount > 5) ? " is Yummy" : " is >> >> >boring"); > > >>+ } >> >>+ >> >>+ @WebMethod @WebResult(name = "cookiesInside") public int >> >> >openCookieJar() > > >>+ { >> >>+ return 123; >> >>+ } >> >>+ } >> >> >>Added: >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/Foo.java > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/Foo.java Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,51 @@ >>+/* >> >>+ * Copyright 2001-2004 The Apache Software Foundation. >> >>+ * >> >>+ * Licensed under the Apache License, Version 2.0 (the "License"); >> >>+ * you may not use this file except in compliance with the License. >> >>+ * You may obtain a copy of the License at >> >>+ * >> >>+ * http://www.apache.org/licenses/LICENSE-2.0 >> >>+ * >> >>+ * Unless required by applicable law or agreed to in writing, software >> >>+ * distributed under the License is distributed on an "AS IS" BASIS, >> >>+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >> >> >implied. > > >>+ * See the License for the specific language governing permissions and >> >>+ * limitations under the License. >> >>+ */ >> >>+ >> >>+ >> >>+import javax.jws.Oneway; >> >>+import javax.jws.WebMethod; >> >>+import javax.jws.WebParam; >> >>+import javax.jws.WebResult; >> >>+import javax.jws.WebService; >> >>+ >> >>+/********************************************************************* >> >> >********** > > >>+ * >> >>+ * >> >>+ * @author Jonathan Colwell >> >>+ */ >> >>+@WebService(name = "Abacus", >> >>+ serviceName = "Cheetorama", >> >>+ targetNamespace = >> >> >"http://www.superflaco.com/AnnotationTest") > > >>+ public class Foo { >> >>+ >> >>+ @WebMethod(operationName = "GoLoco", action="LocoAction") >> >>+ @WebResult >> >>+ public boolean getNutty(@WebParam int level, >> >>+ @WebParam(name="detail") String detail) >> >> >{ > > >>+ >> >>+ return (level > 5); >> >>+ } >> >>+ >> >>+ @WebMethod @WebResult(name = "howdy") public String goHome() >> >>+ { >> >>+ try { >> >>+ return "wutup!"; >> >>+ } >> >>+ catch (Exception e) { >> >>+ return e.toString(); >> >>+ } >> >>+ } >> >>+ } >> >> >>Added: >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/dump.bat > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/dump.bat Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,5 @@ >>+call setEnv >> >>+ >> >>+%JAVA_HOME%\bin\java org.apache.beehive.wsm.axis.DeploymentDumper >> >> >..\annotated-server-config.wsdd ..\server-config.wsdd -classpath >%classpath% -factory >org.apache.beehive.wsm.jsr181.processor.apt.WsmAnnotationProcessorFactor >y -d ..\classes Bar.java Foo.java > > >>+ >> >>+del server-config.wsdd >> >> >>Added: >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/setEnv.bat > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/Annotatio >nBasedDeployment/setEnv.bat Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1 @@ >>+set >> >> >classpath=..\classes;%JAVA_HOME%\lib\tools.jar;..\lib\axis.jar;..\lib\ja >xrpc.jar;..\lib\wsm.jar;..\lib\wsm-axis.jar;..\lib\commons-logging.jar;. >.\lib\saaj.jar;..\lib\wsdl4j.jar;..\lib\;..\lib\jaxrpc.jar;..\lib\common >s-discovery.jar;..\lib\log4j-1.2.8.jar > > >>Added: >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/lib/log4j >.properties > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/lib/log4j >.properties Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,20 @@ >>+# Set root category priority to INFO and its only appender to CONSOLE. >> >>+log4j.rootCategory=INFO, CONSOLE >> >>+#log4j.rootCategory=INFO, CONSOLE, LOGFILE >> >>+ >> >>+# Set the enterprise logger category to FATAL and its only appender to >> >> >CONSOLE. > > >>+log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE >> >>+ >> >>+# CONSOLE is set to be a ConsoleAppender using a PatternLayout. >> >>+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender >> >>+log4j.appender.CONSOLE.Threshold=INFO >> >>+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout >> >>+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n >> >>+ >> >>+# LOGFILE is set to be a File appender using a PatternLayout. >> >>+log4j.appender.LOGFILE=org.apache.log4j.FileAppender >> >>+log4j.appender.LOGFILE.File=axis.log >> >>+log4j.appender.LOGFILE.Append=true >> >>+log4j.appender.LOGFILE.Threshold=INFO >> >>+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout >> >>+log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - >> >> >%m%n > > >>Added: >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/server-co >nfig.wsdd > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/server-co >nfig.wsdd Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,47 @@ >>+ >> >>+> >> >xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> > > >>+ >>+ >>+ >>+ > >> >value="org.apache.axis.attachments.AttachmentsImpl"/> > > >>+ >>+ >>+ >>+ >>+ > >> >type="java:org.apache.beehive.wsm.axis.AnnotatedJWSHandler"> > > >>+ >>+ >>+ > >> >type="java:org.apache.beehive.wsm.axis.AnnotatedJWSHandler"> > > >>+ >>+ >>+ >>+ >>+ >>+ > >> >type="java:org.apache.axis.transport.local.LocalResponder"/> > > >>+ > >> >type="java:org.apache.axis.handlers.http.URLMapper"/> > > >>+ > >> >type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/> > > >>+ >>+ >>+ >>+ >>+ http://xml.apache.org/axis/wsdd/ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ > >> >type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/> > > >>+ >>+ > >> >value="org.apache.axis.transport.http.QSListHandler"/> > > >>+ > >> >value="org.apache.axis.transport.http.QSWSDLHandler"/> > > >>+ > >> >value="org.apache.axis.transport.http.QSMethodHandler"/> > > >>+ >>+ >>+ >>+ >>+ >>+ >>+ >> >> >>Added: >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/web.xml > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/WEB-INF/web.xml >Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,96 @@ >>+ >>+ >>+>+Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> >>+ >>+ >>+ Apache-Axis >>+ >>+ >>+ >> >> >org.apache.axis.transport.http.AxisHTTPSessionListenerlistener-class> > > >>+ >>+ >>+ >>+ AxisServlet >>+ Apache-Axis Servlet >>+ >>+ org.apache.axis.transport.http.AxisServlet >>+ >>+ >>+ >>+ >>+ AdminServlet >>+ Axis Admin Servlet >>+ >>+ org.apache.axis.transport.http.AdminServlet >>+ >>+ 100 >>+ >>+ >>+ >>+ SOAPMonitorService >>+ SOAPMonitorService >>+ >>+ org.apache.axis.monitor.SOAPMonitorService >>+ >>+ >>+ SOAPMonitorPort >>+ 5001 >>+ >>+ 100 >>+ >>+ >>+ >>+ AxisServlet >>+ /servlet/AxisServlet >>+ >>+ >>+ >>+ AxisServlet >>+ *.jws >>+ >>+ >>+ >>+ AxisServlet >>+ /services/* >>+ >>+ >>+ >>+ SOAPMonitorService >>+ /SOAPMonitor >>+ >>+ >>+ >>+ >>+ >>+ >>+ >>+ 5 >>+ >>+ >>+ >>+ >>+ wsdl >>+ text/xml >>+ >>+ >>+ >>+ >>+ xsd >>+ text/xml >>+ >>+ >>+ >>+ index.html >>+ index.jsp >>+ index.jws >>+ >>+ >>+ >> >>Added: >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/happyaxis.jsp > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/happyaxis.jsp >Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,488 @@ >>+ >> >>+<%@ page import="java.io.InputStream, >> >>+ java.io.IOException, >> >>+ javax.xml.parsers.SAXParser, >> >>+ javax.xml.parsers.SAXParserFactory" >> >>+ session="false" %> >> >>+ <% >> >>+ /* >> >>+ * Copyright 2002,2004 The Apache Software Foundation. >> >>+ * >> >>+ * Licensed under the Apache License, Version 2.0 (the "License"); >> >>+ * you may not use this file except in compliance with the License. >> >>+ * You may obtain a copy of the License at >> >>+ * >> >>+ * http://www.apache.org/licenses/LICENSE-2.0 >> >>+ * >> >>+ * Unless required by applicable law or agreed to in writing, software >> >>+ * distributed under the License is distributed on an "AS IS" BASIS, >> >>+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >> >> >implied. > > >>+ * See the License for the specific language governing permissions and >> >>+ * limitations under the License. >> >>+ */ >> >>+%> >> >>+ >> >>+Axis Happiness Page >> >>+ >> >>+ >> >>+<%! >> >>+ >> >>+ /* >> >>+ * Happiness tests for axis. These look at the classpath and warn >> >> >if things > > >>+ * are missing. Normally addng this much code in a JSP page is mad >> >>+ * but here we want to validate JSP compilation too, and have a >> >> >drop-in > > >>+ * page for easy re-use >> >>+ * @author Steve 'configuration problems' Loughran >> >>+ * @author dims >> >>+ * @author Brian Ewins >> >>+ */ >> >>+ >> >>+ >> >>+ /** >> >>+ * Get a string providing install information. >> >>+ * TODO: make this platform aware and give specific hints >> >>+ */ >> >>+ public String getInstallHints(HttpServletRequest request) { >> >>+ >> >>+ String hint= >> >>+ "Note: On Tomcat 4.x and Java1.4, you may >> >> >need to put libraries that contain " > > >>+ +"java.* or javax.* packages into >> >> >CATALINA_HOME/common/lib" > > >>+ +"
jaxrpc.jar and saaj.jar are two such libraries."; >> >>+ return hint; >> >>+ } >> >>+ >> >>+ /** >> >>+ * test for a class existing >> >>+ * @param classname >> >>+ * @return class iff present >> >>+ */ >> >>+ Class classExists(String classname) { >> >>+ try { >> >>+ return Class.forName(classname); >> >>+ } catch (ClassNotFoundException e) { >> >>+ return null; >> >>+ } >> >>+ } >> >>+ >> >>+ /** >> >>+ * test for resource on the classpath >> >>+ * @param resource >> >>+ * @return true iff present >> >>+ */ >> >>+ boolean resourceExists(String resource) { >> >>+ boolean found; >> >>+ InputStream >> >> >instream=this.getClass().getResourceAsStream(resource); > > >>+ found=instream!=null; >> >>+ if(instream!=null) { >> >>+ try { >> >>+ instream.close(); >> >>+ } catch (IOException e) { >> >>+ } >> >>+ } >> >>+ return found; >> >>+ } >> >>+ >> >>+ /** >> >>+ * probe for a class, print an error message is missing >> >>+ * @param out stream to print stuff >> >>+ * @param category text like "warning" or "error" >> >>+ * @param classname class to look for >> >>+ * @param jarFile where this class comes from >> >>+ * @param errorText extra error text >> >>+ * @param homePage where to d/l the library >> >>+ * @return the number of missing classes >> >>+ * @throws IOException >> >>+ */ >> >>+ int probeClass(JspWriter out, >> >>+ String category, >> >>+ String classname, >> >>+ String jarFile, >> >>+ String description, >> >>+ String errorText, >> >>+ String homePage) throws IOException { >> >>+ try { >> >>+ Class clazz = classExists(classname); >> >>+ if(clazz == null) { >> >>+ String url=""; >> >>+ if(homePage!=null) { >> >>+ url="
See > >> >href="+homePage+">"+homePage+""; > > >>+ } >> >>+ out.write("

"+category+": could not find class >> >> >"+classname > > >>+ +" from file "+jarFile >> >>+ +"
"+errorText >> >>+ +url >> >>+ +"

"); >> >>+ return 1; >> >>+ } else { >> >>+ String location = getLocation(out, clazz); >> >>+ if(location == null) { >> >>+ out.write("Found "+ description + " (" + classname + >> >> >")
"); > > >>+ } >> >>+ else { >> >>+ out.write("Found "+ description + " (" + classname + >> >> >") at " + location + "
"); > > >>+ } >> >>+ return 0; >> >>+ } >> >>+ } catch(NoClassDefFoundError ncdfe) { >> >>+ String url=""; >> >>+ if(homePage!=null) { >> >>+ url="
See "+homePage+""; >> >>+ } >> >>+ out.write("

"+category+": could not find a dependency" >> >>+ +" of class "+classname >> >>+ +" from file "+jarFile >> >>+ +"
"+errorText >> >>+ +url >> >>+ +"
The root cause was: "+ncdfe.getMessage() >> >>+ +"
This can happen e.g. if "+classname+" is in" >> >> > > > >>+ +" the 'common' classpath, but a dependency like " >> >>+ +" activation.jar is only in the webapp >> >> >classpath." > > >>+ +"

"); >> >>+ return 1; >> >>+ } >> >>+ } >> >>+ >> >>+ /** >> >>+ * get the location of a class >> >>+ * @param out >> >>+ * @param clazz >> >>+ * @return the jar file or path where a class was found >> >>+ */ >> >>+ >> >>+ String getLocation(JspWriter out, >> >>+ Class clazz) { >> >>+ try { >> >>+ java.net.URL url = >> >> >clazz.getProtectionDomain().getCodeSource().getLocation(); > > >>+ String location = url.toString(); >> >>+ if(location.startsWith("jar")) { >> >>+ url = >> >> >((java.net.JarURLConnection)url.openConnection()).getJarFileURL(); > > >>+ location = url.toString(); >> >>+ } >> >>+ >> >>+ if(location.startsWith("file")) { >> >>+ java.io.File file = new java.io.File(url.getFile()); >> >>+ return file.getAbsolutePath(); >> >>+ } else { >> >>+ return url.toString(); >> >>+ } >> >>+ } catch (Throwable t){ >> >>+ } >> >>+ return "an unknown location"; >> >>+ } >> >>+ >> >>+ /** >> >>+ * a class we need if a class is missing >> >>+ * @param out stream to print stuff >> >>+ * @param classname class to look for >> >>+ * @param jarFile where this class comes from >> >>+ * @param errorText extra error text >> >>+ * @param homePage where to d/l the library >> >>+ * @throws IOException when needed >> >>+ * @return the number of missing libraries (0 or 1) >> >>+ */ >> >>+ int needClass(JspWriter out, >> >>+ String classname, >> >>+ String jarFile, >> >>+ String description, >> >>+ String errorText, >> >>+ String homePage) throws IOException { >> >>+ return probeClass(out, >> >>+ "Error", >> >>+ classname, >> >>+ jarFile, >> >>+ description, >> >>+ errorText, >> >>+ homePage); >> >>+ } >> >>+ >> >>+ /** >> >>+ * print warning message if a class is missing >> >>+ * @param out stream to print stuff >> >>+ * @param classname class to look for >> >>+ * @param jarFile where this class comes from >> >>+ * @param errorText extra error text >> >>+ * @param homePage where to d/l the library >> >>+ * @throws IOException when needed >> >>+ * @return the number of missing libraries (0 or 1) >> >>+ */ >> >>+ int wantClass(JspWriter out, >> >>+ String classname, >> >>+ String jarFile, >> >>+ String description, >> >>+ String errorText, >> >>+ String homePage) throws IOException { >> >>+ return probeClass(out, >> >>+ "Warning", >> >>+ classname, >> >>+ jarFile, >> >>+ description, >> >>+ errorText, >> >>+ homePage); >> >>+ } >> >>+ >> >>+ /** >> >>+ * probe for a resource existing, >> >>+ * @param out >> >>+ * @param resource >> >>+ * @param errorText >> >>+ * @throws Exception >> >>+ */ >> >>+ int wantResource(JspWriter out, >> >>+ String resource, >> >>+ String errorText) throws Exception { >> >>+ if(!resourceExists(resource)) { >> >>+ out.write("

Warning: could not find resource >> >> >"+resource > > >>+ +"
" >> >>+ +errorText); >> >>+ return 0; >> >>+ } else { >> >>+ out.write("found "+resource+"
"); >> >>+ return 1; >> >>+ } >> >>+ } >> >>+ >> >>+ >> >>+ /** >> >>+ * get servlet version string >> >>+ * >> >>+ */ >> >>+ >> >>+ public String getServletVersion() { >> >>+ ServletContext context=getServletConfig().getServletContext(); >> >>+ int major = context.getMajorVersion(); >> >>+ int minor = context.getMinorVersion(); >> >>+ return Integer.toString(major) + '.' + >> >> >Integer.toString(minor); > > >>+ } >> >>+ >> >>+ >> >>+ >> >>+ /** >> >>+ * what parser are we using. >> >>+ * @return the classname of the parser >> >>+ */ >> >>+ private String getParserName() { >> >>+ SAXParser saxParser = getSAXParser(); >> >>+ if (saxParser == null) { >> >>+ return "Could not create an XML Parser"; >> >>+ } >> >>+ >> >>+ // check to what is in the classname >> >>+ String saxParserName = saxParser.getClass().getName(); >> >>+ return saxParserName; >> >>+ } >> >>+ >> >>+ /** >> >>+ * Create a JAXP SAXParser >> >>+ * @return parser or null for trouble >> >>+ */ >> >>+ private SAXParser getSAXParser() { >> >>+ SAXParserFactory saxParserFactory = >> >> >SAXParserFactory.newInstance(); > > >>+ if (saxParserFactory == null) { >> >>+ return null; >> >>+ } >> >>+ SAXParser saxParser = null; >> >>+ try { >> >>+ saxParser = saxParserFactory.newSAXParser(); >> >>+ } catch (Exception e) { >> >>+ } >> >>+ return saxParser; >> >>+ } >> >>+ >> >>+ /** >> >>+ * get the location of the parser >> >>+ * @return path or null for trouble in tracking it down >> >>+ */ >> >>+ >> >>+ private String getParserLocation(JspWriter out) { >> >>+ SAXParser saxParser = getSAXParser(); >> >>+ if (saxParser == null) { >> >>+ return null; >> >>+ } >> >>+ String location = getLocation(out,saxParser.getClass()); >> >>+ return location; >> >>+ } >> >>+ %> >> >>+Axis Happiness Page >> >>+ >> >>+

Axis Happiness Page

>> >>+

Examining webapp configuration

>> >>+ >> >>+

>> >>+

Needed Components

>> >>+<% >> >>+ int needed=0,wanted=0; >> >>+ >> >>+ /** >> >>+ * the essentials, without these Axis is not going to work >> >>+ */ >> >>+ needed=needClass(out, "javax.xml.soap.SOAPMessage", >> >>+ "saaj.jar", >> >>+ "SAAJ API", >> >>+ "Axis will not work", >> >>+ "http://xml.apache.org/axis/"); >> >>+ >> >>+ needed+=needClass(out, "javax.xml.rpc.Service", >> >>+ "jaxrpc.jar", >> >>+ "JAX-RPC API", >> >>+ "Axis will not work", >> >>+ "http://xml.apache.org/axis/"); >> >>+ >> >>+ needed+=needClass(out, >> >> >"org.apache.axis.transport.http.AxisServlet", > > >>+ "axis.jar", >> >>+ "Apache-Axis", >> >>+ "Axis will not work", >> >>+ "http://xml.apache.org/axis/"); >> >>+ >> >>+ needed+=needClass(out, "org.apache.commons.discovery.Resource", >> >>+ "commons-discovery.jar", >> >>+ "Jakarta-Commons Discovery", >> >>+ "Axis will not work", >> >>+ "http://jakarta.apache.org/commons/discovery.html"); >> >>+ >> >>+ needed+=needClass(out, "org.apache.commons.logging.Log", >> >>+ "commons-logging.jar", >> >>+ "Jakarta-Commons Logging", >> >>+ "Axis will not work", >> >>+ "http://jakarta.apache.org/commons/logging.html"); >> >>+ >> >>+ needed+=needClass(out, "org.apache.log4j.Layout", >> >>+ "log4j-1.2.8.jar", >> >>+ "Log4j", >> >>+ "Axis may not work", >> >>+ "http://jakarta.apache.org/log4j"); >> >>+ >> >>+ //should we search for a javax.wsdl file here, to hint that it >> >> >needs > > >>+ //to go into an approved directory? because we dont seem to need >> >> >to do that. > > >>+ needed+=needClass(out, "com.ibm.wsdl.factory.WSDLFactoryImpl", >> >>+ "wsdl4j.jar", >> >>+ "IBM's WSDL4Java", >> >>+ "Axis will not work", >> >>+ null); >> >>+ >> >>+ needed+=needClass(out, "javax.xml.parsers.SAXParserFactory", >> >>+ "xerces.jar", >> >>+ "JAXP implementation", >> >>+ "Axis will not work", >> >>+ "http://xml.apache.org/xerces-j/"); >> >>+ >> >>+ needed+=needClass(out,"javax.activation.DataHandler", >> >>+ "activation.jar", >> >>+ "Activation API", >> >>+ "Axis will not work", >> >>+ >> >> >"http://java.sun.com/products/javabeans/glasgow/jaf.html"); > > >>+%> >> >>+

Optional Components

>> >>+<% >> >>+ /* >> >>+ * now the stuff we can live without >> >>+ */ >> >>+ wanted+=wantClass(out,"javax.mail.internet.MimeMessage", >> >>+ "mail.jar", >> >>+ "Mail API", >> >>+ "Attachments will not work", >> >>+ "http://java.sun.com/products/javamail/"); >> >>+ >> >>+ wanted+=wantClass(out,"org.apache.xml.security.Init", >> >>+ "xmlsec.jar", >> >>+ "XML Security API", >> >>+ "XML Security is not supported", >> >>+ "http://xml.apache.org/security/"); >> >>+ >> >>+ wanted += wantClass(out, "javax.net.ssl.SSLSocketFactory", >> >>+ "jsse.jar or java1.4+ runtime", >> >>+ "Java Secure Socket Extension", >> >>+ "https is not supported", >> >>+ "http://java.sun.com/products/jsse/"); >> >>+ /* >> >>+ * resources on the classpath path >> >>+ */ >> >>+ /* broken; this is a file, not a resource >> >>+ wantResource(out,"/server-config.wsdd", >> >>+ "There is no server configuration file;" >> >>+ +"run AdminClient to create one"); >> >>+ */ >> >>+ /* add more libraries here */ >> >>+ >> >>+ out.write("

"); >> >>+ //is everythng we need here >> >>+ if(needed==0) { >> >>+ //yes, be happy >> >>+ out.write("The core axis libraries are present. "); >> >>+ } else { >> >>+ //no, be very unhappy >> >>+ >> >> >response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); > > >>+ out.write("" >> >>+ +needed >> >>+ +" core axis librar" >> >>+ +(needed==1?"y is":"ies are") >> >>+ +" missing"); >> >>+ } >> >>+ //now look at wanted stuff >> >>+ if(wanted>0) { >> >>+ out.write("" >> >>+ +wanted >> >>+ +" optional axis librar" >> >>+ +(wanted==1?"y is":"ies are") >> >>+ +" missing"); >> >>+ } else { >> >>+ out.write("The optional components are present."); >> >>+ } >> >>+ out.write("

"); >> >>+ //hint if anything is missing >> >>+ if(needed>0 || wanted>0 ) { >> >>+ out.write(getInstallHints(request)); >> >>+ } >> >>+ >> >>+ %> >> >>+

>> >>+ Note: Even if everything this page probes for is >> >> >present, there is no guarantee your > > >>+ web service will work, because there are many configuration >> >> >options that we do > > >>+ not check for. These tests are necessary but not >> >> >sufficient > > >>+


>> >>+ >> >>+

Examining Application Server

>> >>+ <% >> >>+ String servletVersion=getServletVersion(); >> >>+ String xmlParser=getParserName(); >> >>+ String xmlParserLocation = getParserLocation(out); >> >>+ >> >>+ %> >> >>+ >> >>+ > > >>+ >> >>+ > > >>+
Servlet version<%= servletVersion >> >> >%>
XML Parser<%= xmlParser %>
XML ParserLocation<%= xmlParserLocation >> >> >%>
>> >>+<% if(xmlParser.indexOf("crimson")>=0) { %> >> >>+

>> >>+ We recommend Xerces >> >> >2 > > >>+ over Crimson as the XML parser for Axis >> >>+

>> >>+<% } %> >> >>+ >> >>+

Examining System Properties

>> >>+<% >> >>+ /** >> >>+ * Dump the system properties >> >>+ */ >> >>+ java.util.Enumeration e=null; >> >>+ try { >> >>+ e= System.getProperties().propertyNames(); >> >>+ } catch (SecurityException se) { >> >>+ } >> >>+ if(e!=null) { >> >>+ out.write("
");
>>
>>+        for (;e.hasMoreElements();) {
>>
>>+            String key = (String) e.nextElement();
>>
>>+            out.write(key + "=" + System.getProperty(key)+"\n");
>>
>>+        }
>>
>>+        out.write("

"); >> >>+ } else { >> >>+ out.write("System properties are not accessible

"); >> >>+ } >> >>+%> >> >>+


>> >>+ Platform: <%= >> >> >getServletConfig().getServletContext().getServerInfo() %> > > >>+ >> >>+ >> >>+ >> >>+ >> >> >>Added: >> >> >incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/index.html > > >>======================================================================= >> >> >======= > > >>--- (empty file) >>+++ incubator/beehive/trunk/wsm/test/webapps/AnnotatedAxis/index.html >> >> >Thu Sep 9 12:43:48 2004 > > >>@@ -0,0 +1,45 @@ >>+ >> >>+ >> >>+ >> >>+> >>+content="text/html; charset=iso-8859-1"> >> >>+Apache-Axis >> >>+ >> >>+ >> >>+ >> >>+ >> >>+

Apache-AXIS

>> >>+ >> >>+

Hello! Welcome to Apache-Axis -- now with >> >> >Annotations!.

> > >>+ >> >>+

What do you want to do today?

>> >>+ >> >>+
    >> >>+
  • Validate >> >>+ the local installation's configuration
    >> >>+ see below if this does not work.
  • >> >>+
  • View >> >>+ the list of deployed Web services
  • >> >>+
  • >> >>+ Call a local endpoint by its Annotated name (or see its >> >>+ WSDL). >> >>+
  • Visit >> >>+ the Apache-Axis Home Page
  • >> >>+
>> >>+ >> >>+This is a prototype implementation of JSR-181 intended to simply >> >> >explore how difficult it is to make the existing AXIS JWS system support >Annotations. This is not a complete implementation of JSR-181 but it >does cover many of the key features. One should also keep in mind that >there is no intention that this code be considered as anything more than >a somewhat functional draft whipped up in just a few days. Comments and >criticism are welcome especially considering that the author only >started looking at the internals of AXIS on August 10, 2004 and may have >misunderstood how it actually functions. > > >>+ >> >>+ >> >>+

Validating Axis

>> >>+ >> >>+If the "happyaxis" validation page displays an exception instead of a >> >>+status page, the likely cause is that you have multiple XML parsers in >> >>+your classpath. Clean up your classpath by eliminating extraneous >> >> >parsers. > > >>+ >> >>+

>> >>+If you have problems getting Axis to work, consult the Axis >> >>+> >>+href="http://nagoya.apache.org/wiki/apachewiki.cgi?AxisProjectPages">W >> >> >iki > > >>+and then try the Axis user mailing list. >> >>+ >> >>+ >> >> >> >> >> >> > > > >