Win a copy of Building Blockchain Apps 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Problem!! Oracle datasource in Websphere STUDIO

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have problem in creating the Oracle datasource in websphere STUDIO 4.0.
I Added JDBC DRIVER with following details..
Name: OracleDriver
Implementation Class: oracle.jdbc.pool.OracleConnectionPoolDataSource
URL PREFIX : jdbc racle:thin@develop3:1521
classpath : f:\OracleDrivers\classes111.zip

Then I added a datasource with following details:
Name: myDataSource
JNDI name : jdbc/myDataSource
Database Name : oracle

In code I specify :
Hashtable parms = new Hashtable();
parms.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
Context ctx = new InitialContext(parms);
ds = (DataSource)ctx.lookup("jdbc/myDataSource");
java.sql.Connection conn = ds.getConnection("system","manager");

When I run/Debug it, I receive following exception...

java.sql.SQLException: Invalid Oracle URL specified: OracleDataSource.makeURL
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java)
at oracle.jdbc.pool.OracleDataSource.makeURL(OracleDataSource.java)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java)
at com.ibm.ejs.cm.pool.JDBC1xConnectionFactory.createConnection(JDBC1xConnectionFactory.java:42)
at com.ibm.ejs.cm.pool.ConnectionPool.createConnection(ConnectionPool.java:914)
at com.ibm.ejs.cm.pool.ConnectionPool.createOrWaitForConnection(ConnectionPool.java:846)
at com.ibm.ejs.cm.pool.ConnectionPool.findFreeConnection(ConnectionPool.java:764)
at com.ibm.ejs.cm.pool.ConnectionPool.findConnectionForTx(ConnectionPool.java:676)
at com.ibm.ejs.cm.pool.ConnectionPool.allocateConnection(ConnectionPool.java:610)
at com.ibm.ejs.cm.pool.ConnectionPool.getConnection(ConnectionPool.java:274)
at com.ibm.ejs.cm.DataSourceImpl.getConnection(DataSourceImpl.java:113)
at DataSourceServlet.doGet(DataSourceServlet.java:32)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:499)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:278)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:105)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:123)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:122)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:313)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:242)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)

