myeclipse+tomcat+red5开发环境搭建

最近在网上也看了不少关于这方面的资料,可没一篇讲的完整,在此本人献丑写下此文章(此文章适合有一定JAVA开发经验者)

 

不管是什么新技术,最重要的第一步是 如何搭建开发环境 ,好了废话不多说 ready go!!!

 

开发环境

myeclipse7.0

jdk1.6

tomcat6

red5 0.8以及源码(源码搭建请参照我另一篇文章red5源码用eclipse构建)

 

我用的是RED5 0.8版本

1.http://code.google.com/p/red5/downloads/list下载相应的Red5War包,这该包里只有一个ROOT.war

下载完后,你可以先把它解压到TOMCAT6中,把原来的ROOT覆盖掉,启动TOMCAT,没报错说明成功

2.打开MYECLIPSE,新建WEB工程(与我们以往操作一样)取名为yxVideo现在一切OK

把刚才下载的ROOT\WEB-INF\lib中的所有jar包都拷到yxVideo\WebRoot\WEB-INF\lib\中

3.把ROOT\WEB-INF\classes中所有的配制文件拷到yxVideo\src中

并只保留

里面的yxVideo-web.xml与red5-web.properties是我自已加的,因为我们这个项目中要用到它,内容大致如下

yxVideo-web.xml:

 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:lang="http://www.springframework.org/schema/lang"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                           http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd">

  <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
     <property name="location" value="/WEB-INF/classes/red5-web.properties" />
 </bean>
 <!-- oflaDemo web context -->
 <bean id="web.context.yxVideo" class="org.red5.server.Context">
  <property name="scopeResolver" ref="red5.scopeResolver" />
  <property name="clientRegistry" ref="global.clientRegistry" />
  <property name="serviceInvoker" ref="global.serviceInvoker" />
  <property name="mappingStrategy" ref="global.mappingStrategy" />
 </bean>

 <bean id="web.scope.yxVideo" class="org.red5.server.WebScope" init-method="register">
  <property name="server" ref="red5.server" />
  <property name="parent" ref="global.scope" />
  <property name="context" ref="web.context.yxVideo" />
  <property name="handler" ref="web.handler.yxVideo" />
  <property name="contextPath" value="${webapp.contextPath}" />
  <property name="virtualHosts" value="${webapp.virtualHosts}" />
 </bean>

 

   <bean id="web.handler.yxVideo"
     class="com.pzm.Application"
  />

</beans>
red5-web.properties:

webapp.contextPath=/yxVideo
webapp.virtualHosts=localhost, 127.0.0.1,*

这个是我写的一个测试red5应用程序,你可以改成自已的程序

<bean id="web.handler.yxVideo"
     class="com.pzm.Application"
  />

 

现在就要加RED5相关的包,有几种方案可以加

 1.直接把root下面classes打包成JAR包并加入到yxVideo的lib包里

 2.根据red5 0.8所build的之后的jar包,共两个boot.jar,red5.jar

 3.直接到官网下一个RED50.8 exe版,安装完后把boot.jar与red5.jar拷贝到项目LIB中

 

如果都把所有相关JAR加入进去,此时eclipse就不会再报错,大致结构如下

如果以上有些文件没加入到项目中,那么请按照此图把ROOT中所有与该图有关的文件都拷入到你的项目中.

在web.xml还要改点webAppRootKey,这个其实不怎么重要,改不改无所谓了

 

以上都准备好后,如果你已经把Red5War中root.war放入到tomcat,那么请你现在把它删除,不然会有冲突

最好还是把以前的ROOT目录还原到tomcat里

 

接着在myeclipse配制TOMCAT,发布项目,启动TOMCAT,没报错说明就成功了

 

大致流程如上,如有什么不清楚的可以留言,大家一起讨论

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值