error loading class in $CATALINA_BASE/shared/classes

2005-08-23 Thread Harry Hehl
Hello,

I am just starting out with Tomcat 5 and I am experimenting with loading
classes from a servlet. 

I have placed my .class files in $CATALINA_BASE/shared/classes.
My servlet tries to instantiate a class located in
$CATALINA_BASE/shared/classes I get

javax.servlet.ServletException: Servlet execution threw an exception
root cause 
java.lang.IllegalAccessError: tried to access class  from class Y

I discovered even if I delete the .class files from 
CATALINA_BASE/shared/classes I still get this error. 

Is there a security setup required to permit this?

Thanks


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



loading class

2002-10-18 Thread Marek Majtan
I cant't load class 
in Tomcat. For example code
Class.forName (xxx); throws exception.
what to do for that to work?
I've tried to put xxx.class file into
WEB-INF directories,but with no success.
Thanks for advise,
M.

Strnky o automobilech, novinky, autobazary, nov auta,
psluenstv, pojitn aut... http://automoto.volny.cz

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




RE: loading class

2002-10-18 Thread Cox, Charlie
put it in the WEB-INF/classes directory and your serlvet should be able to
find it. 

Charlie

 -Original Message-
 From: Marek Majtan [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, October 17, 2002 12:13 PM
 To: [EMAIL PROTECTED]
 Subject: loading class
 
 
 I cant't load class 
 in Tomcat. For example code
 Class.forName (xxx); throws exception.
 what to do for that to work?
 I've tried to put xxx.class file into
 WEB-INF directories,but with no success.
 Thanks for advise,
 M.
 
 Strnky o automobilech, novinky, autobazary, nov auta,
 psluenstv, pojitn aut... http://automoto.volny.cz
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

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




RE: tomcat 4.0.3 servlet having problem loading class via rmi ?

2002-06-07 Thread Shapira, Yoav

Howdy,
1st thing that comes to mind from looking at the stack trace, not having
tried  tomcat-JINI connectivity: is that file
(com.sun.jini.reggie.RegistrarProxy) in your runtime classpath?  It
should be in the /WEB-INF/lib or /WEB-INF/classes (or one of the common
lib/classes directories).  Usually ClassNotFoundExceptions are fairly
straightforward...

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: java guru [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 06, 2002 5:21 PM
To: [EMAIL PROTECTED]
Subject: tomcat 4.0.3 servlet having problem loading class via rmi ?

Hi.,
  I am trying to access a JINI service thru my
servlet.. inspite of following Security Manager,
Policy file and setting codebase etc, tomcat 4.0.3
repeatedly give following excption.

The JINI service itself is working fine and other
standalone clients can access it.

Read somewhere that the protocol handler of tomcat had
problem but that was two years back..

Any insight to this would be of great help.

Thanks
srini


***
java.lang.ClassNotFoundException:
com.sun.jini.reggie.RegistrarProxy
at
java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at
java.security.AccessController.doPrivileged(Native
Method)
at
java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:207)
at
sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:427)
at
sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:159)
at
java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:629)
at
java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
at
sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:
200)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1503)
at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:161
6)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
at
java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at
net.jini.discovery.IncomingUnicastResponse.init(IncomingUnicastRespon
se.j
ava:78)
at
net.jini.discovery.LookupDiscovery$UnicastDiscoverer.run(LookupDiscover
y.ja
va:322)

=
Thanks and have great day
srini

___
_
Everything you always wanted to know about cars and bikes,now
 at: http://in.autos.yahoo.com

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


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




tomcat 4.0.3 servlet having problem loading class via rmi ?

2002-06-06 Thread java guru

Hi.,
  I am trying to access a JINI service thru my
servlet.. inspite of following Security Manager,
Policy file and setting codebase etc, tomcat 4.0.3
repeatedly give following excption.

The JINI service itself is working fine and other
standalone clients can access it.

Read somewhere that the protocol handler of tomcat had
problem but that was two years back.. 

Any insight to this would be of great help.

Thanks
srini


***
java.lang.ClassNotFoundException:
com.sun.jini.reggie.RegistrarProxy
at
java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at
java.security.AccessController.doPrivileged(Native
Method)
at
java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:207)
at
sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:427)
at
sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:159)
at
java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:629)
at
java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
at
sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:200)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1503)
at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1616)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
at
java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at
net.jini.discovery.IncomingUnicastResponse.init(IncomingUnicastResponse.java:78)
at 
net.jini.discovery.LookupDiscovery$UnicastDiscoverer.run(LookupDiscovery.java:322)

