Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-14-2008, 12:19 PM
Member
 
Join Date: May 2008
Posts: 2
shweta is on a distinguished road
Datasource & JNDI error
hi all,

i am working on application using Tomcat 5.0 and Oracle 10g.

I am using DataSource for database connection. but it is giving me following error.

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '
' for connect URL 'null'
I am in single processing
java.lang.NullPointerException
at com.tcs.perc.perimeter.web.Execute_Transaction_Mix .doPost(Execute_Tra
nsaction_Mix.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(Appl
icationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationF
ilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperV
alve.java:214)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValv
eContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.jav
a:520)
at org.apache.catalina.core.StandardContextValve.invo keInternal(Standard
ContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextV
alve.java:152)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValv
eContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.jav
a:520)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.j
ava:137)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValv
eContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.j
ava:118)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValv
eContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.jav
a:520)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineVal
ve.java:109)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValv
eContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.jav
a:520)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:16
0)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java
:799)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.proce
ssConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java
:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadP
ool.java:683)
at java.lang.Thread.run(Thread.java:595)


it is working great upto datasource lookup. it is also providing me datasource like follows.

ds === org.apache.commons.dbcp.BasicDataSource@1568654

but while calling the function ds.getConnection()
it is giving me error..

my context.xml contains

<Context path="/Perimeter_with_datasource" docBase="C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\Perimeter_with_datasource" crossContext="true"
debug="5" reloadable="true" crossContext="true">

<!-- maxActive: Maximum number of dB connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to 0 for no limit.
-->

<!-- maxIdle: Maximum number of idle dB connections to retain in pool.
Set to -1 for no limit. See also the DBCP documentation on this
and the minEvictableIdleTimeMillis configuration parameter.
-->

<!-- maxWait: Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->

<!-- username and password: MySQL dB username and password for dB connections -->

<!-- driverClassName: Class name for the old mm.mysql JDBC driver is
org.gjt.mm.mysql.Driver - we recommend using Connector/J though.
Class name for the official MySQL Connector/J driver is com.mysql.jdbc.Driver.
-->

<!-- url: The JDBC connection url for connecting to your MySQL dB.
The autoReconnect=true argument to the url makes sure that the
mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
connection. mysqld by default closes idle connections after 8 hours.
-->

<Resource name="jdbc/oracle" auth="Container" type="javax.sql.DataSource">
<ResourceParams>

<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFact ory</value>
</parameter>

<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.OracleDriver</value>
</parameter>

<parameter>
<name>url</name>
<value>jdbcracle:thin:@192.168.140.109:1521rac le</value>
</parameter>

<parameter>
<name>username</name>
<value>perf</value>
</parameter>

<parameter>
<name>password</name>
<value>oracle</value>
</parameter>

<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>

<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>

<parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>

<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>

<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>

<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>

</ResourceParams>
</Resource>
</Context>



can you help me on this???
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-15-2008, 04:37 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 227
Eku is on a distinguished road
i dont know Tomcat but i have a experience in working with Oracle10g. I have a few questions.
Have you installed the Oracle Connector "classes12.jar" to your JDK? Have you tried connecting to it using java?

Your connection String is Fine. Can you post your code please.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-15-2008, 10:38 AM
Member
 
Join Date: May 2008
Posts: 2
shweta is on a distinguished road
thanks Eku
it really helped
my promblem is solved. i put "classes12.jar" in appliction server's lib
and it worked !!!

Thanks !!!!
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-15-2008, 10:42 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,376
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
So please mark your thread solved. It's really help to others.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 05-15-2008, 10:43 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 227
Eku is on a distinguished road
Your Welcome. ^_^
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error, org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy Felissa JavaServer Faces 2 06-26-2008 11:20 PM
how to configure a JNDI URL resource rinks Advanced Java 0 03-12-2008 06:57 PM
Jndi lookup _Need help(URGENT) j satya Enterprise JavaBeans 0 01-14-2008 05:48 AM
Unable to configure JNDI properties amitid4forum Java Blogs 0 11-26-2007 05:37 PM
error in JNDI naming jitendra.ibs Java Servlet 0 06-08-2007 07:23 PM


All times are GMT +3. The time now is 09:05 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org