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 Tim Colson <tc...@cisco.com> on 2002/12/20 17:44:31 UTC

Initial Axis 1.1b Install Failure & Build Error

Hey folks -
  I've run Axis before, but I'm starting fresh with 1.1beta and running
into two problems - the first is EchoHeaders throwing an
InvocationTargetException when using the binary DIST of Axis, the second
is a compile problem while trying to build Axis from src with -ALL- of
the optional libraries (but narrowed down to the HTTPClient lib I
think).

Problem #1:
  Following the 1.1 install instructions, myself and a colleage have
both reproduced the following Fault (below). We are using the binary
dist of 1.1 with Tomcat 3.2.1 and JSDK 1.3.1_02. happyaxis.jsp reports
back success finding everything. The View works, and so does the 'show
me the wsdl' url...but
http://localhost:8080/axis/EchoHeaders.jws?method=list throws this
fault:

AXIS error
Sorry, something seems to have gone wrong... here are the details:

Fault - java.lang.reflect.InvocationTargetException 
AxisFault
 faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.lang.reflect.InvocationTargetException
 faultActor: null
 faultNode: null
 faultDetail: 
	stackTrace: java.lang.reflect.InvocationTargetException:
java.lang.NoClassDefFoundError: org/apache/axis/MessageContext
	at EchoHeaders.getRequest(EchoHeaders.java:112)
	at EchoHeaders.list(EchoHeaders.java:73)
	at java.lang.reflect.Method.invoke(Native Method)
(snipped)
----

Problem #2:
  Figuring that maybe something in the build was fubar... I decided to
start from src and build my own. :-)  Followed the excellent build
instructions and after a little bit of time, compiled and built the
'bare bones' jars. Tried these jars in tomcat - but it wouldn't work
because the servlet stuff wasn't compiled in (I assume that's why.)
  
  So I spent the next hour or so pulling down and expanding ALL of the
other optional jars. (I should be up to date now for any Jakarta project
I care to build...heh heh). I try to compile...but get compile errors.
If I yank out the commons-httpclient.jar, it compiles fine. 

Here are the errors:
     [echo] classpath:
D:\java\xml-axis\java\${xerces.jar};D:\java\xml-axis\java
\test\lib\jakarta-oro-2.0.5.jar;D:\java\xml-axis\java\lib\jsse.jar;D:\ja
va\xml-a
xis\java\lib\JimiProClasses.zip;D:\java\xml-axis\java\lib\activation.jar
;D:\java
\xml-axis\java\lib\mailapi.jar;D:\java\jdk1.3.1_02\lib\tools.jar;D:\java
\xml-axi
s\java\${j2ee.jar};D:\java\xml-axis\java\lib\junit.jar;D:\java\xml-axis\
java\lib
\castor-0.9.4.1.jar;D:\java\xml-axis\java\lib\commons-discovery.jar;D:\j
ava\xml-
axis\java\lib\commons-httpclient.jar;D:\java\xml-axis\java\lib\commons-l
ogging.j
ar;D:\java\xml-axis\java\lib\jcert.jar;D:\java\xml-axis\java\lib\jms.jar
;D:\java
\xml-axis\java\lib\jnet.jar;D:\java\xml-axis\java\lib\log4j-1.2.4.jar;D:
\java\xm
l-axis\java\lib\servlet.jar;D:\java\xml-axis\java\lib\wsdl4j.jar;D:\java
\xml-axi
s\java\lib\xalan.jar;D:\java\xml-axis\java\lib\xercesImpl.jar;D:\java\xm
l-axis\j
ava\lib\xml-apis.jar;D:\java\xml-axis\java\lib\xmlsec.jar;D:\java\jakart
a-ant-1.
5.1\lib\xml-apis.jar;D:\java\jakarta-ant-1.5.1\lib\xercesImpl.jar;D:\jav
a\jakart
a-ant-1.5.1\lib\optional.jar;D:\java\jakarta-ant-1.5.1\lib\junit.jar;D:\
java\jak
arta-ant-1.5.1\lib\ant.jar;D:\java\xml-axis\java\build\classes;D:\java\x
ml-axis\
java\build\tools;D:\java\xml-axis\java\build\lib\axis-ant.jar


