File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Create simple WS in eclipse using JBOSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Create simple WS in eclipse using JBOSS" Watch "Create simple WS in eclipse using JBOSS" New topic
Author

Create simple WS in eclipse using JBOSS

Bobby Anderson
Ranch Hand

Joined: Oct 28, 2008
Posts: 114
Has anyone been successful creating a simple hello world type web service in eclipse 3.3 using JBOSS?

When I try and create a new "Dynamic Web Project" I HAVE to put in database information. The problem is that when I try and deploy I get the following error:
09:38:48,053 FATAL [DatasourceConnectionProvider] Could not find datasource: java:/T2Datasource

I am very new to web services so maybe I am creating the wrong project in eclipse. I don't really need a DB connection for this simple example.

It seems every eclipse tutorial out there is using the older versions of eclipse and they are able to create 'different projects" (i.e. in version 3.3 of eclipse I don't have those options).

Again I am very new and would like to start with a very simple example, so any help would be greatly appreciated

Thanks,
Billy
k Jayapradeep
Greenhorn

Joined: Oct 18, 2008
Posts: 6
hai ,
friend i thing your missing database connection jar file(example you are using orcle must need classes12.jar )import jar file in your Lib directory or check connection method arguments if it should point correct database ? check it.
Bobby Anderson
Ranch Hand

Joined: Oct 28, 2008
Posts: 114
I have the connection .jar file. The problem is probably that I do not have the database started.

But again my question is that all the turtorials online do not go into detail about setting up the DB, nor do you have to provide DB info when creating a 'dynamic web project' in eclipse for these out of date tutorials. That is because the old version of eclipse did not make you have a database for a simple web service.

So the question is still, how do I create a simple hello world web service in eclipse (version 3.4 for EE developers) without a database.

Thanks again.
k Jayapradeep
Greenhorn

Joined: Oct 18, 2008
Posts: 6
hai,
i thing following samples useful for your connection problem.

before understand what type of driver your working.
I give oracle type 4 driver connection details .
java file file1:
import java.sql.*;
public class ConnectionConf
{
public static Connection getConnection() throws Exception
{
String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc racle:thin:@<hostaddress>:1521:<databasename>";
String username = "scott";
String password = "triger";
Class.forName(driver);
Connection conn = DriverManager.getConnection(url, username, password);
return conn;
}

}
java file2
class abc
{
String value="";
String SearchResult="";
public boolean method( String arg1, String arg2)
{
boolean bidAvailability = false;
String bidAvailabilityQuery = " SELECT * FROM table WHERE field1 = ? AND field2 = ? ";
try
{
//here i will call the connection method
Connection conn = ConnectionConf.getConnection();
PreparedStatement ps = conn.prepareStatement( bidAvailabilityQuery );
..
...

After finished that connection problem, start to convert the java file2 into wsdl file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Create simple WS in eclipse using JBOSS