"Name jdbc is not bound in this Context" when conncetiong from different pa
Hi,
I'm just a beginner at this so I'll have to explain everything in details as i have no idea what could be wrong.
I have a working connection to mydatabase using the following method in a CommonMethods.java file in WEB-INF; this file belongs to the "package mrkt.app;" package.
public Connection getDataBaseConnection() {
Connection conn = null ;
try {
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/myproject");
conn = ds.getConnection();
} catch (Exception ex) {
ex.printStackTrace();
return conn ;
} I needed to create a new class in package "package mrkt.app.cat.shop;", in this new java file i need access to the database so i just copied and pasted the above code in the new java file, compiled it, put it in the "WEB-INF/classes/mrkt/app/cat/shop" folder, restarted tomcat to reload classes. The class is loaded successfully, but i always get the following error when calling the method(getShopsCount) using the connection function (getDatabaseConnection)
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
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:137)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at mrkt.app.cat.shop.ShoppingGuide.getDataBaseConnection(ShoppingGuide.java:30)
at mrkt.app.cat.shop.ShoppingGuide.getShopsCount(ShoppingGuide.java:49)
at org.apache.jsp.shopping_005fguide_005fsection_jsp._jspService(shopping_005fguide_005fsection_jsp.java:1418)Regards.
Yehia A.Salam
I have the same problem!
I created a couple of virtualhost on the same webapp like described here
http://www.onjava.com/pub/a/onjava/2003/06/25/tomcat_tips.html
the application works without problems if I point my browser to
http://ip_address/webapp
but, if I open http://www.myvirtualhost.com/ I get a
javax.servlet.ServletException: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
I even defined the same datasource I use for the ip based browsing in the virtualhost datasources (through admin, without restarting tomcat) but I get the same exception... any suggestion?
thanks
Similar Messages
-
Error - Name jdbc is not bound in this Context
Hi,
i wanted to use Datasource in JDBC to make connection with mysql
suport and want to excute Jsp page but not able to execte some error is
getting.
1)Jsp Page: data_source.jsp
<%@ page session="true" import="java.sql.*,javax.sql.*,javax.naming.*" %>
<HTML>
<body bgcolor="blue">
<H1 align = "center" >
Welcome to User and can see the DataSource Connection
<%
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("jdbc/test");
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * from emp");
if(rs.next())
%>
<table width="100%" border="1" >
<tr align="left">
<th>Name</th>
<th>Dept</th>
</tr>
<%
do
%>
<TD> <%= rs.getString("Name") %> </TD>
<TD> <%= rs.getString("Dept") %> </TD>
<%
}while(rs.next());
%>
</table>
<%
}else {
%>
No Results from Query:
<%
rs.close();
stmt.close();
conn.close();
ctx.close();
%>
</body>
</html>
2) web.xml file content
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<description>MySQL Test App</description>
<resource-ref>
<description>Mysql DB Connection</description>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<servlet>
<servlet-name>s1</servlet-name>
<servlet-class>first</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>s1</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
</web-app>
3) myhealth.xml or server.xml
<?xml version='1.0' encoding='utf-8'?>
<Context docBase="C:/Program Files/Apache Software Foundation/Tomcat
5.0/myhealth" path="/myhealth" reloadable="true" privileged="true">
<Resource name="jdbc/test"
scope="Shareable" type="javax.sql.DataSource"
auth="Container" description="hOME.."/>
<ResourceParams name="jdbc/test">
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/test?autoReconnect=true</value>
</parameter>
<parameter>
<name>username</name>
<value>root</value>
</parameter>
<parameter>
<name>password</name>
<value>test</value>
</parameter>
</ResourceParams>
</Context>
4) Error which i got during execution of data_Source.jsp page.
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it
from fulfilling this request.
exception
javax.servlet.ServletException: Name jdbc is not bound in this Context
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.Data_005fSource_jsp._jspService(Data_005fSource_jsp.java:115)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
root cause
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
org.apache.naming.NamingContext.lookup(NamingContext.java:815)
org.apache.naming.NamingContext.lookup(NamingContext.java:198)
org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
javax.naming.InitialContext.lookup(InitialContext.java:351)
org.apache.jsp.Data_005fSource_jsp._jspService(Data_005fSource_jsp.java:56)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
As i made datasource Context using Tomcat apache. But i still get same error.
I tried so much from Google search, please give me proper solution.
Coz this is the common problem most of the programmers face initally
Thanks,
Prabhati installed tomcat. the installation is done successfully..
But i can't connect to the db(MySQL)
i am getting some errors regarding some exception like
**org.apache.jasper.JasperException: An exception occurred processing JSP page /TestTomcatToMySQLConn.jsp at line 16**
**13: Context ctx = new InitialContext();**
**14:* if(ctx == null )*
*15: throw new Exception("Boom - No Context");*
*16: ds = (DataSource)ctx.lookup("java:comp/env/jdbc/testDB");*
*17:*
*18: if(ds == null )*
*19: throw new Exception("Boom - No Datasource");*
Stacktrace:_
* org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)*
* org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)*
* org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)*
* org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)*
* javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
root cause_
javax.servlet.ServletException: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context_
* org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)*
* org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)*
* org.apache.jsp.TestTomcatToMySQLConnjsp._jspService(TestTomcatToMySQLConn_jsp.java:88)*_
* org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)*
* javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
* org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)*
* org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)*
* org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)*
* javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
please Help -
The name 'weblogic.management.home.localhome' is not bound in this context
1. I am trying to run a WebLogic ant target to deploy an web application to WebLogic 8.1. The following is the ant target.
<target name="deploy" >
<echo message="ear.file = ${ear.file}"/>
<wldeploy action="deploy"
source="${ear.file}"
name="${application.name}"
verbose="true"
user="${weblogic.admin.user}"
password="${weblogic.admin.password}"
adminurl="${weblogic.admin.url}"
debug="true"
targets="${weblogic.server}"/>
</target>
2. I got the following error:
C:\jdeveloperworkspace\CART\cart\build\build.xml:107: weblogic.management.deploy.utils.MBeanHomeToolException: Unable to connect to server t3://127.0.0.1:7777 as user weblogic.
Reason: javax.naming.NameNotFoundException: The name 'weblogic.management.home.localhome' is not bound in this context
at oracle.javatools.jndi.HashContext.lookup(HashContext.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at weblogic.management.deploy.utils.MBeanHomeTool.getMBeanHome(MBeanHomeTool.java:174)
at weblogic.Deployer.runBody(Deployer.java:721)
at weblogic.utils.compiler.Tool.run(Tool.java:192)
at weblogic.utils.compiler.Tool.run(Tool.java:147)
at weblogic.Deployer.runMain(Deployer.java:574)
at weblogic.Deployer.mainWithExceptions(Deployer.java:586)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at weblogic.ant.taskdefs.management.WLDeploy.invokeMain(WLDeploy.java:269)
at weblogic.ant.taskdefs.management.WLDeploy.execute(WLDeploy.java:210)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at oracle.jdevimpl.ant.runner.AntLauncher.launch(AntLauncher.java:321)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at oracle.jdevimpl.ant.runner.InProcessAntStarter.runAnt(InProcessAntStarter.java:293)
at oracle.jdevimpl.ant.runner.InProcessAntStarter.mav$runAnt(InProcessAntStarter.java)
at oracle.jdevimpl.ant.runner.InProcessAntStarter$1.run(InProcessAntStarter.java:71)
Check option -adminurl, -username and -password.
3. The interesting thing is: if I use JDeveloper's *.deploy Profile to deploy the same EAR file, it works fine.
4. If I run the same ant target in other IDE, say IntelliJ IDEA 5.1.2, it also works fine.
Any thoughts?
SeanSean,
Are you certain you a referencing the correct port in the admin url its generally defaulted to 7001 on weblogic. Thats all I could think of off the top of my head. Post back if you still have issues. -
Hi
I have developed a search servlet and deployed it in tomcat 4.0.3 and connected to mysql database through jdbc by specifying jndi.
I have coded JNDI lokkup name as "java:comp/env/jdbc/KgoogleDB"
I have added a context in server.xml file of tomcat for DBCP connection pooling .I have tested this in windows and it is running well in it.
But when i hosted this in linux i got error like this
INIT OF SEARCH SERVLET
Error in file reading Connection refused
File Not Found
javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at javax.naming.InitialContext.lookup(InitialContext.java:354)
at DbConnect.getConnection(DbConnect.java:35)
at QueryDetails.Query(QueryDetails.java:32)
at Search.doPost(Search.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:446)
at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:216)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.warp.WarpRequestHandler.handle(WarpRequestHandler.java:217)
at org.apache.catalina.connector.warp.WarpConnection.run(WarpConnection.java:194)
at java.lang.Thread.run(Thread.java:536)
Connection ID null
Entered FINALLY
=================================
What would be the cause of this error?.Please help me.
My server.xml context is
- <Host className="org.apache.catalina.connector.warp.WarpHost" name="www.keralagoogle.com" debug="0" appBase="/domains/www.yy.com/tomcat/webapps" unpackWARs="true">
- <Context path="/yyjava" docBase="/domains/www.yy.com/tomcat/webapps/yyjava" debug="0" reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_KgoogleDB." suffix=".txt" timestamp="true" />
<Resource name="jdbc/KgoogleDB" auth="Container" type="javax.sql.DataSource" />
- <ResourceParams name="jdbc/KgoogleDB">
- <parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
- <!--
Maximum number of dB connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to 0 for no limit.
-->
- <parameter>
<name>maxActive</name>
<value>500</value>
</parameter>
- <!--
Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit.
-->
- <parameter>
<name>maxIdle</name>
<value>300</value>
</parameter>
- <!--
Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
- <parameter>
<name>maxWait</name>
<value>12000</value>
</parameter>
- <!-- MySQL dB username and password for dB connections
-->
- <parameter>
<name>username</name>
<value>pratap</value>
</parameter>
- <parameter>
<name>password</name>
<value>ky67yumXg</value>
</parameter>
- <!-- Class name for mm.mysql JDBC driver
-->
- <parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
- <!--
The JDBC connection url for connecting to your MySQL dB.
The autoReconnect=true argument to the url makes sure that the
mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
connection. mysqld by default closes idle connections after 8 hours.
-->
- <parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/kgoogle?</value>
</parameter>
</ResourceParams>
</Context>
==============================
Please help me find if i have to change the syntax for linux in the above code.
Thanks in Advance
Prathaphi
Thanks for your advise.
But when i chenged my web.xml and jndi name in my servlet file i got error like this
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
at javax.naming.InitialContext.lookup(InitialContext.java:354)
at DbConnect.getConnection(DbConnect.java:35)
at QueryDetails.Query(QueryDetails.java:32)
at Search.doPost(Search.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServl
et.java:446)
at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.jav
a:216)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve
.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
rValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcesso
r.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.ja
va:1107)
at java.lang.Thread.run(Thread.java:536)
Connection ID null
Entered FINALLY
Please help me
Thanks in Advance
Prathap -
"Errored while looking up datasource: PWC4216: Name myDB is not bound in th
hi all,
am trying to deploy my web application (.war which has a servlet which connects to a db and fetches records and displays in jsp) file in SunOne web server V7 but i cant get past this error :
[29/Jun/2010:15:14:46] failure (24218): for host 146.171.59.144 trying to POST /BbaMigrationQueryTool/BBAMigrationQuery, service-j2ee reports: NamingExcep
tion caught: Errored while looking up datasource: PWC4216: Name myDB is not bound in this Context
my java code to lookup the jndi name :
1. //looks up a datasource
2. private static synchronized DataSource getDataSource(String jndiName) throws NamingException {
3.
4. DataSource dataSource = null;
5.
6. try {
7. Context c = new InitialContext();
8. Context envContext = (Context) c.lookup("java:comp/env");
9. Logger.getLogger(DBUtilities.class.getName()).log(Level.INFO, "Found sub context");
10. dataSource = (DataSource) envContext.lookup(jndiName);
11.
12. } catch (NamingException e) {
13. e.printStackTrace();
14. throw new NamingException("Errored while looking up datasource: " + e.getMessage());
15. }
16.
17. return dataSource;
18. }
i call the above method with "jdbc/myDB" and have created a JDBC recourse within the SunOne web server via the admin console.
my web.xml i have an entry for the resource as follows :
1. <resource-ref>
2. <res-ref-name>jdbc/myDB</res-ref-name>
3. <res-type>javax.sql.DataSource</res-type>
4. <res-auth>Container</res-auth>
5. <res-sharing-scope>Shareable</res-sharing-scope>
6. </resource-ref>
in my sun-web.xml i have an entry as follows :
1. <resource-ref>
2. <res-ref-name>jdbc/myDB</res-ref-name>
3. <jndi-name>jdbc/myDB</jndi-name>
4. </resource-ref>
server.xml has this entry in it :
1. <jdbc-resource>
2. <jndi-name>jdbc/myDB</jndi-name>
3. <datasource-class>oracle.jdbc.pool.OracleDataSource</datasource-class>
4. <property>
5. <name>password</name>
6. <value>76765</value>
7. </property>
8. <property>
9. <name>user</name>
10. <value>56756</value>
11. </property>
12. <property>
13. <name>url</name>
14. <value>jdbc:oracle:thin:@serveretc etc</value>
15. </property>
16. <description/>
17. </jdbc-resource>
what could be wrong ??
thanks in advance.
Edited by: cesarNZ on Jun 29, 2010 7:58 PM
Edited by: cesarNZ on Jun 29, 2010 8:00 PMtry to not split the attributes in server.xml
use them like
<Context path="/myPath" docBase="myDocBase" debug="5" reloadable="true" crossContext="true" source="org.eclipse.jst.j2ee.server:myDocBase">
<Resource name="jdbc/myDB"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
username="$$$"
password="$$$"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/myTest" />
</Context>and i dont know why you define two resources
try to look at
http://forums.sun.com/thread.jspa?messageID=11013089� -
Question about removing a node.. getting 'not found in this context' error
hi, i have the following code:
public boolean deleteRunType(String runTypeName){
//in this function we
NodeList nl = Doc.getElementsByTagName("Run-Type");
int numberOfNodes = nl.getLength();
String attribute;
NamedNodeMap attributes;
for(int i=0;i<numberOfNodes;i++){
attributes = nl.item(i).getAttributes();
if(attributes!=null){
Node attributeNode = attributes.getNamedItem("name");
if(attributeNode!=null){
attribute = attributeNode.getNodeValue();
System.out.println("Comparing: attribute = " + attribute + " to runTypeName = " + runTypeName);
if(attribute.compareTo(runTypeName) == 0){
System.out.println("Match!");
Doc.removeChild(nl.item(i));
}//end if
}//end if
}//end for
return true;
//definition of Doc:
DocumentBuilder DB = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Doc = DB.parse(xmlFile);anyways, i am getting an error:
org.apache.crimson.tree.DomEx: NOT_FOUND_ERR: That node does not exist in this context.
at org.apache.crimson.tree.ParentNode.removeChild(Unknown Source)
at RunType.RunTypeXMLWriter.deleteRunType(RunTypeXMLWriter.java:58)
at RunType.RunTypeXMLWriter.main(RunTypeXMLWriter.java:81)when i run it. it crashes on the Doc.removeChild(nl.item(0)); line.
why is this? I grabbed the child directly from the list, so it should exist in this
context. Maybe i don't understand the context.
Any ideas or suggestions? Thank you SO much for all the help. i am finally
starting to get the hang of XML, but i still have some hangups!This is not an uncommon problem.
When you do getElementsByTagName() on a document, you get all elements by that name that anywhere in the tree of the document.
When you do a removeChild, you need to be pointing to the parent of the element you are removing.
If you change the removeChild line to :
Node parent = nl.item(i).getParentNode();
parent.removeChild( nl.item(i) );Also, it is generally not done to use a capital letter to start the name of an instance, such as "Doc". Initial capital letters are usually reserved for class names.
Dave Patterson -
PLS-00357: Table,View Or Sequence reference 'A' not allowed in this context
Hello
I am accepting input values from users through java web page. To accept the values I am using the following code:
import java.sql.*;
import javax.sql.DataSource;
import javax.naming.*;
public class spsrch
public void spsrch()
public String espsrch(String p, String d, String a)
String s1= "";
String strColor="#C0C0C0";
try
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/Oracle9i");
Connection Con = ds.getConnection();
Statement stmt = Con.createStatement();
CallableStatement proc1stmt1=Con.prepareCall ("{call Allsch("+p+","+d+")}");
// ResultSet rs = proc1stmt1.execute();
proc1stmt1.executeUpdate();
Con.close();
catch(Exception e)
System.out.println("Flag Raised"+e);
return s1;
I am calling the procedure 'Allsch' to apply some logic before inserting data into a SQL table.
The 'Allsch' procedure is :
create or replace procedure tmpsch(pno varchar2,pdes varchar2) as
mpartnum varchar2(30);
mpn varchar2(30);
mdes varchar2(150);
cursor c1 is select partnum,description,aircraft_type from master_catalog where description like ltrim(rtrim(mdes))||'%' AND partnum like mpn||'%';
cursor c2 is select partnum from ipc_master where partnum=mpartnum;
cursor c3 is select partnum from fedlog_data where partnum=mpartnum;
cursor c4 is select partnum from superparts where partnum=mpartnum;
cursor c5 is select part_no from supplier_catalog where part_no=mpartnum;
mpno1 varchar2(30);
mpno2 varchar2(30);
mpno3 varchar2(30);
mpno4 varchar2(30);
mpno5 varchar2(30);
mdescription varchar2(150);
maircraft_type varchar2(15);
mstat varchar2(1);
mstat1 varchar2(30);
mstat2 varchar2(30);
mstat3 varchar2(30);
mstat4 varchar2(30);
begin
mstat:='N';
mpn:=pno;
mdes:=pdes;
for i in c1 loop
mstat:='N';
mstat1:='N';
mstat2:='N';
mstat3:='N';
mstat4:='N';
mpno1:=i.partnum;
mpartnum:=i.partnum;
mdescription:=i.description;
maircraft_type:=i.aircraft_type;
for j in c2 loop
mpno2:=j.partnum;
end loop;
for k in c3 loop
mpno3:=k.partnum;
end loop;
for l in c4 loop
mpno4:=l.partnum;
end loop;
for m in c5 loop
mpno5:=m.part_no;
end loop;
if mpno2=mpartnum then
mstat1:=mpno2;
end if;
if mpno3=mpartnum then
mstat2:=mpno3;
end if;
if mpno4=mpartnum then
mstat3:=mpno4;
end if;
if mpno5=mpartnum then
mstat4:=mpno5;
end if;
if mpno1=mpartnum then
mstat:='Y';
insert into tmpcat values(mpno1,mdescription,maircraft_type,mstat1,mstat2,mstat3,mstat4);
end if;
end loop;
end;
Java program compiling time, it not showing any error. But after executing, it is not inserting any data into 'tmpcat' table and throwing the following error :
Flag Raisedjava.sql.SQLException: ORA-06550: line 1, column 14:
PLS-00357: Table,View Or Sequence reference 'A' not allowed in this context
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
[07/22/03 11:47:38][executor-0][W]: Handling error; throwable is "null", status
code is "404" and message is "Not Found: /User/Ecatalog/Validations.js".
[07/22/03 11:47:38][executor-0][W]: Handling error; throwable is "null", status
code is "404" and message is "Not Found: /User/Ecatalog/Validations.js".
Any one please help me to solve the issue.
With thanks
Pramod kumar.
My Email-id is : [email protected]What are p and d in
"{call Allsch("+p+","+d+")}"
Something tells me you might need some quotes in this statement since they are varchar2. Maybe
"{call Allsch('"+p+"','"+d+"')}"
If this doesn't work try to cut off parts of the procedure until it works.
Mike -
Reference to database and/or server name in '' is not supported in this version of SQL Server
Hello all
I am using C# and ADO.NET (native) - Visual Studio 2013.
I am always using full qualified queries like "SELECT * FROM [database].[schema].[table]"
Obviously there is a problem when doing this against SQL Azure,
I get the following error: "Reference to database and/or server name in '' is not supported in this version of SQL Server"
Interesting fact: With SQL Management Studio, the same query works.
I need to know if this error is really a true one or not.
If yes, I can quit using SQL Azure. I would need a SQL Server and not a partial SQL Server :-)
Thanks and best regards
FrankHi,
Here are my suggestions:
1. Use partially qualified queries, because:
a. from a security standpoint, you'd want to limit your login's access across the server instance
b. in order to achieve a even better, you should specify your database as the Initial Catalog directly in the SQL Connection.
If you take into account these practices, SQL Database doesn't come with any limitation from that point of view.
However, in regard to 'With SQL Management Studio, the same query works', this is actually only partially true because if you run that query agains ADO.NET, you'll actually end up in switching databases along the query which is obviously not permitted in
SQL Database since you're running in a hosted black-box version of SQL you're not managing. It's just like running the USE <dbname> command which obviously doesn't work.
Alex -
The reference to the table, view or sequence is not allowed in this context
Hi,
I'm triying to execute the SP that I describe below and the OS give me an error:
CREATE OR REPLACE PROCEDURE DWARE.P_CSCV_AGR_MONTH_REVENUE
TBL_NAME VARCHAR2,
START_DATE DATE,
RESULT_ OUT NUMBER
) AS
BEGIN
DECLARE
v_tbl_name VARCHAR2(30);
v_start_date DATE;
v_result NUMBER := 0;
v_select_aux VARCHAR2(32767) := ' ';
v_temp_table VARCHAR2(30);
v_exists NUMBER;
BEGIN
v_tbl_name := TBL_NAME;
v_start_date := START_DATE;
v_temp_table := 'temp_' || v_tbl_name;
SELECT count(*) INTO v_exists FROM tab WHERE lower(tname) = lower(v_temp_table);
IF (v_exists = 1) THEN
v_select_aux := '
DROP TABLE ' || v_temp_table || ' CASCADE CONSTRAINTS PURGE
EXECUTE IMMEDIATE (v_select_aux);
COMMIT;
END IF;
v_select_aux := 'CREATE TABLE ' || v_temp_table || ' AS
SELECT ch.date_ month_revenue,
s.date_sub month_sub,
s.codpromoter,
u.OPERATOR,
SUM (ch.total) AS TOTAL_OK
FROM cscv_sub_charges_' || to_char(v_start_date, 'YYYY_MM')|| ' ch
INNER JOIN cscv_subs s
ON ch.id_sub = s.ID
INNER JOIN cscv_users u
ON s.id_user = u.ID
WHERE ch.STATUS = 0
GROUP BY ch.date_, s.date_sub, s.codpromoter, u.OPERATOR';
EXECUTE IMMEDIATE (v_select_aux);
COMMIT;
v_select_aux := '
INSERT INTO ' || v_tbl_name || ' (
month_revenue,
month_sub,
codpromoter,
operator,
TOTAL_0,
TOTAL_1,
TOTAL_2,
TOTAL_3,
TOTAL_4,
TOTAL_5,
TOTAL_6,
TOTAL_7,
TOTAL_8,
TOTAL_9,
TOTAL_10,
TOTAL_11
SELECT
month_revenue,
month_sub,
codpromoter,
operator,
TOTAL_0,
TOTAL_1,
TOTAL_2,
TOTAL_3,
TOTAL_4,
TOTAL_5,
TOTAL_6,
TOTAL_7,
TOTAL_8,
TOTAL_9,
TOTAL_10,
TOTAL_11
FROM
SELECT
month_revenue,
month_sub,
codpromoter,
operator,
sum(total_ok) total_0,
0 total_1,
0 total_2,
0 total_3,
0 total_4,
0 total_5,
0 total_6,
0 total_7,
0 total_8,
0 total_9,
0 total_10,
0 total_11
FROM '|| v_temp_table ||'
WHERE to_char(month_sub,''mm/yyyy'') = to_char(sysdate,''mm/yyyy'')
GROUP BY month_revenue,month_sub,codpromoter, operator
UNION ALL
SELECT
month_revenue,
month_sub,
codpromoter,
operator,
0,
sum(total_ok),
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
FROM '|| v_temp_table ||'
WHERE to_char(month_sub,''mm/yyyy'') = to_char((to_date(sysdate,''dd/mm/yy'') - INTERVAL ''1'' MONTH),''mm/yyyy'')
GROUP BY month_revenue,month_sub,codpromoter, operator
GROUP BY month_revenue,
month_sub,
codpromoter,
operator
EXECUTE IMMEDIATE (v_select_aux);
v_result := v_result + SQL%ROWCOUNT;
COMMIT;
v_select_aux := '
DROP TABLE ' || v_temp_table || ' CASCADE CONSTRAINTS PURGE
EXECUTE IMMEDIATE (v_select_aux);
COMMIT;
RESULT_ := v_result;
END;
END P_CSCV_AGR_MONTH_REVENUE;
BEGIN
DWARE.P_CSCV_AGR_MONTH_REVENUE(CSCV_AGR_MONTH_REVENUE,'01/01/2010');
END;
/and the output is:
Error at line 1
ORA-06550: líne 2, column 32:
PLS-00357: The reference to the table, view or sequence 'CSCV_AGR_MONTH_REVENUE' is not allowed in this context
ORA-06550: líne 2, column 1:
PL/SQL: Statement ignoredwhat could I do to resove the problem??
Thanks in advance...Hi,
Your procedure's signature is
CREATE OR REPLACE PROCEDURE DWARE.P_CSCV_AGR_MONTH_REVENUE
TBL_NAME VARCHAR2,
START_DATE DATE,
RESULT_ OUT NUMBER
) i.e. it is expecting two input parameters, TBL_NAME in VARCHAR2 format and the other START_DATE in DATE format. Also you need a variable with data type as NUMBER to hold the value of OUT parameter RESULT_
Now look at the way you are calling this procedure
BEGIN
DWARE.P_CSCV_AGR_MONTH_REVENUE(CSCV_AGR_MONTH_REVENUE,'01/01/2010');
END;
/first parameter has to be a VARCHAR2, so enclose CSCV_AGR_MONTH_REVENUE into single quotes.
second parameter should be a date, so use to_date() function.
Lastly declare a variable with data type as Number for holding value of out parameter RESULT_
Something like this :
declare
t_num number;
begin
a('CSCV_AGR_MONTH_REVENUE',to_date('01/01/2010','MM/DD/YYYY'),t_num);
dbms_output.put_line(t_num);
end;Vivek L -
I get this message when I try to download the trial:
"The address wasn't understood
Firefox doesn't know how to open this address, because one of the following protocols (aam) isn't associated with any program or is not allowed in this context.
You might need to install other software to open this address."
I also get the same message using safari, any ideas? I have pop up blocker disabled. Thank you.AAM doesn't update to Creative Cloud desktop Application
-
I am constantly getting error 1034 with no apparent pattern. This is under the latest version of Windows 7. Apparently I am not alone in this. When will this be addressed by Adobe?
Please send the "MuseLog.txt" file from your "My Documents" folder to my attention along with a link to this forum thread at [email protected] The log should provide additional context regarding the error you're encountering. Thanks.
-
I get a "the requested URL was not found on this server" when trying to play a song in my iphone
I have a new iphone5 and after synking my songs and musice. I get a "The requested URL was not found on this server" when I click on a song or a music video. It is almost like itunes did not copy my songs from my account to the new iphone.
I was having the same problems with my movies and tv shows. I unchecked them, then rechecked them, and synced all them again. Presto! They are all working again. Thank you.
-
I am new to apple hardware, and since upgrading software on my iphone 4S I receive this message. "this accessory is not supported by this iphone" when using my clock radio docking station. Is there away around this?
Hello GuynStPete,
Thanks for using Apple Support Communities.
I found the following support article that has some troubleshooting steps for you to follow in order to resolve this issue you're experiencing:
Resolve issues with iPhone, iPad, and iPod touch accessories
http://support.apple.com/kb/TS2634
Take care,
Alex H. -
Keep getting a "the disk you inserted was not readable by this computer" when I insert my printer cord into either USB port. Recently installed a portable hard drive for back up purposes. Related?
Does your printer have a slot for an SD card? Is there are card in the slot? If so, the computer is trying to mount that card as an external device. It might be corrupted so that it can't be read.
-
the disk you inserted was not readable by this computer. (when putting ipod into mac) help,. now have no music on my ipod. how do i sort this out?
- Verify the file and disk formats on your camcorder and on your friend computer whether they support what you want to do. Also, if you are using a specific application to do the task, you may need to verify an application whether it supports the file format (e.g. MPEG4, Apple Intermediate Codec).
- Verify the device cable type whether Mac OS X 10.4.x supports.
- Verify the device compatibility with Mac OS X 10.4.x.
- Check an available firmware or driver for the camcorder that has developed after Mac OS X 10.4.4.
- Try diagnosing and repairing local hard disk and camcorder's drive directory.
- Verify disks permissions issue.
- Verify whether the disk is TOO warm or cold to read.
- If every troubleshooting does not solve the issue, consider to reformat the camcorder drive.
You may try suggestions by Dale Weisshaar: http://discussions.apple.com/thread.jspa?messageID=1206250
Maybe you are looking for
-
Hey guys. Upgrading from Linux 3.8.8 => 3.9.2 cause the "Connect to a NFS share" feature in the XBMC application to fail with the error "RPC Packet not accepted by the server" Mounting the share via "# mount -t nfs4 192.168.1.100:/home/evan/multimedi
-
Hello Experts, Are EFT/ACH/Transfer one and the same payment method or are they different. All answers would be duly rewarded with points. Thanks, Nandita
-
Remove header from a csv output in Bipublisher
Hi All, I am generating a csv output from a Bipublisher report. The problem is I am getting the header (Column Names) in the extract. I hAve removed the column name header from the rtf template. Please let me know if we have to change any setting any
-
My MDB keep receiving the message from the WLS 7.0
The attachment is my onMessage method in MDB. On the send side, I sent out my message. But one MDB side, I keep receiving new message from TOPIC for each 40 seconds. Do you guys know what is wrong? public void
-
What is it with Apple and Summer Time at the moment?
In iCal I can't scroll to April 2011 with the left tab if I have "Syria" timezone selected and can't book a multi-day event from the end of March beyond 1st April. If I switch the timezone to "Central European", then no problem at all. C'mon Apple...