=
Thanks and have great day
srini


Everything you always wanted to know about cars and bikes,now
 at: http://in.autos.yahoo.com

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




Re: [repost] loading class files

2001-11-27 Thread Craig R. McClanahan



On Mon, 26 Nov 2001, Frank Lawlor wrote:

 Date: Mon, 26 Nov 2001 13:08:02 -0600
 From: Frank Lawlor [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED],
  [EMAIL PROTECTED]
 To: Tomcat (E-mail) [EMAIL PROTECTED]
 Subject: Re: [repost] loading class files

  Note on the other stuff: Classes used on the server
  side should be in a package structure under
  WEB-INF/classes to work correctly. JSPs,
  static content, and client-side applets should
  all be outside the WEB-INF folder for proper
  operation. This is defined in the spec and is
  required for all applications conforming to it.
  Hope this clears some mystery.
  --David Smith
 I cannot find any place in the spec that says that
 JSPs, etc. cannot be under WEB-INF.  I have seen
 many suggestions that this is a good place to put
 them to prevent direct access.  In what way doesn't
 this provide proper operation.

You can indeed put JSP pages inside the WEB-INF directory.  However,
such pages will *only* be accessible via a RequestDispatcher.forward() or
RequestDispatcher.include() call, not direct requests from clients.  This
technique is commonly used in MVC-based web applications to avoid the
possibility that users can type a URL of such a page directly.



 Frank Lawlor
 Athens Group, Inc.
 (512) 345-0600 x151
 Athens Group, an employee-owned consulting firm integrating technology
 strategy and software solutions.

Craig






 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: [repost] loading class files

2001-11-27 Thread David Smith

You're right.  The spec does not say jsps can not be stored under WEB-INF, 
but it does say and I quote the spec:

No file contained in the WEB-INF directory may be served directly to a 
client by the container -- Servlet 2.3 spec pg 60

Given that, what good is storing a .jsp (or .gif, jpg, pdf, etc, ...) file in 
WEB-INF if the client can't request it?  

IMHO, files the client directly request should be outside the WEB-INF 
directory.  Individual mileage may vary though.

--David

On Monday 26 November 2001 02:08 pm, you wrote:
  Note on the other stuff: Classes used on the server
  side should be in a package structure under
  WEB-INF/classes to work correctly. JSPs,
  static content, and client-side applets should
  all be outside the WEB-INF folder for proper
  operation. This is defined in the spec and is
  required for all applications conforming to it.
  Hope this clears some mystery.
  --David Smith

 I cannot find any place in the spec that says that
 JSPs, etc. cannot be under WEB-INF.  I have seen
 many suggestions that this is a good place to put
 them to prevent direct access.  In what way doesn't
 this provide proper operation.

 Frank Lawlor
 Athens Group, Inc.
 (512) 345-0600 x151
 Athens Group, an employee-owned consulting firm integrating technology
 strategy and software solutions.




 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: [repost] loading class files

2001-11-27 Thread DONNIE HALE

As Craig indicated in a message earlier this morning, the good of storing JSPs (in 
particular) under WEB-INF is if you want to enforce that they are only available via 
some kind of dispatching servlet which does a RequestDispatcher.forward or .include. 
In other words, if the application architecture is using something like Struts in 
which the direct execution of some JSPs will fail because they require other 
processing to have previously occurred, then you can make sure they're not 
accidentally served directly by putting them under WEB-INF.

Putting images under WEB-INF doesn't make much sense, as those are all, for the most 
part, implicitly requested by a browser when parsing a page's HTML. So almost all 
requests for images are served directly to a client.

Hope that's clear,

Donnie


 [EMAIL PROTECTED] 11/27/01 10:35AM 
You're right.  The spec does not say jsps can not be stored under WEB-INF, 
but it does say and I quote the spec:

No file contained in the WEB-INF directory may be served directly to a 
client by the container -- Servlet 2.3 spec pg 60

Given that, what good is storing a .jsp (or .gif, jpg, pdf, etc, ...) file in 
WEB-INF if the client can't request it?  

IMHO, files the client directly request should be outside the WEB-INF 
directory.  Individual mileage may vary though.

--David

On Monday 26 November 2001 02:08 pm, you wrote:
  Note on the other stuff: Classes used on the server
  side should be in a package structure under
  WEB-INF/classes to work correctly. JSPs,
  static content, and client-side applets should
  all be outside the WEB-INF folder for proper
  operation. This is defined in the spec and is
  required for all applications conforming to it.
  Hope this clears some mystery.
  --David Smith

 I cannot find any place in the spec that says that
 JSPs, etc. cannot be under WEB-INF.  I have seen
 many suggestions that this is a good place to put
 them to prevent direct access.  In what way doesn't
 this provide proper operation.

 Frank Lawlor
 Athens Group, Inc.
 (512) 345-0600 x151
 Athens Group, an employee-owned consulting firm integrating technology
 strategy and software solutions.




 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: [repost] loading class files

2001-11-27 Thread David Smith

I see Craig has answered on this.  Since he was involved in writing the spec, 
he's most certainly the better person to answer this.

Thanks Craig for the info.

--David

On Tuesday 27 November 2001 10:35 am, you wrote:
 You're right.  The spec does not say jsps can not be stored under WEB-INF,
 but it does say and I quote the spec:

 No file contained in the WEB-INF directory may be served directly to a
 client by the container -- Servlet 2.3 spec pg 60

 Given that, what good is storing a .jsp (or .gif, jpg, pdf, etc, ...) file
 in WEB-INF if the client can't request it?

 IMHO, files the client directly request should be outside the WEB-INF
 directory.  Individual mileage may vary though.

 --David

 On Monday 26 November 2001 02:08 pm, you wrote:
   Note on the other stuff: Classes used on the server
   side should be in a package structure under
   WEB-INF/classes to work correctly. JSPs,
   static content, and client-side applets should
   all be outside the WEB-INF folder for proper
   operation. This is defined in the spec and is
   required for all applications conforming to it.
   Hope this clears some mystery.
   --David Smith
 
  I cannot find any place in the spec that says that
  JSPs, etc. cannot be under WEB-INF.  I have seen
  many suggestions that this is a good place to put
  them to prevent direct access.  In what way doesn't
  this provide proper operation.
 
  Frank Lawlor
  Athens Group, Inc.
  (512) 345-0600 x151
  Athens Group, an employee-owned consulting firm integrating technology
  strategy and software solutions.
 
 
 
 
  --
  To unsubscribe:   mailto:[EMAIL PROTECTED]
  For additional commands: mailto:[EMAIL PROTECTED]
  Troubles with the list: mailto:[EMAIL PROTECTED]

 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: [repost] loading class files

2001-11-26 Thread Frank Lawlor

 Note on the other stuff: Classes used on the server 
 side should be in a package structure under 
 WEB-INF/classes to work correctly. JSPs, 
 static content, and client-side applets should 
 all be outside the WEB-INF folder for proper 
 operation. This is defined in the spec and is 
 required for all applications conforming to it. 
 Hope this clears some mystery. 
 --David Smith 
I cannot find any place in the spec that says that
JSPs, etc. cannot be under WEB-INF.  I have seen
many suggestions that this is a good place to put
them to prevent direct access.  In what way doesn't
this provide proper operation.

Frank Lawlor
Athens Group, Inc.
(512) 345-0600 x151
Athens Group, an employee-owned consulting firm integrating technology
strategy and software solutions.




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: [repost] loading class files

2001-11-20 Thread Satish Talim

Hi,

As suggested, I have unjarred the downloaded MySQL JDBC driver jar file and 
placed it in H:\jakarta-tomcat-4.0.1\webapps\netaps\WEB-INF\classes 
directory along with its package structure. It now works ie. the Driver 
class is found but somehow fails to register with the DriverManager class - 
all sorts of exceptions are raised. Any idea what could be the problem?

My servlet uses JDBC and throws a page with an applet. Then via 
HttpURLConnection I have to do applet/servlet communication...


Amit Lonkar

[...]

I use this setup on my linux box (TC 4.0.1, MySQL JDBC, Mandrake 8).  The
only issue I've ever had with the driver is the downloaded MySQL JDBC driver
file needs to be unjarred.  The .jar file nested inside is the actual JDBC
driver.  Place it in WEB-INF/lib and restart Tomcat so it can find the file.
Alternatively, this file can be in CATALINA_BASE$/lib or
CATALINA_BASE$/common/lib if you want it available to all your apps or all
your apps and Tomcat itself respectively.

Note on the other stuff:  Classes used on the server side should be in a
package structure under WEB-INF/classes to work correctly.  JSPs, static
content, and client-side applets should all be outside the WEB-INF folder for
proper operation.  This is defined in the spec and is required for all
applications conforming to it.

Hope this clears some mystery.

--David Smith


__
Quick Heal Eudora Plugin has scanned email for known viruses, trojans and worms.
www.quickheal.com 



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: [repost] loading class files

2001-11-19 Thread Bo Xu

- Original Message -
From: Yiu Wing [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Monday, November 19, 2001 1:58 AM
Subject: Re: [repost] loading class files


  I suggest you put YourApplet.class together with your
  html/image or other static contents), for ex. :
  webapps/yourapp0/staticContent/
  (staticContent is a folder made by you)

 Thanks very much for your reply and reference email. Yeah, I have to
create
 an extra directory to store all my class files, and I also have to
unzipped
 the JDBC driver in order to get my jsp applet running. But from one of the
 Tomcat's docs, which is tomcat-docs\appdev\deployment.html, in its mid
page
 says,

 /WEB-INF/lib/ - This directory contains JAR files that contain Java class
 files (and associated resources) required for your application, such as
 third party class libraries or JDBC drivers.

 I've copied my JDBC driver there, but it just won't work.  My citation is
 just the opposite of your reference email, which says that JAR files are
 static content and can't be place under /WEB-INF.  Since my applet is
 running now, and so think the docs could be wrong or haven't covered this
 topic completely. I hope someone could look this up.

 Anyway, thanks very much for your email again.  You have saved me!
[...]





Thanks for your thanking!  :-)

BTW, there are two kinds of class/jar in a webapp:
  - for Servlet/jsp(it works in server-side)
  - for Applet or other static content(it will be downloaded to
client together with Applet class, and works in client-side)

I think the reference email means:
   - class/jar for Servlet/jsp itself should be put under WEB-INF
   - class/jar for static content should Not be put under WEB-INF

I think your JDBC driver is used by your JSP directly, it works in
server-side, (it is not downloaded together with  your Applat and
work in client-side), so now, as you say, your JDBC driver should
be put in WEB-INF/lib.


