mysql - Jetty 9 JNDI 设置 - 未找到类 : org. eclipse.jetty.plus.jndi.Resource

标签 mysql jetty jndi

我正在尝试在 Jetty 中为我的一个应用程序配置 JNDI 条目。

我已将 mysql jar:mysql-connector-java-5.1.24-bin.jar 放入 lib/ext

我已编辑 start.ini 并将 OPTIONS 更改为: 选项=服务器、websocket、资源、ext、plus

我还取消了这些行的注释:

OPTIONS=jndi
OPTIONS=plus
etc/jetty-plus.xml

当我运行:service jetty start 我得到:

java.lang.ClassNotFoundException: org.eclipse.jetty.plus.jndi.Resource in file:/usr/share/jetty-distribution-9.0.4.v20130625/etc/jetty.xml

我检查了 plus jar 位于/usr/share/jetty/lib

jar tf jetty-plus-9.0.4.v20130625.jar |grep jndi/Resource.class

给出:

org/eclipse/jetty/plus/jndi/Resource.class

所以类就在那里。

JNDI 条目本身在 etc/jetty.xml 中定义:

...
<New id="fhxprime_test" class="org.eclipse.jetty.plus.jndi.Resource">
  <Arg><Ref refid="Server"/></Arg>
  <Arg>jdbc/fhxprime_test</Arg>
  <Arg>
    <New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
        <Set name="Url">jdbc:mysql://hostname:3306/dbname</Set>
        <Set name="User">user</Set>
        <Set name="Password">password</Set>
    </New>
  </Arg>
</New>
</Configure>

还有其他想法吗?

最佳答案

原来我正在修改另一台服务器上的startup.ini

关于mysql - Jetty 9 JNDI 设置 - 未找到类 : org. eclipse.jetty.plus.jndi.Resource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17824120/

相关文章:

mysql - JBoss Wildfly 10 MYSQL 驱动程序安装问题

mysql - 在新列中引入计算值

spring - 使用 Spring Boot 为 X-FORWARDED-PROTO 配置嵌入式 Jetty 9

具有 jetty 内存泄漏问题的java服务器

spring - 共享的 C3P0 JNDI 数据源在 Jetty 的 servlet 取消部署期间关闭,其他 servlet 不再可以访问

mysql - 优化大表上的日期范围搜索

sql - 什么是 MySQL 索引表?

java - EJB 依赖于另一个 EJB?

java - jetty 9 : How to organise handlers & setWelcomeFiles

java - JPA 是否要求数据源来自 JNDI?