You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by Timothy Mizas <ti...@villanova.edu> on 2008/02/06 19:14:11 UTC

Setting up roller to work with Oracle

Hi,
I've been trying to set up roller to connect to an oracle db and have been having some issues. I've changed the roller-custom.properties to:

installation.type=auto
database.configurationType=jdbc
database.jdbc.driverClass=oracle.jdbc.pool.OracleDataSource
database.jdbc.connectionURL=jdbc:oracle:thin:@url:1521:wdb1/dbname
database.jdbc.username=user
database.jdbc.password=pass
hibernate.dialect=org.hibernate.dialect.Oracle9Dialect

and the roller xml to:

<Context path="/roller"
  docBase="/roller" debug="0">
  <Resource name="jdbc/dbname" auth="Container"
      type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.OracleDriver"
    url="jdbc:oracle:thin:@url:1521:wdb1/dbname"
    username="user"
    password="pass"
    maxActive="20"
    maxIdle="3"
    removeAbandoned="true"
    maxWait="3000" />
</Context>

and in the web.xml inside roller/WEB-INF I change the resource to:

<resource-ref>
            <res-ref-name>jdbc/dbname</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
    </resource-ref>

I'm using a different dbname other than "rollerdb". I'm not sure if roller supports this, so that could be my issue and I'm also not sure if I've set everything up correctly to work for oracle. For a while I was getting an error saying "ORA-12505, TNS:listener does not currently know of SID given in connect descriptor" and then I realized that I still had settings pointing to rollerdb instead of the custom dbname. So I changed that and now I get "javax.naming.NameNotFoundException: Name rollerdb is not bound in this Context".

Has anyone set up roller to connect to Oracle or a different db name that could give me some info on how to do this?

Thanks,
Tim

RE: Setting up roller to work with Oracle

Posted by sh...@contractor.thomson.com.
Hi,

(i) I  am connecting to Oracle 9i with Roller 4.0 with the below
settings in context.xml :-

<Context debug="0" docBase="C:\\apache-roller-4.0\\webapp\\roller\\"
path="/roller">
  <Resource auth="Container"
connectionProperties="autoReconnect=true&amp;useUnicode=true&amp;charact
erEncoding=utf-8&amp;mysqlEncoding=utf8"
driverClassName="oracle.jdbc.driver.OracleDriver" maxActive="50"
maxIdle="3" maxWait="3000" name="jdbc/rollerdb" password="roller"
removeAbandoned="true" type="javax.sql.DataSource"
url="jdbc:oracle:thin:@111.11.11.11:1521:tsb" username="roller "/>
</Context>

(ii) Also I didn't set
hibernate.dialect=org.hibernate.dialect.Oracle9Dialect in
roller-custom.properties

(iii)  I have following settings in roller-custom.properties :-      

       installation.type=manual
       database.configurationType=jdbc
       database.jdbc.driverClass=oracle.jdbc.driver.OracleDriver
	
database.jdbc.connectionURL=jdbc:oracle:thin:@111.11.11.11:1521:tsb
	 database.jdbc.username=roller_user
       database.jdbc.password=roller_pass

I hope it helps.
Thanks

Shyam Prasad Harianathan 

 
-----Original Message-----
From: Timothy Mizas [mailto:timothy.mizas@villanova.edu] 
Sent: Wednesday, February 06, 2008 1:14 PM
To: user@roller.apache.org
Subject: Setting up roller to work with Oracle

Hi,
I've been trying to set up roller to connect to an oracle db and have
been having some issues. I've changed the roller-custom.properties to:

installation.type=auto
database.configurationType=jdbc
database.jdbc.driverClass=oracle.jdbc.pool.OracleDataSource
database.jdbc.connectionURL=jdbc:oracle:thin:@url:1521:wdb1/dbname
database.jdbc.username=user
database.jdbc.password=pass
hibernate.dialect=org.hibernate.dialect.Oracle9Dialect

and the roller xml to:

<Context path="/roller"
  docBase="/roller" debug="0">
  <Resource name="jdbc/dbname" auth="Container"
      type="javax.sql.DataSource"
    driverClassName="oracle.jdbc.OracleDriver"
    url="jdbc:oracle:thin:@url:1521:wdb1/dbname"
    username="user"
    password="pass"
    maxActive="20"
    maxIdle="3"
    removeAbandoned="true"
    maxWait="3000" />
</Context>

and in the web.xml inside roller/WEB-INF I change the resource to:

<resource-ref>
            <res-ref-name>jdbc/dbname</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
    </resource-ref>

I'm using a different dbname other than "rollerdb". I'm not sure if
roller supports this, so that could be my issue and I'm also not sure if
I've set everything up correctly to work for oracle. For a while I was
getting an error saying "ORA-12505, TNS:listener does not currently know
of SID given in connect descriptor" and then I realized that I still had
settings pointing to rollerdb instead of the custom dbname. So I changed
that and now I get "javax.naming.NameNotFoundException: Name rollerdb is
not bound in this Context".

Has anyone set up roller to connect to Oracle or a different db name
that could give me some info on how to do this?

Thanks,
Tim

Re: Setting up roller to work with Oracle

Posted by Gabe Wong <ga...@ngasi.com>.
Broderick, Andrew wrote:
> Where did you put roller-custom.properties? The right location is
> tomcat/common/classes (TC5x) or tomcat/lib (for TC6).
>
> - Dave
>
>
> For app servers such as WebLogic where you can't easily access their
> classes directory, you can put it in the roller.war file, in
> WEB-INF/classes.
>
>   
You are right Andrew. Another benefit for placing properties under 
WEB-INF/classes is that
it enables portability of the application. You can run multiple 
instances with different configuration under the same JVM.

With regards to Tim's configuration, it appears there is a problem with 
the DB syntax

jdbc:oracle:thin:@url:1521:wdb1/dbname, I think should be jdbc:oracle:thin:@url:1521:wdb1


-- 
Regards

Gabe Wong
NGASI AppServer Manager
JAVA AUTOMATION and SaaS Enablement
<a href=http://www.ngasi.com>http://www.ngasi.com</a>
NEW! 8.0 - Centrally manage multiple physical servers


RE: Setting up roller to work with Oracle

Posted by "Broderick, Andrew" <An...@Monster.com>.
Where did you put roller-custom.properties? The right location is
tomcat/common/classes (TC5x) or tomcat/lib (for TC6).

- Dave


For app servers such as WebLogic where you can't easily access their
classes directory, you can put it in the roller.war file, in
WEB-INF/classes.




NOTICE:
This message may contain privileged or otherwise confidential information. If you are not the intended recipient, please immediately advise the sender by reply email and delete the message and any attachments without using, copying or disclosing the contents. (FE1)

Re: Setting up roller to work with Oracle

Posted by Dave <sn...@gmail.com>.
On Feb 6, 2008 1:14 PM, Timothy Mizas <ti...@villanova.edu> wrote:
> Hi,
> I've been trying to set up roller to connect to an oracle db and have been having some issues. I've changed the roller-custom.properties to:
>
> installation.type=auto
> database.configurationType=jdbc
> database.jdbc.driverClass=oracle.jdbc.pool.OracleDataSource
> database.jdbc.connectionURL=jdbc:oracle:thin:@url:1521:wdb1/dbname
> database.jdbc.username=user
> database.jdbc.password=pass
> hibernate.dialect=org.hibernate.dialect.Oracle9Dialect

Assuming your connectionURL, username and passwords are correct that looks good.

You don't need the hibernate.dialect property.


> and the roller xml to:
> <Context path="/roller"
>   docBase="/roller" debug="0">
>   <Resource name="jdbc/dbname" auth="Container"
>       type="javax.sql.DataSource"
>     driverClassName="oracle.jdbc.OracleDriver"
>     url="jdbc:oracle:thin:@url:1521:wdb1/dbname"
>     username="user"
>     password="pass"
>     maxActive="20"
>     maxIdle="3"
>     removeAbandoned="true"
>     maxWait="3000" />
> </Context>
>
> and in the web.xml inside roller/WEB-INF I change the resource to:
>
> <resource-ref>
>             <res-ref-name>jdbc/dbname</res-ref-name>
>             <res-type>javax.sql.DataSource</res-type>
>             <res-auth>Container</res-auth>
>     </resource-ref>

Since you are using installation.type=jdbc instead of JNDI you don't
need to have that <Resource> definition in your roller.xml file, nor
do you need that resource ref. For type=jdbc, all you need are those
properties you set in roller-custom.properties.


> I'm using a different dbname other than "rollerdb". I'm not sure if roller supports this, so that could be my issue and I'm also not sure if I've set everything up correctly to work for oracle. For a while I was getting an error saying "ORA-12505, TNS:listener does not currently know of SID given in connect descriptor" and then I realized that I still had settings pointing to rollerdb instead of the custom dbname. So I changed that and now I get "javax.naming.NameNotFoundException: Name rollerdb is not bound in this Context".
>
> Has anyone set up roller to connect to Oracle or a different db name that could give me some info on how to do this?

Sounds like Roller is not able to find your roller-custom.properties
file. Check your logs, do they say anything about
roller-custom.properties?

Where did you put roller-custom.properties? The right location is
tomcat/common/classes (TC5x) or tomcat/lib (for TC6).

- Dave