Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Jetty、JNDI、Postgresql:未找到类_Java_Postgresql_Jetty_Jndi_Postgresql 9.1 - Fatal编程技术网

Java Jetty、JNDI、Postgresql:未找到类

Java Jetty、JNDI、Postgresql:未找到类,java,postgresql,jetty,jndi,postgresql-9.1,Java,Postgresql,Jetty,Jndi,Postgresql 9.1,我正试图在Jetty中设置一个JNDI数据源。在start.ini文件中,我添加了jetty-plus.xml文件,选项如下所示: OPTIONS=Server,resources,websocket,ext,plus,annotations 然后将资源添加到上下文文件中: <New id="Traildevils" class="org.eclipse.jetty.plus.jndi.Resource"> <Arg/> <Arg>jdbc/

我正试图在Jetty中设置一个JNDI数据源。在start.ini文件中,我添加了jetty-plus.xml文件,选项如下所示:

OPTIONS=Server,resources,websocket,ext,plus,annotations
然后将资源添加到上下文文件中:

<New id="Traildevils" class="org.eclipse.jetty.plus.jndi.Resource">
    <Arg/>
    <Arg>jdbc/Traildevils</Arg>
    <Arg>
        <New class="org.postgresql.ds.PGConnectionPoolDataSource">
            <Set name="User">recom</Set>
            <Set name="Password">recom</Set>
            <Set name="DatabaseName">Traildevils</Set>
            <Set name="ServerName">localhost</Set>
            <Set name="PortNumber">5432</Set>
        </New>
    </Arg>
</New>

jdbc/Traildevils
推荐
推荐
特雷尔德维尔
本地服务器
5432
postgresql-9.1-901.jdbc4.jar文件位于我的war文件的WEB-INF/lib中

当我现在尝试启动jetty时,出现以下错误:

2012-04-12 12:58:09.723:WARN:oejx.XmlConfiguration:Config error at 
<New id="Traildevils" class="org.eclipse.jetty.plus.jndi.Resource"><Arg/>
<Arg>jdbc/Traildevils</Arg>
<Arg>|???<New class="org.postgresql.ds.PGConnectionPoolDataSource">
<Set name="User">recom</Set>
<Set name="Password">recom</Set>
<Set name="DatabaseName">Traildevils</Set>
<Set name="ServerName">localhost</Set><Set name="PortNumber">5432</Set></New>|??</Arg></New> 
java.lang.ClassNotFoundException: org.postgresql.ds.PGConnectionPoolDataSource
2012-04-12 12:58:09.723:警告:oejx.XmlConfiguration:Config错误位于
jdbc/Traildevils
|???
推荐
推荐
特雷尔德维尔
localhost5432 |??
java.lang.ClassNotFoundException:org.postgresql.ds.PGConnectionPoolDataSource

我错过了什么?

您需要将postgresql-9.1-901.jdbc4.jar添加到
$JETTY\u HOME/lib/ext

这是因为jetty在从WAR加载类之前初始化JNDI上下文