No admin page; ServletException: can't find org.apache.struts.action.MESSAGE

2005-08-07 Thread AD Marshall
Can anyone suggest a fix?  TIA for any help. - Andi

After starting tomcat5, this url gives a blank screen: 
  http://localhost:8080/admin/ 

This grep of the documentation, etc that came with tomcat5 produced no results:
[EMAIL PROTECTED] grep -r 'xception.*jakarta.apache.org' 
/srv/www/tomcat5/base/webapps/*
Searching the lists, web for as much hasn't yet revealed a relevant fix.

The following error(s) in /var/log/tomcat5/base/catalina.out (larger, 
contextual extract further below):

cut
Aug 7, 2005 10:37:44 AM
org.apache.catalina.authenticator.FormAuthenticator authenticate
WARNING: Unexpected error forwarding to login page
javax.servlet.ServletException: Cannot find message resources under
key org.apache.struts.action.MESSAGE
cut

That error is immediately preceded by this one, during the start-up of 
the session the above occurred in:
cut
Aug 7, 2005 10:11:23 AM org.apache.struts.validator.ValidatorPlugIn
initResources
INFO: Loading validation rules file from '/WEB-INF/validation.xml'
Aug 7, 2005 10:12:44 AM org.apache.struts.validator.ValidatorPlugIn init
SEVERE: jakarta.apache.org
java.net.UnknownHostException: jakarta.apache.org
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
cut


[Exceptions' context from /var/log/tomcat5/base/catalina.out:]
cut
Aug 7, 2005 10:11:23 AM org.apache.struts.validator.ValidatorPlugIn
initResources
INFO: Loading validation rules file from '/WEB-INF/validation.xml'
Aug 7, 2005 10:12:44 AM org.apache.struts.validator.ValidatorPlugIn init
SEVERE: jakarta.apache.org
java.net.UnknownHostException: jakarta.apache.org
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.init(HttpClient.java:306)
at sun.net.www.http.HttpClient.init(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at 
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:521)
at 
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:498)
at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:626)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown
Source)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown
Source)
at 
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1591)
at 
org.apache.commons.validator.ValidatorResources.init(ValidatorResources.java:159)
at 
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:233)
at 
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:164)
at 
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:839)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044)
at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:876)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4017)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at 
org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at 

Re: tomcat 5.5, jdk1.5 on user mode debian stable hangs after a few days

2005-08-07 Thread Martin Wood

Just to let people know that my application has been running happily for
nearly a week now.

I actually replaced the JDK1.5 with the blackdown 1.4.2 and installed
the compatibility extensions for tomcat.

since then its been fine.

martin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat 5.5, jdk1.5 on user mode debian stable hangs after a few days

2005-08-07 Thread Philip Cote
Good for you!  Glad it all worked out.

On Mon, 2005-08-08 at 02:25 +0100, Martin Wood wrote:
 Just to let people know that my application has been running happily for
 nearly a week now.
 
 I actually replaced the JDK1.5 with the blackdown 1.4.2 and installed
 the compatibility extensions for tomcat.
 
 since then its been fine.
 
 martin
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Oracle function problem in using tomcat 5.5.9

2005-08-07 Thread Geraldine . Wang
 
Hi,

I got an error message as below when I use an oracle function in a statement
in a java bean, but I use the same statement in a java servlet, it's ok.

The statement in the bean is:
public String[] getDetailAD(){

try{
 Connection conn = null;

 if (conn == null) {
 conn = JDBCConnectionPool.getConnection(ORACLE_DATASOURCE);
 }
 if (conn == null) {
 throw new Exception(Can't connect to Oracle);
 }
 Statement stmt = conn.createStatement();

 String query = select ADV_MERCURY_DESC(club_mercury) from
ops$profai.faagent where no = 12345;

 ResultSet rs = stmt.executeQuery(query);
 while (rs.next()) {...

The function is:
(p_str IN STRING) RETURN VARCHAR2
--
IS 

leftstr varchar2(1);
BEGIN
   leftstr := substr (p_str ,1,1);

   IF p_str IS NULL THEN
RETURN 'NONE';  
   ELSIF leftstr = ' ' THEN
RETURN 'NONE';  
   ELSIF leftstr = 'G' THEN
RETURN 'GOLD';
   ELSIF leftstr = 'S' THEN 
RETURN  'SILVER';
   ELSIF leftstr = 'B' THEN 
RETURN  'BLUE';
   ELSIF leftstr = 'T' THEN 
RETURN  'TLC';
   ELSIF leftstr = 'R' THEN 
RETURN  'RED';
   ELSIF leftstr = 'N' THEN 
RETURN  'NOW';
   ELSIF leftstr = 'W' THEN 
RETURN  'NOW GOLD';

   ELSE
RETURN  ('UNKNOWN:' || leftstr || '!');
   END IF;

END ADV_MERCURY_DESC;

The statement and the function are always ok if I run them directly in
Oracle environment or use a servlet which is running under jdk2 and Apache
server 1.3, but get error when run the bean in Tomcat5.5.9, the oracle
driver is classes12.jar.

Could anyone give me a clue?

Thanks in advance.

Geraldine


Error message is here:

java.sql.SQLException: ORA-00904: ADV_MERCURY_DESC: invalid identifier

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at
oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:
643)
at
oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.jav
a:1674)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:1870)
at
oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:
538)
at
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingSt
atement.java:162)
at oiintranet.MainADBean.getDetailAD(MainADBean.java:106)
at
org.apache.jsp.DetailAD_jsp._jspService(org.apache.jsp.DetailAD_jsp:6
3)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:322)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
91)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:856)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
at java.lang.Thread.run(Unknown Source)

***
The information contained in this mail message is confidential and may also be  
legally  privileged.
If you  are not  the intended recipient, please note that  any use,  
dissemination, further distribution,
or reproduction of 

Re: Oracle function problem in using tomcat 5.5.9

2005-08-07 Thread Robert F Hall

Geraldine,

Is the same DB login being used in  all cases?  If not, then the problem 
may be due to the
DB user not having execute privileges on the procedure in question.  
Another possibility

is that the DB's are different and procedure actually does not exist.

- Robert

[EMAIL PROTECTED] wrote:



Hi,

I got an error message as below when I use an oracle function in a statement
in a java bean, but I use the same statement in a java servlet, it's ok.

The statement in the bean is:
public String[] getDetailAD(){
   
try{

Connection conn = null;
   
if (conn == null) {

conn = JDBCConnectionPool.getConnection(ORACLE_DATASOURCE);
}
if (conn == null) {
throw new Exception(Can't connect to Oracle);
}
Statement stmt = conn.createStatement();

String query = select ADV_MERCURY_DESC(club_mercury) from
ops$profai.faagent where no = 12345;

ResultSet rs = stmt.executeQuery(query);
while (rs.next()) {...

The function is:
(p_str IN STRING) RETURN VARCHAR2
--
	IS 
	

leftstr varchar2(1);
BEGIN
   leftstr := substr (p_str ,1,1);

   IF p_str IS NULL THEN
RETURN 'NONE';  
   ELSIF leftstr = ' ' THEN
RETURN 'NONE';  
   ELSIF leftstr = 'G' THEN
RETURN 'GOLD';
	   ELSIF leftstr = 'S' THEN 
	   	RETURN  'SILVER';
	   ELSIF leftstr = 'B' THEN 
	   	RETURN  'BLUE';
	   ELSIF leftstr = 'T' THEN 
	   	RETURN  'TLC';
	   ELSIF leftstr = 'R' THEN 
	   	RETURN  'RED';
	   ELSIF leftstr = 'N' THEN 
	   	RETURN  'NOW';
	   ELSIF leftstr = 'W' THEN 
	   	RETURN  'NOW GOLD';


   ELSE
RETURN  ('UNKNOWN:' || leftstr || '!');
   END IF;

END ADV_MERCURY_DESC;

The statement and the function are always ok if I run them directly in
Oracle environment or use a servlet which is running under jdk2 and Apache
server 1.3, but get error when run the bean in Tomcat5.5.9, the oracle
driver is classes12.jar.

Could anyone give me a clue?

Thanks in advance.

Geraldine


Error message is here:

java.sql.SQLException: ORA-00904: ADV_MERCURY_DESC: invalid identifier

   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
   at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
   at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
   at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
   at
oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:
643)
   at
oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.jav
a:1674)
   at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:1870)
   at
oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:
538)
   at
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingSt
atement.java:162)
   at oiintranet.MainADBean.getDetailAD(MainADBean.java:106)
   at
org.apache.jsp.DetailAD_jsp._jspService(org.apache.jsp.DetailAD_jsp:6
3)
   at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:322)
   at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
91)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
   at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
   at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:213)
   at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
   at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
   at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
   at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
   at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
   at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:856)
   at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:744)
   at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:527)
   at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:80)
   at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
   at java.lang.Thread.run(Unknown Source)

***
The information contained in this mail message is confidential and may also be  
legally  

query problem

2005-08-07 Thread ganesan malairaja


i am extracting info from html forms .. but one of the field allways return 
the value null only


html code

form
input type=text name=username size=8
/form

jsp code

String username = request.getParameter(username);

SQL codes;

String query7 = Insert into Admin(UserName,PassWord,Admin_type,Admin_Name) 
values('+username+','+password+', 'Staff','+AdminName+');


it returns the username as null

i cant figure out what is  the problem
..

any links or example how to do it properly will help

thanks

stmt1.executeUpdate(query7);
stmt1.close();



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Oracle function problem in using tomcat 5.5.9

2005-08-07 Thread Geraldine . Wang
Robert,

Thanks for your reply. I checked before (forgot to mention in my last
message) that the DB login for tomcat (java bean) is the same with the one
for Apache (servlet). They are pointing to the same function under the same
schema. The privliges is ok for the login as it's the creator.

Thanks, I'm still very puzzled.
Geraldine

-Original Message-
From: Robert F Hall [mailto:[EMAIL PROTECTED] 
Sent: Monday, 8 August 2005 2:21 PM
To: Tomcat Users List
Subject: Re: Oracle function problem in using tomcat 5.5.9

Geraldine,

Is the same DB login being used in  all cases?  If not, then the problem may
be due to the DB user not having execute privileges on the procedure in
question.  
Another possibility
is that the DB's are different and procedure actually does not exist.

- Robert

[EMAIL PROTECTED] wrote:

 
Hi,

I got an error message as below when I use an oracle function in a 
statement in a java bean, but I use the same statement in a java servlet,
it's ok.

The statement in the bean is:
public String[] getDetailAD(){

try{
 Connection conn = null;

 if (conn == null) {
 conn = JDBCConnectionPool.getConnection(ORACLE_DATASOURCE);
 }
 if (conn == null) {
 throw new Exception(Can't connect to Oracle);
 }
 Statement stmt = conn.createStatement();

 String query = select ADV_MERCURY_DESC(club_mercury) from 
ops$profai.faagent where no = 12345;

 ResultSet rs = stmt.executeQuery(query);
 while (rs.next()) {...

The function is:
(p_str IN STRING) RETURN VARCHAR2
   --
   IS
   
   leftstr varchar2(1);
   BEGIN
  leftstr := substr (p_str ,1,1);

  IF p_str IS NULL THEN
   RETURN 'NONE';  
  ELSIF leftstr = ' ' THEN
   RETURN 'NONE';  
  ELSIF leftstr = 'G' THEN
   RETURN 'GOLD';
  ELSIF leftstr = 'S' THEN 
   RETURN  'SILVER';
  ELSIF leftstr = 'B' THEN 
   RETURN  'BLUE';
  ELSIF leftstr = 'T' THEN 
   RETURN  'TLC';
  ELSIF leftstr = 'R' THEN 
   RETURN  'RED';
  ELSIF leftstr = 'N' THEN 
   RETURN  'NOW';
  ELSIF leftstr = 'W' THEN 
   RETURN  'NOW GOLD';
   
  ELSE
   RETURN  ('UNKNOWN:' || leftstr || '!');
  END IF;

END ADV_MERCURY_DESC;

The statement and the function are always ok if I run them directly in 
Oracle environment or use a servlet which is running under jdk2 and 
Apache server 1.3, but get error when run the bean in Tomcat5.5.9, the 
oracle driver is classes12.jar.

Could anyone give me a clue?

Thanks in advance.

Geraldine


Error message is here:

java.sql.SQLException: ORA-00904: ADV_MERCURY_DESC: invalid 
identifier

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at
oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:
643)
at
oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.jav
a:1674)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:1870)
at
oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:
538)
at
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingSt
atement.java:162)
at oiintranet.MainADBean.getDetailAD(MainADBean.java:106)
at
org.apache.jsp.DetailAD_jsp._jspService(org.apache.jsp.DetailAD_jsp:6
3)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:322)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
91)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at

Directory Listing in JSP using Tomcat 5.0.28

2005-08-07 Thread Rakesh Kumar
Dear Users,

I am using Tomcat 5.0.28. For a web application called testweb, I have made
DirectoryListing true so that I can view the directory contents (of root
directory) of this webapp. I am able to see the Directory Listing for testweb
accessing URL http://www.myappl.testweb

My qustion is : how to achieve the same using JSP in Tomcat 5.0.28 ?

In JSP, if I say

%@ include file=/ %

does not show me the directory listing.

Rakesh Kumar,
Computer  Information Group,
ISRO Satellite Center,
Airport Road,
Bangalore - 560017
Tel: 25083507/25205277




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Oracle function problem in using tomcat 5.5.9

2005-08-07 Thread Geraldine . Wang
Dear Robert,

After I replied to you I went to check the DB login in server.xml file again
and noticed that I was using a different login. 

Thanks for pinpoint the problem for me. I'm grateful.

Geraldine 

-Original Message-
From: Robert F Hall [mailto:[EMAIL PROTECTED] 
Sent: Monday, 8 August 2005 2:21 PM
To: Tomcat Users List
Subject: Re: Oracle function problem in using tomcat 5.5.9

Geraldine,

Is the same DB login being used in  all cases?  If not, then the problem may
be due to the DB user not having execute privileges on the procedure in
question.  
Another possibility
is that the DB's are different and procedure actually does not exist.

- Robert

[EMAIL PROTECTED] wrote:

 
Hi,

I got an error message as below when I use an oracle function in a 
statement in a java bean, but I use the same statement in a java servlet,
it's ok.

The statement in the bean is:
public String[] getDetailAD(){

try{
 Connection conn = null;

 if (conn == null) {
 conn = JDBCConnectionPool.getConnection(ORACLE_DATASOURCE);
 }
 if (conn == null) {
 throw new Exception(Can't connect to Oracle);
 }
 Statement stmt = conn.createStatement();

 String query = select ADV_MERCURY_DESC(club_mercury) from 
ops$profai.faagent where no = 12345;

 ResultSet rs = stmt.executeQuery(query);
 while (rs.next()) {...

The function is:
(p_str IN STRING) RETURN VARCHAR2
   --
   IS
   
   leftstr varchar2(1);
   BEGIN
  leftstr := substr (p_str ,1,1);

  IF p_str IS NULL THEN
   RETURN 'NONE';  
  ELSIF leftstr = ' ' THEN
   RETURN 'NONE';  
  ELSIF leftstr = 'G' THEN
   RETURN 'GOLD';
  ELSIF leftstr = 'S' THEN 
   RETURN  'SILVER';
  ELSIF leftstr = 'B' THEN 
   RETURN  'BLUE';
  ELSIF leftstr = 'T' THEN 
   RETURN  'TLC';
  ELSIF leftstr = 'R' THEN 
   RETURN  'RED';
  ELSIF leftstr = 'N' THEN 
   RETURN  'NOW';
  ELSIF leftstr = 'W' THEN 
   RETURN  'NOW GOLD';
   
  ELSE
   RETURN  ('UNKNOWN:' || leftstr || '!');
  END IF;

END ADV_MERCURY_DESC;

The statement and the function are always ok if I run them directly in 
Oracle environment or use a servlet which is running under jdk2 and 
Apache server 1.3, but get error when run the bean in Tomcat5.5.9, the 
oracle driver is classes12.jar.

Could anyone give me a clue?

Thanks in advance.

Geraldine


Error message is here:

java.sql.SQLException: ORA-00904: ADV_MERCURY_DESC: invalid 
identifier

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at
oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:
643)
at
oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.jav
a:1674)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:1870)
at
oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:
538)
at
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingSt
atement.java:162)
at oiintranet.MainADBean.getDetailAD(MainADBean.java:106)
at
org.apache.jsp.DetailAD_jsp._jspService(org.apache.jsp.DetailAD_jsp:6
3)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:322)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
91)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:856)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce

RE: query problem

2005-08-07 Thread Marot Laurent
Hello,

Are you sure you don't have another filed name=username somewhere else in 
your jsp code ?

Lau/
 

-Message d'origine-
De : ganesan malairaja [mailto:[EMAIL PROTECTED] 
Envoyé : lundi 8 août 2005 06:28
À : tomcat-user@jakarta.apache.org
Objet : query problem


i am extracting info from html forms .. but one of the field allways return the 
value null only

html code

form
input type=text name=username size=8 /form

jsp code

String username = request.getParameter(username);

SQL codes;

String query7 = Insert into Admin(UserName,PassWord,Admin_type,Admin_Name)
values('+username+','+password+', 'Staff','+AdminName+');

it returns the username as null

i cant figure out what is  the problem
..

any links or example how to do it properly will help

thanks

stmt1.executeUpdate(query7);
stmt1.close();



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]