[INFO] BUILD SUCCESSFUL
但是我到E:\apache-continuum-1.1\continuum-1.1\apps\continuum\webapp\WEB-INF\working-directory\30\target
下面查看continuum構建完之后的war包
.war\WEB-INF\classes文件夾里沒有class文件,只有properties和xml配置文件
step 1 : 生成server key
使用java/kegtool工具
keytool -genkey -alias tomcat -keyalg RSA -keypass changeit -storepass changeit -keystore e:/server.keystore -validity 3600
注:參數 -validity 指證書的有效期(天),缺省有效期很短,只有90天。
step 2 : 將證書導入java證書信任庫,服務端和客戶端都必須導入證書
分2步,第一步導出證書,第二步導入信任庫(tomcat為證書別名)
keytool -export -trustcacerts -alias tomcat -file server.cer -keystore e:/server.keystore -storepass changeit
keytool -import -trustcacerts -alias tomcat -file server.cer -keystore E:/Java/jdk1.6.0_03/jre/lib/security/cacerts -storepass changeit
其他有用的keytool命令
列表:keytool -list -v -keystore E:/Java/jre1.6.0_03/lib/security/cacerts
刪除:keytool -delete -trustcacerts -alias tomcat -keystore E:/Java/jdk1.6.0_03/jre/lib/security/cacerts -storepass changeit
注:E:/Java/jdk1.6.0_03/jre/lib/security/cacerts的JRE路徑和tomcat設置的E:\Java\jdk1.6.0_03\jre\bin\client\jvm.dll路徑相同
step 3 : 配置tomcat server.xml,服務端和客戶端都必須配置
tomcat6.0加入以下xml代碼
<Connector protocol="org.apache.coyote.http11.Http11Protocol"
port="8443" minSpareThreads="5" maxSpareThreads="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="e:/server.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS"/>
參考:http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
反復檢查多變,排除程序問題,那么問題就出在windows身上,2003的安全比較高,所以本身屏蔽了比較多的服務,而且對登錄程序的用戶也又限制.默認的登錄tomcat的帳戶應該是system用戶(沒有具體查證),本地帳戶不具有訪問網絡的權限.問題找到了.
打開 服務管理,配置Tomcat服務屬性里的登錄帳戶,修改登錄帳戶為具有訪問網絡的帳戶(你可以修改為administrator試試).
問題還沒有完全解決,tomcat只能通過\\192.168.0.202\files網絡路徑的形式訪問共享,不能通過網絡映射驅動器訪問(Y:\files)
由于時間緊迫.所有沒有去研究windows2003哪個服務屏蔽administrator訪問網絡映射驅動器的權限.下次有時間再研究
環境,兩臺主機 操作系統都是 window2003,主機A映射一個主機B的網絡磁盤
在開發環境windows xp home版可以正常的往主機B的網絡磁盤寫文件
拿到服務器上就完蛋,拋出異常java.io.FileNotFoundException
拿同事的機器(同樣是home版)跑tomcat,也能正常寫.
起初以為是系統登錄用戶的問題.兩臺主機都建立同樣的用戶和密碼,再測試還是失敗.
換個方法建立域帳戶,把兩臺主機都加入到域里面,使用同樣域帳戶登陸主機,最后失敗中的失敗.
實在搞不明白.如果不行就換linux了
還做了一個測試,在主機A上寫了個普通的class,cmd java class執行,執行一個寫往主機B網絡磁盤寫文件的操作,可以寫過去,但是在tomcat環境下卻寫不過去..why....
今天研究了下TOMCAT集群,遇到問題,望解答!環境是一樣的2臺機器(下面用tomcat1,tomcat2來表示這兩臺機器)
按照官方網站的文檔配置,2個服務器都能正常起來。而且都監聽到了對方的存在,下面是輸出信息:
信息: Verification complete. Member disappeared[org.apache.catalina.tribes.membership.MemberImpl[tcp://WDGJ-14:4001,WDGJ-14,4001, alive=1608998,id={101 20 -85 1 -96 113 79 34 -116 24 -43 -93 27 -49 -87 44 }, payload={}, command={}, domain={}, ]]
web.xml的 <distributable/> 已經配置了
使用同一個IE窗口訪問2個服務得到的SESSION ID不同,在tomcat1保存一個session attribute,在tomcat2上沒有,得到結果,配置失敗。SESSION沒有被復制到另一個服務。望高手幫幫忙!
我沒有做負載均衡,只做了集群。
以下是tomcat官網上的原話,不知道是不是我沒理解明白,誰能再給說明下:
1.All your session attributes must implement java.io.Serializable
2.Uncomment the Cluster element in server.xml
If you have defined custom cluster valves, make sure you have the ReplicationValve defined as well under the Cluster element in server.xml
3.If your Tomcat instances are running on the same machine, make sure the tcpListenPort attribute is unique for each instance, in most cases Tomcat is smart enough to resolve this on it 's own by autodetecting available ports in the range 4000-4100
4.Make sure your web.xml has the <distributable/> element or set at your <Context distributable= "true " />
5.If you are using mod_jk, make sure that jvmRoute attribute is set at your Engine <Engine name= "Catalina " jvmRoute= "node01 " > and that the jvmRoute attribute value matches your worker name in workers.properties
6.Make sure that all nodes have the same time and sync with NTP service!
7.Make sure that your loadbalancer is configured for sticky session mode.
兩個TOMCAT的server.xml唯一不同的地方就是Receiver的監聽端口,一個是4000一個是4001
server.xml文件如下:
<Server port= "8005 " shutdown= "SHUTDOWN ">
<Listener className= "org.apache.catalina.core.AprLifecycleListener " SSLEngine= "on " />
<Listener className= "org.apache.catalina.core.JasperListener " />
<Listener className= "org.apache.catalina.mbeans.ServerLifecycleListener " />
<Listener className= "org.apache.catalina.mbeans.GlobalResourcesLifecycleListener " />
<GlobalNamingResources>
<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 " />
</GlobalNamingResources>
<Service name= "Catalina ">
<Connector port= "80 " protocol= "HTTP/1.1 "
connectionTimeout= "20000 "
redirectPort= "8443 " />
<Connector port= "8009 " protocol= "AJP/1.3 " redirectPort= "8443 " />
<Engine name= "Catalina " defaultHost= "localhost ">
<Cluster className= "org.apache.catalina.ha.tcp.SimpleTcpCluster "
channelSendOptions= "8 ">
<Manager className= "org.apache.catalina.ha.session.DeltaManager "
expireSessionsOnShutdown= "false "
notifyListenersOnReplication= "true "/>
<Channel className= "org.apache.catalina.tribes.group.GroupChannel ">
<Membership className= "org.apache.catalina.tribes.membership.McastService "
address= "228.0.0.4 "
port= "45564 "
frequency= "500 "
dropTime= "3000 "/>
<Receiver className= "org.apache.catalina.tribes.transport.nio.NioReceiver "
address= "auto "
port= "4000 "
autoBind= "100 "
selectorTimeout= "5000 "
maxThreads= "6 "/>
<Sender className= "org.apache.catalina.tribes.transport.ReplicationTransmitter ">
<Transport className= "org.apache.catalina.tribes.transport.nio.PooledParallelSender "/>
</Sender>
<Interceptor className= "org.apache.catalina.tribes.group.interceptors.TcpFailureDetector "/>
<Interceptor className= "org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor "/>
</Channel>
<Valve className= "org.apache.catalina.ha.tcp.ReplicationValve "
filter= " "/>
<Valve className= "org.apache.catalina.ha.session.JvmRouteBinderValve "/>
<Deployer className= "org.apache.catalina.ha.deploy.FarmWarDeployer "
tempDir= "/tmp/war-temp/ "
deployDir= "/tmp/war-deploy/ "
watchDir= "/tmp/war-listen/ "
watchEnabled= "false "/>
<ClusterListener className= "org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener "/>
<ClusterListener className= "org.apache.catalina.ha.session.ClusterSessionListener "/>
</Cluster>
<Realm className= "org.apache.catalina.realm.UserDatabaseRealm "
resourceName= "UserDatabase "/>
<Host name= "localhost " appBase= "webapps "
unpackWARs= "true " autoDeploy= "true "
xmlValidation= "false " xmlNamespaceAware= "false ">
</Host>
</Engine>
</Service>
</Server>
| |||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
---|---|---|---|---|---|---|---|---|---|
28 | 29 | 30 | 31 | 1 | 2 | 3 | |||
4 | 5 | 6 | 7 | 8 | 9 | 10 | |||
11 | 12 | 13 | 14 | 15 | 16 | 17 | |||
18 | 19 | 20 | 21 | 22 | 23 | 24 | |||
25 | 26 | 27 | 28 | 29 | 30 | 1 | |||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
常用鏈接
留言簿(1)
隨筆檔案
搜索
最新評論

- 1.?re: tomcat訪問網絡映射驅動器被windows2003限制
- 搜一下”通過jcifs實現java訪問網絡共享文件“,用smb協議的java實現類包訪問沒有問題的。
- --阿湘哥哥
- 2.?re: 往網絡映射磁盤寫文件遇見的怪事
-
@么
windows2003的安全機制不允許程序往映射網絡磁盤里寫文件。
你直接使用網絡路徑寫就可以了 - --dd.zhang
- 3.?re: 往網絡映射磁盤寫文件遇見的怪事
- 大哥你們怎么解決的 我也遇到了 沒有思路啊
- --么
- 4.?re: tomcat訪問網絡映射驅動器被windows2003限制
- 評論內容較長,點擊標題查看
- --dd.zhang
- 5.?re: tomcat訪問網絡映射驅動器被windows2003限制
- 評論內容較長,點擊標題查看
- --dd.zhang