trouble with jndi database resource, uportal 3.1.1, and tomcat 6.0.20

11 messages Options
Embed this post
Permalink
Curtis Garman

trouble with jndi database resource, uportal 3.1.1, and tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
Does anyone have experience using jndi database resources for portlets
that deploy in uportal 3.1.1 on tomcat 6. I've got some portlets we
are running via jndi connection pooling in our uportal 2.6.1
environment on tomcat 5.5.25 and while they work great for 2.6.1, I
can't get the portlets to run on 3.1.1 unless I hard-code the
connection information into the portlets.  The portlets are not
spring-based at this point. I keep getting the following exception

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

My context.xml configuration is as follows

        <Resource name="jdbc/cancellation" auth="Container" type="javax.sql.DataSource"
          username="user" password="password"
          driverClassName="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://server:1433;databaseName=database"
          maxActive="10" maxIdle="5" maxWait="1000"
          poolPreparedStatements="true"
          removeAbandoned="true"
          removeAbandonedTimeout="300"
          logAbandoned="true"
        />

I usually do not use the web.xml resource-ref...it seems to work without it...

 <resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/cancellation</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>

...and it actually starts throwing a different error when I include it

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

I tried moving my context.xml to conf/Catalina/localhost and changing
the name of the file to appname.xml and this gave me yet another error

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC
driver class 'net.sourceforge.jtds.jdbc.Driver'

Does anyone have any ideas?

--
Curtis Garman
Web Programmer
Heartland Community College

---
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/uportal-user
Susan Bramhall

Re: trouble with jndi database resource, uportal 3.1.1, and tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Are you putting the jndi information in the server context.xml or in the applicationContext.xml?  It has to be in the server context to allow all the portlets to share the connections.  And the jdbc library has to be shared as well.
Susan

Curtis Garman wrote:
Does anyone have experience using jndi database resources for portlets
that deploy in uportal 3.1.1 on tomcat 6. I've got some portlets we
are running via jndi connection pooling in our uportal 2.6.1
environment on tomcat 5.5.25 and while they work great for 2.6.1, I
can't get the portlets to run on 3.1.1 unless I hard-code the
connection information into the portlets.  The portlets are not
spring-based at this point. I keep getting the following exception

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

My context.xml configuration is as follows

	<Resource name="jdbc/cancellation" auth="Container" type="javax.sql.DataSource"
	  username="user" password="password"
	  driverClassName="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://server:1433;databaseName=database"
	  maxActive="10" maxIdle="5" maxWait="1000"
	  poolPreparedStatements="true"
	  removeAbandoned="true"
	  removeAbandonedTimeout="300"
	  logAbandoned="true"
	/>

I usually do not use the web.xml resource-ref...it seems to work without it...

 <resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/cancellation</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>

...and it actually starts throwing a different error when I include it

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

I tried moving my context.xml to conf/Catalina/localhost and changing
the name of the file to appname.xml and this gave me yet another error

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC
driver class 'net.sourceforge.jtds.jdbc.Driver'

Does anyone have any ideas?

  

--

Susan Bramhall ([hidden email])
Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
Yale University Information Technology Services (ITS)
25 Science Park, 150 Munson St, New Haven, CT 06520
Phone:  203 432 6697

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/uportal-user
Curtis Garman

Re: trouble with jndi database resource, uportal 3.1.1, and tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
Since the connection pool is only used by a single portlet and there
is no need for any other webapp to see it, I placed my Resource in the
the context.xml of my application (portlet)...I had tried placing my
driver in the shared/lib too but that didn't help.

On Fri, Oct 16, 2009 at 1:06 PM, Susan Bramhall <[hidden email]> wrote:

> Are you putting the jndi information in the server context.xml or in the
> applicationContext.xml?  It has to be in the server context to allow all the
> portlets to share the connections.  And the jdbc library has to be shared as
> well.
> Susan
>
> Curtis Garman wrote:
>
> Does anyone have experience using jndi database resources for portlets
> that deploy in uportal 3.1.1 on tomcat 6. I've got some portlets we
> are running via jndi connection pooling in our uportal 2.6.1
> environment on tomcat 5.5.25 and while they work great for 2.6.1, I
> can't get the portlets to run on 3.1.1 unless I hard-code the
> connection information into the portlets.  The portlets are not
> spring-based at this point. I keep getting the following exception
>
> javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
>
> My context.xml configuration is as follows
>
> <Resource name="jdbc/cancellation" auth="Container"
> type="javax.sql.DataSource"
>  username="user" password="password"
>  driverClassName="net.sourceforge.jtds.jdbc.Driver"
> url="jdbc:jtds:sqlserver://server:1433;databaseName=database"
>  maxActive="10" maxIdle="5" maxWait="1000"
>  poolPreparedStatements="true"
>  removeAbandoned="true"
>  removeAbandonedTimeout="300"
>  logAbandoned="true"
> />
>
> I usually do not use the web.xml resource-ref...it seems to work without
> it...
>
>  <resource-ref>
>       <description>DB Connection</description>
>       <res-ref-name>jdbc/cancellation</res-ref-name>
>       <res-type>javax.sql.DataSource</res-type>
>       <res-auth>Container</res-auth>
>   </resource-ref>
>
> ...and it actually starts throwing a different error when I include it
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
> driver of class '' for connect URL 'null'
>
> I tried moving my context.xml to conf/Catalina/localhost and changing
> the name of the file to appname.xml and this gave me yet another error
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC
> driver class 'net.sourceforge.jtds.jdbc.Driver'
>
> Does anyone have any ideas?
>
>
>
> --
>
> Susan Bramhall ([hidden email])
> Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
> Yale University Information Technology Services (ITS)
> 25 Science Park, 150 Munson St, New Haven, CT 06520
> Phone:  203 432 6697
>
> --
>
> You are currently subscribed to [hidden email] as:
> [hidden email]
> To unsubscribe, change settings or access archives, see
> http://www.ja-sig.org/wiki/display/JSG/uportal-user



