You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Eric White <ew...@rocksteady.com> on 2002/11/19 15:35:54 UTC

accessing mysql from a dbbrowser portlet

I don't want to replace hypersonic as the user/group/role db under
Jetspeed, I just want to access a mysql db from a dbbrowser portlet (one
that I'd write or hijack from the demos/examples).

But, I'm looking for the special sauce recipe of tasks I'm supposed to
perform.  Can somebody point me to the right sequence of URLs.

I understand torque.properties fits in here somewhere but, after
reviewing the last few month's of mailing list posts, it appears that I
have to generate some files for torque/turbine to consume as part of the
object-to-relational mapping stage.

Any help/pointers would be greatly appreciated.

thanks

eric


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: accessing mysql from a dbbrowser portlet

Posted by Mark Orciuch <ma...@ngsltd.com>.
You may want to enable Torque logging in tr.props:

services.LoggingService.logforj.log4j.rootCategory = WARNING, logforj

Your datasource may be misconfigured and Torque will not report the error
unless its logging is activated. I've spent countless hours debugging
similar problems just to find out that one of my datasources had an error.
When Torque cannot initialize a datasource, it just ignores the remaining
sources. Nothing jumps out on me in your config but here's an example of
mysql datasource that works (note that I use different JDBC driver):

torque.database.scarab.adapter = mysql
torque.dsfactory.scarab.factory =
org.apache.torque.dsfactory.TorqueDataSourceFactory
torque.dsfactory.scarab.pool.defaultMaxConnections = 10
torque.dsfactory.scarab.pool.maxExpiryTime = 3600
torque.dsfactory.scarab.pool.connectionWaitTimeout = 10
torque.dsfactory.scarab.connection.driver = org.gjt.mm.mysql.Driver
torque.dsfactory.scarab.connection.url = jdbc:mysql://localhost/scarab
torque.dsfactory.scarab.connection.user =  me
torque.dsfactory.scarab.connection.password = password

Best regards,

Mark C. Orciuch
Next Generation Solutions, Ltd.
e-Mail: mark_orciuch@ngsltd.com
web: http://www.ngsltd.com


> -----Original Message-----
> From: Eric White [mailto:ewhite@rocksteady.com]
> Sent: Tuesday, November 19, 2002 9:00 AM
> To: Jetspeed Users List
> Subject: RE: accessing mysql from a dbbrowser portlet
>
>
> great info.  I've got the following mysql setup in torque.properties:
>
> torque.database.billing.adapter=mysql
> torque.dsfactory.billing.connection.driver=com.mysql.jdbc.Driver
> torque.dsfactory.billing.connection.url=jdbc:mysql://localhost:3306/test
> torque.dsfactory.billing.connection.user=user1
> torque.dsfactory.billing.connection.password=pass1
>
> #
>
> torque.dsfactory.billing.factory=org.apache.torque.dsfactory.Torqu
> eDataSourceFactory
> torque.dsfactory.billing.pool.defaultMaxConnections=10
> torque.dsfactory.billing.pool.maxExpiryTime=3600
> torque.dsfactory.billing.pool.connectionWaitTimeout=10
>
>
> and I see the following in my browser when I hit
> http://localhost:8080/jetspeed. I've placed the mysql JDBC driver in the
> WEB-INF/lib directory and re-warred/redeployed everything. This error
> occurs whether I specify the user/pwd as properties or if I change the
> DB URL to pass them via that mechanism.
>
> I'm using the mysql-connector-java-2.0.14-bin.jar driver for JDBC access
> to MySQL.
>
> Any ideas or pointers to the torque.dsfactory.* property syntax?  I
> couldn't find these on the Torque project reference page(s).
>
> thanks
>
>
> Horrible Exception: java.lang.Error: Error in
> BasePeer.initTableSchema(TURBINE_USER): Connection object is null!
> 	at
> org.apache.jetspeed.om.security.turbine.BaseTurbineUserPeer.initCl
> ass(BaseTurbineUserPeer.java:130)
> 	at
> org.apache.jetspeed.om.security.turbine.BaseTurbineUserPeer.<clini
> t>(BaseTurbineUserPeer.java:109)
> 	at
> org.apache.jetspeed.services.security.turbine.TurbineUserManagemen
> t.getUser(TurbineUserManagement.java:164)
> 	at
> org.apache.jetspeed.services.JetspeedUserManagement.getUser(Jetspe
> edUserManagement.java:98)
> 	at
> org.apache.jetspeed.services.security.turbine.TurbineAuthenticatio
> n.getAnonymousUser(TurbineAuthentication.java:184)
> 	at
> org.apache.jetspeed.services.JetspeedAuthentication.getAnonymousUs
> er(JetspeedAuthentication.java:107)
> 	at
> org.apache.jetspeed.services.JetspeedSecurity.getAnonymousUser(Jet
> speedSecurity.java:157)
> 	at
> org.apache.jetspeed.modules.actions.TemplateSessionValidator.doPer
> form(TemplateSessionValidator.java:97)
> 	at
> org.apache.jetspeed.modules.actions.JetspeedSessionValidator.doPer
> form(JetspeedSessionValidator.java:103)
> 	at org.apache.turbine.modules.Action.perform(Action.java:87)
> 	at
> org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
> 	at org.apache.turbine.Turbine.doGet(Turbine.java:468)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationD
> ispatcher.java:684)
> 	at
> org.apache.catalina.core.ApplicationDispatcher.doForward(Applicati
> onDispatcher.java:432)
> 	at
> org.apache.catalina.core.ApplicationDispatcher.forward(Application
> Dispatcher.java:356)
> 	at
> org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.
> java:427)
> 	at org.apache.jsp.index_jsp._jspService(index_jsp.java:42)
> 	at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrap
> per.java:204)
> 	at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(A
> pplicationFilterChain.java:247)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicati
> onFilterChain.java:193)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapp
> erValve.java:260)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveCon
> text.invokeNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:480)
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardConte
> xtValve.java:191)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveCon
> text.invokeNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:480)
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValv
> e.java:180)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveCon
> text.invokeNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispat
> cherValve.java:170)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveCon
> text.invokeNext(StandardPipeline.java:641)
> 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValv
> e.java:172)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveCon
> text.invokeNext(StandardPipeline.java:641)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:480)
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngine
> Valve.java:174)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveCon
> text.invokeNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:480)
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
> 	at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
> 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.pr
> ocessConnection(Http11Protocol.java:380)
> 	at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Thre
> adPool.java:533)
> 	at java.lang.Thread.run(Thread.java:536)
>
>
>
> On Tue, 2002-11-19 at 11:36, David Sean Taylor wrote:
> >
> >
> > > -----Original Message-----
> > > From: Eric White [mailto:ewhite@rocksteady.com]
> > > Sent: Tuesday, November 19, 2002 6:36 AM
> > > To: jetspeed-user@jakarta.apache.org
> > > Subject: accessing mysql from a dbbrowser portlet
> > >
> > >
> > > I don't want to replace hypersonic as the user/group/role db under
> > > Jetspeed, I just want to access a mysql db from a dbbrowser
> portlet (one
> > > that I'd write or hijack from the demos/examples).
> > >
> > > But, I'm looking for the special sauce recipe of tasks I'm supposed to
> > > perform.  Can somebody point me to the right sequence of URLs.
> > >
> > > I understand torque.properties fits in here somewhere but, after
> > > reviewing the last few month's of mailing list posts, it
> appears that I
> > > have to generate some files for torque/turbine to consume as
> part of the
> > > object-to-relational mapping stage.
> > >
> > The dbbrowserportlet works generically on a database using
> > java.sql.ResultSetMetaData, so it doesn't make use of torque at
> all except
> > for the connection.
> >
> > Here is one way to configure a second database connection pool in the
> > Torque.properties. It is named 'ender':
> >
> > torque.database.ender.adapter=oracle
> > torque.dsfactory.ender.connection.driver =
> oracle.jdbc.driver.OracleDriver
> > torque.dsfactory.ender.connection.url =
> > jdbc:oracle:thin:@yourSid:1521:yourSchema
> > torque.dsfactory.ender.connection.user =  jetspeed
> > torque.dsfactory.ender.connection.password = password
> >
> torque.dsfactory.ender.factory=org.apache.torque.dsfactory.TorqueD
> ataSourceF
> > actory
> > torque.dsfactory.ender.pool.defaultMaxConnections=10
> > torque.dsfactory.ender.pool.maxExpiryTime=3600
> > torque.dsfactory.ender.pool.connectionWaitTimeout=10
> >
> > To use this connection pool in the DatabaseBrowserPortlet, specify it by
> > name:
> >
> >         <!-- to use an alternate torque pool, set this parameter -->
> >         <parameter name="poolname" value="ender" hidden="false"/>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: accessing mysql from a dbbrowser portlet

Posted by Eric White <ew...@rocksteady.com>.
no prob, no need to explain.  I cvs co'd the src tree and built a
version from the src tip that works fine now.

I'm just a little wary of using tip sources to work from. Is there a cvs
label for 1.4b2 that might be  a little less volatile than the tips (...
or at least I could believe so in my own little world)?

On Tue, 2002-11-19 at 18:13, David Sean Taylor wrote:
> > -----Original Message-----
> > From: Eric White [mailto:ewhite@rocksteady.com]
> > Sent: Tuesday, November 19, 2002 2:52 PM
> > To: Jetspeed Users List
> > Subject: RE: accessing mysql from a dbbrowser portlet
> >
> >
> > using the 1.4b1 release, not CVS head. Should I move to CVS head?
> 
> Hi Eric,
> 
> Yes, it would be better.
> With 1.4b1, the DatabaseBrowser didn't yet support named connection pools.
> 
> Also (ahem) Im giving you the wrong parameters for 1.4b1, the Torque
> property file format has changed.
> See this on Upgrading Torque:
> http://jakarta.apache.org/jetspeed/site/supporting-projects.html
> 
> It works about the same way in 1.4b1, except you don't have "torque."
> prefixing and data source support wasn't there at the time
> 
> You have to remember that you are not dealing with a professional support
> technician.
> Im supposed to always ask "Excuse me sir, which version are you using?"
> But I forgot to ask that question and stupidly assumed that you were at the
> cvs head.
> My apologies,
> 
> David
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: accessing mysql from a dbbrowser portlet

Posted by David Sean Taylor <da...@bluesunrise.com>.

> -----Original Message-----
> From: Eric White [mailto:ewhite@rocksteady.com]
> Sent: Tuesday, November 19, 2002 2:52 PM
> To: Jetspeed Users List
> Subject: RE: accessing mysql from a dbbrowser portlet
>
>
> using the 1.4b1 release, not CVS head. Should I move to CVS head?

Hi Eric,

Yes, it would be better.
With 1.4b1, the DatabaseBrowser didn't yet support named connection pools.

Also (ahem) Im giving you the wrong parameters for 1.4b1, the Torque
property file format has changed.
See this on Upgrading Torque:
http://jakarta.apache.org/jetspeed/site/supporting-projects.html

It works about the same way in 1.4b1, except you don't have "torque."
prefixing and data source support wasn't there at the time

You have to remember that you are not dealing with a professional support
technician.
Im supposed to always ask "Excuse me sir, which version are you using?"
But I forgot to ask that question and stupidly assumed that you were at the
cvs head.
My apologies,

David



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: accessing mysql from a dbbrowser portlet

Posted by Eric White <ew...@rocksteady.com>.
using the 1.4b1 release, not CVS head. Should I move to CVS head?

btw, scouring the jetspeed.log file reviewed a severe error stack
prefaced with a message to send off to the turbine developers because
"... this should never happen..."  I packaged up log file and
Torque.properties for them.

On Tue, 2002-11-19 at 16:18, David Sean Taylor wrote:
> 
> 
> > -----Original Message-----
> > From: Eric White [mailto:ewhite@rocksteady.com]
> > Sent: Tuesday, November 19, 2002 2:07 PM
> > To: Jetspeed Users List
> > Subject: RE: accessing mysql from a dbbrowser portlet
> >
> >
> > I left the original entries alone. I want a second database
> > specification for use with the DBBrowserPortlet (specified as a
> > different pool in the portlet.xreg entry for DBBrowserPortlet)
> >
> >
> Ok, from the example I sent you, I replaced the Oracle connection params
> with MySQL params to point to a MySQL db here, copy in the mysql jar file,
> and it works first time. I did not touch the original hypersonic 'default'
> connection, nor did I touch the security-schema.xml.
> 
> Are you working from the cvs head or an older version?
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: accessing mysql from a dbbrowser portlet

Posted by David Sean Taylor <da...@bluesunrise.com>.

> -----Original Message-----
> From: Eric White [mailto:ewhite@rocksteady.com]
> Sent: Tuesday, November 19, 2002 2:07 PM
> To: Jetspeed Users List
> Subject: RE: accessing mysql from a dbbrowser portlet
>
>
> I left the original entries alone. I want a second database
> specification for use with the DBBrowserPortlet (specified as a
> different pool in the portlet.xreg entry for DBBrowserPortlet)
>
>
Ok, from the example I sent you, I replaced the Oracle connection params
with MySQL params to point to a MySQL db here, copy in the mysql jar file,
and it works first time. I did not touch the original hypersonic 'default'
connection, nor did I touch the security-schema.xml.

Are you working from the cvs head or an older version?



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: accessing mysql from a dbbrowser portlet

Posted by Eric White <ew...@rocksteady.com>.
On Tue, 2002-11-19 at 15:20, David Sean Taylor wrote:
> 
> 
> > -----Original Message-----
> > From: Eric White [mailto:ewhite@rocksteady.com]
> > Sent: Tuesday, November 19, 2002 7:00 AM
> > To: Jetspeed Users List
> > Subject: RE: accessing mysql from a dbbrowser portlet
> >
> >
> > great info.  I've got the following mysql setup in torque.properties:
> >
> > torque.database.billing.adapter=mysql
> > torque.dsfactory.billing.connection.driver=com.mysql.jdbc.Driver
> > torque.dsfactory.billing.connection.url=jdbc:mysql://localhost:3306/test
> > torque.dsfactory.billing.connection.user=user1
> > torque.dsfactory.billing.connection.password=pass1
> >
> > #
> >
> > torque.dsfactory.billing.factory=org.apache.torque.dsfactory.Torqu
> > eDataSourceFactory
> > torque.dsfactory.billing.pool.defaultMaxConnections=10
> > torque.dsfactory.billing.pool.maxExpiryTime=3600
> > torque.dsfactory.billing.pool.connectionWaitTimeout=10
> >
> >
> > and I see the following in my browser when I hit
> > http://localhost:8080/jetspeed. I've placed the mysql JDBC driver in the
> > WEB-INF/lib directory and re-warred/redeployed everything. This error
> > occurs whether I specify the user/pwd as properties or if I change the
> > DB URL to pass them via that mechanism.
> 
> I don't understand that last sentence
> 

rather than using individual properties, you can pass userid/pwd to the
mysql driver in the form

jdbc:mysql://localhost:3306/test?user=user1&password=pass1

... which doesn't work either.

> >
> > I'm using the mysql-connector-java-2.0.14-bin.jar driver for JDBC access
> > to MySQL.
> >
> > Any ideas or pointers to the torque.dsfactory.* property syntax?  I
> > couldn't find these on the Torque project reference page(s).
> >
> > thanks
> >
> >
> > Horrible Exception: java.lang.Error: Error in
> > BasePeer.initTableSchema(TURBINE_USER): Connection object is null!
> > 	at
> > org.apache.jetspeed.om.security.turbine.BaseTurbineUserPeer.initCl
> > ass(BaseTurbineUserPeer.java:130)
> > 	at
> 
> 
> It is failing to find a connection object for the default database.
> 
> Did you remove or modify the default settings from Torque.properties? They
> look like this:
> 
> torque.database.default.adapter=hypersonic
> torque.dsfactory.default.connection.driver = org.hsqldb.jdbcDriver
> torque.dsfactory.default.connection.url =
> jdbc:hsqldb:${webappRoot}/WEB-INF/db/jetspeed
> torque.dsfactory.default.connection.user = sa
> torque.dsfactory.default.connection.password =
> 
> They are necessary for the default Jetspeed security service to access the
> hypersonic db
> From what I understand, you want 2 db connections, right?
> One for the DBBrowserPortlet to point to mySQL, and the other for Jetspeed
> Security using the default settings
> 
> 

I left the original entries alone. I want a second database
specification for use with the DBBrowserPortlet (specified as a
different pool in the portlet.xreg entry for DBBrowserPortlet)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: accessing mysql from a dbbrowser portlet

Posted by David Sean Taylor <da...@bluesunrise.com>.

> -----Original Message-----
> From: Eric White [mailto:ewhite@rocksteady.com]
> Sent: Tuesday, November 19, 2002 7:00 AM
> To: Jetspeed Users List
> Subject: RE: accessing mysql from a dbbrowser portlet
>
>
> great info.  I've got the following mysql setup in torque.properties:
>
> torque.database.billing.adapter=mysql
> torque.dsfactory.billing.connection.driver=com.mysql.jdbc.Driver
> torque.dsfactory.billing.connection.url=jdbc:mysql://localhost:3306/test
> torque.dsfactory.billing.connection.user=user1
> torque.dsfactory.billing.connection.password=pass1
>
> #
>
> torque.dsfactory.billing.factory=org.apache.torque.dsfactory.Torqu
> eDataSourceFactory
> torque.dsfactory.billing.pool.defaultMaxConnections=10
> torque.dsfactory.billing.pool.maxExpiryTime=3600
> torque.dsfactory.billing.pool.connectionWaitTimeout=10
>
>
> and I see the following in my browser when I hit
> http://localhost:8080/jetspeed. I've placed the mysql JDBC driver in the
> WEB-INF/lib directory and re-warred/redeployed everything. This error
> occurs whether I specify the user/pwd as properties or if I change the
> DB URL to pass them via that mechanism.

I don't understand that last sentence

>
> I'm using the mysql-connector-java-2.0.14-bin.jar driver for JDBC access
> to MySQL.
>
> Any ideas or pointers to the torque.dsfactory.* property syntax?  I
> couldn't find these on the Torque project reference page(s).
>
> thanks
>
>
> Horrible Exception: java.lang.Error: Error in
> BasePeer.initTableSchema(TURBINE_USER): Connection object is null!
> 	at
> org.apache.jetspeed.om.security.turbine.BaseTurbineUserPeer.initCl
> ass(BaseTurbineUserPeer.java:130)
> 	at


It is failing to find a connection object for the default database.

Did you remove or modify the default settings from Torque.properties? They
look like this:

torque.database.default.adapter=hypersonic
torque.dsfactory.default.connection.driver = org.hsqldb.jdbcDriver
torque.dsfactory.default.connection.url =
jdbc:hsqldb:${webappRoot}/WEB-INF/db/jetspeed
torque.dsfactory.default.connection.user = sa
torque.dsfactory.default.connection.password =

They are necessary for the default Jetspeed security service to access the
hypersonic db
>From what I understand, you want 2 db connections, right?
One for the DBBrowserPortlet to point to mySQL, and the other for Jetspeed
Security using the default settings



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: accessing mysql from a dbbrowser portlet

Posted by Eric White <ew...@rocksteady.com>.
great info.  I've got the following mysql setup in torque.properties:

torque.database.billing.adapter=mysql
torque.dsfactory.billing.connection.driver=com.mysql.jdbc.Driver
torque.dsfactory.billing.connection.url=jdbc:mysql://localhost:3306/test
torque.dsfactory.billing.connection.user=user1
torque.dsfactory.billing.connection.password=pass1

#

torque.dsfactory.billing.factory=org.apache.torque.dsfactory.TorqueDataSourceFactory
torque.dsfactory.billing.pool.defaultMaxConnections=10
torque.dsfactory.billing.pool.maxExpiryTime=3600
torque.dsfactory.billing.pool.connectionWaitTimeout=10


and I see the following in my browser when I hit
http://localhost:8080/jetspeed. I've placed the mysql JDBC driver in the
WEB-INF/lib directory and re-warred/redeployed everything. This error
occurs whether I specify the user/pwd as properties or if I change the
DB URL to pass them via that mechanism.

I'm using the mysql-connector-java-2.0.14-bin.jar driver for JDBC access
to MySQL.

Any ideas or pointers to the torque.dsfactory.* property syntax?  I
couldn't find these on the Torque project reference page(s).

thanks


Horrible Exception: java.lang.Error: Error in
BasePeer.initTableSchema(TURBINE_USER): Connection object is null!
	at
org.apache.jetspeed.om.security.turbine.BaseTurbineUserPeer.initClass(BaseTurbineUserPeer.java:130)
	at
org.apache.jetspeed.om.security.turbine.BaseTurbineUserPeer.<clinit>(BaseTurbineUserPeer.java:109)
	at
org.apache.jetspeed.services.security.turbine.TurbineUserManagement.getUser(TurbineUserManagement.java:164)
	at
org.apache.jetspeed.services.JetspeedUserManagement.getUser(JetspeedUserManagement.java:98)
	at
org.apache.jetspeed.services.security.turbine.TurbineAuthentication.getAnonymousUser(TurbineAuthentication.java:184)
	at
org.apache.jetspeed.services.JetspeedAuthentication.getAnonymousUser(JetspeedAuthentication.java:107)
	at
org.apache.jetspeed.services.JetspeedSecurity.getAnonymousUser(JetspeedSecurity.java:157)
	at
org.apache.jetspeed.modules.actions.TemplateSessionValidator.doPerform(TemplateSessionValidator.java:97)
	at
org.apache.jetspeed.modules.actions.JetspeedSessionValidator.doPerform(JetspeedSessionValidator.java:103)
	at org.apache.turbine.modules.Action.perform(Action.java:87)
	at org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
	at org.apache.turbine.Turbine.doGet(Turbine.java:468)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
	at
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:427)
	at org.apache.jsp.index_jsp._jspService(index_jsp.java:42)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
	at java.lang.Thread.run(Thread.java:536)