compile:
    [javac] Compiling 1 source file to
D:\java\xml-axis\java\build\classes
    [javac]
D:\java\xml-axis\java\src\org\apache\axis\transport\http\CommonsHTTP
Sender.java:128: cannot resolve symbol
    [javac] symbol  : method setRequestBody  (java.lang.String)
    [javac] location: class
org.apache.commons.httpclient.methods.PostMethod
    [javac]             method.setRequestBody(new
String(baos.toByteArray()));
    [javac]                   ^
    [javac]
D:\java\xml-axis\java\src\org\apache\axis\transport\http\CommonsHTTP
Sender.java:264: cannot resolve symbol
    [javac] symbol  : method setProxyCredentials
(<null>,org.apache.commons.htt
pclient.Credentials)
    [javac] location: class org.apache.commons.httpclient.HttpState
    [javac]                 state.setProxyCredentials(null, proxyCred);
    [javac]                      ^
    [javac]
D:\java\xml-axis\java\src\org\apache\axis\transport\http\CommonsHTTP
Sender.java:302: cannot resolve symbol
    [javac] symbol  : method setProxyCredentials
(<null>,org.apache.commons.htt
pclient.Credentials)
    [javac] location: class org.apache.commons.httpclient.HttpState
    [javac]                 state.setProxyCredentials(null, proxyCred);
    [javac]                      ^
    [javac]
D:\java\xml-axis\java\src\org\apache\axis\transport\http\CommonsHTTP
Sender.java:327: cannot resolve symbol
    [javac] symbol  : method setSoTimeout  (int)
    [javac] location: class org.apache.commons.httpclient.HttpConnection
    [javac]             conn.setSoTimeout(msgContext.getTimeout());
    [javac]                 ^
    [javac] 4 errors

BUILD FAILED
file:D:/java/xml-axis/java/build.xml:92: Compile failed; see the
compiler error output for details.

P.S. I do have the Xerces libs in ${axis.home}/java/lib (xercesImpl.jar
and xmlApis.jar)... But the classpath shows
D:\java\xml-axis\java\${xerces.jar}; -> so what's up with that?

Thanks!
Tim



	


Java 1.4 issue

Posted by Mitch Gitman <mg...@usa.net>.
I've come across an Axis problem with Java 1.4. The 1.4 JDK introduces a 
couple methods in the Exception class:
public Throwable getCause()
public StackTraceElement[] getStackTrace()

Suppose the Java interface you're converting to a web service throws 
exceptions. Since the above methods are public, they're picked up by 
Java2WSDL for Exception, RemoteException and any descendant thereof. So 
Java2WSDL produces the following warnings:

org.apache.axis.wsdl.fromJava.Types isBeanCompatible
WARNING: The class java.lang.Throwable is defined in a java or javax 
package and
  cannot be converted into an xml schema type.  An xml schema anyType will 
be use
d to define this class in the wsdl file.
org.apache.axis.wsdl.fromJava.Types isBeanCompatible
WARNING: The class java.lang.StackTraceElement is defined in a java or 
javax pac
kage and cannot be converted into an xml schema type.  An xml schema 
anyType wil
l be used to define this class in the wsdl file.

I notice that, in the generated WSDL file, the references to Throwable, 
StackTraceElement, and array of StackTraceElement mention a namespace, 
tns3, which in my system doesn't exist.

Next I run WSDL2Java. It throws the following exception:
java.io.IOException: Type StackTraceElement is referenced but not defined.
         at 
org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(SymbolTable.java:496)
         at 