--
Curtis Garman
Web Programmer
Heartland Community College

---
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/uportal-user

Eric Dalquist

Re: trouble with jndi database resource, uportal 3.1.1, and tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
In reply to this post by Susan Bramhall
Some javascript/style in this post has been disabled (why?)
This isn't very helpful for your current problem but we haven't used JNDI managed DataSources in uPortal or our portlets since upgrading to 3.0. They always seem to have some sort of issue and a locally declared DBCP DataSource in the Spring app context seems to work much better.

-Eric

Curtis Garman wrote:
Since the connection pool is only used by a single portlet and there
is no need for any other webapp to see it, I placed my Resource in the
the context.xml of my application (portlet)...I had tried placing my
driver in the shared/lib too but that didn't help.

On Fri, Oct 16, 2009 at 1:06 PM, Susan Bramhall [hidden email] wrote:
  
Are you putting the jndi information in the server context.xml or in the
applicationContext.xml?  It has to be in the server context to allow all the
portlets to share the connections.  And the jdbc library has to be shared as
well.
Susan

Curtis Garman wrote:

Does anyone have experience using jndi database resources for portlets
that deploy in uportal 3.1.1 on tomcat 6. I've got some portlets we
are running via jndi connection pooling in our uportal 2.6.1
environment on tomcat 5.5.25 and while they work great for 2.6.1, I
can't get the portlets to run on 3.1.1 unless I hard-code the
connection information into the portlets.  The portlets are not
spring-based at this point. I keep getting the following exception

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

My context.xml configuration is as follows

	<Resource name="jdbc/cancellation" auth="Container"
type="javax.sql.DataSource"
	  username="user" password="password"
	  driverClassName="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://server:1433;databaseName=database"
	  maxActive="10" maxIdle="5" maxWait="1000"
	  poolPreparedStatements="true"
	  removeAbandoned="true"
	  removeAbandonedTimeout="300"
	  logAbandoned="true"
	/>

I usually do not use the web.xml resource-ref...it seems to work without
it...

 <resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/cancellation</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>

...and it actually starts throwing a different error when I include it

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

I tried moving my context.xml to conf/Catalina/localhost and changing
the name of the file to appname.xml and this gave me yet another error

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC
driver class 'net.sourceforge.jtds.jdbc.Driver'

Does anyone have any ideas?



--

Susan Bramhall ([hidden email])
Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
Yale University Information Technology Services (ITS)
25 Science Park, 150 Munson St, New Haven, CT 06520
Phone:  203 432 6697

--

You are currently subscribed to [hidden email] as:
[hidden email]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/uportal-user
    



  


smime.p7s (4K) Download Attachment
Curtis Garman

Re: trouble with jndi database resource, uportal 3.1.1, and tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
Actually that is somewhat helpful because I've noticed others in the
community are doing the same thing...I could easily enough convert the
before mentioned portlets to spring...however spring development
hasn't quite been sanctioned here yet. What you just said will be
helpful in lobbying for it :)

One reason why I am interested in using jndi over an internal pool is
because we use lamba probe to help monitor things and it provides a
nice web interface to be able to view jndi connection pools and how
many open connections there are for each. I really don't want to lose
that if possible.

Another thing that makes the jndi thing problematic is that related to
another thread I started too...I set up a portlet overlay to apply all
customizations to our portlets...but it seemes to loose all
context.xml files from the META-INF directory...which obviously hurts
when using this file to link to or provide credentials to your
datasource.

Curtis


On Fri, Oct 16, 2009 at 1:51 PM, Eric Dalquist
<[hidden email]> wrote:

> This isn't very helpful for your current problem but we haven't used JNDI
> managed DataSources in uPortal or our portlets since upgrading to 3.0. They
> always seem to have some sort of issue and a locally declared DBCP
> DataSource in the Spring app context seems to work much better.
>
> -Eric
>
> Curtis Garman wrote:
>
> Since the connection pool is only used by a single portlet and there
> is no need for any other webapp to see it, I placed my Resource in the
> the context.xml of my application (portlet)...I had tried placing my
> driver in the shared/lib too but that didn't help.
>
> On Fri, Oct 16, 2009 at 1:06 PM, Susan Bramhall <[hidden email]>
> wrote:
>
>
> Are you putting the jndi information in the server context.xml or in the
> applicationContext.xml?  It has to be in the server context to allow all the
> portlets to share the connections.  And the jdbc library has to be shared as
> well.
> Susan
>
> Curtis Garman wrote:
>
> Does anyone have experience using jndi database resources for portlets
> that deploy in uportal 3.1.1 on tomcat 6. I've got some portlets we
> are running via jndi connection pooling in our uportal 2.6.1
> environment on tomcat 5.5.25 and while they work great for 2.6.1, I
> can't get the portlets to run on 3.1.1 unless I hard-code the
> connection information into the portlets.  The portlets are not
> spring-based at this point. I keep getting the following exception
>
> javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
>
> My context.xml configuration is as follows
>
> <Resource name="jdbc/cancellation" auth="Container"
> type="javax.sql.DataSource"
>  username="user" password="password"
>  driverClassName="net.sourceforge.jtds.jdbc.Driver"
> url="jdbc:jtds:sqlserver://server:1433;databaseName=database"
>  maxActive="10" maxIdle="5" maxWait="1000"
>  poolPreparedStatements="true"
>  removeAbandoned="true"
>  removeAbandonedTimeout="300"
>  logAbandoned="true"
> />
>
> I usually do not use the web.xml resource-ref...it seems to work without
> it...
>
>  <resource-ref>
>       <description>DB Connection</description>
>       <res-ref-name>jdbc/cancellation</res-ref-name>
>       <res-type>javax.sql.DataSource</res-type>
>       <res-auth>Container</res-auth>
>   </resource-ref>
>
> ...and it actually starts throwing a different error when I include it
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
> driver of class '' for connect URL 'null'
>
> I tried moving my context.xml to conf/Catalina/localhost and changing
> the name of the file to appname.xml and this gave me yet another error
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC
> driver class 'net.sourceforge.jtds.jdbc.Driver'
>
> Does anyone have any ideas?
>
>
>
> --
>
> Susan Bramhall ([hidden email])
> Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
> Yale University Information Technology Services (ITS)
> 25 Science Park, 150 Munson St, New Haven, CT 06520
> Phone:  203 432 6697
>
> --
>
> You are currently subscribed to [hidden email] as:
> [hidden email]
> To unsubscribe, change settings or access archives, see
> http://www.ja-sig.org/wiki/display/JSG/uportal-user
>
>
>



--
Curtis Garman
Web Programmer
Heartland Community College

---
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/uportal-user

Eric Dalquist

Re: trouble with jndi database resource, uportal 3.1.1, and tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
In reply to this post by Eric Dalquist
Some javascript/style in this post has been disabled (why?)
Curtis Garman wrote:
Actually that is somewhat helpful because I've noticed others in the
community are doing the same thing...I could easily enough convert the
before mentioned portlets to spring...however spring development
hasn't quite been sanctioned here yet. What you just said will be
helpful in lobbying for it :)
  
Glad to help ;)
One reason why I am interested in using jndi over an internal pool is
because we use lamba probe to help monitor things and it provides a
nice web interface to be able to view jndi connection pools and how
many open connections there are for each. I really don't want to lose
that if possible.
  
You can take a look at jmxContext.xml in uPortal to see an example of using Spring to easily expose things such as local DataSource pools via JMX. Not sure if lamba prob can talk JMX but uPortal exposes a whole bunch of data that way.
Another thing that makes the jndi thing problematic is that related to
another thread I started too...I set up a portlet overlay to apply all
customizations to our portlets...but it seemes to loose all
context.xml files from the META-INF directory...which obviously hurts
when using this file to link to or provide credentials to your
datasource.
  
Does the default overlay configuration include any <excluded> paths? That would be my first guess in diagnosing that. Perhaps add an explicit include in the overlay config?
Curtis


On Fri, Oct 16, 2009 at 1:51 PM, Eric Dalquist
[hidden email] wrote:
  
This isn't very helpful for your current problem but we haven't used JNDI
managed DataSources in uPortal or our portlets since upgrading to 3.0. They
always seem to have some sort of issue and a locally declared DBCP
DataSource in the Spring app context seems to work much better.

-Eric

Curtis Garman wrote:

Since the connection pool is only used by a single portlet and there
is no need for any other webapp to see it, I placed my Resource in the
the context.xml of my application (portlet)...I had tried placing my
driver in the shared/lib too but that didn't help.

On Fri, Oct 16, 2009 at 1:06 PM, Susan Bramhall [hidden email]
wrote:


Are you putting the jndi information in the server context.xml or in the
applicationContext.xml?  It has to be in the server context to allow all the
portlets to share the connections.  And the jdbc library has to be shared as
well.
Susan

Curtis Garman wrote:

Does anyone have experience using jndi database resources for portlets
that deploy in uportal 3.1.1 on tomcat 6. I've got some portlets we
are running via jndi connection pooling in our uportal 2.6.1
environment on tomcat 5.5.25 and while they work great for 2.6.1, I
can't get the portlets to run on 3.1.1 unless I hard-code the
connection information into the portlets.  The portlets are not
spring-based at this point. I keep getting the following exception

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

My context.xml configuration is as follows

	<Resource name="jdbc/cancellation" auth="Container"
type="javax.sql.DataSource"
	  username="user" password="password"
	  driverClassName="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://server:1433;databaseName=database"
	  maxActive="10" maxIdle="5" maxWait="1000"
	  poolPreparedStatements="true"
	  removeAbandoned="true"
	  removeAbandonedTimeout="300"
	  logAbandoned="true"
	/>

I usually do not use the web.xml resource-ref...it seems to work without
it...

 <resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/cancellation</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>

...and it actually starts throwing a different error when I include it

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

I tried moving my context.xml to conf/Catalina/localhost and changing
the name of the file to appname.xml and this gave me yet another error

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC
driver class 'net.sourceforge.jtds.jdbc.Driver'

Does anyone have any ideas?



--

Susan Bramhall ([hidden email])
Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
Yale University Information Technology Services (ITS)
25 Science Park, 150 Munson St, New Haven, CT 06520
Phone:  203 432 6697

--

You are currently subscribed to [hidden email] as:
[hidden email]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/uportal-user



    



  


smime.p7s (4K) Download Attachment
Susan Bramhall

Re: trouble with jndi database resource, uportal 3.1.1, and tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
In reply to this post by Eric Dalquist
Some javascript/style in this post has been disabled (why?)
We've been using jndi datasources successfully ever since we went to 3.1 with no problems... We have a shared pool used by several portlets and the portal itself.  It would be hard for us to do it without jndi since developers don't have access to those credentials.  They are all using Spring.  Not sure what we are doing right that others have stumbled on.  Sample snippet from a portlet context:

    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:comp/env/jdbc/uPortalDB"/>
    </bean>

I'd be curious to know what your problems have been.
Susan

Eric Dalquist wrote:
This isn't very helpful for your current problem but we haven't used JNDI managed DataSources in uPortal or our portlets since upgrading to 3.0. They always seem to have some sort of issue and a locally declared DBCP DataSource in the Spring app context seems to work much better.

-Eric

Curtis Garman wrote:
Since the connection pool is only used by a single portlet and there
is no need for any other webapp to see it, I placed my Resource in the
the context.xml of my application (portlet)...I had tried placing my
driver in the shared/lib too but that didn't help.

On Fri, Oct 16, 2009 at 1:06 PM, Susan Bramhall [hidden email] wrote:
  
Are you putting the jndi information in the server context.xml or in the
applicationContext.xml?  It has to be in the server context to allow all the
portlets to share the connections.  And the jdbc library has to be shared as
well.
Susan

Curtis Garman wrote:

Does anyone have experience using jndi database resources for portlets
that deploy in uportal 3.1.1 on tomcat 6. I've got some portlets we
are running via jndi connection pooling in our uportal 2.6.1
environment on tomcat 5.5.25 and while they work great for 2.6.1, I
can't get the portlets to run on 3.1.1 unless I hard-code the
connection information into the portlets.  The portlets are not
spring-based at this point. I keep getting the following exception

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

My context.xml configuration is as follows

	<Resource name="jdbc/cancellation" auth="Container"
type="javax.sql.DataSource"
	  username="user" password="password"
	  driverClassName="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://server:1433;databaseName=database"
	  maxActive="10" maxIdle="5" maxWait="1000"
	  poolPreparedStatements="true"
	  removeAbandoned="true"
	  removeAbandonedTimeout="300"
	  logAbandoned="true"
	/>

I usually do not use the web.xml resource-ref...it seems to work without
it...

 <resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/cancellation</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>

...and it actually starts throwing a different error when I include it

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

I tried moving my context.xml to conf/Catalina/localhost and changing
the name of the file to appname.xml and this gave me yet another error

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC
driver class 'net.sourceforge.jtds.jdbc.Driver'

Does anyone have any ideas?



--

Susan Bramhall ([hidden email])
Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
Yale University Information Technology Services (ITS)
25 Science Park, 150 Munson St, New Haven, CT 06520
Phone:  203 432 6697

--

You are currently subscribed to [hidden email] as:
[hidden email]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/uportal-user
    



  

--

Susan Bramhall ([hidden email])
Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
Yale University Information Technology Services (ITS)
25 Science Park, 150 Munson St, New Haven, CT 06520
Phone:  203 432 6697

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/uportal-user
Curtis Garman

Re: trouble with jndi database resource, uportal 3.1.1, and tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
In reply to this post by Eric Dalquist
It's quite possible that I missed something. I attached one of my
overlay pom.xml files...there is nothing to it. I found a page Jen
Bourey and Susan created and looked at how the other overlay portlets
were set up. I assumed that since the only thing I'm  really
overriding anything is my log4j.properties file that everything in
META-INF should be copied from the war file dependency

Curtis

On Fri, Oct 16, 2009 at 2:07 PM, Eric Dalquist
<[hidden email]> wrote:

> Curtis Garman wrote:
>
> Actually that is somewhat helpful because I've noticed others in the
> community are doing the same thing...I could easily enough convert the
> before mentioned portlets to spring...however spring development
> hasn't quite been sanctioned here yet. What you just said will be
> helpful in lobbying for it :)
>
>
> Glad to help ;)
>
> One reason why I am interested in using jndi over an internal pool is
> because we use lamba probe to help monitor things and it provides a
> nice web interface to be able to view jndi connection pools and how
> many open connections there are for each. I really don't want to lose
> that if possible.
>
>
> You can take a look at jmxContext.xml in uPortal to see an example of using
> Spring to easily expose things such as local DataSource pools via JMX. Not
> sure if lamba prob can talk JMX but uPortal exposes a whole bunch of data
> that way.
>
> Another thing that makes the jndi thing problematic is that related to
> another thread I started too...I set up a portlet overlay to apply all
> customizations to our portlets...but it seemes to loose all
> context.xml files from the META-INF directory...which obviously hurts
> when using this file to link to or provide credentials to your
> datasource.
>
>
> Does the default overlay configuration include any <excluded> paths? That
> would be my first guess in diagnosing that. Perhaps add an explicit include
> in the overlay config?
>
> Curtis
>
>
> On Fri, Oct 16, 2009 at 1:51 PM, Eric Dalquist
> <[hidden email]> wrote:
>
>
> This isn't very helpful for your current problem but we haven't used JNDI
> managed DataSources in uPortal or our portlets since upgrading to 3.0. They
> always seem to have some sort of issue and a locally declared DBCP
> DataSource in the Spring app context seems to work much better.
>
> -Eric
>
> Curtis Garman wrote:
>
> Since the connection pool is only used by a single portlet and there
> is no need for any other webapp to see it, I placed my Resource in the
> the context.xml of my application (portlet)...I had tried placing my
> driver in the shared/lib too but that didn't help.
>
> On Fri, Oct 16, 2009 at 1:06 PM, Susan Bramhall <[hidden email]>
> wrote:
>
>
> Are you putting the jndi information in the server context.xml or in the
> applicationContext.xml?  It has to be in the server context to allow all the
> portlets to share the connections.  And the jdbc library has to be shared as
> well.
> Susan
>
> Curtis Garman wrote:
>
> Does anyone have experience using jndi database resources for portlets
> that deploy in uportal 3.1.1 on tomcat 6. I've got some portlets we
> are running via jndi connection pooling in our uportal 2.6.1
> environment on tomcat 5.5.25 and while they work great for 2.6.1, I
> can't get the portlets to run on 3.1.1 unless I hard-code the
> connection information into the portlets.  The portlets are not
> spring-based at this point. I keep getting the following exception
>
> javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
>
> My context.xml configuration is as follows
>
> <Resource name="jdbc/cancellation" auth="Container"
> type="javax.sql.DataSource"
>  username="user" password="password"
>  driverClassName="net.sourceforge.jtds.jdbc.Driver"
> url="jdbc:jtds:sqlserver://server:1433;databaseName=database"
>  maxActive="10" maxIdle="5" maxWait="1000"
>  poolPreparedStatements="true"
>  removeAbandoned="true"
>  removeAbandonedTimeout="300"
>  logAbandoned="true"
> />
>
> I usually do not use the web.xml resource-ref...it seems to work without
> it...
>
>  <resource-ref>
>       <description>DB Connection</description>
>       <res-ref-name>jdbc/cancellation</res-ref-name>
>       <res-type>javax.sql.DataSource</res-type>
>       <res-auth>Container</res-auth>
>   </resource-ref>
>
> ...and it actually starts throwing a different error when I include it
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
> driver of class '' for connect URL 'null'
>
> I tried moving my context.xml to conf/Catalina/localhost and changing
> the name of the file to appname.xml and this gave me yet another error
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC
> driver class 'net.sourceforge.jtds.jdbc.Driver'
>
> Does anyone have any ideas?
>
>
>
> --
>
> Susan Bramhall ([hidden email])
> Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
> Yale University Information Technology Services (ITS)
> 25 Science Park, 150 Munson St, New Haven, CT 06520
> Phone:  203 432 6697
>
> --
>
> You are currently subscribed to [hidden email] as:
> [hidden email]
> To unsubscribe, change settings or access archives, see
> http://www.ja-sig.org/wiki/display/JSG/uportal-user
>
>
>
>
>
>


--
Curtis Garman
Web Programmer
Heartland Community College

---
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/uportal-user
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <parent>
        <groupId>org.jasig.portal.portlets-overlay</groupId>
        <artifactId>uportal-portlets-overlay-parent</artifactId>
        <version>3.1.1</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>heartland-text-portlet</artifactId>
    <packaging>war</packaging>

    <name>heartland-text-portlet</name>
    <description>Overlay on heartland-text-portlet.</description>

    <dependencies>
        <dependency>
            <groupId>edu.heartland.portlet</groupId>
            <artifactId>heartland-text-portlet</artifactId>
            <version>${heartland.text.portlet.version}</version>
            <type>war</type>
        </dependency>
    </dependencies>

        <build>
        <plugins>
                        <plugin>
                <groupId>org.apache.pluto</groupId>
                <artifactId>maven-pluto-plugin</artifactId>
            </plugin>
        </plugins>
        </build>
       
</project>
Curtis Garman

Re: trouble with jndi database resource, uportal 3.1.1, and tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
In reply to this post by Susan Bramhall
Susan what version of tomcat are you guys running? I'm sure that it
has nothing to do with that at all...since the error that I am getting
is all over the internet...but I'm curious anyway. I'm playing with
6.0.20

The error I'm getting seems to indicate that I haven't clearly stated
where it should look for the connection information or that it is
ignoring the application context.xml...I'm not sure how else to
configure it...the maddening thing is that the same configuration
works on our current portal :)

On Fri, Oct 16, 2009 at 2:18 PM, Susan Bramhall <[hidden email]> wrote:

> We've been using jndi datasources successfully ever since we went to 3.1
> with no problems... We have a shared pool used by several portlets and the
> portal itself.  It would be hard for us to do it without jndi since
> developers don't have access to those credentials.  They are all using
> Spring.  Not sure what we are doing right that others have stumbled on.
> Sample snippet from a portlet context:
>
>     <bean id="dataSource"
> class="org.springframework.jndi.JndiObjectFactoryBean">
>         <property name="jndiName" value="java:comp/env/jdbc/uPortalDB"/>
>     </bean>
>
> I'd be curious to know what your problems have been.
> Susan
>
> Eric Dalquist wrote:
>
> This isn't very helpful for your current problem but we haven't used JNDI
> managed DataSources in uPortal or our portlets since upgrading to 3.0. They
> always seem to have some sort of issue and a locally declared DBCP
> DataSource in the Spring app context seems to work much better.
>
> -Eric
>
> Curtis Garman wrote:
>
> Since the connection pool is only used by a single portlet and there
> is no need for any other webapp to see it, I placed my Resource in the
> the context.xml of my application (portlet)...I had tried placing my
> driver in the shared/lib too but that didn't help.
>
> On Fri, Oct 16, 2009 at 1:06 PM, Susan Bramhall <[hidden email]>
> wrote:
>
>
> Are you putting the jndi information in the server context.xml or in the
> applicationContext.xml?  It has to be in the server context to allow all the
> portlets to share the connections.  And the jdbc library has to be shared as
> well.
> Susan
>
> Curtis Garman wrote:
>
> Does anyone have experience using jndi database resources for portlets
> that deploy in uportal 3.1.1 on tomcat 6. I've got some portlets we
> are running via jndi connection pooling in our uportal 2.6.1
> environment on tomcat 5.5.25 and while they work great for 2.6.1, I
> can't get the portlets to run on 3.1.1 unless I hard-code the
> connection information into the portlets.  The portlets are not
> spring-based at this point. I keep getting the following exception
>
> javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
>
> My context.xml configuration is as follows
>
> <Resource name="jdbc/cancellation" auth="Container"
> type="javax.sql.DataSource"
>  username="user" password="password"
>  driverClassName="net.sourceforge.jtds.jdbc.Driver"
> url="jdbc:jtds:sqlserver://server:1433;databaseName=database"
>  maxActive="10" maxIdle="5" maxWait="1000"
>  poolPreparedStatements="true"
>  removeAbandoned="true"
>  removeAbandonedTimeout="300"
>  logAbandoned="true"
> />
>
> I usually do not use the web.xml resource-ref...it seems to work without
> it...
>
>  <resource-ref>
>       <description>DB Connection</description>
>       <res-ref-name>jdbc/cancellation</res-ref-name>
>       <res-type>javax.sql.DataSource</res-type>
>       <res-auth>Container</res-auth>
>   </resource-ref>
>
> ...and it actually starts throwing a different error when I include it
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
> driver of class '' for connect URL 'null'
>
> I tried moving my context.xml to conf/Catalina/localhost and changing
> the name of the file to appname.xml and this gave me yet another error
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC
> driver class 'net.sourceforge.jtds.jdbc.Driver'
>
> Does anyone have any ideas?
>
>
>
> --
>
> Susan Bramhall ([hidden email])
> Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
> Yale University Information Technology Services (ITS)
> 25 Science Park, 150 Munson St, New Haven, CT 06520
> Phone:  203 432 6697
>
> --
>
> You are currently subscribed to [hidden email] as:
> [hidden email]
> To unsubscribe, change settings or access archives, see
> http://www.ja-sig.org/wiki/display/JSG/uportal-user
>
>
>
>
> --
>
> Susan Bramhall ([hidden email])
> Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
> Yale University Information Technology Services (ITS)
> 25 Science Park, 150 Munson St, New Haven, CT 06520
> Phone:  203 432 6697
>
> --
>
> You are currently subscribed to [hidden email] as:
> [hidden email]
> To unsubscribe, change settings or access archives, see
> http://www.ja-sig.org/wiki/display/JSG/uportal-user



--
Curtis Garman
Web Programmer
Heartland Community College

---
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/uportal-user

Curtis Garman

Re: trouble with jndi database resource, uportal 3.1.1, and tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
In reply to this post by Eric Dalquist
hmm...I know you have to enable jmxremote
(-Dcom.sun.management.jmxremote) in tomcat to get the jdni resources
to show up in probe but I'm assuming that is a specific part of
jmx...I really don't know anything about it.

Also while I was peeking at jmxContext, I noticed jndiContext...any
idea what that does?

On Fri, Oct 16, 2009 at 2:07 PM, Eric Dalquist
<[hidden email]> wrote:

> Curtis Garman wrote:
>
> Actually that is somewhat helpful because I've noticed others in the
> community are doing the same thing...I could easily enough convert the
> before mentioned portlets to spring...however spring development
> hasn't quite been sanctioned here yet. What you just said will be
> helpful in lobbying for it :)
>
>
> Glad to help ;)
>
> One reason why I am interested in using jndi over an internal pool is
> because we use lamba probe to help monitor things and it provides a
> nice web interface to be able to view jndi connection pools and how
> many open connections there are for each. I really don't want to lose
> that if possible.
>
>
> You can take a look at jmxContext.xml in uPortal to see an example of using
> Spring to easily expose things such as local DataSource pools via JMX. Not
> sure if lamba prob can talk JMX but uPortal exposes a whole bunch of data
> that way.
>
> Another thing that makes the jndi thing problematic is that related to
> another thread I started too...I set up a portlet overlay to apply all
> customizations to our portlets...but it seemes to loose all
> context.xml files from the META-INF directory...which obviously hurts
> when using this file to link to or provide credentials to your
> datasource.
>
>
> Does the default overlay configuration include any <excluded> paths? That
> would be my first guess in diagnosing that. Perhaps add an explicit include
> in the overlay config?
>
> Curtis
>
>
> On Fri, Oct 16, 2009 at 1:51 PM, Eric Dalquist
> <[hidden email]> wrote:
>
>
> This isn't very helpful for your current problem but we haven't used JNDI
> managed DataSources in uPortal or our portlets since upgrading to 3.0. They
> always seem to have some sort of issue and a locally declared DBCP
> DataSource in the Spring app context seems to work much better.
>
> -Eric
>
> Curtis Garman wrote:
>
> Since the connection pool is only used by a single portlet and there
> is no need for any other webapp to see it, I placed my Resource in the
> the context.xml of my application (portlet)...I had tried placing my
> driver in the shared/lib too but that didn't help.
>
> On Fri, Oct 16, 2009 at 1:06 PM, Susan Bramhall <[hidden email]>
> wrote:
>
>
> Are you putting the jndi information in the server context.xml or in the
> applicationContext.xml?  It has to be in the server context to allow all the
> portlets to share the connections.  And the jdbc library has to be shared as
> well.
> Susan
>
> Curtis Garman wrote:
>
> Does anyone have experience using jndi database resources for portlets
> that deploy in uportal 3.1.1 on tomcat 6. I've got some portlets we
> are running via jndi connection pooling in our uportal 2.6.1
> environment on tomcat 5.5.25 and while they work great for 2.6.1, I
> can't get the portlets to run on 3.1.1 unless I hard-code the
> connection information into the portlets.  The portlets are not
> spring-based at this point. I keep getting the following exception
>
> javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
>
> My context.xml configuration is as follows
>
> <Resource name="jdbc/cancellation" auth="Container"
> type="javax.sql.DataSource"
>  username="user" password="password"
>  driverClassName="net.sourceforge.jtds.jdbc.Driver"
> url="jdbc:jtds:sqlserver://server:1433;databaseName=database"
>  maxActive="10" maxIdle="5" maxWait="1000"
>  poolPreparedStatements="true"
>  removeAbandoned="true"
>  removeAbandonedTimeout="300"
>  logAbandoned="true"
> />
>
> I usually do not use the web.xml resource-ref...it seems to work without
> it...
>
>  <resource-ref>
>       <description>DB Connection</description>
>       <res-ref-name>jdbc/cancellation</res-ref-name>
>       <res-type>javax.sql.DataSource</res-type>
>       <res-auth>Container</res-auth>
>   </resource-ref>
>
> ...and it actually starts throwing a different error when I include it
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
> driver of class '' for connect URL 'null'
>
> I tried moving my context.xml to conf/Catalina/localhost and changing
> the name of the file to appname.xml and this gave me yet another error
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC
> driver class 'net.sourceforge.jtds.jdbc.Driver'
>
> Does anyone have any ideas?
>
>
>
> --
>
> Susan Bramhall ([hidden email])
> Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
> Yale University Information Technology Services (ITS)
> 25 Science Park, 150 Munson St, New Haven, CT 06520
> Phone:  203 432 6697
>
> --
>
> You are currently subscribed to [hidden email] as:
> [hidden email]
> To unsubscribe, change settings or access archives, see
> http://www.ja-sig.org/wiki/display/JSG/uportal-user
>
>
>
>
>
>



--
Curtis Garman
Web Programmer
Heartland Community College

---
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/uportal-user

Susan Bramhall

Re: trouble with jndi database resource, uportal 3.1.1, and tomcat 6.0.20

Reply Threaded More More options
Print post
Permalink
In reply to this post by Curtis Garman
Some javascript/style in this post has been disabled (why?)
We're running Tomcat Version 6.0.18 and using Oracle drivers.  Resource defined in conf/contenxt.xml looks like this:

 <Resource name="jdbc/uPortalDB" auth="Container" type="javax.sql.DataSource"       
          factory='org.apache.commons.dbcp.BasicDataSourceFactory'         
          username="user" password="pw"
          driverClassName="oracle.jdbc.OracleDriver"
          url="jdbc:oracle:thin:@server:1521:SID"
          maxActive='50' maxIdle='10' maxWait='5000'
          poolPreparedStatements='true'
          testOnBorrow='true'
          validationQuery='Select user from dual'
          removeAbandoned='true'
          logAbandoned='true'
          connectionProperties="oracle.jdbc.ReadTimeout=10000;oracle.net.CONNECT_TIMEOUT=2000"
     />

As I said, the portal uses this connection for all database access as do a few portlets.  Hope this helps.
Susan

Curtis Garman wrote:
Susan what version of tomcat are you guys running? I'm sure that it
has nothing to do with that at all...since the error that I am getting
is all over the internet...but I'm curious anyway. I'm playing with
6.0.20

The error I'm getting seems to indicate that I haven't clearly stated
where it should look for the connection information or that it is
ignoring the application context.xml...I'm not sure how else to
configure it...the maddening thing is that the same configuration
works on our current portal :)

On Fri, Oct 16, 2009 at 2:18 PM, Susan Bramhall [hidden email] wrote:
  
We've been using jndi datasources successfully ever since we went to 3.1
with no problems... We have a shared pool used by several portlets and the
portal itself.  It would be hard for us to do it without jndi since
developers don't have access to those credentials.  They are all using
Spring.  Not sure what we are doing right that others have stumbled on.
Sample snippet from a portlet context:

    <bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:comp/env/jdbc/uPortalDB"/>
    </bean>

I'd be curious to know what your problems have been.
Susan

Eric Dalquist wrote:

This isn't very helpful for your current problem but we haven't used JNDI
managed DataSources in uPortal or our portlets since upgrading to 3.0. They
always seem to have some sort of issue and a locally declared DBCP
DataSource in the Spring app context seems to work much better.

-Eric

Curtis Garman wrote:

Since the connection pool is only used by a single portlet and there
is no need for any other webapp to see it, I placed my Resource in the
the context.xml of my application (portlet)...I had tried placing my
driver in the shared/lib too but that didn't help.

On Fri, Oct 16, 2009 at 1:06 PM, Susan Bramhall [hidden email]
wrote:


Are you putting the jndi information in the server context.xml or in the
applicationContext.xml?  It has to be in the server context to allow all the
portlets to share the connections.  And the jdbc library has to be shared as
well.
Susan

Curtis Garman wrote:

Does anyone have experience using jndi database resources for portlets
that deploy in uportal 3.1.1 on tomcat 6. I've got some portlets we
are running via jndi connection pooling in our uportal 2.6.1
environment on tomcat 5.5.25 and while they work great for 2.6.1, I
can't get the portlets to run on 3.1.1 unless I hard-code the
connection information into the portlets.  The portlets are not
spring-based at this point. I keep getting the following exception

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

My context.xml configuration is as follows

	<Resource name="jdbc/cancellation" auth="Container"
type="javax.sql.DataSource"
	  username="user" password="password"
	  driverClassName="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://server:1433;databaseName=database"
	  maxActive="10" maxIdle="5" maxWait="1000"
	  poolPreparedStatements="true"
	  removeAbandoned="true"
	  removeAbandonedTimeout="300"
	  logAbandoned="true"
	/>

I usually do not use the web.xml resource-ref...it seems to work without
it...

 <resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/cancellation</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>

...and it actually starts throwing a different error when I include it

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

I tried moving my context.xml to conf/Catalina/localhost and changing
the name of the file to appname.xml and this gave me yet another error

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC
driver class 'net.sourceforge.jtds.jdbc.Driver'

Does anyone have any ideas?



--

Susan Bramhall ([hidden email])
Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
Yale University Information Technology Services (ITS)
25 Science Park, 150 Munson St, New Haven, CT 06520
Phone:  203 432 6697

--

You are currently subscribed to [hidden email] as:
[hidden email]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/uportal-user




--

Susan Bramhall ([hidden email])
Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
Yale University Information Technology Services (ITS)
25 Science Park, 150 Munson St, New Haven, CT 06520
Phone:  203 432 6697

--

You are currently subscribed to [hidden email] as:
[hidden email]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/uportal-user
    



  

--

Susan Bramhall ([hidden email])
Senior Developer, Infrastructure Systems and Architecture (formerly T&P)
Yale University Information Technology Services (ITS)
25 Science Park, 150 Munson St, New Haven, CT 06520
Phone:  203 432 6697

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/uportal-user