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 "Chen, Li (Research, YOH)" <ch...@research.ge.com> on 2003/07/02 14:28:48 UTC
Trouble connecting web service in Axis to Oracle DB
Hi all,
Here is a peculiar situation that I am trying to resolve: I am
trying to deploy a simple web service that would connect in a "chain"
fashion to the back-end JDBC-Oracle connection class and retreive data from
the Oracle database. The "client" sees a simple JWS file as the endpoint
URL, and calls one of the JWS's methods. The method then calls a some other
classes, each which does its work and eventually the JDBC-Oracle class is
executed and result from the Oracle DB is pulled. However, I have this
mysterious error -- when I send from one of the "client" to a request to the
JWS web service file, I see the following error message as intercepted by
TCPMonitor:
HTTP/1.1 500 Internal Server Error
Date: Wed, 02 Jul 2003 12:07:41 GMT
Server: Jetty/4.2.9 (Windows 2000/5.0 x86 java/1.4.1_02)
Set-Cookie: JSESSIONID=51m56qekkr93f;Path=/spoda
Set-Cookie2: JSESSIONID=51m56qekkr93f;Version=1;Path=/spoda;Discard
Content-Type: text/xml; charset=utf-8
Content-Length: 2715
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<SOAP-ENV:faultcode
xmlns:ns4="http://xml.apache.org/axis/">ns4:Server.generalException</SOAP-EN
V:faultcode>
<SOAP-ENV:faultstring>java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:2
20)
at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:244)
at
org.apache.axis.handlers.JWSProcessor.invokeImpl(JWSProcessor.java:227)
at
org.apache.axis.handlers.JWSProcessor.invoke(JWSProcessor.java:99)
at
org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:232)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:262)
at
org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:338)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandl
er.java:294)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext
.java:507)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
at org.mortbay.http.HttpServer.service(HttpServer.java:863)
at org.jboss.jetty.Jetty.service(Jetty.java:460)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
at
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
Caused by: java.lang.NoClassDefFoundError:
oracle/jdbc/driver/OracleDriver
at CCR_Connection.<init>(CCR_Connection.java:38)
at Converter.grabData(Converter.java:60)
at Spoda.getPersonData(Spoda.java:64) ... 27 more \
</SOAP-ENV:faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
This Caused by: java.lang.NoClassDefFoundError:
oracle/jdbc/driver/OracleDriver seems to be the cause of the error. However,
I can't figure out why tha happens: when I rename the JWS file as a Java
file and execute a "request" on the server side (i.e. pass all my parameters
on the "server" side to the Java file), it works perfectly. And yes, I have
included the JDBC-Oracle drivers in the classpath. I am using:
JBoss 3.2.1 with Jetty
Axis 1.1RC2
Oracle 8i (8.1.7.0.0)
Any insights into this?
Thanks!!
Lee
Question
Posted by Arvin Jay Cando <aj...@ntsp.nec.co.jp>.
my WSDD
------------
<deployment name="test" xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
<service name="ElementService" provider="java:RPC">
<parameter name="alias" value="ElementService"/>
<parameter name="className" value="samples.encoding.ElementService" />
<parameter name="allowedMethods" value="echoElement" />
<typeMapping xmlns:typeNS="urn:myNameSpace"
qname="typeNS:Data"
languageSpecificType="java:samples.encoding.Data"
serializer="samples.encoding.DataSerFactory"
deserializer="samples.encoding.DataDeserFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</service>
</deployment>
-------------
my sample code
...
public static void main(String args[]) {
MessageContext msgContext = new MessageContext(new AxisServer());
SOAPEnvelope msg = new SOAPEnvelope();
RPCParam arg1 = new RPCParam("urn:myNamespace", "testParam",
"this is a string");
QName dataQName = new QName("typeNS", "Data");
....
was my WSDD correct in my typeMapping tag?
thanks... im so sorry but im just really lost in trying to make this run...
Re: Trouble connecting web service in Axis to Oracle DB
Posted by Srinath Perera <he...@vijayaba.cse.mrt.ac.lk>.
dear Chen, Li
Am not sure about the oracle exception. one simple things you can try is
to try to deploy the service with a wsdd(if need more info look at axis
user guide) file rather than using .jws.
I grant you nothing. But i feel it worth a try.(when you use the jws it
has certain limitaions)
regards
Srinath
On Wed, 2003-07-02 at 18:28, Chen, Li (Research, YOH) wrote:
> Hi all,
> Here is a peculiar situation that I am trying to resolve: I am
> trying to deploy a simple web service that would connect in a "chain"
> fashion to the back-end JDBC-Oracle connection class and retreive data from
> the Oracle database. The "client" sees a simple JWS file as the endpoint
> URL, and calls one of the JWS's methods. The method then calls a some other
> classes, each which does its work and eventually the JDBC-Oracle class is
> executed and result from the Oracle DB is pulled. However, I have this
> mysterious error -- when I send from one of the "client" to a request to the
> JWS web service file, I see the following error message as intercepted by
> TCPMonitor:
>
> HTTP/1.1 500 Internal Server Error
> Date: Wed, 02 Jul 2003 12:07:41 GMT
> Server: Jetty/4.2.9 (Windows 2000/5.0 x86 java/1.4.1_02)
> Set-Cookie: JSESSIONID=51m56qekkr93f;Path=/spoda
> Set-Cookie2: JSESSIONID=51m56qekkr93f;Version=1;Path=/spoda;Discard
> Content-Type: text/xml; charset=utf-8
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <SOAP-ENV:Body>
> <SOAP-ENV:Fault>
> <SOAP-ENV:faultcode
> xmlns:ns4="http://xml.apache.org/axis/">ns4:Server.generalException</SOAP-EN
> V:faultcode>
> <SOAP-ENV:faultstring>java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
> )
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> .java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:2
> 20)
> at
> org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:244)
>
> at
> org.apache.axis.handlers.JWSProcessor.invokeImpl(JWSProcessor.java:227)
>
> at
> org.apache.axis.handlers.JWSProcessor.invoke(JWSProcessor.java:99)
> at
> org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:232)
> at org.apache.axis.server.AxisServer.invoke(AxisServer.java:262)
>
> at
> org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:338)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
> at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
> at
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandl
> er.java:294)
> at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
>
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
> at
> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext
> .java:507)
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
> at org.mortbay.http.HttpServer.service(HttpServer.java:863)
> at org.jboss.jetty.Jetty.service(Jetty.java:460)
> at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
>
> at
> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
>
> at
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
>
> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
>
> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
> Caused by: java.lang.NoClassDefFoundError:
> oracle/jdbc/driver/OracleDriver
> at CCR_Connection.<init>(CCR_Connection.java:38)
> at Converter.grabData(Converter.java:60)
> at Spoda.getPersonData(Spoda.java:64) ... 27 more \
> </SOAP-ENV:faultstring>
> </SOAP-ENV:Fault>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> This Caused by: java.lang.NoClassDefFoundError:
> oracle/jdbc/driver/OracleDriver seems to be the cause of the error. However,
> I can't figure out why tha happens: when I rename the JWS file as a Java
> file and execute a "request" on the server side (i.e. pass all my parameters
> on the "server" side to the Java file), it works perfectly. And yes, I have
> included the JDBC-Oracle drivers in the classpath. I am using:
>
> JBoss 3.2.1 with Jetty
> Axis 1.1RC2
> Oracle 8i (8.1.7.0.0)
>
> Any insights into this?
>
> Thanks!!
>
> Lee
>