Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

JNDI look up error in JBoss..urgent help needed

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The jmx-console includes a JNDIView MBean. Just run that and you can see where everything is bound in JNDI.
 
What a stench! Central nervous system shutting down. Save yourself tiny ad!
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic