Re: need help using bean (solution)

2001-01-16 Thread Kervin Pierre

hi,

Just found the problem.  Although I specified a context for my
/usr/local/apache/htdocs directory as the "/" context, I didn't specify
a context for my individual webapps.  I thought they would be covered by
the "/" context.  Anyway, I specified a "/networkdb" context and that
fixed the problem.
I'm not sure if that makes sense but that was the change that seemed to
have fixed the problem.

Thanks to all who replied,

PS. I can't use any sql from java.sql even if I import java.sql.* in my
JSP files.  This is not a big problem since I can ( and should ) put all
the sql in separate beans anyway, but I'm wondering whether this was
indicative of a misconfiguration somewhere.

-Kervin


"COLE,GLENN (Non-HP-SantaClara,ex2)" wrote:
> 
> Hi, Kevin --
> 
> I couldn't figure out how to run web apps under a directory
> other than $TOMCAT_HOME/webapps, so I made a link under there
> to point to my webapp.
> 
> In your case, under $TOMCAT_HOME/webapps, try
> 
>ln -s /user/local/apache/htdocs/networkdb networkdb
> 
> ...although personally I definitely wouldn't put the webapp
> in the apache directory.  What happens when you upgrade Apache?
> Won't that wipe out your webapp?
> 
> --Glenn
> 
> -Original Message-----
> From: Kervin Pierre [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 15, 2001 9:16 AM
> To: [EMAIL PROTECTED]
> Subject: Re: need help using bean
> 
> Hi,
> 
> Firstly, thanks for the responses Bill and Karan.
> 
> I created my own application under my apache document directory ( I'm
> using mod_jk ).  Is this going to cause a problem?  My apache root is
> /usr/local/apache/htdocs and hence I placed my application in
> /usr/local/apache/htdocs/networkdb and my web-inf directory is
> /usr/local/apache/htdocs/networkdb/WEB-INF/ .  I read that beans need to
> have they class hierarchy mimic on the file system, so I placed my final
> bean source file in
> /usr/local/apache/htdocs/networkdb/WEB-INF/classes/edu/fit/eng/networkdb/
> . JSP pages load and run fine, so I guess my mod_jk setup is working,
> but beans do not load.
> 
> Must I modify my class path?  Is there anything I should be doing
> differently since I'm using mod_jk ( ie., since my application is not
> under the $TOMCAT_HOME directory )
> 
> My simple program now looks like program now looks like
> 
> <%@ page language="java" import="edu.fit.eng.networkdb.*" %>
>  scope="page" />
> 
> 
> [...]
> 
> and my bean file (
> WEB-INF/classes/edu/fit/eng/networkdb/sqlConnBean.java )...
> 
> package edu.fit.eng.networkdb;
> 
> import java.io.*;
> import java.sql.*;
> import java.beans.*;
> 
> public class sqlConnBean
> {
> private Connection conn;
> [...]
> 
> Any ideas?,
> -Kervin
> 
> karanmalhi wrote:
> >
> > Please tell me if you have made your own web application or using the
> > default and have you put your directories(packages) in the classes
> directory
> > of the web-inf directory
> > i.e.
> > your package should be placed here
> > tomcat_home\webapps\web-inf\classes
> >
> > or if you make your own webapplication e.g. kervin  then
> >
> > tomcat_home\webapps\kervin\web-inf\classes
> >
> > hope this will help you
> >
> > karan
> > - Original Message -
> > From: "Kervin Pierre" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Sunday, January 14, 2001 1:09 AM
> > Subject: Re: need help using bean
> >
> > > William Brogden wrote:
> > > >
> > > > Kervin Pierre wrote:
> > > > >
> > > > > Hello,
> > > > >
> > > > > I can't seem to get this to work. The bean compiles OK but when I
> try
> > to
> > > > > load it, I get a "Error: 500" below saying that my package couldn't
> be
> > > > > loaded.
> > > > >
> > > > > ...
> > > > > org.apache.jasper.JasperException: Unable to compile class for
> > > > >
> >
> JSP/usr/local/jakarta/build/tomcat/work/localhost_8080/_0002fnetworkdb_0002f
> > index_0002ejspindex_jsp_0.java:15:
> > > > > Package edu.fit.eng.networkdb.sqlConnObj not found in import.
> > > > > import edu.fit.eng.networkdb.sqlConnObj.*;
> > > > > ...
> > > > >
> > > > > My jsp page begins like this
> > > > >
> > > > > <%@ page language="java"
> import="edu.fit.eng.networkdb.sqlConnObj.*&quo

Re: need help using bean

2001-01-15 Thread Kervin Pierre

Hi,

Firstly, thanks for the responses Bill and Karan.

I created my own application under my apache document directory ( I'm
using mod_jk ).  Is this going to cause a problem?  My apache root is
/usr/local/apache/htdocs and hence I placed my application in
/usr/local/apache/htdocs/networkdb and my web-inf directory is
/usr/local/apache/htdocs/networkdb/WEB-INF/ .  I read that beans need to
have they class hierarchy mimic on the file system, so I placed my final
bean source file in
/usr/local/apache/htdocs/networkdb/WEB-INF/classes/edu/fit/eng/networkdb/
. JSP pages load and run fine, so I guess my mod_jk setup is working,
but beans do not load.

Must I modify my class path?  Is there anything I should be doing
differently since I'm using mod_jk ( ie., since my application is not
under the $TOMCAT_HOME directory )