On Tue, 2002-11-19 at 11:36, David Sean Taylor wrote:
> 
> 
> > -----Original Message-----
> > From: Eric White [mailto:ewhite@rocksteady.com]
> > Sent: Tuesday, November 19, 2002 6:36 AM
> > To: jetspeed-user@jakarta.apache.org
> > Subject: accessing mysql from a dbbrowser portlet
> >
> >
> > I don't want to replace hypersonic as the user/group/role db under
> > Jetspeed, I just want to access a mysql db from a dbbrowser portlet (one
> > that I'd write or hijack from the demos/examples).
> >
> > But, I'm looking for the special sauce recipe of tasks I'm supposed to
> > perform.  Can somebody point me to the right sequence of URLs.
> >
> > I understand torque.properties fits in here somewhere but, after
> > reviewing the last few month's of mailing list posts, it appears that I
> > have to generate some files for torque/turbine to consume as part of the
> > object-to-relational mapping stage.
> >
> The dbbrowserportlet works generically on a database using
> java.sql.ResultSetMetaData, so it doesn't make use of torque at all except
> for the connection.
> 
> Here is one way to configure a second database connection pool in the
> Torque.properties. It is named 'ender':
> 
> torque.database.ender.adapter=oracle
> torque.dsfactory.ender.connection.driver = oracle.jdbc.driver.OracleDriver
> torque.dsfactory.ender.connection.url =
> jdbc:oracle:thin:@yourSid:1521:yourSchema
> torque.dsfactory.ender.connection.user =  jetspeed
> torque.dsfactory.ender.connection.password = password
> torque.dsfactory.ender.factory=org.apache.torque.dsfactory.TorqueDataSourceF
> actory
> torque.dsfactory.ender.pool.defaultMaxConnections=10
> torque.dsfactory.ender.pool.maxExpiryTime=3600
> torque.dsfactory.ender.pool.connectionWaitTimeout=10
> 
> To use this connection pool in the DatabaseBrowserPortlet, specify it by
> name:
> 
>         <!-- to use an alternate torque pool, set this parameter -->
>         <parameter name="poolname" value="ender" hidden="false"/>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: accessing mysql from a dbbrowser portlet

Posted by David Sean Taylor <da...@bluesunrise.com>.

> -----Original Message-----
> From: Eric White [mailto:ewhite@rocksteady.com]
> Sent: Tuesday, November 19, 2002 6:36 AM
> To: jetspeed-user@jakarta.apache.org
> Subject: accessing mysql from a dbbrowser portlet
>
>
> I don't want to replace hypersonic as the user/group/role db under
> Jetspeed, I just want to access a mysql db from a dbbrowser portlet (one
> that I'd write or hijack from the demos/examples).
>
> But, I'm looking for the special sauce recipe of tasks I'm supposed to
> perform.  Can somebody point me to the right sequence of URLs.
>
> I understand torque.properties fits in here somewhere but, after
> reviewing the last few month's of mailing list posts, it appears that I
> have to generate some files for torque/turbine to consume as part of the
> object-to-relational mapping stage.
>
The dbbrowserportlet works generically on a database using
java.sql.ResultSetMetaData, so it doesn't make use of torque at all except
for the connection.

Here is one way to configure a second database connection pool in the
Torque.properties. It is named 'ender':

torque.database.ender.adapter=oracle
torque.dsfactory.ender.connection.driver = oracle.jdbc.driver.OracleDriver
torque.dsfactory.ender.connection.url =
jdbc:oracle:thin:@yourSid:1521:yourSchema
torque.dsfactory.ender.connection.user =  jetspeed
torque.dsfactory.ender.connection.password = password
torque.dsfactory.ender.factory=org.apache.torque.dsfactory.TorqueDataSourceF
actory
torque.dsfactory.ender.pool.defaultMaxConnections=10
torque.dsfactory.ender.pool.maxExpiryTime=3600
torque.dsfactory.ender.pool.connectionWaitTimeout=10

To use this connection pool in the DatabaseBrowserPortlet, specify it by
name:

        <!-- to use an alternate torque pool, set this parameter -->
        <parameter name="poolname" value="ender" hidden="false"/>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>