Torben Norling, I seem to have lost your original message during the mailing
list switchover, so I'm just replying generally. Hopefully you'll get this.
I was in a similar situation of being unable to edit my context, but found
that datasources can be set up in code. I added the following to
RollerContext.java to set my datasource. I use the OracleDataSource object,
you may need a different one for your DB.
//Bind Datasourse to JNDI instead of using
container - Oracle Version
InitialContext ic = new InitialContext();
OracleDataSource vds = new OracleDataSource();
vds.setURL("jdbc:oracle:thin:@site.domain.com:25380:NAME");
vds.setUser("roller");
vds.setPassword("password");
vds.setDescription("A DB for the Roller blogging
tool");
ic.rebind("roller:rollerdbpool", vds);
mLogger.info("DB Pool Initialized");
This was inserted just before the call to setupRollerConfig(). It probably
could be added it elsewhere, if you didn't want to muck around in the Roller
code, but it needs to run prior to any Roller code that accesses the
Datasource though.
I think the situation of being unable to edit ones context is likely more
prevalent than some would like to believe. Offering a default alternative
means to specify datasources rather than "get a different ISP" would be
quite helpful. Perhaps a init-param in web.xml or portion of
roller-config.xml.
Kenneth M. Kolano
Technology Architecture & Innovation
908-423-4241
WS1B-51B
-----Original Message-----
From: Matt Raible [mailto:[EMAIL PROTECTED]
Sent: Monday, July 11, 2005 10:40 AM
To: [email protected]
Subject: Re: Datasource without server.xml / roller_tomcat_5_0.xml
You can put the <Context> in a META-INF/context.xml file of a WAR and
it'll get picked up and deployed by Tomcat 5. However, the classes
(JARs) that are needed by Resources in context.xml must be already
deployed in Tomcat (in common/lib).
Hope this helps,
Matt
On 7/11/05, Anil Gangolli <[EMAIL PROTECTED]> wrote:
>
> Tomcat does have some scheme for including the context XML within the
WEB-INF of the web app itself, but I don't know the details of
> exactly how it works. They do this for their own manager webapp (in
server/webapps). I suggest examining this route to see if it
> can be applied to normal webapps in Tomcat as well. If it applies, it
would allow you to include the appropriately named context
> xml file in your webapp when you upload that. Check the Tomcat docs for
further info. I can't give you a precise reference
> unfortunately; you may have to experiment locally to understand the
specific behavior.
>
> Failing that route, it's also possible to create the DBCP BasicDataSource
explicitly in code if you're willing to modify the Roller
> sources. I'm not sure if it is possible to deal with the Realm that way
though, but it may be. This is definitely a less desirable
> route long term.
>
> Sorry for lateness of the response and the brevity now.
>
> --a.
>
>
> ----- Original Message -----
> From: "Dave Johnson" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Monday, July 11, 2005 6:49 AM
> Subject: Re: Datasource without server.xml / roller_tomcat_5_0.xml
>
>
> >
> > I'm not aware of any other way to create a datasource in Tomcat. It is
possible that you could configure Hibernate to use the
> > JDBC DataManager instead of a configuring a datasource. To do that
you'd have to hack WEB-INF/classes/hibernate.cfg.xml. There
> > is an example of a DataManager base config in that file, but it is
commented out.
> >
> > <!--
> > Examples for configuring Hibernate to use the JDBC Driver
Manager
> > <property
name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</ property>
> > <property
name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost:3219</
property>
> > <property name="hibernate.connection.username">sa</property>
> > <property name="hibernate.connection.password"></property>
> > <property
name="hibernate.dialect">net.sf.hibernate.dialect.HSQLDialect</ property>
> >
> > But, you'll still need a way to configure Tomcat to authenticate
against the Roller database. So I guess you are stuck, unless
> > you want to rip and replace Roller's authentication system.
> >
> > Not good. I guess my recommendation is: if your ISP won't allow you to
configure your app, find another ISP.
> >
> > - Dave
> >
> >
> >
> > On Jul 1, 2005, at 2:50 AM, Torben Norling wrote:
> >
> >> Hi,
> >> I'm planning on using Roller 1.2 and right now I'm looking for an ISP
here
> >> in Sweden that supports Tomcat 5+. I have found one that looks pretty
good
> >> but it seems like I don't have access to server.xml or app.level
context
> >> settings like roller_tomcat_5_0.xml. Ok, they have another "account
level"
> >> that gives me my own JVM that would solve it but the price rises
pretty much
> >> then.
> >>
> >> My question is if it is possible to place these settings in web.xml
instead
> >> or if anyone have another tips how to handle this... I know this
question is
> >> more kind of Tomcat specific, sorry about that.
> >>
> >> Thanks // Torben Norling
>
>
------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New
Jersey, USA 08889), and/or its affiliates (which may be known outside the
United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as
Banyu) that may be confidential, proprietary copyrighted and/or legally
privileged. It is intended solely for the use of the individual or entity named
on this message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and then delete
it from your system.
------------------------------------------------------------------------------