Bo
Nov19, 2001



 
  reference email :-)
  
   In which directory of the Tomcat installation do we copy the html and
   applet classes?
 
  I suggest you also read the Application Developer's Guide included with
  Tomcat.  The Tomcat 4 version is also online at:
 
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/
 
  From the point of view of the server, applet classes and JAR files are
  just static content.  Therefore, they should be placed in the same
  directory as your static HTML pages, ***not*** under /WEB-INF.
 
   Amit Lonkar
  
 
  Craig McClanahan
  
 
 
 
  Bo
  Nov.18, 2001
 
 
 
 
  - Original Message -
  From: Yiu Wing [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, November 19, 2001 12:41 AM
  Subject: [repost] loading class files
 
 
   Sorry guys this is a repost. But after doing numerous google search
and
   wading through the docs, I still can't solve my problem with regard to
   loading applet classes. I sincerely hope some of you can help me this
  time,
   I desperately need to get this working.  The same message is as
follow.
  
   Hello All,
  
   I'm writing an applet that uses JDBC to connect to MySQL server , and
 the
   applet is embedded in a jsp.  I'm new to this, so I went on and read
the
   docs that come with Tomcat.  I'm also using CVS and ant for the
  development.
   The source code layout of my project is as suggested in the docs,
which
 is
  
   project name
 |- docs
 |- src
 |- web
   |--WEB-INF
  
   In the project/web/WEB-INF directory, do I have to create a classes
and
  lib
   subdirectories?  The reason I ask this is because the class loader,
from
  the
   Tomcat or web browser, can't find the class files.  But they're
clearly
 in
   the web directory, whose structure is as,
  
   project
 | login.jsp (that's the jsp file that embeds the applet)
 | WEB-INF
   |--- classes (this directory has
all
  the
   needed class files)
   |--- lib (where the MySQL driver
is
   stored)
  
   The Tomcat docs says the classes and lib dir are made visible to
other
   classes within your particular web application, but why my class
files
   can't be loaded there?  If I move all the class files to the top of
the
  web
   directory, and change code=MyClass.class  to code=MyClass in
the
  jsp
   file, then everything seems to working OK. Oh, yeah, almost forgot, I
 also
   need to copy the whole directory tree for the driver to the web
 directory
  as
   well.  Setting the classpath for the driver doesn't work.  I don't
want
 to
   copy the class files to the top of the web directory every time, can
 those
   file be loaded in the classes and lib directories.  Sorry about

Re: [repost] loading class files

2001-11-19 Thread David Smith

I use this setup on my linux box (TC 4.0.1, MySQL JDBC, Mandrake 8).  The 
only issue I've ever had with the driver is the downloaded MySQL JDBC driver 
file needs to be unjarred.  The .jar file nested inside is the actual JDBC 
driver.  Place it in WEB-INF/lib and restart Tomcat so it can find the file.  
Alternatively, this file can be in CATALINA_BASE$/lib or 
CATALINA_BASE$/common/lib if you want it available to all your apps or all 
your apps and Tomcat itself respectively.

Note on the other stuff:  Classes used on the server side should be in a 
package structure under WEB-INF/classes to work correctly.  JSPs, static 
content, and client-side applets should all be outside the WEB-INF folder for 
proper operation.  This is defined in the spec and is required for all 
applications conforming to it.

Hope this clears some mystery.

--David Smith

On Monday 19 November 2001 12:41 am, you wrote:
 Sorry guys this is a repost. But after doing numerous google search and
 wading through the docs, I still can't solve my problem with regard to
 loading applet classes. I sincerely hope some of you can help me this time,
 I desperately need to get this working.  The same message is as follow.

 Hello All,

 I'm writing an applet that uses JDBC to connect to MySQL server , and the
 applet is embedded in a jsp.  I'm new to this, so I went on and read the
 docs that come with Tomcat.  I'm also using CVS and ant for the
 development. The source code layout of my project is as suggested in the
 docs, which is

 project name

   |- docs
   |- src
   |- web
   |
 |--WEB-INF

 In the project/web/WEB-INF directory, do I have to create a classes and lib
 subdirectories?  The reason I ask this is because the class loader, from
 the Tomcat or web browser, can't find the class files.  But they're clearly
 in the web directory, whose structure is as,

 project

   | login.jsp (that's the jsp file that embeds the applet)
   | WEB-INF
   |
 |--- classes (this directory has all
 | the

 needed class files)

 |--- lib (where the MySQL driver is

 stored)

 The Tomcat docs says the classes and lib dir are made visible to other
 classes within your particular web application, but why my class files
 can't be loaded there?  If I move all the class files to the top of the web
 directory, and change code=MyClass.class  to code=MyClass in the
 jsp file, then everything seems to working OK. Oh, yeah, almost forgot, I
 also need to copy the whole directory tree for the driver to the web
 directory as well.  Setting the classpath for the driver doesn't work.  I
 don't want to copy the class files to the top of the web directory every
 time, can those file be loaded in the classes and lib directories.  Sorry
 about this rather long message, but I'm getting very frustrated and hopping
 some of you can help me with this.

 Thanks for your help in advance.

 P.S. I'm using Tomcat4.0 on Win2000





 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: [repost] loading class files

2001-11-19 Thread Yiu Wing

[...]
  But from one of the
  Tomcat's docs, which is tomcat-docs\appdev\deployment.html, in its mid
 page
  says,
 
  /WEB-INF/lib/ - This directory contains JAR files that contain Java
class
  files (and associated resources) required for your application, such as
  third party class libraries or JDBC drivers.
 
  I've copied my JDBC driver there, but it just won't work.  My citation
is
  just the opposite of your reference email, which says that JAR files are
  static content and can't be place under /WEB-INF.  Since my applet is
  running now, and so think the docs could be wrong or haven't covered
this
  topic completely. I hope someone could look this up.
 
  Anyway, thanks very much for your email again.  You have saved me!
 [...]


 Thanks for your thanking!  :-)

I was very frustrated, I was trying to get this working for a week and I
didn't get anywhere, that's why the big thanks ;-).

 BTW, there are two kinds of class/jar in a webapp:
   - for Servlet/jsp(it works in server-side)
   - for Applet or other static content(it will be downloaded to
 client together with Applet class, and works in client-side)

 I think the reference email means:
- class/jar for Servlet/jsp itself should be put under WEB-INF
- class/jar for static content should Not be put under WEB-INF

 I think your JDBC driver is used by your JSP directly, it works in
 server-side, (it is not downloaded together with  your Applat and
 work in client-side), so now, as you say, your JDBC driver should
 be put in WEB-INF/lib.


I'm just wondering the JDBC driver is working on the client side, cos' if I
place the driver jar file in WEB-INF/lib directory then it can't be found.
I've also tried the common/lib directory, as the other helpful folk
suggested, and it can't be found there, either.  I've actually embedded my
database connection in the applet, so it does look like I should place the
driver on a separate directory.


[snip]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: [repost] loading class files

2001-11-19 Thread Yiu Wing


 I use this setup on my linux box (TC 4.0.1, MySQL JDBC, Mandrake 8).  The
 only issue I've ever had with the driver is the downloaded MySQL JDBC
driver
 file needs to be unjarred.  The .jar file nested inside is the actual JDBC
 driver.  Place it in WEB-INF/lib and restart Tomcat so it can find the
file.
 Alternatively, this file can be in CATALINA_BASE$/lib or
 CATALINA_BASE$/common/lib if you want it available to all your apps or all
 your apps and Tomcat itself respectively.

My applet uses the JDBC directly, so I've unjarred the driver and everything
works fine now.  Thanks for clearing things up for me.

 Note on the other stuff:  Classes used on the server side should be in a
 package structure under WEB-INF/classes to work correctly.  JSPs, static
 content, and client-side applets should all be outside the WEB-INF folder
for
 proper operation.  This is defined in the spec and is required for all
 applications conforming to it.

 Hope this clears some mystery.

 --David Smith

 On Monday 19 November 2001 12:41 am, you wrote:
  Sorry guys this is a repost. But after doing numerous google search and
  wading through the docs, I still can't solve my problem with regard to
  loading applet classes. I sincerely hope some of you can help me this
time,
  I desperately need to get this working.  The same message is as follow.
 
  Hello All,
 
  I'm writing an applet that uses JDBC to connect to MySQL server , and
the
  applet is embedded in a jsp.  I'm new to this, so I went on and read the
  docs that come with Tomcat.  I'm also using CVS and ant for the
  development. The source code layout of my project is as suggested in the
  docs, which is
 
  project name
 
|- docs
|- src
|- web
|
  |--WEB-INF
 
  In the project/web/WEB-INF directory, do I have to create a classes and
lib
  subdirectories?  The reason I ask this is because the class loader, from
  the Tomcat or web browser, can't find the class files.  But they're
clearly
  in the web directory, whose structure is as,
 
  project
 
| login.jsp (that's the jsp file that embeds the applet)
| WEB-INF
|
  |--- classes (this directory has all
  | the
 
  needed class files)
 
  |--- lib (where the MySQL driver is
 
  stored)
 
  The Tomcat docs says the classes and lib dir are made visible to other
  classes within your particular web application, but why my class files
  can't be loaded there?  If I move all the class files to the top of the
web
  directory, and change code=MyClass.class  to code=MyClass in the
  jsp file, then everything seems to working OK. Oh, yeah, almost forgot,
I
  also need to copy the whole directory tree for the driver to the web
  directory as well.  Setting the classpath for the driver doesn't work.
I
  don't want to copy the class files to the top of the web directory every
  time, can those file be loaded in the classes and lib directories.
Sorry
  about this rather long message, but I'm getting very frustrated and
hopping
  some of you can help me with this.
 
  Thanks for your help in advance.
 
  P.S. I'm using Tomcat4.0 on Win2000
 



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




[repost] loading class files

2001-11-18 Thread Yiu Wing

Sorry guys this is a repost. But after doing numerous google search and
wading through the docs, I still can't solve my problem with regard to
loading applet classes. I sincerely hope some of you can help me this time,
I desperately need to get this working.  The same message is as follow.

Hello All,

I'm writing an applet that uses JDBC to connect to MySQL server , and the
applet is embedded in a jsp.  I'm new to this, so I went on and read the
docs that come with Tomcat.  I'm also using CVS and ant for the development.
The source code layout of my project is as suggested in the docs, which is

project name
  |- docs
  |- src
  |- web
|--WEB-INF

In the project/web/WEB-INF directory, do I have to create a classes and lib
subdirectories?  The reason I ask this is because the class loader, from the
Tomcat or web browser, can't find the class files.  But they're clearly in
the web directory, whose structure is as,

project
  | login.jsp (that's the jsp file that embeds the applet)
  | WEB-INF
|--- classes (this directory has all the
needed class files)
|--- lib (where the MySQL driver is
stored)

The Tomcat docs says the classes and lib dir are made visible to other
classes within your particular web application, but why my class files
can't be loaded there?  If I move all the class files to the top of the web
directory, and change code=MyClass.class  to code=MyClass in the jsp
file, then everything seems to working OK. Oh, yeah, almost forgot, I also
need to copy the whole directory tree for the driver to the web directory as
well.  Setting the classpath for the driver doesn't work.  I don't want to
copy the class files to the top of the web directory every time, can those
file be loaded in the classes and lib directories.  Sorry about this rather
long message, but I'm getting very frustrated and hopping some of you can
help me with this.

Thanks for your help in advance.

P.S. I'm using Tomcat4.0 on Win2000





--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: [repost] loading class files

2001-11-18 Thread Bo Xu

I suggest you put YourApplet.class together with your
html/image or other static contents), for ex. :
webapps/yourapp0/staticContent/
(staticContent is a folder made by you)


reference email :-)

 In which directory of the Tomcat installation do we copy the html and
 applet classes?

I suggest you also read the Application Developer's Guide included with
Tomcat.  The Tomcat 4 version is also online at:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/

From the point of view of the server, applet classes and JAR files are
just static content.  Therefore, they should be placed in the same
directory as your static HTML pages, ***not*** under /WEB-INF.

 Amit Lonkar


Craig McClanahan




Bo
Nov.18, 2001




- Original Message -
From: Yiu Wing [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 19, 2001 12:41 AM
Subject: [repost] loading class files


 Sorry guys this is a repost. But after doing numerous google search and
 wading through the docs, I still can't solve my problem with regard to
 loading applet classes. I sincerely hope some of you can help me this
time,
 I desperately need to get this working.  The same message is as follow.

 Hello All,

 I'm writing an applet that uses JDBC to connect to MySQL server , and the
 applet is embedded in a jsp.  I'm new to this, so I went on and read the
 docs that come with Tomcat.  I'm also using CVS and ant for the
development.
 The source code layout of my project is as suggested in the docs, which is

 project name
   |- docs
   |- src
   |- web
 |--WEB-INF

 In the project/web/WEB-INF directory, do I have to create a classes and
lib
 subdirectories?  The reason I ask this is because the class loader, from
the
 Tomcat or web browser, can't find the class files.  But they're clearly in
 the web directory, whose structure is as,

 project
   | login.jsp (that's the jsp file that embeds the applet)
   | WEB-INF
 |--- classes (this directory has all
the
 needed class files)
 |--- lib (where the MySQL driver is
 stored)

 The Tomcat docs says the classes and lib dir are made visible to other
 classes within your particular web application, but why my class files
 can't be loaded there?  If I move all the class files to the top of the
web
 directory, and change code=MyClass.class  to code=MyClass in the
jsp
 file, then everything seems to working OK. Oh, yeah, almost forgot, I also
 need to copy the whole directory tree for the driver to the web directory
as
 well.  Setting the classpath for the driver doesn't work.  I don't want to
 copy the class files to the top of the web directory every time, can those
 file be loaded in the classes and lib directories.  Sorry about this
rather
 long message, but I'm getting very frustrated and hopping some of you can
 help me with this.

 Thanks for your help in advance.

 P.S. I'm using Tomcat4.0 on Win2000





 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]





--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: [repost] loading class files

2001-11-18 Thread Yiu Wing

 I suggest you put YourApplet.class together with your
 html/image or other static contents), for ex. :
 webapps/yourapp0/staticContent/
 (staticContent is a folder made by you)

Thanks very much for your reply and reference email. Yeah, I have to create
an extra directory to store all my class files, and I also have to unzipped
the JDBC driver in order to get my jsp applet running. But from one of the
Tomcat's docs, which is tomcat-docs\appdev\deployment.html, in its mid page
says,

/WEB-INF/lib/ - This directory contains JAR files that contain Java class
files (and associated resources) required for your application, such as
third party class libraries or JDBC drivers.

I've copied my JDBC driver there, but it just won't work.  My citation is
just the opposite of your reference email, which says that JAR files are
static content and can't be place under /WEB-INF.  Since my applet is
running now, and so think the docs could be wrong or haven't covered this
topic completely. I hope someone could look this up.

Anyway, thanks very much for your email again.  You have saved me!


 reference email :-)
 
  In which directory of the Tomcat installation do we copy the html and
  applet classes?

 I suggest you also read the Application Developer's Guide included with
 Tomcat.  The Tomcat 4 version is also online at:

   http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/

 From the point of view of the server, applet classes and JAR files are
 just static content.  Therefore, they should be placed in the same
 directory as your static HTML pages, ***not*** under /WEB-INF.

  Amit Lonkar
 

 Craig McClanahan
 



 Bo
 Nov.18, 2001




 - Original Message -
 From: Yiu Wing [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, November 19, 2001 12:41 AM
 Subject: [repost] loading class files


  Sorry guys this is a repost. But after doing numerous google search and
  wading through the docs, I still can't solve my problem with regard to
  loading applet classes. I sincerely hope some of you can help me this
 time,
  I desperately need to get this working.  The same message is as follow.
 
  Hello All,
 
  I'm writing an applet that uses JDBC to connect to MySQL server , and
the
  applet is embedded in a jsp.  I'm new to this, so I went on and read the
  docs that come with Tomcat.  I'm also using CVS and ant for the
 development.
  The source code layout of my project is as suggested in the docs, which
is
 
  project name
|- docs
|- src
|- web
  |--WEB-INF
 
  In the project/web/WEB-INF directory, do I have to create a classes and
 lib
  subdirectories?  The reason I ask this is because the class loader, from
 the
  Tomcat or web browser, can't find the class files.  But they're clearly
in
  the web directory, whose structure is as,
 
  project
| login.jsp (that's the jsp file that embeds the applet)
| WEB-INF
  |--- classes (this directory has all
 the
  needed class files)
  |--- lib (where the MySQL driver is
  stored)
 
  The Tomcat docs says the classes and lib dir are made visible to other
  classes within your particular web application, but why my class files
  can't be loaded there?  If I move all the class files to the top of the
 web
  directory, and change code=MyClass.class  to code=MyClass in the
 jsp
  file, then everything seems to working OK. Oh, yeah, almost forgot, I
also
  need to copy the whole directory tree for the driver to the web
directory
 as
  well.  Setting the classpath for the driver doesn't work.  I don't want
to
  copy the class files to the top of the web directory every time, can
those
  file be loaded in the classes and lib directories.  Sorry about this
 rather
  long message, but I'm getting very frustrated and hopping some of you
can
  help me with this.
 
  Thanks for your help in advance.
 
  P.S. I'm using Tomcat4.0 on Win2000
 
 
 
 
 
  --
  To unsubscribe:   mailto:[EMAIL PROTECTED]
  For additional commands: mailto:[EMAIL PROTECTED]
  Troubles with the list: mailto:[EMAIL PROTECTED]
 
 



 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Loading class files

2001-11-14 Thread Yiu Wing

Hello All,

I'm writing an applet that uses JDBC to connect to MySQL server , and the
applet is embedded in a jsp.  I'm new to this, so I went on and read the
docs that come with Tomcat.  I'm also using CVS and ant for the development.
The source code layout of my project is as suggested in the docs, which is

project name
  |- docs
  |- src
  |- web
|--WEB-INF

In the project/web/WEB-INF directory, do I have to create a classes and lib
subdirectories?  The reason I ask this is because the class loader, from the
Tomcat or web browser, can't find the class files.  But they're clearly in
the web directory, whose structure is as,

project
  | login.jsp (that's the jsp file that embeds the applet)
  | WEB-INF
|--- classes (this directory has all the
needed class files)
|--- lib (where the MySQL driver is
stored)

The Tomcat docs says the classes and lib dir are made visible to other
classes within your particular web application, but why my class files
can't be loaded there?  If I move all the class files to the top of the web
directory, and change code=MyClass.class  to code=MyClass in the jsp
file, then everything seems to working OK. Oh, yeah, almost forgot, I also
need to copy the whole directory tree for the driver to the web directory as
well.  Setting the classpath for the driver doesn't work.  I don't want to
copy the class files to the top of the web directory every time, can those
file be loaded in the classes and lib directories.  Sorry about this rather
long message, but I'm getting very frustrated and hopping some of you can
help me with this.

Thanks for your help in advance.

P.S. I'm using Tomcat4.0 on Win2000




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]