- 浏览: 62202 次
- 来自: 北京
最新评论
-
caowei3047:
确实强悍。
不过jquery的那个仿igoogle组件似乎也不 ...
仿igoogle拖动框 -
zhangyuqing052:
没用的,还会过期!
何让Struts From提交后“后退”页面不过期 -
skorpi:
跟我现在一样,一点动力都没有,都想回家种地了,对技术也不是那么 ...
迷茫,2年工作经验的小兵的迷茫 -
jason.hsu:
..这样作不行..甚至还少一个.mymetadata文件..
怎么将java工程修改为myeclipse识别的web工程 -
dean_liu:
Seam Requirements 写道
Seam 2.x e ...
与我一起学seam(1)
下面是错误提示。下面还有我的TOMCAT配置文件。(是通过tomcat图形页面生成的)
请各位 。小弟(本人人品低连代码都欺负人)。谢谢。
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Exception in JSP: /jndiTest.jsp:10
7: <%
8:
9: Context initCtx = new InitialContext();
10: DataSource ds = (DataSource)initCtx.lookup("java:comp/env/dbc/Test");
11:
12: Connection conn = ds.getConnection();
13: conn.close();
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.ServletException: Name dbc is not bound in this Context
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.jndiTest_jsp._jspService(jndiTest_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.naming.NameNotFoundException: Name dbc is not bound in this Context
org.apache.naming.NamingContext.lookup(NamingContext.java:769)
org.apache.naming.NamingContext.lookup(NamingContext.java:139)
org.apache.naming.NamingContext.lookup(NamingContext.java:780)
org.apache.naming.NamingContext.lookup(NamingContext.java:139)
org.apache.naming.NamingContext.lookup(NamingContext.java:780)
org.apache.naming.NamingContext.lookup(NamingContext.java:152)
org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
javax.naming.InitialContext.lookup(InitialContext.java:351)
org.apache.jsp.jndiTest_jsp._jspService(jndiTest_jsp.java:55)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
tomcat配置文件
---------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Server>
<Listener className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
<Resource
auth="Container"
description="User database that can be updated and saved"
name="UserDatabase"
type="org.apache.catalina.UserDatabase"
pathname="conf/tomcat-users.xml"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"/>
<Resource
name="jdbc/Test"
type="javax.sql.DataSource"
password="tiger"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="scott"
url="jdbc:oracle:thin:@10.164.11.226:1521:dbserver"
maxActive="4"/>
</GlobalNamingResources>
<Service
name="Catalina">
<Connector
port="8090"
redirectPort="8443"
minSpareThreads="25"
connectionTimeout="20000"
maxSpareThreads="75"
maxThreads="150">
</Connector>
<Connector
port="8009"
redirectPort="8443"
protocol="AJP/1.3">
</Connector>
<Engine
defaultHost="localhost"
name="Catalina">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
<Host
appBase="webapps"
name="localhost">
</Host>
</Engine>
</Service>
</Server>
加上再執行 grant conn, resource on username;
同樣不好使
弄了一下午 快抓狂了
请各位 。小弟(本人人品低连代码都欺负人)。谢谢。
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Exception in JSP: /jndiTest.jsp:10
7: <%
8:
9: Context initCtx = new InitialContext();
10: DataSource ds = (DataSource)initCtx.lookup("java:comp/env/dbc/Test");
11:
12: Connection conn = ds.getConnection();
13: conn.close();
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.ServletException: Name dbc is not bound in this Context
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.jndiTest_jsp._jspService(jndiTest_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.naming.NameNotFoundException: Name dbc is not bound in this Context
org.apache.naming.NamingContext.lookup(NamingContext.java:769)
org.apache.naming.NamingContext.lookup(NamingContext.java:139)
org.apache.naming.NamingContext.lookup(NamingContext.java:780)
org.apache.naming.NamingContext.lookup(NamingContext.java:139)
org.apache.naming.NamingContext.lookup(NamingContext.java:780)
org.apache.naming.NamingContext.lookup(NamingContext.java:152)
org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
javax.naming.InitialContext.lookup(InitialContext.java:351)
org.apache.jsp.jndiTest_jsp._jspService(jndiTest_jsp.java:55)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
tomcat配置文件
---------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Server>
<Listener className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
<Resource
auth="Container"
description="User database that can be updated and saved"
name="UserDatabase"
type="org.apache.catalina.UserDatabase"
pathname="conf/tomcat-users.xml"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"/>
<Resource
name="jdbc/Test"
type="javax.sql.DataSource"
password="tiger"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="scott"
url="jdbc:oracle:thin:@10.164.11.226:1521:dbserver"
maxActive="4"/>
</GlobalNamingResources>
<Service
name="Catalina">
<Connector
port="8090"
redirectPort="8443"
minSpareThreads="25"
connectionTimeout="20000"
maxSpareThreads="75"
maxThreads="150">
</Connector>
<Connector
port="8009"
redirectPort="8443"
protocol="AJP/1.3">
</Connector>
<Engine
defaultHost="localhost"
name="Catalina">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
<Host
appBase="webapps"
name="localhost">
</Host>
</Engine>
</Service>
</Server>
评论
10 楼
tornyz
2007-07-10
ddandyy 写道
ORA-28000: the account is locked
unlock:alter user 用户名 account unlock;
不好使
unlock:alter user 用户名 account unlock;
加上再執行 grant conn, resource on username;
同樣不好使
弄了一下午 快抓狂了
9 楼
ddandyy
2006-12-25
ORA-28000: the account is locked
unlock:alter user 用户名 account unlock;
unlock:alter user 用户名 account unlock;
8 楼
likenice
2006-12-25
不行呀。我关掉其他了所有的程序。删除了jdbc/Test。测试还是不行。同样的错误。去google也没什么收获。我用的是公司的测试数据库,回去自己在装个ORACLE吧。 谢谢 "抛出异常的爱" 的细心指点。
7 楼
抛出异常的爱
2006-12-25
Cannot create PoolableConnectionFactory (ORA-28000: the account is locked)
先只留一个数据源。。。。。
其它的数据源先用注释注了。。。 <!-- -->
看着像是连接被锁了。。。
用用google看看有什么启示。。。
http://www.easyjf.com/html/bbs/20060419/23993816-1316542.htm
http://peter-kong.iteye.com/blog/39307
先只留一个数据源。。。。。
其它的数据源先用注释注了。。。 <!-- -->
看着像是连接被锁了。。。
用用google看看有什么启示。。。
http://www.easyjf.com/html/bbs/20060419/23993816-1316542.htm
http://peter-kong.iteye.com/blog/39307
6 楼
ddandyy
2006-12-25
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-28000: the account is locked
)
)
5 楼
likenice
2006-12-25
本人在次道歉。
由于仓促。没有检查。
下面是真正的错误提示。请高手们指点。不会在有错了。
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Exception in JSP: /jndiTest.jsp:12
9: Context initCtx = new InitialContext();
10: DataSource ds = (DataSource)initCtx.lookup("java:comp/env/jdbc/Oracle");
11:
12: Connection conn = ds.getConnection();
13: conn.close();
14:
15: System.out.println("123");
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.ServletException: Cannot create PoolableConnectionFactory (ORA-28000: the account is locked
)
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.jndiTest_jsp._jspService(jndiTest_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-28000: the account is locked
)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
org.apache.jsp.jndiTest_jsp._jspService(jndiTest_jsp.java:57)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.17
tomcat配置文件
---------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Server>
<Listener className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
<Resource
auth="Container"
description="User database that can be updated and saved"
name="UserDatabase"
type="org.apache.catalina.UserDatabase"
pathname="conf/tomcat-users.xml"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"/>
<Resource
name="jdbc/Oracle"
type="javax.sql.DataSource"
password="tiger"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="scott"
url="jdbc:oracle:thin:@10.164.11.226:1521:dbserver"
maxActive="4"/>
<Resource
name="jdbc/Test"
type="javax.sql.DataSource"
password="tiger"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="scott"
url="jdbc:oracle:thin:@10.164.11.226:1521:dbserver"
maxActive="4"/>
</GlobalNamingResources>
<Service
name="Catalina">
<Connector
port="8090"
redirectPort="8443"
minSpareThreads="25"
connectionTimeout="20000"
maxSpareThreads="75"
maxThreads="150">
</Connector>
<Connector
port="8009"
redirectPort="8443"
protocol="AJP/1.3">
</Connector>
<Engine
defaultHost="localhost"
name="Catalina">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
<Host
appBase="webapps"
name="localhost">
</Host>
</Engine>
</Service>
</Server>
由于仓促。没有检查。
下面是真正的错误提示。请高手们指点。不会在有错了。
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Exception in JSP: /jndiTest.jsp:12
9: Context initCtx = new InitialContext();
10: DataSource ds = (DataSource)initCtx.lookup("java:comp/env/jdbc/Oracle");
11:
12: Connection conn = ds.getConnection();
13: conn.close();
14:
15: System.out.println("123");
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.ServletException: Cannot create PoolableConnectionFactory (ORA-28000: the account is locked
)
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.jndiTest_jsp._jspService(jndiTest_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-28000: the account is locked
)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
org.apache.jsp.jndiTest_jsp._jspService(jndiTest_jsp.java:57)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.17
tomcat配置文件
---------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Server>
<Listener className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
<Resource
auth="Container"
description="User database that can be updated and saved"
name="UserDatabase"
type="org.apache.catalina.UserDatabase"
pathname="conf/tomcat-users.xml"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"/>
<Resource
name="jdbc/Oracle"
type="javax.sql.DataSource"
password="tiger"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="scott"
url="jdbc:oracle:thin:@10.164.11.226:1521:dbserver"
maxActive="4"/>
<Resource
name="jdbc/Test"
type="javax.sql.DataSource"
password="tiger"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="scott"
url="jdbc:oracle:thin:@10.164.11.226:1521:dbserver"
maxActive="4"/>
</GlobalNamingResources>
<Service
name="Catalina">
<Connector
port="8090"
redirectPort="8443"
minSpareThreads="25"
connectionTimeout="20000"
maxSpareThreads="75"
maxThreads="150">
</Connector>
<Connector
port="8009"
redirectPort="8443"
protocol="AJP/1.3">
</Connector>
<Engine
defaultHost="localhost"
name="Catalina">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
<Host
appBase="webapps"
name="localhost">
</Host>
</Engine>
</Service>
</Server>
4 楼
ddandyy
2006-12-25
javax.naming.NameNotFoundException: Name dbc is not bound in this Context
3 楼
抛出异常的爱
2006-12-25
Name dbc is not bound in this Context
2 楼
likenice
2006-12-25
不好意思。我删错了。上面的本来有一个
<Resource
name="jdbc/Test"
type="javax.sql.DataSource"
password="tiger"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="scott"
url="jdbc:oracle:thin:@10.164.11.226:1521:dbserver"
maxActive="4"/>
我给误删了。应该不是这方面的问题。请在考虑下还可能是哪方面的问题。
<Resource
name="jdbc/Test"
type="javax.sql.DataSource"
password="tiger"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="scott"
url="jdbc:oracle:thin:@10.164.11.226:1521:dbserver"
maxActive="4"/>
我给误删了。应该不是这方面的问题。请在考虑下还可能是哪方面的问题。
1 楼
抛出异常的爱
2006-12-25
likenice 写道
下面是错误提示。下面还有我的TOMCAT配置文件。(是通过tomcat图形页面生成的)
请各位 。小弟(本人人品低连代码都欺负人)。谢谢。
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Exception in JSP: /jndiTest.jsp:10
7: <%
8:
9: Context initCtx = new InitialContext();
10: DataSource ds = (DataSource)initCtx.lookup("java:comp/env/dbc/Test");//你声明的叫这个名子"jdbc/Oracle"
11:
12: Connection conn = ds.getConnection();
13: conn.close();
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.ServletException: Name dbc is not bound in this Context
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.jndiTest_jsp._jspService(jndiTest_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.naming.NameNotFoundException: Name dbc is not bound in this Context
org.apache.naming.NamingContext.lookup(NamingContext.java:769)
org.apache.naming.NamingContext.lookup(NamingContext.java:139)
org.apache.naming.NamingContext.lookup(NamingContext.java:780)
org.apache.naming.NamingContext.lookup(NamingContext.java:139)
org.apache.naming.NamingContext.lookup(NamingContext.java:780)
org.apache.naming.NamingContext.lookup(NamingContext.java:152)
org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
javax.naming.InitialContext.lookup(InitialContext.java:351)
org.apache.jsp.jndiTest_jsp._jspService(jndiTest_jsp.java:55)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
tomcat配置文件
---------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Server>
<Listener className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
<Resource
auth="Container"
description="User database that can be updated and saved"
name="UserDatabase"
type="org.apache.catalina.UserDatabase"
pathname="conf/tomcat-users.xml"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"/>
<Resource
name="jdbc/Oracle"
type="javax.sql.DataSource"
password="tiger"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="scott"
url="jdbc:oracle:thin:@10.164.11.226:1521:dbserver"
maxActive="4"/>
</GlobalNamingResources>
<Service
name="Catalina">
<Connector
port="8090"
redirectPort="8443"
minSpareThreads="25"
connectionTimeout="20000"
maxSpareThreads="75"
maxThreads="150">
</Connector>
<Connector
port="8009"
redirectPort="8443"
protocol="AJP/1.3">
</Connector>
<Engine
defaultHost="localhost"
name="Catalina">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
<Host
appBase="webapps"
name="localhost">
</Host>
</Engine>
</Service>
</Server>
请各位 。小弟(本人人品低连代码都欺负人)。谢谢。
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Exception in JSP: /jndiTest.jsp:10
7: <%
8:
9: Context initCtx = new InitialContext();
10: DataSource ds = (DataSource)initCtx.lookup("java:comp/env/dbc/Test");//你声明的叫这个名子"jdbc/Oracle"
11:
12: Connection conn = ds.getConnection();
13: conn.close();
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.ServletException: Name dbc is not bound in this Context
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.jndiTest_jsp._jspService(jndiTest_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.naming.NameNotFoundException: Name dbc is not bound in this Context
org.apache.naming.NamingContext.lookup(NamingContext.java:769)
org.apache.naming.NamingContext.lookup(NamingContext.java:139)
org.apache.naming.NamingContext.lookup(NamingContext.java:780)
org.apache.naming.NamingContext.lookup(NamingContext.java:139)
org.apache.naming.NamingContext.lookup(NamingContext.java:780)
org.apache.naming.NamingContext.lookup(NamingContext.java:152)
org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
javax.naming.InitialContext.lookup(InitialContext.java:351)
org.apache.jsp.jndiTest_jsp._jspService(jndiTest_jsp.java:55)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
tomcat配置文件
---------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Server>
<Listener className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
<Resource
auth="Container"
description="User database that can be updated and saved"
name="UserDatabase"
type="org.apache.catalina.UserDatabase"
pathname="conf/tomcat-users.xml"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"/>
<Resource
name="jdbc/Oracle"
type="javax.sql.DataSource"
password="tiger"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxIdle="2"
maxWait="5000"
username="scott"
url="jdbc:oracle:thin:@10.164.11.226:1521:dbserver"
maxActive="4"/>
</GlobalNamingResources>
<Service
name="Catalina">
<Connector
port="8090"
redirectPort="8443"
minSpareThreads="25"
connectionTimeout="20000"
maxSpareThreads="75"
maxThreads="150">
</Connector>
<Connector
port="8009"
redirectPort="8443"
protocol="AJP/1.3">
</Connector>
<Engine
defaultHost="localhost"
name="Catalina">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
<Host
appBase="webapps"
name="localhost">
</Host>
</Engine>
</Service>
</Server>
相关推荐
在Tomcat6.0中配置JNDI,主要是为了实现应用中的数据源管理,使得多个应用可以共享一个数据库连接池,提高资源利用率和系统性能。 **一、JNDI的基本概念** JNDI提供了一个统一的接口,让开发者可以查找和绑定各种...
在Tomcat中,JNDI被用来查找和绑定资源,如数据源、EJB等。配置JNDI资源可以帮助我们实现应用程序与数据库或其他服务的解耦,提高代码的可移植性和可维护性。 当在Tomcat6中配置JNDI时,错误可能由多种原因引起: ...
Tomcat 配置 JNDI 数据源 Tomcat 是一个流行的 Java Web 服务器,JNDI(Java Naming and Directory Interface)是 Java 中的一种命名和目录接口规范。Tomcat 中的 JNDI 数据源是指将数据库连接信息注册到 JNDI ...
tomcat中配置jndi 数据源!!!
【标题】:“Tomcat配置JNDI数据源” 【描述】:“在Tomcat服务器上配置JNDI数据源,特别是通过DBCP连接池的方式” 【标签】:“tomcat,配置,JNDI数据源” 【内容】:配置JNDI数据源在Java Web应用程序中是一个...
### Tomcat6中配置JNDI方法详解 #### 一、引言 在Java Web开发过程中,连接数据库是一项基础而重要的工作。常见的连接方式包括直接使用JDBC(Java Database Connectivity)以及通过JNDI(Java Naming and Directory...
在Tomcat中,JNDI常用于配置数据库连接池,使得多个Web应用可以共享同一个数据库连接。 配置JNDI的步骤如下: 1. **安装与配置MySQL**: 首先确保你已经安装了MySQL数据库,并创建了所需的数据库和用户。你需要...
在这个场景中,“intellij idea使用tomcat开发时自动部署jndi数据源”是一个重要的知识点,它涉及到如何在IDE中配置和管理数据库连接,以便于在应用运行时动态地查找和使用数据源。 JNDI(Java Naming and ...
### Tomcat中JNDI原理详解 #### 一、引言 Java Naming and Directory Interface (JNDI) 是Java平台中用于访问命名和目录服务的API。它为开发者提供了访问各种命名和目录服务(如DNS、LDAP等)的统一接口。在Tomcat...
Tomcat配置JNDI数据源的N种方法
配置JNDI数据源在Tomcat中通常涉及以下几个步骤: 1. **配置context.xml**: - 提供的文件名`context.xml`表明这是Tomcat的上下文配置文件,通常位于`$CATALINA_HOME/conf/Catalina/localhost/应用名.xml`或者在...
本示例主要讲解如何在Tomcat6中结合JNDI(Java Naming and Directory Interface)和C3P0库来配置数据库连接池,这对于初学者理解Web应用服务器与数据库的交互方式具有很大帮助。 首先,C3P0是一个开源的JDBC连接池...
本文将详细介绍如何在Apache Tomcat 5.5中配置JNDI。 #### 二、准备工作 1. **Tomcat安装**: 确保已经正确安装了Apache Tomcat 5.5.26版本。 2. **数据库驱动**: 准备好相应的数据库驱动JAR文件,例如本例中的...
在Tomcat配置JNDI数据源的三种方式
本文将详细介绍如何在Tomcat中配置JNDI,以及如何实现数据库连接。 1. **JNDI配置步骤** - **创建数据源**: 首先,你需要创建一个数据库数据源。例如,如果你使用的是MySQL,那么可以在Tomcat的`conf/server.xml`...
首先,我们需要理解Tomcat中的JNDI配置。JNDI允许我们将资源(如数据源)注册到一个全局命名空间中,这样其他应用组件可以通过名称来查找和使用这些资源。在Tomcat中,我们主要在`server.xml`配置文件中定义这些资源...
Tomcat中的JNDI主要分为两部分:全局JNDI和Web应用局部JNDI。全局JNDI通常用于配置跨多个Web应用的共享资源,如全局数据源。这些资源在`$CATALINA_HOME/conf/server.xml`文件中的`<GlobalNamingResources>`元素下...
在Java应用服务器中,如Tomcat 6.0,配置JNDI(Java Naming and Directory Interface)的DBCP(Database Connection Pool)连接池是管理数据库连接的重要步骤。JNDI是一个标准接口,允许应用程序查找和访问命名服务...