org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:396)
         at 
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:382)
         at 
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:367)
         at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:246)
         at java.lang.Thread.run(Thread.java:536)

The only way I have found to prevent this problem is to take the WSDL file 
generated by Java2WSDL and strip any references to the Throwable and 
StackTraceElements. I do this hack during my build using a DOM parser.

I also have a .NET client that needs the Axis web service's WSDL. Since the 
dynamic WSDL obtained through the ?wsdl URL parameter will have the same 
dreaded Throwable and StackTraceElements belonging to the same dreaded 
undefined namespace, I have to feed .NET my hacked static WSDL.

Ironically, exception throwing works. At the end of this message is the 
content of a sample SOAP response containing a fault corresponding to the 
original server exception. The response even contains a stack trace in the 
fault detail.

So with the hack, everything works. Just, it's irritating that, without 
this hack, Axis seemingly can't produce a valid WSDL in the common 
circumstance of needing to throw exceptions in Java 1.4.
===============================================================================
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
   <soapenv:Fault>
    <faultcode>soapenv:Server.userException</faultcode>
    <faultstring>This is a test exception.</faultstring>
    <detail>
     <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">This is a test 
exception.
         at foo.bar.ApplicationBean.testException(ApplicationBean.java:225)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         ...
</ns1:stackTrace>
    </detail>
   </soapenv:Fault>
  </soapenv:Body>
</soapenv:Envelope>


Axis 1.1b and tomcat 3.2.x?

Posted by Tim Colson <tc...@cisco.com>.
Sorry to be a pest, but has anybody got 1.1b to work with Tomcat 3.2.x?

Thanks!
Tim


-----Original Message-----
From: Tim Colson [mailto:tcolson@cisco.com] 
Sent: Monday, December 23, 2002 6:53 AM
To: axis-user@xml.apache.org
Subject: RE: Initial Axis 1.1b Install Failure & Build Error


Replying to myself here...at least to keep the thread alive - still
hoping for additional help. ;-)

I loaded up Axis 1.1b inside Tomcat 4.1.18 and it runs swimmingly. No
errors. The 3.2.1 issue appears to be a classpath problem of some sort. 

Can anybody get 1.1b to run in Tomcat 3.2.1? 

Thanks!
Tim

-----Original Message-----
From: Tim Colson [mailto:tcolson@cisco.com] 
Sent: Friday, December 20, 2002 9:45 AM
To: axis-user@xml.apache.org
Subject: Initial Axis 1.1b Install Failure & Build Error


Hey folks -
  I've run Axis before, but I'm starting fresh with 1.1beta and running
into two problems - the first is EchoHeaders throwing an
InvocationTargetException when using the binary DIST of Axis, the second
is a compile problem while trying to build Axis from src with -ALL- of
the optional libraries (but narrowed down to the HTTPClient lib I
think).

Problem #1:
  Following the 1.1 install instructions, myself and a colleage have
both reproduced the following Fault (below). We are using the binary
dist of 1.1 with Tomcat 3.2.1 and JSDK 1.3.1_02. happyaxis.jsp reports
back success finding everything. The View works, and so does the 'show
me the wsdl' url...but
http://localhost:8080/axis/EchoHeaders.jws?method=list throws this
fault:

AXIS error
Sorry, something seems to have gone wrong... here are the details:

Fault - java.lang.reflect.InvocationTargetException 
AxisFault
 faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.lang.reflect.InvocationTargetException
 faultActor: null
 faultNode: null
 faultDetail: 
	stackTrace: java.lang.reflect.InvocationTargetException:
java.lang.NoClassDefFoundError: org/apache/axis/MessageContext
	at EchoHeaders.getRequest(EchoHeaders.java:112)
	at EchoHeaders.list(EchoHeaders.java:73)
	at java.lang.reflect.Method.invoke(Native Method)
(snipped)
----

Problem #2:
  Figuring that maybe something in the build was fubar... I decided to
