0

我收到这个错误

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="!!!!!!!!!" 

任何人都知道资源的确切名称应该是什么

谢谢

4

1 回答 1

0

此链接可能会对您有所帮助。JNDI 名称应该是“jdbc/sparx”。

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

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

您是否也在 web.xml 中声明了资源?你必须有那个,你知道的。

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

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

如果您仍然有问题,我会尝试换入另一个数据库来代替 DB2,只是为了让连接正常工作。MySQL、Hypersonic——除了 IBM 产品之外的任何东西。如果您让它发挥作用,您就会知道 DB2 特定的事情是问题所在。

于 2009-06-24T00:30:26.943 回答