You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ha...@apache.org on 2004/10/06 15:46:10 UTC

cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws WSDL2Ws.java

hawkeye     2004/10/06 06:46:10

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws WSDL2Ws.java
  Log:
  This temporarily fixes the classpath problem when the WSDL2ws is after axis java jar. It simply puts out a nicer error message.WSDL2ws will get refactored in 1.4 o make this fix obsolete
  
  Revision  Changes    Path
  1.40      +14 -1     ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
  
  Index: WSDL2Ws.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- WSDL2Ws.java	8 Sep 2004 06:41:10 -0000	1.39
  +++ WSDL2Ws.java	6 Oct 2004 13:46:10 -0000	1.40
  @@ -803,7 +803,20 @@
   		    	    data.getOptionBykey("w"));
   		    	    
   				System.out.println( "\nCode generation completed.\n");
  -            } catch (Exception e) {            	
  +            } 
  +		catch(NoSuchMethodError noSuchMethodError)
  +            {
  +            	// catch the no such method error that occurs when they have put this class after axis java 1.2
  +            	if(noSuchMethodError.getMessage().indexOf("org.apache.axis.wsdl.symbolTable.ElementDecl.getMinOccrs")>-1)
  +            	{
  +            		System.out.println("We have caught the following error - "+noSuchMethodError);
  +					System.out.println("");
  +					System.out.println("This usually occurs when axis java jar file comes before WSDL2ws.jar in your classpath.");
  +					System.out.println("Please verify that WSDL2ws.jar comes first in your classpath and correct if necessary");
  +					System.out.println("If it does and you still get this error then please raise an issue with the supplier of your code");
  +            	}
  +
  +            }catch (Exception e) {            	
               	e.printStackTrace();
   				System.out.println( "\nCode generation failed. Please see errors above.\n");
               }