或者如何设置一个solr.solr.home系统属性?给下面的代码用。
if( home == null ) {
String prop = "solr.solr.home";
home = normalizeDir(System.getProperty(prop));
if( home != null ) {
log.info("using system property solr.home: " + home );
}
}原SOLR资料地址:http://www.cnblogs.com/abob/archive/2007/08/05/844193.aspx
if( home == null ) {
String prop = "solr.solr.home";
home = normalizeDir(System.getProperty(prop));
if( home != null ) {
log.info("using system property solr.home: " + home );
}
}原SOLR资料地址:http://www.cnblogs.com/abob/archive/2007/08/05/844193.aspx
解决方案 »
- POI sst table
- VP UML字体发虚,可有解决办法?
- 网上淘宝-网络资源检索
- 有使用WebLogic Platform 8.1的吗 请教几个问题 谢谢了
- [求助]已学会Java基本语法,做过了Oracle基本的JDBC编程,想搞办公自动化方向,下一步应该怎么学习
- 求屏蔽弹出窗口工作原理类似3721、Pop-up Blocker这样的软件工作机制
- 再求一个struts的例子,重要的是有数据库操作,DAO部分.
- 大家帮我看看下面一个在jbuilder里面编译的问题出在哪里吧,谢谢! :)
- java中怎么调动.dll????????????
- 在sessionbean中如何调用entitybean?
- 初学者,最简单的程序,几个疑问,马上给分
- 请问一下一个页面的JS怎么引用另一个页面JS的值。谢谢了,十分感谢。
说了这么多,记着给分,卖血呀!
<Context path="/CSDNOne" docBase="CSDNOne"
debug="5" reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_DBTest_log." suffix=".txt"
timestamp="true"/>
<Resource name="jdbc/db2DataSource"
auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/db2DataSource">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- Maximum number of dB connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to 0 for no limit.
-->
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<!-- Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit.
-->
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<!-- Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<!-- MySQL dB username and password for dB connections -->
<parameter>
<name>username</name>
<value>root</value>
</parameter>
<parameter>
<name>password</name>
<value>123456</value>
</parameter>
<!-- Class name for mm.mysql JDBC driver -->
<parameter>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
<!-- The JDBC connection url for connecting to your MySQL dB.
The autoReconnect=true argument to the url makes sure that the
mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
connection. mysqld by default closes idle connections after 8 hours.
-->
<parameter>
<name>url</name> <value>jdbc:mysql://localhost:3306/CSDNOne?autoReconnect=true</value>
</parameter>
</ResourceParams>
</Context>
________________________________________
访问时用:
Context initContext = new InitialContext();
//在tomcat中配置的数据源名jdbc\db2DataSource
Context envContext = (Context)initContext.lookup("java:comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/db2DataSource");
1。tomcat配置jndi
<Context docBase="f:/solr.war" debug="0" crossContext="true" >
<Environment name="solr/home" type="java.lang.String"
value="f:/my/solr/home" override="true" />
</Context>
2.tomcat配置系统属性
set JAVA_OPTS="-Dsolr.solr.home=D:\\test\\solr"