我正在尝试在Jetty中为我的一个应用程序配置一个JNDI条目。
我把mysql jar:mysql-connector-java-5.1.24-bin.jar放在lib / ext中
我已经编辑了start.ini并将OPTIONS更改为: OPTIONS =服务器,网页套接字,资源,电话分机,加
我还取消了这些行:
OPTIONS=jndi
OPTIONS=plus
etc/jetty-plus.xml
当我跑步时:服务码头开始我得到:
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>
还有其他想法吗?
答案 0 :(得分:2)
原来我正在修改另一台服务器上的startup.ini