Please Take a look..
Urgent...
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there...
the url u have specified is
jdbc racle:thin@develop3:1521
i c there is a colon missing after the thin...
check that ur url looks exactly as
jdbc racle:thin:@develop3:1521 atabasename
actual format of URL:
jdbc racle:thin:@hostname:1521 atabasename
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi! i have the same problem. i havent solved it yet. how did you do that. do you have detailed document on how to make it work. especially in defining datasource on websphere application developer test environment.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have the same problem too....i have checked to make sure i got the correct URL.....but when i run test environment...it's still telling me i can't connect to the database.....
************* End Display Current Environment *************
[10/1/02 20:09:30:352 EDT] d715bb5 Server U Version : 4.0.2
[10/1/02 20:09:30:362 EDT] d715bb5 Server U Edition: Advanced Single Server Edition for Multiplatforms
[10/1/02 20:09:30:362 EDT] d715bb5 Server U Build date: Tue Dec 18 00:00:00 EST 2001
[10/1/02 20:09:30:362 EDT] d715bb5 Server U Build number: a0150.05
[10/1/02 20:09:37:912 EDT] d715bb5 DrAdminServer I WSVR0053I: DrAdmin available on port 7000
[10/1/02 20:09:38:022 EDT] d715bb5 ResourceBinde I WSVR0049I: Binding Session Persistence datasource as jdbc/Session
[10/1/02 20:09:38:042 EDT] d715bb5 ResourceBinde I WSVR0049I: Binding ProductCategory as jdbc/ProductCategory
[10/1/02 20:09:39:865 EDT] d715bb5 EJBEngine I WSVR0037I: Starting EJB jar: ProductCategoryEJB
[10/1/02 20:09:41:167 EDT] d715bb5 ConnectionPoo X CONM6009E: Failed to get connection to the database from datasource (ProductCategory).
[10/1/02 20:09:41:197 EDT] d715bb5 JDBCPersister W CNTR0031W: Error starting CMP bean: ProductCategoryEAR#ProductCategoryEJB.jar#ProductCategory
[10/1/02 20:09:41:237 EDT] d715bb5 JDBCPersister W CNTR0032W: Error creating CMP persister using datasource: jdbc/ProductCategory
[10/1/02 20:09:41:257 EDT] d715bb5 EJBEngine X WSVR0062E: Failed to start EJB, ProductCategoryEAR#ProductCategoryEJB.jar#ProductCategory: Invalid Oracle URL specified: OracleDataSource.makeURL
[10/1/02 20:09:41:808 EDT] d715bb5 ServletEngine A SRVE0161I: IBM WebSphere Application Server - Web Container. Copyright IBM Corp. 1998-2001
[10/1/02 20:09:41:858 EDT] d715bb5 ServletEngine A SRVE0162I: Servlet Specification Level: 2.2
[10/1/02 20:09:41:868 EDT] d715bb5 ServletEngine A SRVE0163I: Supported JSP Specification Level: 1.1
[10/1/02 20:09:42:198 EDT] d715bb5 ServletEngine A SRVE0167I: Session Manager is Configured - Initializing...
[10/1/02 20:09:42:479 EDT] d715bb5 CacheManager A DYNA0011E: Servlet cache file dynacache.xml not found; caching is disabled
[10/1/02 20:09:42:519 EDT] d715bb5 ServletEngine A SRVE0169I: Loading Web Module: IBM EJB Test Client.
[10/1/02 20:09:43:069 EDT] d715bb5 WebGroup I SRVE0091I: [Servlet LOG]: JSP 1.1 Processor: init
[10/1/02 20:09:43:120 EDT] d715bb5 WebGroup I SRVE0091I: [Servlet LOG]: SimpleFileServlet: init
[10/1/02 20:09:43:140 EDT] d715bb5 ServletEngine A SRVE0169I: Loading Web Module: ProductCategory.
[10/1/02 20:09:43:320 EDT] d715bb5 WebGroup I SRVE0091I: [Servlet LOG]: JSP 1.1 Processor: init
[10/1/02 20:09:43:360 EDT] d715bb5 WebGroup I SRVE0091I: [Servlet LOG]: SimpleFileServlet: init
[10/1/02 20:09:43:440 EDT] d715bb5 WebGroup I SRVE0091I: [Servlet LOG]: InvokerServlet: init
[10/1/02 20:09:43:500 EDT] d715bb5 HttpTransport A SRVE0171I: Transport http is listening on port 8,080.
[10/1/02 20:09:43:560 EDT] d715bb5 Server A WSVR0023I: Server Default Server open for e-business
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frank
I followed the what you have done. I'm also getting the same error. Have you got the answer? If yes could you also tell us what url we need to provide (while defining OracleConnectionPoolDataSource as driver class.)
Also does it makes any difference if we specify
'oracle.jdbc.driver.OracleDriver' as driver implementation class name?
Thanks in advance.
Regards
abhilesh

