Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Deploying webservice on Oracle IAS
Deploying webservice on Oracle IAS [message #175113] Thu, 20 July 2006 06:09 Go to next message
Eclipse User
Originally posted by: Ben_Engbers.yahoo.com

Hi,

Maybe that this is not the best place to drop my problem but I don't
know where else I can do this.

With Eclipse Callisto (out of the box) and Tomcat 5.5.17, I have
developed a service which uses a Global JNDI datasource. This service is
exported to a WAR-file and then deployed on Oracle 10 IAS.

On Oracle, the service can't connect to the database.

In Jdeveloper 10.1.2 I have written a test-service which is exported to
an EAR-file. The getConnection() function is copied (cut and paste).
After deploying the webservice returns the correct answer.

Can anyone give me a clue on what I am doing wrong?

Thanks,
Ben

package tester;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;

public class JNDItest {
public String simpleJNDI() {
int aantal = 0;
String query;
Connection conn = null;
try {
conn = this.getConnection();
Statement stmt = conn.createStatement();
StringBuffer sb = new StringBuffer("select count(*) from exporteis");
query = sb.toString();
ResultSet rs = stmt.executeQuery(query);
while (rs.next()) {
aantal = rs.getInt(1);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return "In Exporteis zitten " +aantal+" records";
}

private Connection getConnection() {
Connection retour = null;
try {
Context ctx = new InitialContext();
if (ctx == null) {
throw new Exception("Er is geen context.");
}
DataSource ds = (DataSource)
ctx.lookup("java:comp/env/jdbc/Client");
if (ds != null) {
retour = ds.getConnection();
}
} catch (Exception e) {
e.printStackTrace();
}
return retour;
}

}
Re: Deploying webservice on Oracle IAS [message #175377 is a reply to message #175113] Tue, 25 July 2006 11:24 Go to previous message
Kathy Chan is currently offline Kathy Chan
Messages: 93
Registered: July 2009
Member
Hi Ben,

I assume the bean that you want to turn into Web service requires certain
JARs. Please make sure that those required JARs have been added to the
WebContent/WEB-INF/lib directory so that the Web service can find the
classes in those JARs during runtime.

Are you using the Axis Web service runtime (e.g. using the WTP Web services
wizard to create the Web service or creating one manually)? If so, you
could check to see if the Axis servlet is deployed properly or not by
launching the URL:

http://localhost:8080/<YourWebProject>/services/AdminService

Check to see if the Web service you deployed is there or not.

Regards,

Kathy Chan

"Ben Engbers" <Ben_Engbers@yahoo.com> wrote in message
news:e9nkor$ufv$1@utils.eclipse.org...
> Hi,
>
> Maybe that this is not the best place to drop my problem but I don't
> know where else I can do this.
>
> With Eclipse Callisto (out of the box) and Tomcat 5.5.17, I have
> developed a service which uses a Global JNDI datasource. This service is
> exported to a WAR-file and then deployed on Oracle 10 IAS.
>
> On Oracle, the service can't connect to the database.
>
> In Jdeveloper 10.1.2 I have written a test-service which is exported to
> an EAR-file. The getConnection() function is copied (cut and paste).
> After deploying the webservice returns the correct answer.
>
> Can anyone give me a clue on what I am doing wrong?
>
> Thanks,
> Ben
>
> package tester;
>
> import java.sql.Connection;
> import java.sql.ResultSet;
> import java.sql.SQLException;
> import java.sql.Statement;
>
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import javax.sql.DataSource;
>
> public class JNDItest {
> public String simpleJNDI() {
> int aantal = 0;
> String query;
> Connection conn = null;
> try {
> conn = this.getConnection();
> Statement stmt = conn.createStatement();
> StringBuffer sb = new StringBuffer("select count(*) from
exporteis");
> query = sb.toString();
> ResultSet rs = stmt.executeQuery(query);
> while (rs.next()) {
> aantal = rs.getInt(1);
> }
> } catch (Exception e) {
> e.printStackTrace();
> } finally {
> try {
> conn.close();
> } catch (SQLException e) {
> e.printStackTrace();
> }
> }
> return "In Exporteis zitten " +aantal+" records";
> }
>
> private Connection getConnection() {
> Connection retour = null;
> try {
> Context ctx = new InitialContext();
> if (ctx == null) {
> throw new Exception("Er is geen context.");
> }
> DataSource ds = (DataSource)
> ctx.lookup("java:comp/env/jdbc/Client");
> if (ds != null) {
> retour = ds.getConnection();
> }
> } catch (Exception e) {
> e.printStackTrace();
> }
> return retour;
> }
>
> }
Previous Topic:how to change web project without redeploy?
Next Topic:Problems launching JSP in Eclipse 3.2
Goto Forum:
  


Current Time: Wed Jul 30 15:21:58 EDT 2014

Powered by FUDForum. Page generated in 0.02527 seconds