turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrab <michele.raba...@nscorp.com>
Subject Re: Turbine 2.3.3 - change database url based on environment (QA, TEST, etc.)
Date Thu, 22 Sep 2011 13:07:27 GMT


Thomas Vandahl-2 wrote:
> 
> No, the ResourceLink element belongs in the context file of your web
> application. After deployment it normally sits in
> conf/Catalina/localhost/yourappcontext.xml The context file
> documentation is at tomcat.apache.org. The idea I wanted to get across
> is to simplify the mapping by moving it out of the application.
> 

Thanks for your patience!  After making the changes below and restarting
tomcat, I'm getting the following error that I need help with:

ERROR org.apache.torque.oid.IDBroker - Could not open a connection to the
database inventory_test
java.lang.NullPointerException

Changes:

changed /tomcat/webapps/inventory/WEB-INF/conf/torque.properties... now
contains only the following properties,

torque.applicationRoot = .
torque.idbroker.cleverquantity = true
torque.idbroker.prefetch = true
torque.idbroker.usenewconnection = true
torque.database.default = inventory
torque.database.inventory.adapter =     mysql
torque.dsfactory.inventory.factory =   
org.apache.torque.dsfactory.JndiDataSourceFactory
torque.dsfactory.inventory.jndi.path=jdbc/inventory

changed /tomcat/conf/server.xml...GlobalNamingResources looks like this,

  <GlobalNamingResources>

    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>

    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
       description="User database that can be updated and saved"
           factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
          pathname="conf/tomcat-users.xml" />

     <!-- Connection to 'inventory_test' -->
     <Resource name="jdbc/inventory_test"
       auth="Container"
       type="javax.sql.DataSource"
       driverClassName="org.gjt.mm.mysql.Driver"
       url="jdbc:mysql://Inventorymysqltest.ns.com/inventory_test"
       user="user"
       password="password"
       />


  </GlobalNamingResources>

changed /tomcat/conf/context.xml... added this line to the <Context>
section,

    <ResourceLink global="jdbc/inventory_test" name="jdbc/inventory"
type="javax.sql.DataSource"/>



-- 
View this message in context: http://old.nabble.com/Turbine-2.3.3---change-database-url-based-on-environment-%28QA%2C-TEST%2C-etc.%29-tp32423328p32503813.html
Sent from the Turbine - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@turbine.apache.org
For additional commands, e-mail: user-help@turbine.apache.org


Mime
View raw message