Java Tomcat JNDI错误

Java Tomcat JNDI错误,java,tomcat,jndi,Java,Tomcat,Jndi,我得到这个错误 Jun 23, 2009 4:49:10 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 5265 ms 0 [http-8080-Processor25] ERROR Could not load security-xss-regex.txt file. [at app.sparx.navigate.AppNavigationControllerServlet.init(

我得到这个错误

Jun 23, 2009 4:49:10 PM org.apache.catalina.startup.Catalina start INFO: Server 
   startup in 5265 ms 
0 [http-8080-Processor25] ERROR Could not load security-xss-regex.txt file. [at
   app.sparx.navigate.AppNavigationControllerServlet.init(AppNavigationControllerServlet.java:45)] 
   Unable to register any web resource locators (/resources/sparx, /sparx were not found). 
   Please use the SparxResourcesServlet for serving Sparx resources. 
2328 [http-8080-Processor25] ERROR Name jdbc is not bound in this Context [at 
   net.sf.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:58)] 
2328 [http-8080-Processor25] ERROR net.sf.hibernate.exception.GenericJDBCException: Cannot
   open connection [at app.security.AppLoginAuthenticator.isUserValid(AppLoginAuthenticator.java:89)]
   and this is what I have in my server.xml file    
Resource name="sparx" 
   auth="Container" type="javax.sql.DataSource" 
   driverClassName="com.ibm.db2.jcc.DB2Driver" 
   url="jdbc:db2://192.168.0.131:50000/MAX" 
   username="db2admin" password="!!!!!!!!!" 
有人知道资源的确切名称吗

谢谢

也许能帮到你。JNDI名称应该是“jdbc/sparx”

看起来您无法打开连接,因为找不到文件security-xss-regex.txt

这些东西不属于server.xml。(无论如何,您不能总是依赖于能够编辑该文件。)正确的位置是META-INF/context.xml

您是否也在web.xml中声明了资源?你知道,你一定有

JDBC驱动程序JAR必须位于Tomcat 5.x的公共/lib或Tomcat 6.x的/lib中

您使用的是Hibernate的一个非常旧的版本——以“net.sf.Hibernate”开头的包名很古老。是时候升级了


如果您仍然有问题,我会尝试交换另一个数据库来代替DB2,以使连接正常工作。MySQL,高超音速-IBM产品以外的任何产品。如果你能做到这一点,你就会知道DB2特有的东西是问题所在。

谢谢你的数据库密码。砍掉…:pThanks…这个项目是我的传下来的…我必须首先启动并运行,然后修改。。