gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 02:28:08 44 4
gpt4 key购买 nike

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

我已经把 mysql jar: mysql-connector-java-5.1.24-bin.jar 放在 lib/ext 中

我编辑了 start.ini 并将 OPTIONS 更改为: OPTIONS=Server,websocket,resources,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/

44 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com