Page 1 of 1

Demo site on Tomcat7 and intellij on windows

Posted: Thu Aug 14, 2014 12:59 am
by learn.broadleaf
Hi All,

I am trying get the demo site to run in tomcat 7 and windows.

looks like i need to configure the jndi datasource lookup in my tomcat7 first but couldn't seem to get this to work

here is there error

Code: Select all

java.sql.SQLException: ${database.driver}
   at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)
   at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
   at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:699)
   at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:631)
   at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:485)


i have followed this link,

viewtopic.php?f=15&t=1985

i tried to set CATALINA_OPTS in my catalina_home/bin/startup.bat or created a file called setenv.bat and have this line in there

Code: Select all

set CATALINA_OPTS="
-Ddatabase.url=jdbc:hsqldb:hsql://localhost/broadleaf
-Ddatabase.user=sa
-Ddatabase.password=null
-Ddatabase.driver=org.hsqldb.jdbcDriver"


but still have this error on startup ..

Code: Select all

java.sql.SQLException: ${database.driver}
   at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)
   at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
   at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:699)
   at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:631)
   at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:485)


you guys have any idea on how to resolve this ?

Thanks

Re: Demo site on Tomcat7 and intellij on windows

Posted: Fri Aug 15, 2014 10:25 am
by jocanas
Hello,

I believe there are a few of going about doing this; I will share my approach that has worked for me when deploying broadleaf via the Tomcat server configuration in IntelliJ. In my tomcat folder, I go directly into the /conf/context.xml file and set the following entries:

Code: Select all

     <Resource name="jdbc/web" auth="Container" type="javax.sql.DataSource"
               maxActive="10" maxIdle="30" maxWait="10000"
               username="sa" password="" driverClassName="org.hsqldb.jdbcDriver"
               url="jdbc:hsqldb:hsql://localhost/broadleaf"/>
               
    <Resource name="jdbc/secure" auth="Container" type="javax.sql.DataSource"
               maxActive="10" maxIdle="30" maxWait="10000"
               username="sa" password="" driverClassName="org.hsqldb.jdbcDriver"
               url="jdbc:hsqldb:hsql://localhost/broadleaf"/>
       
    <Resource name="jdbc/storage" auth="Container" type="javax.sql.DataSource"
               maxActive="10" maxIdle="30" maxWait="10000"
               username="sa" password="" driverClassName="org.hsqldb.jdbcDriver"
               url="jdbc:hsqldb:hsql://localhost/broadleaf"/>


Here's a few more details on setting this up in our docs with a few more options:
http://www.broadleafcommerce.com/docs/c ... ion/tomcat

Re: Demo site on Tomcat7 and intellij on windows

Posted: Fri Aug 15, 2014 10:32 pm
by learn.broadleaf
Hi,

Thank you so much for your help. Broafleaf community is awesome!