aspose file tools*
The moose likes JBoss/WildFly and the fly likes How to access a DataSource in JBoss Remoting ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How to access a DataSource in JBoss Remoting ?" Watch "How to access a DataSource in JBoss Remoting ?" New topic
Author

How to access a DataSource in JBoss Remoting ?

Ken P Williams
Greenhorn

Joined: Mar 19, 2010
Posts: 2

Hi All,

I'm trying to use JBoss Remoting because we want to use server-side Java
in an Enterprise application but using a plain 'socket' protocol (i.e. not HTTP)
because we want the clustering and database-pooling that JEE offers.

So it seems to me that the way to do this is to use the JBoss Remoting
which allows us to use JBoss, and specify the use of the 'socket' transport.

So I've downloaded the JBoss Remoting libs from http://jboss.org/jbossremoting
and have been able (using 'ant') to build and run the code examples, as shown
in the documentation. (In particular, the SimpleClient and SimpleServer examples.)

I've now tried to modify the SimpleServer code (below) to connect to a MySQL
database using a DataSource (to use connection-pooling) but have run into a number
of problems.




I can use 'ant' to build the server fine, but when it tries to run it throws an error...




Problem 1. My first problem is how do I specify the DataSource ? Normally I would specify a DataSource in the 'web.xml' of a
web-app but ths is not a web application so there is no web.xml file. None of the JBoss Remoting examples have web.xml files.
So I tried creating a mysql-ds.xml file (below) and placing it at various locations under where I've unzipped the
download but I still get the same error.



Problem 2. The examples all run within their own stripped-down JBoss container that comes with the download.
It contains only a few .jar files (below), the directory layout is different, and there is no 'deploy' directory.
It does not seem to be the JBoss Microcontainer (http://jboss.org/jbossmc) either.





If I managed to solve the DataSource problem, how would I deploy the application under
this server ? How do I admin and configure this server (it displays no Admin page
on http://localhost:8080 when it runs and there seems to be no admin console) ?
Is it possible to deploy a JBoss Remoting app under a normal JBoss server ?

I'm a bit unsure what to do next and would be *very* grateful for any help anyone can give.

Thanks and Regards,

Ken
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

In your data source xml you need to set "use-java-context" to false.



Regards, Rene Larsen
Dropbox Invite
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

For the remote deployment I can only think of this one (beside using Maven or Ant): http://community.jboss.org/wiki/JSR88Client
Ken P Williams
Greenhorn

Joined: Mar 19, 2010
Posts: 2

Hi Rene,

I added the



but I still get the same error



I'll look at the JSR88 code.

Regards,

Ken
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Yeah, I didn't see that the first time I read your code

You also need to set-up your InitialContext - e.g. like this:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to access a DataSource in JBoss Remoting ?
 
Similar Threads
EJB30-JBOSS sample tutorial doesn't works!!
Running JBoss localy from Eclipse - can't establish connection
Webservices using hibernate, jboss and eclipse and MySQL
JNDI Port number issue while strating JBoss server 4.2.2.GA
CommunicationException in war file deployment