RE: other files than jsp not processed by tomcat+mod_jk+apache

2001-07-07 Thread Greg Trasuk

Hi Carlos:

As I understand it, you want the JSP/servlet pages processed through Tomcat,
but other files handled by Apache - correct?

If so, then is it possible that Apache doesn't know where to find the other
files?  You need to have a mapping like this in your httpd.conf:

Alias /mycontext /path-to-mycontext/web

You may also have to set options on the directory, depending on the setup of
your Apache server.  Tomcat automatically generates configuration options
for Apache when it starts up - see conf/tomcat-apache.conf.  In most cases
you can simply use Apache's Include directive to include this file in your
Apache configuration.  If your setup is more complicated (e.g. virtual
hosts), at least the tomcat-apache.conf gives you a decent starting point.

Greg Trasuk.
StratusCom Manufacturing Systems - We use technology to turn information to
profits on your plant floor.
http://stratuscom.ca

-Original Message-
From: Carlos Ferrão [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 10:26 PM
To: [EMAIL PROTECTED]
Subject: RE: other files than jsp not processed by tomcat+mod_jk+apache



Hi,
My http.conf loads the mod_jk.conf file in tomcat/conf. This file has a
/mycontext/*.jsp ajp12
The jsp's are executing through apache fine. Other files like html/gif's are
not found under my subcontext. The result is a page with my jsp processed
but without images and proper CSS formatting.
My WAR file has:

/mycontext
|
.jsp
|
.html
|
.css
|
|__/images
|logo.gif

Best Regards,
Carlos Ferrao


-Original Message-
From: Vinay Menon [mailto:[EMAIL PROTECTED]]
Sent: sábado, 7 de Julho de 2001 12:53
To: [EMAIL PROTECTED]
Subject: Re: other files than jsp not processed by tomcat+mod_jk+apache


your httpd.conf should explicitly say /context/*.jsp I believe.
- Original Message -
From: "Carlos Ferrão" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 07, 2001 6:08 AM
Subject: other files than jsp not processed by tomcat+mod_jk+apache


>
> Hello list,
>
> I'm running Tomcat3.2.2 embedded in JBoss.
> I integrated tomcat with apache through mod_jk in order to avoid
> http://url:8080 port specification and to make apache process the html.
>
> My problem is that under a context in Tomcat only the jsp files are
> processed. It doesn't find any images or html files and it doesn't process
> them. How should I configure tomcat so .jsp files are processed by tomcat
> but html/images files under my tomcat context are processed by apache??
>
> If I access to my context through http://url:8080/mycontext, tomcat's http
> port everything runs fine.
> My war file is deployed in Jboss's deploy dir but this shouldn't be a
> problem.
>
> Yours desperate,
> Carlos Ferrao
>





RE: Problem

2001-07-07 Thread

Very often this is caused by errors in your TOMCAT_HOME - perhaps you have
spaces in the directory names? While this is not a problem for Tomcat in
general, somehow you can't have spaces in the TOMCAT_HOME in your
wrapper.properties.

Try moving Tomcat to a path without spaces in directory names and then
modify the env. variables and try.  That should do the trick.

Cheerioh!



Emir.

-Original Message-
From: molu molu [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 4:51 PM
To: [EMAIL PROTECTED]
Subject: Problem


Hi Dear

My Problem about Tomcat for NT service, i make all the changes needed ,
and when i type this command (net start Tomcat) , where tomcat is the 
service name
this message appear
( The tomcat service could not be started
  The service did not report an error ).

So any help will be appreciated, and please i need it As soon As possible.

Best Regards
Mohammad Jamous

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.



RE: other files than jsp not processed by tomcat+mod_jk+apache

2001-07-07 Thread Carlos Ferrão


Hi,
My http.conf loads the mod_jk.conf file in tomcat/conf. This file has a
/mycontext/*.jsp ajp12
The jsp's are executing through apache fine. Other files like html/gif's are
not found under my subcontext. The result is a page with my jsp processed
but without images and proper CSS formatting.
My WAR file has:

/mycontext
|
.jsp
|
.html
|
.css
|
|__/images
|logo.gif

Best Regards,
Carlos Ferrao


-Original Message-
From: Vinay Menon [mailto:[EMAIL PROTECTED]]
Sent: sábado, 7 de Julho de 2001 12:53
To: [EMAIL PROTECTED]
Subject: Re: other files than jsp not processed by tomcat+mod_jk+apache


your httpd.conf should explicitly say /context/*.jsp I believe.
- Original Message -
From: "Carlos Ferrão" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 07, 2001 6:08 AM
Subject: other files than jsp not processed by tomcat+mod_jk+apache


>
> Hello list,
>
> I'm running Tomcat3.2.2 embedded in JBoss.
> I integrated tomcat with apache through mod_jk in order to avoid
> http://url:8080 port specification and to make apache process the html.
>
> My problem is that under a context in Tomcat only the jsp files are
> processed. It doesn't find any images or html files and it doesn't process
> them. How should I configure tomcat so .jsp files are processed by tomcat
> but html/images files under my tomcat context are processed by apache??
>
> If I access to my context through http://url:8080/mycontext, tomcat's http
> port everything runs fine.
> My war file is deployed in Jboss's deploy dir but this shouldn't be a
> problem.
>
> Yours desperate,
> Carlos Ferrao
>





RE: Help on application scope

2001-07-07 Thread Michael Wentzel

>   I tried to do a Singleton Instance of a class containing a 
> Hashmap of
> entried mapping IPs to session objects to be used later for session
> invalidation. I instantiate the singleton instance with a 
> generic servlet,
> but I dont think it worked when I started the server because 
> I didnt see my
> println message when I started the server, and I can when I 
> call the servlet
> explicitly. How do I know if I correctly setup the servlet to 
> startup when
> the server starts?

If you don't already you can put debug output into your Servlet's
init() method.  The method gets called whenever an instance of a
Servlet is created.

> Also, having a singleton instance, do I still need to import 
> the class in
> the jsp page I use it in? Should it find it anyways if I dont?

Yes, even though you have an instance classes(jsp's are classes in
the end) have to know where to look for the definition of other classes.
Therefore you can either
a) import the class
b) refer to the fully qualified class name(including package) everytime
   you refer to the class.

> Also, when I do put it in the import, for some reason the 
> singleton instance
> is intantiated twice in different JSP pages, thus furthering 
> my belief that
> this class was created possibly in the first JSP page and 
> discarded, then
> recreated in the second JSP page. Somebody help, This is 
> getting ridiculous
> I originally tried this with application scope but it couldnt find the
> instance in another jsp page though it was in the same application.

The second instance is more than likely because of your servlet mapping.
One instance is created for every mapping in you webapp plus one for the 
default /servlet/ServletName mapping.  You don't really need any mappings
because you don't really need an HttpServlet if I understand you application
appropriately.

My idea went more along these lines

public class MyServlet extends javax.servlet.GenericServlet {
public void init(ServletConfig config) throws ServletException {
this.config = config;
log("init");
this.init();
}

public void init() throws ServletException {
  MyClass.initialize();
}
}

public class MyClass {
public static java.util.Map myMap = null;
public static void initialize() {
  if (myMap == null) { myMap = new HashMap(); }
  /* any other init goes here */
}