start from src and build my own. :-)  Followed the excellent build
instructions and after a little bit of time, compiled and built the
'bare bones' jars. Tried these jars in tomcat - but it wouldn't work
because the servlet stuff wasn't compiled in (I assume that's why.)
  
  So I spent the next hour or so pulling down and expanding ALL of the
other optional jars. (I should be up to date now for any Jakarta project
I care to build...heh heh). I try to compile...but get compile errors.
If I yank out the commons-httpclient.jar, it compiles fine. 

Here are the errors:
     [echo] classpath:
D:\java\xml-axis\java\${xerces.jar};D:\java\xml-axis\java
\test\lib\jakarta-oro-2.0.5.jar;D:\java\xml-axis\java\lib\jsse.jar;D:\ja
va\xml-a
xis\java\lib\JimiProClasses.zip;D:\java\xml-axis\java\lib\activation.jar
;D:\java
\xml-axis\java\lib\mailapi.jar;D:\java\jdk1.3.1_02\lib\tools.jar;D:\java
\xml-axi
s\java\${j2ee.jar};D:\java\xml-axis\java\lib\junit.jar;D:\java\xml-axis\
java\lib
\castor-0.9.4.1.jar;D:\java\xml-axis\java\lib\commons-discovery.jar;D:\j
ava\xml-
axis\java\lib\commons-httpclient.jar;D:\java\xml-axis\java\lib\commons-l
ogging.j
ar;D:\java\xml-axis\java\lib\jcert.jar;D:\java\xml-axis\java\lib\jms.jar
;D:\java
\xml-axis\java\lib\jnet.jar;D:\java\xml-axis\java\lib\log4j-1.2.4.jar;D:
\java\xm
l-axis\java\lib\servlet.jar;D:\java\xml-axis\java\lib\wsdl4j.jar;D:\java
\xml-axi
s\java\lib\xalan.jar;D:\java\xml-axis\java\lib\xercesImpl.jar;D:\java\xm
l-axis\j
ava\lib\xml-apis.jar;D:\java\xml-axis\java\lib\xmlsec.jar;D:\java\jakart
a-ant-1.
5.1\lib\xml-apis.jar;D:\java\jakarta-ant-1.5.1\lib\xercesImpl.jar;D:\jav
a\jakart
a-ant-1.5.1\lib\optional.jar;D:\java\jakarta-ant-1.5.1\lib\junit.jar;D:\
java\jak
arta-ant-1.5.1\lib\ant.jar;D:\java\xml-axis\java\build\classes;D:\java\x
ml-axis\ java\build\tools;D:\java\xml-axis\java\build\lib\axis-ant.jar


compile:
    [javac] Compiling 1 source file to
D:\java\xml-axis\java\build\classes
    [javac]
D:\java\xml-axis\java\src\org\apache\axis\transport\http\CommonsHTTP
Sender.java:128: cannot resolve symbol
    [javac] symbol  : method setRequestBody  (java.lang.String)
    [javac] location: class
org.apache.commons.httpclient.methods.PostMethod
    [javac]             method.setRequestBody(new
String(baos.toByteArray()));
    [javac]                   ^
    [javac]
D:\java\xml-axis\java\src\org\apache\axis\transport\http\CommonsHTTP
Sender.java:264: cannot resolve symbol
    [javac] symbol  : method setProxyCredentials
(<null>,org.apache.commons.htt
pclient.Credentials)
    [javac] location: class org.apache.commons.httpclient.HttpState
    [javac]                 state.setProxyCredentials(null, proxyCred);
    [javac]                      ^
    [javac]
D:\java\xml-axis\java\src\org\apache\axis\transport\http\CommonsHTTP
Sender.java:302: cannot resolve symbol
    [javac] symbol  : method setProxyCredentials
(<null>,org.apache.commons.htt
pclient.Credentials)
    [javac] location: class org.apache.commons.httpclient.HttpState
    [javac]                 state.setProxyCredentials(null, proxyCred);
    [javac]                      ^
    [javac]
