eclipse内嵌jetty(run-jetty-run插件) 配置jndi数据源
运行环境 java 6,eclipse juno,ssh(spring,hibernate,springmvc )
1、离线安装
下载地址:http://pan.baidu.com/s/1qX67wOc,下载后,解压,把features和plugins拷贝到eclipse安装目录的plugins下,重启eclipse。
2、在线安装(我用的这种)
help--> install new software... -->
地址:http://run-jetty-run.googlecode.com/svn/trunk/updatesite
(我的ping不到,我用的是这个地址 http://eclipse-jetty.github.io/update/ )
安装完成,重启eclipse。
开始配置.
进入Run---> Debug Configurations... --->
新建一个Jetty Webapp (如下图)

然后在Options页签勾选Enable JNDI Support。

最后在WEB-INF 目录下新建jetty-env.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<!-- 应用数据源 -->
<New id="test" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>jdbc/test-local</Arg> <!--这个要和数据源里面的对应-->
<Arg>
<New class="org.apache.commons.dbcp.BasicDataSource">
<Set name="driverClassName">oracle.jdbc.driver.OracleDriver</Set>
<Set name="url">jdbc:oracle:thin:@ ip:1521:orcl</Set>
<Set name="username">username</Set>
<Set name="password">password</Set>
<Set name="maxActive">500</Set>
<Set name="maxIdle">30</Set>
<Set name="maxWait">10000</Set>
</New>
</Arg>
</New>
</Configure>
数据源我是这么配置的
<bean id="dataSourceLocal" name="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/test-local"/>
<property name="resourceRef" value="true" />
</bean>
最后以jetty 运行。

启动成功!

eclipse内嵌jetty(run-jetty-run插件) 配置jndi数据源的更多相关文章
- Eclipse内嵌的webservice客户端
概述 Eclipse内嵌的webservice客户端,可用于发起请求,查看结果,展示请求和响应的报文. 详情 在Java EE视图,可以看到内嵌的webservice客户端浏览器登陆按钮 点击打开浏览 ...
- 012.Delphi插件之QPlugins,多实例内嵌窗口服务
这个DEMO中主要是在DLL中建立了一个IDockableControl类,并在DLL的子类中写了具体的实现方法. 在主程序exe中,找到这个服务,然后调用DLL的内嵌方法,把DLL插件窗口内嵌到主程 ...
- Spring Boot 揭秘与实战(五) 服务器篇 - 其他内嵌服务器 发表于 2017-01-03 | Spring框架 | Spri
文章目录 1. Jetty 的切换 2. Undertow的使用 Spring Boot 可选择内嵌 Tomcat.Jetty 和 Undertow,因此我们不需要以 war 包形式部署项目.< ...
- 【Spring Boot】内嵌容器
Spring Boot内嵌容器支持Tomcat.Jetty.Undertow. tomcat容器 spring boot 的web应用开发必须使用spring-boot-starter-web,其默认 ...
- (转)利用eclipse external tool 执行mvn jetty:run
一.如果这个工程是标准的maven-webapp那么基本上不用修改,直接运行jetty:run就可以执行. 但是有时候会报错说 [ERROR] No plugin found for prefix ' ...
- 使用jetty作为内嵌服务器启动项目
http://blog.csdn.net/robinpipi/article/details/7557035 需求:把jetty作为内嵌的一个服务器,直接启动,web项目不用部署在应用服务器中.在网上 ...
- Message高级特性 & 内嵌Jetty实现文件服务器
1. Messaage Properties 常见属性 更多的属性以及介绍参考:http://activemq.apache.org/activemq-message-properties.html ...
- IDEA内嵌Jetty启动SpringMvc项目
这段时间本意是想要研究一下Netty的多线程异步NIO通讯框架,看完原理想要做下源码分析.查找资料发现Jetty框架底层支持用Netty做web请求的多线程分发处理,于是就筹备着将Jetty框架内嵌到 ...
- Spring Boot 内嵌容器 Tomcat / Undertow / Jetty 优雅停机实现
Spring Boot 内嵌容器 Tomcat / Undertow / Jetty 优雅停机实现 Anoyi 精讲JAVA 精讲JAVA 微信号 toooooooozi 功能介绍 讲解java深层次 ...
随机推荐
- Adb工具配置和设备连接
ADB全程Android Debug Bridge,是Android SDK里的一个工具,用这个工具可以直接操作管理Android模拟器或者真实的Android设备(如手机). 一.Adb工具使用配置 ...
- VS2010遇到fatal error C1083: 无法打开预编译头文件:“xxx.pch”: No such file or directory
对C++和VS2010非常不熟悉,但是无奈赶着项目,只能看了点基础就上手,然后就碰到这个问题了. 原因分析: http://bbs.csdn.net/topics/340191697?page=1 编 ...
- DBA-mysql-字符集
查看支持的字符集:show charset; 查看现使用字符集:status; 1.在[mysqld]下添加 default-character-set=utf8 (mysql 5.1版本) char ...
- wget: unable to resolve host address 解决办法
vim /etc/resolv.conf 加上下面两句: nameserver 8.8.8.8 #google域名服务器nameserver 8.8.4.4 #google域名服务器
- 调试新技能get - powershell
1. win+r -> powershell_ise 2. debug-process 3. type processname....WITHOUT ".exe"
- php.ini修改php上传文件大小限制的方法详解
打开php.ini,首先找到file_uploads = on ;是否允许通过HTTP上传文件的开关.默认为ON即是开upload_tmp_dir ;文件上传至服务器上存储临时文件的地方,如果没指定就 ...
- ASP.NET: 正在中止线程 错误原及解决方法
#[操作记录]:2010-02-23 9:25:12 System.Threading.ThreadAbortException: 正在中止线程. 症状 如果使用 Response.End.Resp ...
- git如何设置账号密码
查看已设配置 git config --list 修改GIT全局用户名 git config --global user.name [username] 修改GIT全局邮箱 git config -- ...
- Install CodeBlocks in CentOS 7
- For now, CodeBlocks doesn't privide binary packages for CentOS7.(http://www.codeblocks.org/downloa ...
- PHPCMS v9 超级安全防范教程!
一.目录权限设置很重要:可以有效防范黑客上传木马文件.如果通过 chmod 644 * -R 的话,php文件就没有权限访问了.如果通过chmod 755 * -R 的话,php文件的权限就高了. 所 ...