/* static accessor/modifier methods go here */
}


Then your jsp's would import MyClass and reference the static accessor/
modifier methods as necessary.  The static map will ensure that there is
only one instance of the session mapping per JVM(note that this is
significant since you can ONLY be assured that there is one instance of
the map for each JVM, hence the importance of only having one servlet
mapping for your servlet.)

I don't know exactly what you're trying to accomplish in your app but if
you are trying to manager HttpSession invalidation you might want to 
check out javax.servlet.http.HttpSessionBindingListener and the valueUnbound
method in this class.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Servlet File upload Oreily MultipartParser problems

2001-07-07 Thread Randy Paries

I found out what it was

in jBuilder I was using tomcat but ajp12

in production i was using ajp13

I upgrading the linux box to tomcat 3.2.2 and life is fine again.

Thanks

-Original Message-
From: Peter Davison [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 11:16 AM
To: [EMAIL PROTECTED]
Subject: Re: Servlet File upload Oreily MultipartParser problems


I've got it to work on Linux but only using Tomcat stand-alone, not with
apache.

If I understand correctly, you are getting the input stream from the
request directly - "req.getInputStream()".

My understanding on how the MultipartParser works is that you instantiate
a MultipartParser giving it the request, then iterate through the parts
handling
the ParamParts one way and the FileParts another.  Something like:

MultipartParser mp = new MultipartParser(request, ...)
Part p = null;
while ((p = mp.readNextPart()) != null)
{
if p is a paramPart ...
else if p is a filePart
{
FilePart fp = (FilePart) p;
InputStream is = fp.getInputStream();

}
}

So each FilePart has it's own inputStream.

Not sure what the "Y"s you are seeing mean, but the above works for me.

Regards,
Pete.
Thus spake "Randy Paries" <[EMAIL PROTECTED]> on Sat, 7 Jul 2001
09:11:53 -0500:

RP> Hello,
RP>
RP> does anyone have the Oreily MultipartParser file upload working with
Tomcat
RP> and apache on Linux.
RP>
RP> I have developed this upload servlet using Jbuilder 4 and Win2000. The
RP> servlet works with the Jbuilder debugger(tomcat 3.1) and jrun. But is
does
RP> work when I push it to my production linux box.
RP>
RP> When I execute the form to upload the image on the linux box, the form
just
RP> hangs.
RP>
RP> what is strange is that every time
RP> ServletInputStream in = req.getInputStream();
RP> is called I get a "Y" printed on the console.
RP>
RP> Do anyone have this working on the linux config?
RP>
RP> has anyone seen a similar problem?
RP>
RP> Thanks
RP>
RP> Randy
RP>




RE: need some help on tomcat-oracle

2001-07-07 Thread Chauhan, Anand



Praveen,
 
You 
could use Servlets + JDBC to connect to the Oracle DB.. better still 
try using an App Server(Weblogic) to connect to it. Let me know if any of these 
don't work out. 
 
-Andy

  -Original Message-From: praveen 
  [mailto:[EMAIL PROTECTED]]Sent: Friday, July 06, 2001 10:35 
  PMTo: [EMAIL PROTECTED]Subject: need some 
  help on tomcat-oracle
  Hi
  I am very new to linux 
  environment..Recently i downloaded tomcat and installed on my linuxbox...Now i 
  want to configure connectivity between tomcat and oracle database...Anybody 
  pls help me out how to do this and the classpath variables and any other 
  settings to configure...
  Pls do needful...
   
  Thanks & Regards
  Praveen


calling a config file from bean

2001-07-07 Thread Batsheva Raviv

has anyone wrote a method to read a config file from a bean?
how can I call a config file from the bean.
if I use Servlet I can use the web.xml file, but I call a bean file from the
jsp page.
where should I put the config file? do I have to hard code the path to the
config file.



Thank you,
Batsheva




Re: Servlet File upload Oreily MultipartParser problems

2001-07-07 Thread Peter Davison

I've got it to work on Linux but only using Tomcat stand-alone, not with
apache.

If I understand correctly, you are getting the input stream from the
request directly - "req.getInputStream()".

My understanding on how the MultipartParser works is that you instantiate 
a MultipartParser giving it the request, then iterate through the parts handling
the ParamParts one way and the FileParts another.  Something like:

MultipartParser mp = new MultipartParser(request, ...)
Part p = null;
while ((p = mp.readNextPart()) != null)
{
if p is a paramPart ...
else if p is a filePart
{
FilePart fp = (FilePart) p;
InputStream is = fp.getInputStream();

}
}

So each FilePart has it's own inputStream.

Not sure what the "Y"s you are seeing mean, but the above works for me.

Regards,
Pete.
Thus spake "Randy Paries" <[EMAIL PROTECTED]> on Sat, 7 Jul 2001 09:11:53 -0500:

RP> Hello,
RP> 
RP> does anyone have the Oreily MultipartParser file upload working with Tomcat
RP> and apache on Linux.
RP> 
RP> I have developed this upload servlet using Jbuilder 4 and Win2000. The
RP> servlet works with the Jbuilder debugger(tomcat 3.1) and jrun. But is does
RP> work when I push it to my production linux box.
RP> 
RP> When I execute the form to upload the image on the linux box, the form just
RP> hangs.
RP> 
RP> what is strange is that every time
RP> ServletInputStream in = req.getInputStream();
RP> is called I get a "Y" printed on the console.
RP> 
RP> Do anyone have this working on the linux config?
RP> 
RP> has anyone seen a similar problem?
RP> 
RP> Thanks
RP> 
RP> Randy
RP> 



Servlet File upload Oreily MultipartParser problems

2001-07-07 Thread Randy Paries

Hello,

does anyone have the Oreily MultipartParser file upload working with Tomcat
and apache on Linux.

I have developed this upload servlet using Jbuilder 4 and Win2000. The
servlet works with the Jbuilder debugger(tomcat 3.1) and jrun. But is does
work when I push it to my production linux box.

When I execute the form to upload the image on the linux box, the form just
hangs.

what is strange is that every time
ServletInputStream in = req.getInputStream();
is called I get a "Y" printed on the console.

Do anyone have this working on the linux config?

has anyone seen a similar problem?

Thanks

Randy





Problem

2001-07-07 Thread molu molu

Hi Dear

My Problem about Tomcat for NT service, i make all the changes needed ,
and when i type this command (net start Tomcat) , where tomcat is the 
service name
this message appear
( The tomcat service could not be started
  The service did not report an error ).

So any help will be appreciated, and please i need it As soon As possible.

Best Regards
Mohammad Jamous

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




Re: Problem running servlets on Apache/Tomcat

2001-07-07 Thread Vinay Menon

Make sure that your connectio pool class is under the correct directory
structure under WEB-INF/classes. For eg. if your ConnectionPool class is in
uk.co.youconame.dbclasses.ConnectionPool make sure that it exists under  the
directory

WEB-INF/classes/uk/co/yourconame/dbclasses/

Vinay
- Original Message -
From: "Priya Gupta" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 07, 2001 12:02 AM
Subject: Problem running servlets on Apache/Tomcat


> Hi
>   This query has been posted on this list quite a no.
> of times and even after going through the archives I'm
> still stuck up with this problem!
>   To start with the configuration... I'm working
> Windows 2000 professional with Tomcat 3.2.2 and Apache
> 1.3.20. The backend is Oracle 8.1.6.
>   I have an application called 'portfolio' for which I
> created a folder in C:\TOMCAT_HOME\webapps called
> portfolio with a hierarchy of other directories
> required, like
> C:\TOMCAT_HOME\webapps\portfolio\WEB-INF where I
> copied the web.xml and
> C:\TOMCAT_HOME\webapps\portfolio\WEB-INF\classes where
> I put all the servlet classes. I have put all the
> other files like htmls, images etc. in the
> C:\TOMCAT_HOME\webapps\portfolio directory! and not to
> forget the C:\TOMCAT_HOME\webapps\portfolio\lib dir.
> for all the jar files and Orcale driver...
>I have made changes to my servlet.xml file also to
> let tomcat recognize my application! Putting in the
> 'context-path' stuff and have edited the web.xml file
> to map the servlets
>Now I can execute my servlets but cannot run
> them... coz when I try exceuting them I get an error
> 'ClassDefNotFound: ConnectionPool/ConnectionPool'
>Now CoonnectionPool is actually a package(as the
> name impies) that i created to make a connection to
> the database. Its also in the classes dir. When I
> execute the servlets I dont get any errors as to
> "unable to find ConnectionPool", so I presume that
> they are in the Path.
>Now I'm really stuck up and am unable to find the
> real problem! May be someone out there whos done
> something similar can help me solve this
> Thanks a lot in advance
> Priyanka
>
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/




Re: other files than jsp not processed by tomcat+mod_jk+apache

2001-07-07 Thread Vinay Menon

your httpd.conf should explicitly say /context/*.jsp I believe.
- Original Message -
From: "Carlos Ferrão" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 07, 2001 6:08 AM
Subject: other files than jsp not processed by tomcat+mod_jk+apache


>
> Hello list,
>
> I'm running Tomcat3.2.2 embedded in JBoss.
> I integrated tomcat with apache through mod_jk in order to avoid
> http://url:8080 port specification and to make apache process the html.
>
> My problem is that under a context in Tomcat only the jsp files are
> processed. It doesn't find any images or html files and it doesn't process
> them. How should I configure tomcat so .jsp files are processed by tomcat
> but html/images files under my tomcat context are processed by apache??
>
> If I access to my context through http://url:8080/mycontext, tomcat's http
> port everything runs fine.
> My war file is deployed in Jboss's deploy dir but this shouldn't be a
> problem.
>
> Yours desperate,
> Carlos Ferrao
>




Re: need some help on tomcat

2001-07-07 Thread Vinay Menon



dump your oracle drivers [classes12.zip or 
classes111.zip] in TOMCAT_HOME/lib/apps or 
under TOMCAT_HOME/webapps/yourwebappname/WEB-INF/lib.
 
Vinay
 
 

1. If you have a jar file you want to share across all your webapps, just put 
it under TOMCAT_HOME/lib/apps
2. If you have a jar file you want to share across all your webapps and the 
servlet engine, just put it under TOMCAT_HOME/lib/common
3. If you have class files that you want to share across all your webapps, 
just put it under any folder you wish to but make sure that the System property 
'org.apache.tomcat.apps.classpath' points to this directory.
4. If you have class files that you want to share across all your webapps and 
the servlet engine, just put it under any folder you wish to but make sure that 
the System property 'org.apache.tomcat.common.classpath' points to this 
directory.

  - Original Message - 
  From: 
  praveen 
  To: [EMAIL PROTECTED] 
  
  Sent: Saturday, July 07, 2001 7:22 
  AM
  Subject: need some help on tomcat
  
  
  Hi
  I am very new to linux 
  environment..Recently i downloaded tomcat and installed on my linuxbox...Now i 
  want to configure connectivity between tomcat and oracle database...Anybody 
  pls help me out how to do this and the classpath variables and any other 
  settings to configure...
  Pls do needful...
   
  Thanks & Regards
  Praveen


Catalina and my own servlet

2001-07-07 Thread Forge




Hi there,

I downloaded tomcat 4.0-b5 and it runs fine. (using jdk 1.3; java 1.2
segfaults).

I copied HelloWorldExample.java, renamed it to TestServlet.java,
compiled it (agains the servlet.jar that comes with catalina)
set up a test context, with correct web.xml (which states that the
servlet must be loaded at start time)

but when I restart the engine I get the famous

TestServlet is not a Servlet

exception.

I cannot recompile tomcat since I dont have all the tools required...

Any ideas?