我正在尝试在 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/