aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes JNDI look up error in JBoss..urgent help needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JNDI look up error in JBoss..urgent help needed" Watch "JNDI look up error in JBoss..urgent help needed" New topic
Author

JNDI look up error in JBoss..urgent help needed

kala praveen
Greenhorn

Joined: Nov 04, 2004
Posts: 21
Greetings,

I am trying use a SQL Server Data Source object through JBoss server but getting so many errors.

I think I have all the required jar files in CLASSPATH.

I have copied the mssql-ds.xml to JBOSS_DIST\server\default\deploy directory and modified it in the following way:

<datasources>
<local-tx-datasource>
<jndi-name>MSSQLDS</jndi-name>
<connection-url>
jdbc:microsoft:sqlserver://172.20.37.219:1433;DatabaseName=master
</connection-url>
<driver-class>
com.microsoft.jdbc.sqlserver.SQLServerDriver
</driver-class>
<user-name>sa</user-name>
<password>welcome</password>
</local-tx-datasource>
</datasources>

I also had standardjaws.xml modified and copied to E:\jboss-3.2.4\server\default\conf directory.

while starting up the server shows the following confirmation:

14:11:00,780 INFO [MSSQLDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=MSSQLDS to JNDI name 'java:/MSSQLDS'

But, when I execute the following client code on the same machine, it is giveing runtime error:
**after setting the env props into HashTable ht..

Context ic=new InitialContext(ht);
DataSource ds=(DataSource)ic.lookup("java:comp/env/jdbc/MSSQLDS");

Error:

Exception in thread "main" javax.naming.NameNotFoundException: comp not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
at org.jnp.server.NamingServer.lookup(NamingServer.java:253)
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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at TestJdbcJBoss.main(TestJdbcJBoss.java:21)


*** I have also tried the above look up statement with java:/MSSQLDS, java:/env/MSSQLDS and all the possible combinations.

It is not detecting whatever that comes after "java: "

I am really tiered with this error...Writing here with a ray of hope..plz help me.
Kripal Singh
Ranch Hand

Joined: Jul 26, 2001
Posts: 254
Is there a way to look up the JNDI tree in JBOSS like it is done in WEBlogic . if yes have a look at the tree that object is bound .


# Help an unprivileged kid.<br /> Whatever u do will make a difference...<br /> ...to a child's life & ur own #<br /><a href="http://www.cry.org/" target="_blank" rel="nofollow">www.cry.org/</a>
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

The jmx-console includes a JNDIView MBean. Just run that and you can see where everything is bound in JNDI.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JNDI look up error in JBoss..urgent help needed