• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Could not create connection !!!!

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Ranch Hand
Posts: 293
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do not put database drivers in WEB-INF/lib. Put them in the lib directory for your configuration.
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Could not load org.hsqldb.jdbcDriver.



Because , you deleted driver of HypersonicDB from lib directory of jboss. ( restore driver )
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic