Yinka Olicks

Greenhorn
+ Follow
since Aug 28, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Yinka Olicks

hello ranchers ,
Pls does tomcat work with ejb and if so how do I configure tomcat to work with with ejbs
tanks
18 years ago
hello Ranchers,
Sorry to botjer you all but,I have a project I am working on,the application is web based so I am using jsp as the frontend tomcat as the application server,and Oraqcle/mysql as the database.
Now the scope of the program is to use the jsp page from a client system to connect to a bean which does the database connection,now when the user clicks on a button on the jsp page its suppose to trigger the bean to pick up the path to a file from a column in the databse which is on a server in a different system/environment.If path is found it follows the path to pick up the file which could also be in a different environment/system and copies it back to a folder on the server system I am not supposed to use ftp and I have tried a couple of thins and I keep on getting errors here is a sample of the last code I used and error

package empire;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
import java.sql.*;


public class GetFile2
{
private String list=null;
private String id=null;
private String pref=null;
private String url=null;
private String fpath=null;
Connection connect = null;
ResultSet result = null;
PreparedStatement state = null;
Socket s;
ServerSocket ss;


public void setlist(String list)
{

this.list=list;
}
public void setid(String id)
{

this.id=id;
}
/* public void setpref(String pref)
{

this.pref=pref;
} */


public String getlist()
{
return list;
}

public String getid()
{
return id;
}
/* public String getpref()
{
return pref;
} */

public GetFile2() throws ClassNotFoundException
{
Class.forName("com.mysql.jdbc.Driver");

}
public void getSocket(Socket s)
{
this.s=s;
}
public boolean AccountValidate()
{
boolean validate=false;
String list1="";
String id1="";
String pref1="";
try{

list=getlist();
id=getid();
//pref=getpref();


connect=DriverManager.getConnection("jdbc:mysql://localhost/empire?user=roy&password=arsenal");
state=connect.prepareStatement("Select * from CLIENTS_TAB where CLIENT_ID='"+id+"'");
//String strQuery = "Select * from clients_Tab where client_id= ?";
//state = connect.createStatement();
ResultSet result = state.executeQuery();
while(result.next())
{

id = result.getString(1);
pref = result.getString(2);
//list= result.getString(3);
fpath = result.getString(3);

System.out.println("path picked"+" "+fpath);

}
id=id.trim();
pref=pref.trim();

if(pref.equals("fixed") && list.equals("upload"))
{
s = new Socket("crux",1024);
System.out.println("CONNECTED To CLIENT");
ss = new ServerSocket(1024);
s = ss.accept();
FileInputStream in = new FileInputStream(fpath);
BufferedOutputStream bout=new BufferedOutputStream(s.getOutputStream());
int k;
System.out.println("SENDING...");
while((k=in.read())!=-1)
bout.write(k);
bout.flush();
bout.close();
System.out.println("FILE SENT");

BufferedInputStream fin = new BufferedInputStream(s.getInputStream());
FileOutputStream out=new FileOutputStream("c:\\roy\\java1.txt");
int k1;


while((k1=in.read())!=-1)
out.write(k1);
out.flush();
out.close();
System.out.println("FILE RECEIVED");
validate=true;
}
else
{
validate=false;
System.out.println("sorry");
}
}

catch (Exception e)
{
System.out.println("ERROR SENDING sorry " + e);
// System.out.println("ERROR SENDING:"+e1);
}
/* catch(Exception e1)
{
System.out.println("ERROR SENDING:"+e1);
} */

return validate;
}

}

I get this error
Aug 23, 2005 6:53:36 PM org.apache.commons.modeler.Registry loadRegistry
INFO: Loading registry information
Aug 23, 2005 6:53:36 PM org.apache.commons.modeler.Registry getRegistry
INFO: Creating new Registry instance
Aug 23, 2005 6:53:37 PM org.apache.commons.modeler.Registry getServer
INFO: Creating MBeanServer
Aug 23, 2005 6:53:38 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.12-LE-jdk14
Aug 23, 2005 6:54:00 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
Aug 23, 2005 6:54:01 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on tcp port 8009
Aug 23, 2005 6:54:01 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=16/391 config=C:\Program Files\Apache Group\Tomcat 4
.1\conf\jk2.properties
path picked c:\roberts\java1.txt
ERROR SENDING sorry java.net.ConnectException: Connection refused: connect

guess I am stock any suggestions I would be very glad and if my whole approach is wrong pls tell me what thanks
18 years ago
Hello Ranchers Pls is it possible and if so How can I bundle my applet with a jre,
18 years ago
thanks,but what if I just want to use jsp to copy from a system on the network to another system within the network,please how do I go about that thanks
18 years ago
tanks I am copying from server to a client machine and how can is it possible to use http to copy files with jsp thanks
18 years ago
hi ranchers,
pls I am writing an application using jsp and tomcat1.4,the application is supposed to connect to a database(oracle),pick up the path to a file,which is stored as a string in a table in the database,then follow the path and copy the file into a seperate folder,the connection to the database and picking up of the path I can do but,following and copying the file on to a different folder I cant pls how do I accomplish this
thanks
thanks I need to copy from the server to the client machine
[ August 17, 2005: Message edited by: Yinka Olicks ]
18 years ago
hi ranchers,
sorry to bother you but have been trying to run an sms application on the net using an sms gateway,the program is supposed to retrive data from a database using mysql and sent to phone nos,but when I get on the net I get this errors only
Aug 15, 2005 11:46:59 AM org.apache.commons.modeler.Registry loadRegistry
INFO: Loading registry information
Aug 15, 2005 11:46:59 AM org.apache.commons.modeler.Registry getRegistry
INFO: Creating new Registry instance
Aug 15, 2005 11:47:00 AM org.apache.commons.modeler.Registry getServer
INFO: Creating MBeanServer
Aug 15, 2005 11:47:01 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.12-LE-jdk14
Aug 15, 2005 11:47:13 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
Aug 15, 2005 11:47:13 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on tcp port 8009
Aug 15, 2005 11:47:13 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=31/109 config=C:\Program Files\Apache Group\Tomcat 4
.1\conf\jk2.properties
SQL Exception is caught.java.sql.SQLException: Invalid authorization specificati
on: Access denied for user: 'roy@crux.mshome.net' (Using password: YES)
SQL Exception is caught.java.sql.SQLException: Invalid authorization specificati
on: Access denied for user: 'roy@crux.mshome.net' (Using password: YES)
Sending message to subscriber...
Message was sent!

the part I really do not get is the mshome part thanks
hi ranchers,
pls I have been working on an sms application using jsp and mysql when I connect to the net I get this error message pls help the last part I know why but the sql exceptions and access denials I dont understand
my user name is roy and system name z crux dont know where the mshome.net comes from tanks

Jun 26, 2005 3:05:24 PM org.apache.commons.modeler.Registry loadRegistry
INFO: Loading registry information
Jun 26, 2005 3:05:24 PM org.apache.commons.modeler.Registry getRegistry
INFO: Creating new Registry instance
Jun 26, 2005 3:05:24 PM org.apache.commons.modeler.Registry getServer
INFO: Creating MBeanServer
Jun 26, 2005 3:05:24 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.12-LE-jdk14
Jun 26, 2005 3:05:29 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
Jun 26, 2005 3:05:29 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on tcp port 8009
Jun 26, 2005 3:05:29 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/47 config=C:\Program Files\Apache Group\Tomcat 4.1
\conf\jk2.properties
SQL Exception is caught.java.sql.SQLException: Invalid authorization specificati
on: Access denied for user: 'roy@crux.mshome.net' (Using password: YES)
SQL Exception is caught.java.sql.SQLException: Invalid authorization specificati
on: Access denied for user: 'roy@crux.mshome.net' (Using password: YES)
Sending message to subscriber...
Message was not sent!
Error Code: 431
Error Description: Invalid Subscriber ID.
Error Resolution:
how do I compile the tld files with tomcat4.0 and where do I place the class files it creates tanks
My tld files dont compile cant find certain classes when I try to compile Do I need to set any class path variable
18 years ago
JSP
hello fellows
I have been battling with making jsp pages access java beans class files with tomcat4.1.
I have a jsp file Useb.jsp which is a form it calls up another jsp file Use.jsp
<%@ page language="java" %>
<jsp:useBean id="BA" scope="session" class="BankAccount1" />
<jsp:setProperty name="BA" property ="sAccountID" param="sAccountID" />
<jsp:setProperty name="BA" property ="sPin" param="sPin" />

<html>
<head>
<title>Result Page</title>
</head>
<body bgcolor="fffffr">
<%
String sAccountID = BA.getsAccountID();
String sPin = BA.getsPin();
boolean validate = BA.AccountValidate();
if(validate == true)
{
out.println("The User Is Validated ");
}
else
{
out.println("The User Is Not Validated");
}
%>
</body>
</html>
which is supposed to call the bean class I hava compiled the bean class and copied the class file to tomcat (in stallation folder and path)C:\Program Files\Apache Group\Tomcat 4.1\webapps\ent1\WEB-INF\classes and the jsp files to C:\Program Files\Apache Group\Tomcat 4.1\webapps\ent1\jsp
but I get this error message when I submit the form in the jsp file tanks

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: Unable to compile class for JSP

An error occurred at line: 1 in the jsp file: /jsp/Use.jsp

Generated servlet error:
[javac] Compiling 1 source file

C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\ent1\jsp\Use_jsp.java:42: cannot find symbol
symbol : class BankAccount1
location: class org.apache.jsp.Use_jsp
BankAccount1 BA = null;
^



An error occurred at line: 1 in the jsp file: /jsp/Use.jsp

Generated servlet error:
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\ent1\jsp\Use_jsp.java:44: cannot find symbol
symbol : class BankAccount1
location: class org.apache.jsp.Use_jsp
BA = (BankAccount1) pageContext.getAttribute("BA", PageContext.SESSION_SCOPE);
^



An error occurred at line: 1 in the jsp file: /jsp/Use.jsp

Generated servlet error:
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\ent1\jsp\Use_jsp.java:47: cannot find symbol
symbol : class BankAccount1
location: class org.apache.jsp.Use_jsp
BA = (BankAccount1) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "BankAccount1");
^
3 errors


at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:120)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:313)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:324)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
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 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:595)



--------------------------------------------------------------------------------

Apache Tomcat/4.1.12-LE-jdk14
18 years ago
JSP
Hi everyone,

I'm having problems connecting to Oracle using jsp. The (startup and) error messages I got are:




The line(s) which I use to connect to the database from the jsp is as follows:



where the SID is "angel" , and the name and the password are "test","test");

This statement among the startup messages "Binding DataSource, name = jdbc/Cloudscape, url = jdbc:cloudscape:rmi:Cloudscape" is making me think that I first have to tell J2EE that I'm using Oracle and not cloudscape and also specify the url.

Is my diagnosis right?

How then do I do this?

Any useful answer or suggestion would be greatly appreciated.
19 years ago
JSP
where do I put java class files in case I use a java bean in my jsp page on j2ee1.3.1.
normally with j2ee1.2.1 you place java class files in j2ee/lib/classes folder which j2ee1.3.1 does not have
and how do I connect a jsp form to oracle 9i database using j2ee1.3.1 as my application server.
very urgent tanks
19 years ago
JSP