Topic: 哪位在Jetty下配过JNDI数据源啊?帮帮忙吧

  Print this page

1.哪位在Jetty下配过JNDI数据源啊?帮帮忙吧 Copy to clipboard
Posted by: windshome
Posted on: 2009-03-12 22:34

我在一个jetty的web程序中配置数据源,在jetty.xml中配置之后,直接jetty启动失败,报:
2009-03-12 22:22:15.794:BlushNFO: Logging to STDERR via org.mortbay.log.StdErrLog
2009-03-12 22:22:15.997::WARN: Config error at <Call name="addDataSource"><Arg>
jdbc/DSTest</Arg><Arg>
<New class="oracle.jdbc.pool.OracleConnectionPoolDataSource"><Set name="URL
">jdbc:oracle:thinAngry127.0.0.1:1521:orcl</Set><Set name="User">ca23</Set><Set nam
e="Password">ca23</Set></New>
</Arg></Call>
2009-03-12 22:22:15.997::WARN: EXCEPTION
java.lang.IllegalStateException: No Method: <Call name="addDataSource"><Arg>jdbc
/DSTest</Arg><Arg>
<New class="oracle.jdbc.pool.OracleConnectionPoolDataSource"><Set name="URL
">jdbc:oracle:thinAngry127.0.0.1:1521:orcl</Set><Set name="User">ca23</Set><Set nam
e="Password">ca23</Set></New>
</Arg></Call> on class org.mortbay.jetty.Server
at org.mortbay.xml.XmlConfiguration.call(XmlConfiguration.java:553)
at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:244)

at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:206)

at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:966)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mortbay.start.Main.invokeMain(Main.java:194)
at org.mortbay.start.Main.start(Main.java:512)
at org.mortbay.start.Main.main(Main.java:119)

后来改在web-info下的jetty-env.xml中配置,启动没问题了,但是在JSP中lookup该数据源时,报:

Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

配置为:
<New id="DSTest" class="org.mortbay.jetty.plus.naming.Resource">
  <Arg>jdbc/DSTest</Arg>
<Arg>
<New class="oracle.jdbc.pool.OracleConnectionPoolDataSource">
<Set name="URL">jdbc:oracle:thinAngry127.0.0.1:1521:orcl</Set>
<Set name="User">ca23</Set>
<Set name="Password">ca23</Set>

</New>
</Arg>
</New>

哪位配过的帮我看看?谢谢!
jetty版本是6.11


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923