My simple program now looks like program now looks like 

<%@ page language="java" import="edu.fit.eng.networkdb.*" %>



[...]

and my bean file (
WEB-INF/classes/edu/fit/eng/networkdb/sqlConnBean.java )...

package edu.fit.eng.networkdb;

import java.io.*;
import java.sql.*;
import java.beans.*;

public class sqlConnBean
{
private Connection conn;
[...]

Any ideas?,
-Kervin

karanmalhi wrote:
> 
> Please tell me if you have made your own web application or using the
> default and have you put your directories(packages) in the classes directory
> of the web-inf directory
> i.e.
> your package should be placed here
> tomcat_home\webapps\web-inf\classes
> 
> or if you make your own webapplication e.g. kervin  then
> 
> tomcat_home\webapps\kervin\web-inf\classes
> 
> hope this will help you
> 
> karan
> - Original Message -
> From: "Kervin Pierre" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, January 14, 2001 1:09 AM
> Subject: Re: need help using bean
> 
> > William Brogden wrote:
> > >
> > > Kervin Pierre wrote:
> > > >
> > > > Hello,
> > > >
> > > > I can't seem to get this to work. The bean compiles OK but when I try
> to
> > > > load it, I get a "Error: 500" below saying that my package couldn't be
> > > > loaded.
> > > >
> > > > ...
> > > > org.apache.jasper.JasperException: Unable to compile class for
> > > >
> JSP/usr/local/jakarta/build/tomcat/work/localhost_8080/_0002fnetworkdb_0002f
> index_0002ejspindex_jsp_0.java:15:
> > > > Package edu.fit.eng.networkdb.sqlConnObj not found in import.
> > > > import edu.fit.eng.networkdb.sqlConnObj.*;
> > > > ...
> > > >
> > > > My jsp page begins like this
> > > >
> > > > <%@ page language="java" import="edu.fit.eng.networkdb.sqlConnObj.*"%>
> > > > 
> > >
> > > When you name your class in the useBean tag you MUST use the
> > > complete package - it doesn't matter that you imported the package
> > >
> >
> > Thanks,
> >
> > I tried this but I'm getting the same error.
> >
> > [...]
> > org.apache.jasper.JasperException: Unable to compile class for
> >
> JSP/usr/local/jakarta/build/tomcat/work/localhost_8080/_0002fnetworkdb_0002f
> index_0002ejspindex_jsp_0.java:15:
> > Package edu.fit.eng.networkdb.sqlConnObj not found in import.
> > import edu.fit.eng.networkdb.sqlConnObj.*;
> > [...]
> >
> > My page reads now
> >
> > <%@ page language="java" import="edu.fit.eng.networkdb.sqlConnObj.*"%>
> >  > class="edu.fit.eng.networkdb.sqlConnObj.sqlConnBean" scope="page" />
> > [...]
> >
> >
> > What does this error mean? How do I fix it?
> >
> > -Kervin
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]

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




Re: need help using bean

2001-01-13 Thread William Brogden



Kervin Pierre wrote:
> 
> William Brogden wrote:
> >
> > Kervin Pierre wrote:
> > >
> > > Hello,
> > >
> > > I can't seem to get this to work. The bean compiles OK but when I try to
> > > load it, I get a "Error: 500" below saying that my package couldn't be
> > > loaded.
> > >
> > > ...
> > > org.apache.jasper.JasperException: Unable to compile class for
> > > 
>JSP/usr/local/jakarta/build/tomcat/work/localhost_8080/_0002fnetworkdb_0002findex_0002ejspindex_jsp_0.java:15:
> > > Package edu.fit.eng.networkdb.sqlConnObj not found in import.
> > > import edu.fit.eng.networkdb.sqlConnObj.*;
> > > ...
> > >
> > > My jsp page begins like this
> > >
> > > <%@ page language="java" import="edu.fit.eng.networkdb.sqlConnObj.*"%>
> > > 
> >
> > When you name your class in the useBean tag you MUST use the
> > complete package - it doesn't matter that you imported the package
> >
> 
> Thanks,
> 
> I tried this but I'm getting the same error.
> 
> [...]
> org.apache.jasper.JasperException: Unable to compile class for
> 
>JSP/usr/local/jakarta/build/tomcat/work/localhost_8080/_0002fnetworkdb_0002findex_0002ejspindex_jsp_0.java:15:
> Package edu.fit.eng.networkdb.sqlConnObj not found in import.
> import edu.fit.eng.networkdb.sqlConnObj.*;
> [...]
> 
> My page reads now
> 
> <%@ page language="java" import="edu.fit.eng.networkdb.sqlConnObj.*"%>
>  class="edu.fit.eng.networkdb.sqlConnObj.sqlConnBean" scope="page" />
> [...]
> 
> What does this error mean? How do I fix it?
> 

Here are some possibilites that occur to me:
1) your package name and the path from WEB-INF to the class file dont
agree:
WEB-INF\classes\edu\fit\eng\networkdb\sqlConnObj\sqlConnBean.class

2) Are you sure that should be sqlConnBean - normal naming convention
would be SqlConnBean

WBB


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




Re: need help using bean

2001-01-13 Thread karanmalhi

Please tell me if you have made your own web application or using the
default and have you put your directories(packages) in the classes directory
of the web-inf directory
i.e.
your package should be placed here
tomcat_home\webapps\web-inf\classes

or if you make your own webapplication e.g. kervin  then

tomcat_home\webapps\kervin\web-inf\classes

hope this will help you

karan
- Original Message -
From: "Kervin Pierre" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 14, 2001 1:09 AM
Subject: Re: need help using bean


> William Brogden wrote:
> >
> > Kervin Pierre wrote:
> > >
> > > Hello,
> > >
> > > I can't seem to get this to work. The bean compiles OK but when I try
to
> > > load it, I get a "Error: 500" below saying that my package couldn't be
> > > loaded.
> > >
> > > ...
> > > org.apache.jasper.JasperException: Unable to compile class for
> > >
JSP/usr/local/jakarta/build/tomcat/work/localhost_8080/_0002fnetworkdb_0002f
index_0002ejspindex_jsp_0.java:15:
> > > Package edu.fit.eng.networkdb.sqlConnObj not found in import.
> > > import edu.fit.eng.networkdb.sqlConnObj.*;
> > > ...
> > >
> > > My jsp page begins like this
> > >
> > > <%@ page language="java" import="edu.fit.eng.networkdb.sqlConnObj.*"%>
> > > 
> >
> > When you name your class in the useBean tag you MUST use the
> > complete package - it doesn't matter that you imported the package
> >
>
> Thanks,
>
> I tried this but I'm getting the same error.
>
> [...]
> org.apache.jasper.JasperException: Unable to compile class for
>
JSP/usr/local/jakarta/build/tomcat/work/localhost_8080/_0002fnetworkdb_0002f
index_0002ejspindex_jsp_0.java:15:
> Package edu.fit.eng.networkdb.sqlConnObj not found in import.
> import edu.fit.eng.networkdb.sqlConnObj.*;
> [...]
>
> My page reads now
>
> <%@ page language="java" import="edu.fit.eng.networkdb.sqlConnObj.*"%>
>  class="edu.fit.eng.networkdb.sqlConnObj.sqlConnBean" scope="page" />
> [...]
>
>
> What does this error mean? How do I fix it?
>
> -Kervin
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>


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




Re: need help using bean

2001-01-13 Thread Kervin Pierre

William Brogden wrote:
> 
> Kervin Pierre wrote:
> >
> > Hello,
> >
> > I can't seem to get this to work. The bean compiles OK but when I try to
> > load it, I get a "Error: 500" below saying that my package couldn't be
> > loaded.
> >
> > ...
> > org.apache.jasper.JasperException: Unable to compile class for
> > 
>JSP/usr/local/jakarta/build/tomcat/work/localhost_8080/_0002fnetworkdb_0002findex_0002ejspindex_jsp_0.java:15:
> > Package edu.fit.eng.networkdb.sqlConnObj not found in import.
> > import edu.fit.eng.networkdb.sqlConnObj.*;
> > ...
> >
> > My jsp page begins like this
> >
> > <%@ page language="java" import="edu.fit.eng.networkdb.sqlConnObj.*"%>
> > 
> 
> When you name your class in the useBean tag you MUST use the
> complete package - it doesn't matter that you imported the package
> 

Thanks,

I tried this but I'm getting the same error.

[...]
org.apache.jasper.JasperException: Unable to compile class for
JSP/usr/local/jakarta/build/tomcat/work/localhost_8080/_0002fnetworkdb_0002findex_0002ejspindex_jsp_0.java:15:
Package edu.fit.eng.networkdb.sqlConnObj not found in import.
import edu.fit.eng.networkdb.sqlConnObj.*;
[...]

My page reads now

<%@ page language="java" import="edu.fit.eng.networkdb.sqlConnObj.*"%>

[...]


What does this error mean? How do I fix it?

-Kervin

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




Re: need help using bean

2001-01-12 Thread William Brogden



Kervin Pierre wrote:
> 
> Hello,
> 
> I can't seem to get this to work. The bean compiles OK but when I try to
> load it, I get a "Error: 500" below saying that my package couldn't be
> loaded.
> 
> ...
> org.apache.jasper.JasperException: Unable to compile class for
> 
>JSP/usr/local/jakarta/build/tomcat/work/localhost_8080/_0002fnetworkdb_0002findex_0002ejspindex_jsp_0.java:15:
> Package edu.fit.eng.networkdb.sqlConnObj not found in import.
> import edu.fit.eng.networkdb.sqlConnObj.*;
> ...
> 
> My jsp page begins like this
> 
> <%@ page language="java" import="edu.fit.eng.networkdb.sqlConnObj.*"%>
> 

When you name your class in the useBean tag you MUST use the 
complete package - it doesn't matter that you imported the package


-- 
WBB - [EMAIL PROTECTED]
Java Cert mock exams http://www.lanw.com/java/javacert/
Author of Java Developer's Guide to Servlets and JSP 
ISBN 0-7821-2809-2

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