-
15. Re: java.naming.provider.url parsing problem?
peterj Aug 29, 2006 6:01 PM (in response to csturtz)Actually, I was going to bring this up earlier. If you are trying to gain access to a data source from a remote client, you can't do that. Remote access assumes that all of the classes involved can be invoked remotely via some proxy. That might be true for the datasource class itself (I'm not sure), but I can almost guarantee that none of the JDBC classes (Connection, PreparedStatement, ResultSet) are accessible remotely. At least, that is my understanding.
-
16. Re: java.naming.provider.url parsing problem?
csturtz Aug 30, 2006 10:07 AM (in response to csturtz)Here's something I found on the JBoss wiki. It sounds like I should be able to access the DataSource remotely.
http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigDataSourcesConfiguring a DataSource for remote usage
As of jboss-4.0.0 there is support for accessing a DataSource from a remote client. The one change that is neccessary for the client to be able to lookup the DataSource from jndi is to specify use-java-context=false as shown here:
<datasources>
<local-tx-datasource>
<jndi-name>GenericDS</jndi-name>
<use-java-context>false</use-java-context>
<connection-url>...</connection-url>
...
This results in the DataSource being bound under the jndi name "GenericDS" instead of the default of "java:/GenericDS" which restricts the lookup to the same vm as the jboss server.
Note: JBoss does not recommend using this feature on a production environment. It requires accessing a connection pool remotely and this is an anti-pattern as connections are not serializable. Besides, transaction propagation is not supported and it could lead to connection leaks if the remote clients are unreliable (i.e crashes, network failure). If you do need to access a datasource remotely, JBoss recommends accessing it via a remote session bean facade. -
17. Re: java.naming.provider.url parsing problem?
csturtz Aug 30, 2006 11:49 AM (in response to csturtz)I just made a break through that's pretty interesting.
We run all of our tests through Maven2. Since the exception i was getting doesn't provide much information, I decided to use my IDE (IntelliJ IDEA) to do some debugging. To my surprise, everything worked perfectly. So, whatever is going on has nothing to do with JBoss. I've just got to figure out any differences between the Maven2 JVM Environment and the IDEA JVM Environment when running these tests.
Thanks for all the help!
... on to the Maven2 forums ... -
18. Re: java.naming.provider.url parsing problem?
litalh Sep 12, 2006 11:02 AM (in response to csturtz)Hi.
I have the same problem as described.
I'm using the following properties:
provider.url = jnp://serverName:1099
initial.context.factory = org.jnp.interfaces.NamingContextFactory
url.pkg.prefixes = org.jboss.naming.client
The jboss is running on a different machine with unix operating system.
when trying to connect I get the following exception :
javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 137.0.0.1;
Does anyone have any idea ?
Thanks a lot,
Lital -
19. Re: java.naming.provider.url parsing problem?
peterj Sep 12, 2006 11:51 AM (in response to csturtz)Did you read through the entire post? Did you try telnet? If so, what were your results?
Also see http://www.jboss.com/index.html?module=bb&op=viewtopic&t=90091