D:\java\xml-axis\java\src\org\apache\axis\transport\http\CommonsHTTP
Sender.java:327: cannot resolve symbol
    [javac] symbol  : method setSoTimeout  (int)
    [javac] location: class org.apache.commons.httpclient.HttpConnection
    [javac]             conn.setSoTimeout(msgContext.getTimeout());
    [javac]                 ^
    [javac] 4 errors

BUILD FAILED
file:D:/java/xml-axis/java/build.xml:92: Compile failed; see the
compiler error output for details.

P.S. I do have the Xerces libs in ${axis.home}/java/lib (xercesImpl.jar
and xmlApis.jar)... But the classpath shows
D:\java\xml-axis\java\${xerces.jar}; -> so what's up with that?

Thanks!
Tim



	




RE: Initial Axis 1.1b Install Failure & Build Error

Posted by Tim Colson <tc...@cisco.com>.
Replying to myself here...at least to keep the thread alive - still
hoping for additional help. ;-)

I loaded up Axis 1.1b inside Tomcat 4.1.18 and it runs swimmingly. No
errors. The 3.2.1 issue appears to be a classpath problem of some sort. 

Can anybody get 1.1b to run in Tomcat 3.2.1? 

Thanks!
Tim

-----Original Message-----
From: Tim Colson [mailto:tcolson@cisco.com] 
Sent: Friday, December 20, 2002 9:45 AM
To: axis-user@xml.apache.org
Subject: Initial Axis 1.1b Install Failure & Build Error


Hey folks -
  I've run Axis before, but I'm starting fresh with 1.1beta and running
into two problems - the first is EchoHeaders throwing an
InvocationTargetException when using the binary DIST of Axis, the second
is a compile problem while trying to build Axis from src with -ALL- of
the optional libraries (but narrowed down to the HTTPClient lib I
think).

Problem #1:
  Following the 1.1 install instructions, myself and a colleage have
both reproduced the following Fault (below). We are using the binary
dist of 1.1 with Tomcat 3.2.1 and JSDK 1.3.1_02. happyaxis.jsp reports
back success finding everything. The View works, and so does the 'show
me the wsdl' url...but
http://localhost:8080/axis/EchoHeaders.jws?method=list throws this
fault:

AXIS error
Sorry, something seems to have gone wrong... here are the details:

Fault - java.lang.reflect.InvocationTargetException 
AxisFault
 faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.lang.reflect.InvocationTargetException
 faultActor: null
 faultNode: null
 faultDetail: 
	stackTrace: java.lang.reflect.InvocationTargetException:
java.lang.NoClassDefFoundError: org/apache/axis/MessageContext
	at EchoHeaders.getRequest(EchoHeaders.java:112)
	at EchoHeaders.list(EchoHeaders.java:73)
	at java.lang.reflect.Method.invoke(Native Method)
(snipped)
----

Problem #2:
  Figuring that maybe something in the build was fubar... I decided to
start from src and build my own. :-)  Followed the excellent build
instructions and after a little bit of time, compiled and built the
'bare bones' jars. Tried these jars in tomcat - but it wouldn't work
because the servlet stuff wasn't compiled in (I assume that's why.)
  
  So I spent the next hour or so pulling down and expanding ALL of the
other optional jars. (I should be up to date now for any Jakarta project
I care to build...heh heh). I try to compile...but get compile errors.
If I yank out the commons-httpclient.jar, it compiles fine. 

Here are the errors:
     [echo] classpath:
