Changeset 29903 for main/trunk/greenstone3
- Timestamp:
- 2015-05-20T17:19:33+12:00 (9 years ago)
- Location:
- main/trunk/greenstone3
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/build.properties.in
r29845 r29903 15 15 # uncomment the following if you have moved the greenstone3 web directory to tomcats webapps dir 16 16 #web.home=${tomcat.installed.path}/webapps/greenstone3 17 18 # Default derby networked server portnumber is 1527, can change this here in case of conflict 19 derby.server.port=1527 17 20 18 21 ## Collection building options -
main/trunk/greenstone3/build.xml
r29845 r29903 606 606 <pathelement location="${web.writablelib}"/> 607 607 <fileset dir="${web.writablelib}"> 608 <include name="derby .jar"/>608 <include name="derbyclient.jar"/> <!--<include name="derby.jar"/>--> 609 609 </fileset> 610 610 </path> 611 611 612 <path id="derby.server.classpath"> 613 <pathelement location="${web.lib}/derbynet.jar"/> 614 <pathelement location="${web.lib}/derby.jar"/> 615 </path> 616 617 612 618 <path id="local.tomcat.path"> 613 619 <pathelement location="${basedir}/bin/script"/> … … 780 786 781 787 <target name="get-default-servlet-url"> 782 788 <echo>http://${tomcat.server}:${tomcat.port}${app.path}${server.default.servlet}</echo> 783 789 </target> 784 790 785 <target name="start" depends="init,configure-tomcat,configure-web,configure-solr-ext,start-tomcat" 791 <target name="start-derby-java"> 792 <echo>Launching derby on ${derby.server.port}...</echo> 793 <java classname="org.apache.derby.drda.NetworkServerControl" fork="true" spawn="true" clonevm="true"> 794 <arg value="start"/> 795 <classpath refid="derby.server.classpath"/> 796 </java> 797 </target> 798 799 <!-- Using derby 10.1.2.1 800 See db-derby-10.1.2.1-bin/docs/html/adminguide/index.html --> 801 <target name="start-derby"> 802 <echo>About to launch derby on ${derby.server.port}</echo> 803 <property name="derby.server.classpath.prop" refid="derby.server.classpath" /> 804 805 <exec executable="java" spawn="true"><!-- failonerror="true"--> 806 <env key="CLASSPATH" path="${derby.server.classpath.prop}"/> 807 <arg value="org.apache.derby.drda.NetworkServerControl"/> 808 <arg value="start"/> 809 <arg value="-p"/> 810 <arg value="${derby.server.port}"/> 811 </exec> 812 </target> 813 814 <target name="stop-derby"> 815 <java classname="org.apache.derby.drda.NetworkServerControl"> 816 <arg value="shutdown"/> 817 <classpath refid="derby.server.classpath"/> 818 </java> 819 </target> 820 821 <target name="start" depends="init,configure-tomcat,configure-web,configure-solr-ext,start-derby,start-tomcat" 786 822 description="Startup the Tomcat server." > 787 823 <echo>${app.name} (${app.version}) server running using Apache Tomcat and Java</echo> … … 813 849 </target> 814 850 815 <target name="stop" depends="init,stop-tomcat "851 <target name="stop" depends="init,stop-tomcat,stop-derby" 816 852 description="Shutdown the Tomcat server."/> 817 853 … … 1201 1237 <filter token="tomcat.server" value="${tomcat.server}"/> 1202 1238 <filter token="tomcat.port" value="${tomcat.port}"/> 1239 <filter token="derbyserver.port" value="${derby.server.port}"/> 1203 1240 <filter token="perlpath" value="${escaped.perl.path}"/> 1204 1241 <filter token="disable.collection.building" value="${disable.collection.building}"/> … … 1352 1389 <filter token="privilegedattribute" value="${privileged.attribute}"/> 1353 1390 <filter token="allowedIPs" value="${allowed.IPs}"/> 1391 <filter token="derbyserverport" value="${derby.server.port}"/> 1354 1392 </filterset> 1355 1393 </copy> … … 1735 1773 <target name="update-userdb" description="Add or modify users" depends="check-tomcat-running"> 1736 1774 1737 <!-- stop tomcat if running, since derby db is embedded and only allows connections from one jvm instance at a time 1775 <!-- 1776 We're now using derby networked server, so stopping and starting tomcat is not necessary. 1777 For embedded derby: stop tomcat if running, since derby db is embedded 1778 and only allows connections from one jvm instance at a time 1738 1779 See http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html 1739 1780 The ${tomcat.isrunning} property is set by the depends-target "check-tomcat-running" --> 1781 <!-- 1740 1782 <if> 1741 1783 <bool> … … 1744 1786 <antcall target="stop-tomcat"/> 1745 1787 </if> 1788 --> 1746 1789 1747 1790 <!--<echo>${admin.password}</echo>--> <!-- for testing --> … … 1758 1801 1759 1802 <!-- run tomcat again if it used to be running --> 1803 <!-- 1760 1804 <if> 1761 1805 <bool> … … 1764 1808 <antcall target="start-tomcat"/> 1765 1809 </if> 1810 --> 1766 1811 </target> 1767 1812 -
main/trunk/greenstone3/resources/tomcat/greenstone3.xml.in
r29845 r29903 10 10 allowLinking="false" 11 11 xmlBlockExternal="false"> 12 12 13 <!-- 14 For embedded derby db: 15 driverName="org.apache.derby.jdbc.EmbeddedDriver" 16 connectionURL="jdbc:derby:@gsdl3webhome@/etc/usersDB" 17 --> 13 18 <Realm className="org.apache.catalina.realm.JDBCRealm" 14 driverName="org.apache.derby.jdbc. EmbeddedDriver"15 connectionURL="jdbc:derby: @gsdl3webhome@/etc/usersDB"19 driverName="org.apache.derby.jdbc.ClientDriver" 20 connectionURL="jdbc:derby://localhost:@derbyserverport@/@gsdl3webhome@/etc/usersDB" 16 21 userTable="users" userNameCol="username" userCredCol="password" 17 22 userRoleTable="roles" roleNameCol="role" -
main/trunk/greenstone3/resources/web/global.properties.in
r29250 r29903 19 19 [email protected]@ 20 20 tomcat.context=greenstone3 21 [email protected]@ 21 22 22 23 ## Proxy setup - set these if you are behind a firewall and you want services that access the internet -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/sql/derby/DerbySQLServer.java
r20009 r29903 8 8 import java.sql.SQLException; 9 9 10 import org.greenstone.util.GlobalProperties; 11 10 12 public class DerbySQLServer implements SQLServer{ 11 static final String PROTOCOL = "jdbc:derby:"; 12 static final String DRIVER = "org.apache.derby.jdbc.EmbeddedDriver"; 13 14 static final String PORT = GlobalProperties.getProperty("derby.server.port");//, "1527"); 15 static final String PROTOCOL = "jdbc:derby://localhost:"+PORT+"/"; //"jdbc:derby:"; 16 static final String DRIVER = "org.apache.derby.jdbc.ClientDriver"; //"org.apache.derby.jdbc.EmbeddedDriver"; 13 17 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.sql.derby.DerbySQLServer.class.getName()); 14 18 … … 51 55 public boolean disconnect(String databasePath){ 52 56 try{ 53 String protocol_str = PROTOCOL + databasePath + ";shutdown=true"; 54 DriverManager.getConnection(protocol_str); 57 // Only shutdown if using embedded derby, 58 // not if it's a networked derby server, which is what we now use 59 60 if(DRIVER.equals("org.apache.derby.jdbc.EmbeddedDriver")) { 61 String protocol_str = PROTOCOL + databasePath + ";shutdown=true"; 62 DriverManager.getConnection(protocol_str); 63 } 55 64 }catch (SQLException se){ 56 65 String theError = (se).getSQLState(); -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/DerbyWrapper.java
r28234 r29903 35 35 public class DerbyWrapper 36 36 { 37 static final String PROTOCOL = "jdbc:derby:"; 38 static final String DRIVER = "org.apache.derby.jdbc.EmbeddedDriver"; 37 static final String PORT = GlobalProperties.getProperty("derby.server.port");//, "1527"); 38 static final String PROTOCOL = "jdbc:derby://localhost:"+PORT+"/"; // "jdbc:derby:"; 39 static final String DRIVER = "org.apache.derby.jdbc.ClientDriver"; //"org.apache.derby.jdbc.EmbeddedDriver"; 39 40 static final String USERSDB = "usersDB"; 40 41 static final String USERS = "users"; … … 134 135 { 135 136 // shutdown the whole server 137 // but not if we're a derby client using the derby network server 138 // only if we're using an embedded derby 139 if(DRIVER.equals("org.apache.derby.jdbc.EmbeddedDriver")) { 136 140 DriverManager.getConnection(PROTOCOL + ";shutdown=true"); 141 } 137 142 } 138 143 catch (SQLException se)
Note:
See TracChangeset
for help on using the changeset viewer.