使用Jetty启动服务报错

Shine_Panda 2011-05-11 08:47:10
[2011-05-11 08:41:13] runqianReportLogger : [ERROR] - Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.runqian.report4.dataset.JNDIConnectionFactory.<init>(Unknown Source:13)
at com.runqian.report4.view.ReportServlet._$1(Unknown Source:390)



ublic static void main(String[] args) throws Exception {

Server server = new Server();
Connector connector = new SelectChannelConnector();
connector.setPort(80); // 设置要监听的端口.
server.addConnector(connector);
WebAppContext context = new WebAppContext();
context.setContextPath("/test"); // 设置上下文路径
// 设置web应用根路径
context.setResourceBase("D:/java/workspace/test/WebContent");
HandlerCollection handlerCollection = new HandlerCollection();
handlerCollection.addHandler(context);
server.setHandler(handlerCollection);
server.start();

}

...全文
304 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
艾莎云 2011-05-17
  • 打赏
  • 举报
回复
CHANGE TO APAPHE OR TOMCAT,TRY IT ~!
望舒 2011-05-17
  • 打赏
  • 举报
回复
不懂帮顶
Shine_Panda 2011-05-16
  • 打赏
  • 举报
回复
求救啊!
哈哈哈3234 2011-05-13
  • 打赏
  • 举报
回复
lz 加油,不懂
Shine_Panda 2011-05-13
  • 打赏
  • 举报
回复
这问题还没解决啊。这分该怎么送呢?
xxy8100 2011-05-11
  • 打赏
  • 举报
回复
那不是润乾报表报的错吗
风中之心 2011-05-11
  • 打赏
  • 举报
回复
什么情况啊?
Shine_Panda 2011-05-11
  • 打赏
  • 举报
回复
有懂的兄弟没。

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