D:\java\xml-axis\java\${xerces.jar};D:\java\xml-axis\java
\test\lib\jakarta-oro-2.0.5.jar;D:\java\xml-axis\java\lib\jsse.jar;D:\ja
va\xml-a
xis\java\lib\JimiProClasses.zip;D:\java\xml-axis\java\lib\activation.jar
;D:\java
\xml-axis\java\lib\mailapi.jar;D:\java\jdk1.3.1_02\lib\tools.jar;D:\java
\xml-axi
s\java\${j2ee.jar};D:\java\xml-axis\java\lib\junit.jar;D:\java\xml-axis\
java\lib
\castor-0.9.4.1.jar;D:\java\xml-axis\java\lib\commons-discovery.jar;D:\j
ava\xml-
axis\java\lib\commons-httpclient.jar;D:\java\xml-axis\java\lib\commons-l
ogging.j
ar;D:\java\xml-axis\java\lib\jcert.jar;D:\java\xml-axis\java\lib\jms.jar
;D:\java
\xml-axis\java\lib\jnet.jar;D:\java\xml-axis\java\lib\log4j-1.2.4.jar;D:
\java\xm
l-axis\java\lib\servlet.jar;D:\java\xml-axis\java\lib\wsdl4j.jar;D:\java
\xml-axi
s\java\lib\xalan.jar;D:\java\xml-axis\java\lib\xercesImpl.jar;D:\java\xm
l-axis\j
ava\lib\xml-apis.jar;D:\java\xml-axis\java\lib\xmlsec.jar;D:\java\jakart
a-ant-1.
5.1\lib\xml-apis.jar;D:\java\jakarta-ant-1.5.1\lib\xercesImpl.jar;D:\jav
a\jakart
a-ant-1.5.1\lib\optional.jar;D:\java\jakarta-ant-1.5.1\lib\junit.jar;D:\
java\jak
arta-ant-1.5.1\lib\ant.jar;D:\java\xml-axis\java\build\classes;D:\java\x
ml-axis\ java\build\tools;D:\java\xml-axis\java\build\lib\axis-ant.jar


compile:
    [javac] Compiling 1 source file to
D:\java\xml-axis\java\build\classes
    [javac]
D:\java\xml-axis\java\src\org\apache\axis\transport\http\CommonsHTTP
Sender.java:128: cannot resolve symbol
    [javac] symbol  : method setRequestBody  (java.lang.String)
    [javac] location: class
org.apache.commons.httpclient.methods.PostMethod
    [javac]             method.setRequestBody(new
String(baos.toByteArray()));
    [javac]                   ^
    [javac]
D:\java\xml-axis\java\src\org\apache\axis\transport\http\CommonsHTTP
Sender.java:264: cannot resolve symbol
    [javac] symbol  : method setProxyCredentials
(<null>,org.apache.commons.htt
pclient.Credentials)
    [javac] location: class org.apache.commons.httpclient.HttpState
    [javac]                 state.setProxyCredentials(null, proxyCred);
    [javac]                      ^
    [javac]
D:\java\xml-axis\java\src\org\apache\axis\transport\http\CommonsHTTP
Sender.java:302: cannot resolve symbol
    [javac] symbol  : method setProxyCredentials
(<null>,org.apache.commons.htt
pclient.Credentials)
    [javac] location: class org.apache.commons.httpclient.HttpState
    [javac]                 state.setProxyCredentials(null, proxyCred);
    [javac]                      ^
    [javac]
D:\java\xml-axis\java\src\org\apache\axis\transport\http\CommonsHTTP
Sender.java:327: cannot resolve symbol
    [javac] symbol  : method setSoTimeout  (int)
    [javac] location: class org.apache.commons.httpclient.HttpConnection
    [javac]             conn.setSoTimeout(msgContext.getTimeout());
    [javac]                 ^
    [javac] 4 errors

BUILD FAILED
file:D:/java/xml-axis/java/build.xml:92: Compile failed; see the
compiler error output for details.

P.S. I do have the Xerces libs in ${axis.home}/java/lib (xercesImpl.jar
and xmlApis.jar)... But the classpath shows
D:\java\xml-axis\java\${xerces.jar}; -> so what's up with that?

Thanks!
Tim