前天在tomcat中部署了2个项目,Eric_Manager和Eric_Regedit,在Eric_Manager启动过程中有关于访问Eric_Regedit的一段代码
public boolean registerRoomUser(String roomId,Set userlist){
this.myUrl = this.myUrl + "/RegeditUserAction!regeditRoomAndUser.do";
URL url;
String usernames = null;
if(userlist == null || userlist.size() == 0){
usernames = "userNames="+"";
}else{
usernames = this.mapConvertStirng(userlist);
}
BufferedReader read = null;
PrintWriter out = null;
boolean checkResult = false;
try {
url = new URL(this.myUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
out = new PrintWriter(connection.getOutputStream());
out.print(usernames + "&");
out.print("roomId="+roomId);
out.flush();
read = new BufferedReader(new InputStreamReader(connection.getInputStream()) );
String input = null;
if((input = read.readLine()) != null)
{
if(input.equals("false")){
checkResult = false;
}else if(input.equals("true")){
checkResult = true;
}
}
} catch (MalformedURLException e) {
Log4jUtil.info("连接注册服务器发生MalformedURLException异常---------1");
} catch (IOException e) {
Log4jUtil.info("连接注册服务器发生IOException异常---------2");
}finally{
out.close();
try {
read.close();
} catch (IOException e) {
Log4jUtil.info("关闭流时发生IOException");
}
}
return checkResult;
}
此时Tomcat还未加载Eric_Regedit的项目,那么程序段就会堵塞在:
read = new BufferedReader(new InputStreamReader(connection.getInputStream()) );
那么这样就会造成项目无法正常启动。
分享到:
相关推荐
tomcat启动项目部署步骤 。
在Tomcat启动时会去webapps下访问默认ROOT目录下的应用程序,这就导致你始终不能直接访问的原因 切记切记切记,这才是关键 先将它原始就有的ROOT删掉 把 自己的项目包“oa.war” 改成 “ROOT.war” 即可,因为下面的...
Tomcat启动时,通过监听器来实现,当tomcat启动时自动地访问本地地servlet。也可以实现访问本地jsp
windows及linux环境下,tomcat启动参数的设置。在Tomcat上运行j2ee项目代码时,经常会出现内存溢出的情况,解决办法是在系统参数中增加系统参数...
项目名称和部署到Tomcat的项目名不一致,访问不到报错。以前遇到过这个问题,就放到一边了。今天再次遇到了。就好好解决下了。
tomcat启动管理工具
tomcat配置默认访问项目,配置后可直接通过ip地址加端口号访问项目
内嵌式tomcat启动web工程,maven代码 内嵌式tomcat启动web工程,maven代码
Tomcat启动分析以及如何启动 关于tomcat的配置及其代码
tomcat启动时立即调用quartz执行一次
tomcat启动脚本tomcat启动脚本tomcat启动脚本tomcat启动脚本tomcat启动脚本tomcat启动脚本tomcat启动脚本tomcat启动脚本tomcat启动脚本tomcat启动脚本tomcat启动脚本tomcat启动脚本tomcat启动脚本
tomcat 开机启动,dos窗口去掉,tomcat 开机启动,dos窗口去掉
tomcat启动不了问题处理 解决tomcat启动不了问题
( Eclipse中Tomcat启动失败的解决方案.txt
tomcat启动时执行java自定义方法,一般用于启动时赋值情况。
设置tomcat只允许域名访问 设置tomcat只允许域名访问
tomcat配置只能域名访问禁止ip访问 直接替换tomcat里面的server.xml 文件,但是里面的ip要更换你自己的ip
tomcat-juli.jar 用于在tomcat启动报错时除错
Tomcat设置默认启动项目,顾名思义,就是让可以在浏览器的地址栏中输入ip:8080,就能访问到我们的项目。
tomcat启动|退出执行事件类: import java.io.File; import java.io.FileWriter; import java.io.IOException; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import ...