File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Could not create connection !!!!

 
shailesh kumar
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Everybody,

I am new bie to JBoss and I am trying to connect Oracle and having some problems, would appreciate if somobody can respond urgently. I have ojdbc14.jar in WEB-INF/lib diretory
Here are my app-ds.xml file


web.xml --file


Here is the code by which I am trying to get the connection:



Here is the error:
10:37:59,262 INFO [STDOUT] ds**********org.jboss.resource.adapter.jdbc.WrapperD
ataSource@335053
10:37:59,402 WARN [JBossManagedConnectionPool] Throwable while attempting to ge
t a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested
throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver
class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc racle:thin:@dev:1521:test_dev at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.c
reateManagedConnection(LocalManagedConnectionFactory.java:161)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.cr
eateConnectionEventListener(InternalManagedConnectionPool.java:508)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.ge
tConnection(InternalManagedConnectionPool.java:207)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BaseP
ool.getConnection(JBossManagedConnectionPool.java:534)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManage
dConnection(BaseConnectionManager2.java:395)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedCo
nnection(TxConnectionManager.java:297)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateC
onnection(BaseConnectionManager2.java:447)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$Connectio
nManagerProxy.allocateConnection(BaseConnectionManager2.java:874)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(Wrapp
erDataSource.java:103)
at com.exelixis.plateloader.ProcessBarcodeAction.execute(ProcessBarcodeA
ction.java:78)
at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:116
4)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 
Dave Salter
Ranch Hand
Posts: 293
Java Mac OS X Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you are using the wrong Oracle drivers for your version of your database. Are you using the correct drivers?
 
shailesh kumar
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think i have to classes12.jar file in lib directory, i removed the ojdbc14.jar and i copied classes12.jar file. now iam getting diffrent error..i dont understand why jboss is loading this driver..this unrelated to my application
 
norman richards
Author
Ranch Hand
Posts: 367
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do not put database drivers in WEB-INF/lib. Put them in the lib directory for your configuration.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could not load org.hsqldb.jdbcDriver.


Because , you deleted driver of HypersonicDB from lib directory of jboss. ( restore driver )
 
trinity
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For oracle 10g and if you are using jdk1.4 or higher use ojdbc14.jar. Download ojdbc14.jar from oracle website.

Place it inthe jboss/default/lib directory.

Connection conn = null;
Context ic =null;
DataSource ds=null;
// To be used in JBoss Server
try{
ic = new InitialContext();

ds=(DataSource)ic.lookup("java:/OracleDS");
System.out.println(ds.toString());
//System.out.println(ds.);
conn = ds.getConnection();
}
catch(Exception ere)
{
ere.printStackTrace();
}

OraceDS is the JNDI name give inghe Oracle-ds.xml file

If your problem is not fixed, let me help you.

Trinity
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic