I am new to jboss, working on deploying and running a small test application using Jboss 3.0 and Oracle 8i. It simply consists of one session bean and a client class to test session bean. I have copied the classes12.zip file in %JBOSSHOME%\server\default\lib and appropriately edited oracle-service.xml, login-config.xml files for my Oracle database. The session bean (named Contact) creates an instance of dataSource and attempts to create a connection with following function call:
con = dataSource.getConnection();
This results in following error:
20:46:03,513 INFO [STDOUT] SQLException: Could not create connection; - nested
throwable: (java.sql.SQLException: invalid arguments in call); - nested throwabl
e: (org.jboss.resource.JBossResourceException: Could not create connection; - ne
sted throwable: (java.sql.SQLException: invalid arguments in call)):null
20:46:03,523 INFO [STDOUT] from ContactBean
In desperation, I tried to connect with following call and it worked
con = dataSource.getConnection(username, password);
I am not using jboss.xml because i have read somewhere that this file is not required unless there is vendor specific configuration.
I am using following (ejb-jar.xml) descriptor for the session bean
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar>
Simple application
<display-name>Data Access Application</display-name>
<enterprise-beans>
<ejb-name>Contact</ejb-name>
com.javapro.ejb.ContactHome
com.javapro.ejb.Contact
<ejb-class>com.javapro.ejb.ContactBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</enterprise-beans>
</ejb-jar>
I would appreciate if any one can give me some clues why my connection is not established without passing username and password as parameters.
Thanks,
Irfan