Article View: borland.public.jbuilder.database
Article #420Re: JNDI Connection Problem
From: Tom
Date: Sat, 03 Dec 2005 06:26
Date: Sat, 03 Dec 2005 06:26
132 lines
6060 bytes
6060 bytes
Steven C. Gray wrote:
> I did some more research on Sun's site and found the answer to the "unable
> to find java class on classpath:
>
>>servlet-class" error message. As is indicated in web.xml, Jbuilder adds
>
> the debugjsp servlet on the fly when the debugger is running and removes it
> when debugging is finished. The error message is normal and does not cause
> any problems when debugging. I am still having the JNDI connection problem,
> but I have more information on that. The problem is more IDE specific
> rather than database specific so I will repost a question with more
> information to the JBuilder IDE newsgroup site.
>
> S Gray
> "Steven C. Gray" <stegra@qwest.net> wrote in message
> news:42c3a0a6$1@newsgroups.borland.com...
>
>>I am having problems getting a JSF application to connect to the database.
>>Here are the details:
>>
>>Jbuilder has put the following into web.xml:
>> <servlet>
>> <servlet-name>debugjsp</servlet-name>
>> <description>Added by JBuilder to compile JSPs with debug
>>info</description>
>> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>> <init-param>
>> <param-name>classdebuginfo</param-name>
>> <param-value>true</param-value>
>> </init-param>
>> <load-on-startup>3</load-on-startup>
>> </servlet>
>>
>>JBuilder is flagging an error on the org.apache.jasper.servlet.JspServlet
>>line with the message: "unable to find java class on classpath:
>>servlet-class"
>>What do I need to do to correct this?
>>
>>Additional problems might be connected to the missing class, but here is
>>additional info in case it helps:
>>Java code to connect to database:
>> ctx = new InitialContext();
>> Context envCtx = (Context) ctx.lookup("java:comp/env");
>> DataSource ds = (DataSource) envCtx.lookup("jdbc/DefaultDS");
>>//Next line fails with a null pointer exception. The datasource ds is
>>apparently not getting populated in the lookup statement "DataSource ds =
>>(DataSource) envCtx.lookup("jdbc/DefaultDS");"
>> conn = ds.getConnection();
>> stmt = conn.createStatement();
>>
>>Context.xml:
>><!-- The contents of this file will be loaded for each web application -->
>><Context
>> cookies="true"
>> crossContext="true"
>> reloadable="true"
>> antiJARLocking="true"
>> antiResourceLocking="true"
>> cacheMaxSize="1024"
>> cacheTTL="5000"
>> cachingAllowed="true"
>> caseSensitive="true"
>> managerChecksFrequency="10"
>> processTlds="true"
>> swallowOutput="false"
>> tldNamespaceAware="false"
>> tldValidation="false"
>> unpackWAR="true"
>> useNaming="true"
>>
>> >
>>
>> <!-- Default set of monitored resources -->
>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
>> <WatchedResource>META-INF/context.xml</WatchedResource>
>>
>> <!-- Uncomment this to disable session persistence across Tomcat
>>restarts -->
>> <!-- <Manager pathname="" /> -->
>>
>> <Resource name="jdbc/DefaultDS" auth="Container"
>> scope="Shareable"
>> type="javax.sql.DataSource"
>> maxActive="15"
>> maxIdle="5"
>> maxOpenPreparedStatements="0"
>> minIdle="0"
>> maxWait="60000"
>> username="test"
>> password="test"
>> DatabaseName="TEC"
>>
>>driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
>>
>>url="jdbc:microsoft:sqlserver://essential-sbs:1433"
>> numTestsPerEvictionRun="15"
>> timeBetweenEvictionRunsMillis="900000"
>> minEvictableIdleTimeMillis="900000"
>> testWhileIdle="true"
>> testOnBorrow="false"
>> validationQuery="select count(*) from
>>tec.dbo.conference"
>> removeAbandoned="true"
>> removeAbandonedTimeout="300"
>> logAbandoned="true"
>> />
>>
>>
>>
>></Context>
>>
>>Any help would be greatly appreciated.
>>
>>TIA
>>
>>S Gray
>>
>>
>>
>>
>
>
>
Steven - did you ever find a solution for this? I'm having trouble
getting a JNDI database resource set up within JBuilder 2006. I can get
it to work with Tomcat outside of Jbuilder, but not within JBuilder (due
to fact that Jbuilder is managing the .xml/tomcat config - still trying
to figure this out.) Do you know where I can find a definitive set of
instructions for configuring a JNDI database resource within Jbuilder 2006?
thanks
Tom
Technical Details
Message-ID:
<43913a32$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42c3a0a6$1@newsgroups.borland.com> <42c879ec$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1073da,2417608254d405db X-Google-Attributes: gid1073da,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Sat, 03 Dec 2005 01:26:03 -0500 From: Tom <tom.butler@adephia.net> User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.database Subject: Re: JNDI Connection Problem References: <42c3a0a6$1@newsgroups.borland.com> <42c879ec$1@newsgroups.borland.com> In-Reply-To: <42c879ec$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 68.235.63.81 Message-ID: <43913a32$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1133591090 68.235.63.81 (2 Dec 2005 22:24:50 -0700) Lines: 132 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail