wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes Could not perform loook up operation in JBoss..need urgent help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Could not perform loook up operation in JBoss..need urgent help" Watch "Could not perform loook up operation in JBoss..need urgent help" New topic
Author

Could not perform loook up operation in JBoss..need urgent help

kala praveen
Greenhorn

Joined: Nov 04, 2004
Posts: 21
Hello,

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.
Henrique Sousa
Ranch Hand

Joined: Apr 29, 2004
Posts: 92
Hi Kala,

I think you should check you deployment descriptor (ejb-jar.xml), for in order to get a DataSource from some EJB you must configure a resource reference to it. So for each bean that needs access to the DataSource, you should have something like this in your ejb-jar.xml:


And in jboss.xml (just once):


And then you lookup like this:


I hope that's all. Best regards,


Henrique Sousa<br />SCJP 1.4<br /> <br />All men die, not all men really live - Braveheart, 1995
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Could not perform loook up operation in JBoss..need urgent help
 
Similar Threads
cmp on jboss-3.0.6_tomcat-4.1.18 with mysql
Question: ejb-ref with ejb3.0 and jboss-4.2.0.GA
JNDI look up error in JBoss..urgent help needed
Jboss rar JNDI lookup
Does jboss bind to 0.0.0.0 on a non-clustered server ?