搞了一晚上。首先,导入工程。当然 源代码在这 http://www.igniterealtime.org/downloads/download-landing.jsp?file=openfire/openfire_src_3_7_1.zip
将jar包导入。这里可能会缺少
http://download.csdn.net/download/kingsonl/4419275 这里有jar包下载
然后 用ant 来build
然后配置运行参数
继续
然后 要点advanced options
这里选择语言文件
然后运行
纳尼
HTTP ERROR 500
Problem accessing /setup/index.jsp. Reason:
Server Error
Caused by:
java.lang.NullPointerException at org.jivesoftware.admin.AdminConsole.getAppName(AdminConsole.java:137) at org.jivesoftware.openfire.admin.decorators.setup_jsp._jspService(setup_jsp.java:177) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:427) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:494) at org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:182) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:933) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.Dispatcher.include(Dispatcher.java:189) at com.opensymphony.module.sitemesh.filter.PageFilter.applyDecorator(PageFilter.java:156) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:59) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187) at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:74) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187) at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:50) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187) at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:78) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187) at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:164) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:425) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:494) at org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:182) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:933) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) at org.eclipse.jetty.server.Server.handle(Server.java:334) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559) at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:992) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:541) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:203) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) at java.lang.Thread.run(Thread.java:619)
把 admin-sidebar.xml和openfire_i18n_en.properties放到bin目录下
运行 ok 大功告成!
默认的 内存是 64Mb 想要改大内存,在运行参数的 VM arguments中加上
-Xms512m
-Xmx512m
如果是JDK1.7 直接运行ant脚本会报错
这里需要把ant脚本修改一下
<condition property="java.not.ok" value="true">
<not>
<or>
<contains string="${ant.java.version}" substring="1.5"/>
<contains string="${ant.java.version}" substring="1.6"/>
<contains string="${ant.java.version}" substring="1.7"/>
</or>
</not>
</condition>
<contains string="${ant.java.version}" substring="1.7"/>这里加上1.7版本
<javac
destdir="${anttools.target.dir}/classes"
includeAntRuntime="no"
debug="on"
source="1.7"
executable="D:\JDK7.0\bin\javac" compiler="1.7" target="1.7"
>
在 javac节点 加上 source="1.7"
executable="D:\JDK7.0\bin\javac" compiler="1.7" target="1.7"