- HTML code
javax.naming.NameNotFoundException: ÃûÇ° jdbc ¤Ï¤³¤Î¥³¥ó¥Æ¥¥¹¥È¤Ë¥Ð¥¤¥ó¥É¤µ¤ì¤Æ¤¤¤Þ¤»¤ó at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:140) at org.apache.naming.NamingContext.lookup(NamingContext.java:781) at org.apache.naming.NamingContext.lookup(NamingContext.java:140) at org.apache.naming.NamingContext.lookup(NamingContext.java:781) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152) at javax.naming.InitialContext.lookup(Unknown Source) at com.sys.util.Struts.<init>(Struts.java:14) at com.sys.model.Product.<init>(Product.java:12) at com.sys.action.SaveProductAction.execute(SaveProductAction.java:17) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675) at java.lang.Thread.run(Unknown Source)
¶ÔÓ¦µÄ´íÎó´¦ÈçÏ£º
- Java code
public class Struts { protected Context ctx = new InitialContext(); protected DataSource ds; protected Connection conn; public Struts() throws Exception { ds = (DataSource)ctx.lookup("java:/comp/env/jdbc/struts"); conn = ds.getConnection(); }}
------½â¾ö·½°¸--------------------
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
Caused by: java.sql.SQLException: No suitable driver
1¡¢Á¬½ÓÓõÄjar´æÔÚ £¿
2¡¢Á¬½ÓµÄURLÕý³£ £¿
------½â¾ö·½°¸--------------------
ÄãµÄµÚÒ»¸öÎÊÌâÊÇʲôÇé¿ö¿ÉÒÔ˵˵²»£¿