Originally posted by Frank Shaw:
i have the same problem too....i have checked to make sure i got the correct URL.....but when i run test environment...it's still telling me i can't connect to the database.....
************* End Display Current Environment *************
[10/1/02 20:09:30:352 EDT] d715bb5 Server U Version : 4.0.2
[10/1/02 20:09:30:362 EDT] d715bb5 Server U Edition: Advanced Single Server Edition for Multiplatforms
[10/1/02 20:09:30:362 EDT] d715bb5 Server U Build date: Tue Dec 18 00:00:00 EST 2001
[10/1/02 20:09:30:362 EDT] d715bb5 Server U Build number: a0150.05
[10/1/02 20:09:37:912 EDT] d715bb5 DrAdminServer I WSVR0053I: DrAdmin available on port 7000
[10/1/02 20:09:38:022 EDT] d715bb5 ResourceBinde I WSVR0049I: Binding Session Persistence datasource as jdbc/Session
[10/1/02 20:09:38:042 EDT] d715bb5 ResourceBinde I WSVR0049I: Binding ProductCategory as jdbc/ProductCategory
[10/1/02 20:09:39:865 EDT] d715bb5 EJBEngine I WSVR0037I: Starting EJB jar: ProductCategoryEJB
[10/1/02 20:09:41:167 EDT] d715bb5 ConnectionPoo X CONM6009E: Failed to get connection to the database from datasource (ProductCategory).
[10/1/02 20:09:41:197 EDT] d715bb5 JDBCPersister W CNTR0031W: Error starting CMP bean: ProductCategoryEAR#ProductCategoryEJB.jar#ProductCategory
[10/1/02 20:09:41:237 EDT] d715bb5 JDBCPersister W CNTR0032W: Error creating CMP persister using datasource: jdbc/ProductCategory
[10/1/02 20:09:41:257 EDT] d715bb5 EJBEngine X WSVR0062E: Failed to start EJB, ProductCategoryEAR#ProductCategoryEJB.jar#ProductCategory: Invalid Oracle URL specified: OracleDataSource.makeURL
[10/1/02 20:09:41:808 EDT] d715bb5 ServletEngine A SRVE0161I: IBM WebSphere Application Server - Web Container. Copyright IBM Corp. 1998-2001
[10/1/02 20:09:41:858 EDT] d715bb5 ServletEngine A SRVE0162I: Servlet Specification Level: 2.2
[10/1/02 20:09:41:868 EDT] d715bb5 ServletEngine A SRVE0163I: Supported JSP Specification Level: 1.1
[10/1/02 20:09:42:198 EDT] d715bb5 ServletEngine A SRVE0167I: Session Manager is Configured - Initializing...
[10/1/02 20:09:42:479 EDT] d715bb5 CacheManager A DYNA0011E: Servlet cache file dynacache.xml not found; caching is disabled
[10/1/02 20:09:42:519 EDT] d715bb5 ServletEngine A SRVE0169I: Loading Web Module: IBM EJB Test Client.
[10/1/02 20:09:43:069 EDT] d715bb5 WebGroup I SRVE0091I: [Servlet LOG]: JSP 1.1 Processor: init
[10/1/02 20:09:43:120 EDT] d715bb5 WebGroup I SRVE0091I: [Servlet LOG]: SimpleFileServlet: init
[10/1/02 20:09:43:140 EDT] d715bb5 ServletEngine A SRVE0169I: Loading Web Module: ProductCategory.
[10/1/02 20:09:43:320 EDT] d715bb5 WebGroup I SRVE0091I: [Servlet LOG]: JSP 1.1 Processor: init
[10/1/02 20:09:43:360 EDT] d715bb5 WebGroup I SRVE0091I: [Servlet LOG]: SimpleFileServlet: init
[10/1/02 20:09:43:440 EDT] d715bb5 WebGroup I SRVE0091I: [Servlet LOG]: InvokerServlet: init
[10/1/02 20:09:43:500 EDT] d715bb5 HttpTransport A SRVE0171I: Transport http is listening on port 8,080.
[10/1/02 20:09:43:560 EDT] d715bb5 Server A WSVR0023I: Server Default Server open for e-business

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
can you verify your SID ?
the adress of orcle db is like that:
jdbc racle:thin:@<hostname>:<port>:<sid>
your configuration mean that your database name is : oracle
can you try directly whith the IP adress for the hostname ... it's may be a DNS problem ...
By
 
was92
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
if you try with 'oracle.jdbc.driver.OracleDriver'
you can't use the connection pool ....
so your DB connections will be slower ...
 
Frank Shaw
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi abhilesh,
This is what you need to do.
After you add the JDBC driver and the data source, you need to add RESOURCE PROPERTIES.
Name: URL (has to be all cap)
Value: jdbc racle:thin:@yourHost:1521:yourDatabase
my works now!!!
Frank
 
Abhilesh Khatri
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frank
Thanks for the reply. Its working for me.
Hope to discuss few things in future with you again. Thanks once again.
regards
abhilesh

Originally posted by Frank Shaw:
Hi abhilesh,
This is what you need to do.
After you add the JDBC driver and the data source, you need to add RESOURCE PROPERTIES.
Name: URL (has to be all cap)
Value: jdbc racle:thin:@yourHost:1521:yourDatabase
my works now!!!
Frank

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frank,
Thank you very much for that information. Once I added the resource to the Datasource it worked perfectly. I don't know why the documentation was lacking this information, or maybe I just overlooked it.
Thanks again,
COREY
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to thank everybody for giving a solution to this issue !
WebSphere does not help !
Lucia
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all who posted. I finally got this working after many hours of frustration.
\
 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!