Method returning null

2005-12-26 Thread mukesh
Hi all,

 

I have deployed a web service on my tomcat 5.5.12 running on
linux7.0.  I am using axis 1.3.

 

I am trying to call a function which returns an integer but I am
getting null always.

 

Why so? Please advice what could be the problem?

 

Regards,

Mukesh Kumar

 



Configure Farming Tomcat

2005-12-26 Thread carlos . garcia
Hello,

I am trying to configue something like this:

One Hardware balancer

Two Apache-1.3.33
Two Tomcat-5.5.7

with four machines.

The load balancer works fine but I have many problems with Cluster
(farming) configuration. I donĀ“t know how I have to configure this in order
to put a class (or .jsp)  in one Tomcat and this class distributes accross
multicast net to the ohter tomcat.


The cluster directive has this configuration:

Cluster className
=org.apache.catalina.cluster.tcp.SimpleTcpCluster
 managerClassName
=org.apache.catalina.cluster.session.DeltaManager
 expireSessionsOnShutdown=false
 useDirtyFlag=false
 notifyListenersOnReplication=true
 name=cluster

Membership
className=org.apache.catalina.cluster.mcast.McastService
mcastAddr=228.0.0.4
mcastPort=45564
mcastFrequency=500
mcastDropTime=3000/

Receiver
className
=org.apache.catalina.cluster.tcp.ReplicationListener
tcpListenAddress=auto
tcpListenPort=4000
tcpSelectorTimeout=100
tcpThreadCount=6/

Sender
className
=org.apache.catalina.cluster.tcp.ReplicationTransmitter
replicationMode=synchronous
ackTimeout=15000/

Valve className
=org.apache.catalina.cluster.tcp.ReplicationValve
filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.
*\.css;.*\.txt;/

Deployer className
=org.apache.catalina.cluster.deploy.FarmWarDeployer
  tempDir=/tmp/war-temp/
  deployDir=/tmp/war-deploy/
  watchDir=/tmp/war-listen/
  watchEnabled=true/

/Cluster


Can anybody help me?

Thanks and sorry for my bad english!!!

-



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



Connection refused

2005-12-26 Thread mukesh
Hi friends,
I have found the cause of the error, in fact function is never gets
called. Its throwing an error nested exception is:
java.net.ConnectException: Connection refused


Code is like this

Try
{
//calling function here
}catch(Exception e)
{
out.println(e.getMessage());
}

In fact I have connected tomcat 5.5.12 to apache2.0 via mod_jk.

Outpus is nested exception is: java.net.ConnectException: Connection
refused

Please suugest the solution.

Kind regards
Mukesh Kumar


-Original Message-
From: mukesh [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 26, 2005 5:29 PM
To: 'Tomcat Users List'
Subject: Method returning null

Hi all,

 

I have deployed a web service on my tomcat 5.5.12 running on
linux7.0.  I am using axis 1.3.

 

I am trying to call a function which returns an integer but I am
getting null always.

 

Why so? Please advice what could be the problem?

 

Regards,

Mukesh Kumar

 




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



UDP Server app

2005-12-26 Thread kjr_23
I'm developing an application that will monitor a port on Tomcat 5.5.x and
receive udp datagrams.  I've got the class coded, but not sure if I've done
it correctly.  I created a class with a main() method that runs the code to
read from whatever port I specify.  Do I need to configure Tomcat to open
this port or listen on the port?  Should I inherit my server class from
thread, so it can be multithreaded?  How do I know my application is
running?  I usually just develop classes/applications that are initiated by
JSP pages.

Thanks,
K



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



Re: tomcat-apache ajp13 connection problem (answer time)

2005-12-26 Thread tomcat
no, none at all. there is the network switch followed by the firewall.


Quoting Prasad [EMAIL PROTECTED]:

 Any load balancers exist in your enviornment ??
 [EMAIL PROTECTED] wrote:
 
 hello there,
 
 i have two servers inside the dmz, one with redhat 9 the other with
 fedora core 4. the box running with fedora core has tomcat 5.5.9
 and apache 2.0.54. the connection is made with ajp13.
 the redhat 9 has an older apache and java version.
 these two servers run separated, so each one has all it
 needs on its system.
 
 there are multiple virtual hosts and web applications on each server.
 accessing such a web application from localhost works well, the
 same when beeing inside the dmz and using a testclient.
 now the problem, requests from outside the dmz work still well
 for the redhat 9 installation, fedora core 4 however has answer
 times between page and image loads that are from multiple seconds
 to minutes!
 
 i have looked at all known log files, but got no errors at all, there
 is simply a wait time between multiple requests and i dont see why.
 
 running tomcat on port 80 as standalone however works correctly from
 outside the dmz. apache as standalone too. however as soon as the
 ajp13 connector connects the two, from outside the dmz requests slow
 down.
 
 has anybody an idea where i might have a closer look too to get this
 problem solved ?
 
 thanks a lot,
 
 stephan
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
   
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 





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



Re: UDP Server app

2005-12-26 Thread Pulkit Singhal
Hi,

A few questions to help clarify what you want:

1) Is this UDP port actually being used by your instance of Tomcat for
implementing some functionality and you simply want to listen on the port
without interfering with the actions that take place? (kind of like a wire
tap)
-- If you are indeed trying to monitor a port on Tomcat then I take it
that Tomcat already makes use of that port of somehow. In which case, you
should really have no need to open anything or configure Tomcat in any way,
shape or form.

2) Are you looking to add-to Tomcat's present functionality on this UDP port
or extend it with
your code?
-- I lack ideas on this one.

3) This really has nothing to do with Tomcat in the sense that you just want
to listen on a UDP port and your app just happens to be deployed on Tomcat
and you just want the damned thing to work?
-- I think that if its simply an app that you deployed on Tomcat that will
listen on any given UDP port then Tomcat has no business constraining you.
But ofcourse this can be confirmed :)

If it was me...here's how I would go about confirming:
a) I think that since main() is a static method, it should run automagically
when you deploy your app into webapps and start tomcat.
b) You can confirm this by writing a fake webapp (real quick) where the main
method contains print_out statements to your catalina.log
c) If you see these log statements in catalina.log or wherever else you
tried to output them to then your code in main() should have run.
d) Now, put similar print statements in your real webapp's main() method
inside the try and catch block so that you know if you are listening or
failing.
e) You can also write a test class that prints an UDP message on the port
that you are either hard-coded to listen to or maybe have a configuration
file for. In turn, have your listening webapp print any messages it
captures. Then looking at the file (stdout or catalina.out) where you
printed the message...you should have a good feel for where you stand.

Cheers,
- Pulkit

On 12/26/05, kjr_23 [EMAIL PROTECTED] wrote:

 I'm developing an application that will monitor a port on Tomcat 5.5.x and
 receive udp datagrams.  I've got the class coded, but not sure if I've
 done
 it correctly.  I created a class with a main() method that runs the code
 to
 read from whatever port I specify.  Do I need to configure Tomcat to open
 this port or listen on the port?  Should I inherit my server class from
 thread, so it can be multithreaded?  How do I know my application is
 running?  I usually just develop classes/applications that are initiated
 by
 JSP pages.

 Thanks,
 K



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




RE: UDP Server app

2005-12-26 Thread kjr_23
Pulkit,
 This will be a brand new application.  We will be tracking a fleet of about
300 - 400 vehicles with modems in them which send out udp data.  We will
configure them to send to a port of our choosing.  I am planning to host a
java app on Tomcat to read this data, parse it and write to a database.  It
sounds like your question 3 below is correct.  I just want to get it
working, and my app happens to be deployed on Tomcat.  I guess I can monitor
the port without Tomcat needing to be configured differently.  That being
said, do you think my app with the main() method is the way to go, or should
I extend thread and make it threaded with a run() method?  Anyone see any
design flaws or opportunity for improvement?  As I said, most of my
experience thus far has been writing web applications that are called from
JSP's, so this is all new to me.

Thanks,
K

-Original Message-
From: Pulkit Singhal [mailto:[EMAIL PROTECTED]
Sent: Monday, December 26, 2005 2:27 PM
To: Tomcat Users List
Subject: Re: UDP Server app


Hi,

A few questions to help clarify what you want:

1) Is this UDP port actually being used by your instance of Tomcat for
implementing some functionality and you simply want to listen on the port
without interfering with the actions that take place? (kind of like a wire
tap)
-- If you are indeed trying to monitor a port on Tomcat then I take it
that Tomcat already makes use of that port of somehow. In which case, you
should really have no need to open anything or configure Tomcat in any way,
shape or form.

2) Are you looking to add-to Tomcat's present functionality on this UDP port
or extend it with
your code?
-- I lack ideas on this one.

3) This really has nothing to do with Tomcat in the sense that you just want
to listen on a UDP port and your app just happens to be deployed on Tomcat
and you just want the damned thing to work?
-- I think that if its simply an app that you deployed on Tomcat that will
listen on any given UDP port then Tomcat has no business constraining you.
But ofcourse this can be confirmed :)

If it was me...here's how I would go about confirming:
a) I think that since main() is a static method, it should run automagically
when you deploy your app into webapps and start tomcat.
b) You can confirm this by writing a fake webapp (real quick) where the main
method contains print_out statements to your catalina.log
c) If you see these log statements in catalina.log or wherever else you
tried to output them to then your code in main() should have run.
d) Now, put similar print statements in your real webapp's main() method
inside the try and catch block so that you know if you are listening or
failing.
e) You can also write a test class that prints an UDP message on the port
that you are either hard-coded to listen to or maybe have a configuration
file for. In turn, have your listening webapp print any messages it
captures. Then looking at the file (stdout or catalina.out) where you
printed the message...you should have a good feel for where you stand.

Cheers,
- Pulkit

On 12/26/05, kjr_23 [EMAIL PROTECTED] wrote:

 I'm developing an application that will monitor a port on Tomcat 5.5.x and
 receive udp datagrams.  I've got the class coded, but not sure if I've
 done
 it correctly.  I created a class with a main() method that runs the code
 to
 read from whatever port I specify.  Do I need to configure Tomcat to open
 this port or listen on the port?  Should I inherit my server class from
 thread, so it can be multithreaded?  How do I know my application is
 running?  I usually just develop classes/applications that are initiated
 by
 JSP pages.

 Thanks,
 K



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





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



Tomcat Datasource , can we define them in war file (whithout accessing to Admin console)?

2005-12-26 Thread Legolas Woodland

Hi
Thank you for reading my post.
Is it possible to make a data-source without admin console ?
I mean by defining the data-source in web.xml or in Context.xml (i think 
i read somewhere that we could put context.xml into meta-inf folder and 
it will act like Context definition in admin console).


is it mandatory that Tomcat shared library folder contain my database 
jdbc driver to have data-source ?
I mean can we bundle , our JDBC driver inside war file and define the 
data-source in war file too ? 


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



Keystore password in clear text

2005-12-26 Thread Shibu Vachery
Hi,

Is there a way in tomcat on (Windows / Unix) that we can avoid the keystore
password being set in clear text in the server.xml file?

Is there a way that the JVM system parameter  
javax.net.ssl.keyStorePassword can be passed in to the tomcat server when
it starts up so that the password is not stored in the server.xml file?

I tried modifying catalina.bat to include this parameter but that did not do
much good. Am I missing something?

Any help will be much appreciated.

Thanks,
 Shibu.


Re: mod_jk versus mod_proxy under load ?

2005-12-26 Thread Pulkit Singhal
I hate to take you off topic here but just in case you migth want to check
this post out as well:

*Re: About possible memory leak in Tomcat 5.x*

Cheers and Gluck!

On 12/26/05, Laurent Perez [EMAIL PROTECTED] wrote:

 Hello

 One of our production servers recently started to suffer from very
 heavy performance troubles under load : the current setup is apache2 +
 mod_jk/ajp13 + tomcat5.0.25, jdk 1.4.2, 1GB (Xmx/Xms to 640MB) on a
 dual 2.4Ghz Xeon server. The maximum amount of requests/sec reached is
 around 15req/sec under production load, and I'd like to hit something
 between 30 and 40req/sec, unfortunately, mod_cache is not really an
 option for our current hosting company.

 Are there available benchmarks comparing mod_jk and mod_proxy
 available, or resulting from anyone's personal experience ? I googled
 quite a bit and results are just random, someone will tell jk is
 faster, someone else will tell proxy is faster, so I'm looking for
 some advice on this TC list.

 Thanks for any input

 Laurent

 --
 a href=http://in-pocket.blogspot.com;http://in-pocket.blogspot.com
 - Mobile world, technology and more/a

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




Re: Tomcat Datasource , can we define them in war file (whithout accessing to Admin console)?

2005-12-26 Thread Khawaja Shams
Hello,
   I am assuming that you are trying to define this datasource in order to
do application server managed connection pooling.  The closest I have done
to what you described is declare a datasource as a global resource in the
server.xml and refer to it in context definition.  You can define a new
context in the $CATALINA_HOME/conf/Catalina/localhost/APPNAME.xml. Here is
an example:

?xml version=1.0 encoding=UTF-8?
Context path=/son
  ResourceLink
name=jdbc/teamDB
global=jdbc/teamDB
type=javax.sql.DataSource
  /
/Context

 However, I still needed to put the jdbc jar file in the common/lib.  I am
not completely sure about this, but for application server to manage your
datasource, one needs to make the proper jar file available to the app
server by putting it in the common/lib as it will not look inside each
deployed directory to perform application independent tasks.  I am also
curious to know if someone has found a way around this.


Best Regards,
Khawaja Shams

On 12/26/05, Legolas Woodland [EMAIL PROTECTED] wrote:

 Hi
 Thank you for reading my post.
 Is it possible to make a data-source without admin console ?
 I mean by defining the data-source in web.xml or in Context.xml (i think
 i read somewhere that we could put context.xml into meta-inf folder and
 it will act like Context definition in admin console).

 is it mandatory that Tomcat shared library folder contain my database
 jdbc driver to have data-source ?
 I mean can we bundle , our JDBC driver inside war file and define the
 data-source in war file too ?

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




Tomcat uses locally only.

2005-12-26 Thread Travis Morris
This may be a newbie question forgive me for that.   I'm currently 
using Tomcat as a client-side server which is intended to only be 
accessed by the local user.   Therefore it does not need to be accessed 
via a remote IP.  Is there a setting in the connector to specify that 
the server is only to be accessed via localhost?   I know I can just 
setup the firewall to not allow incoming on that port but I'd like to 
do it at the server level as well.


The reason for the client-side server is we needed an 'offline' version 
of our application and rather then support two codelines I went to the 
easier solution of creating an offline web application on the local 
client.


Anyways, one of our customers is voicing concerns about hackers gaining 
access to the laptop via the webserver, and I'd rather go back with 
them for with not only the local firewall solution but also a way to 
lock down the application server itself.  Or is there an application 
server which would be better suited for this?  We use tomcat in 
production which is why I went with it for the client-side suite.


Thanks for your assistance :)


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



Re: detecting a new file

2005-12-26 Thread Wade Chandler
--- Khawaja Shams [EMAIL PROTECTED] wrote:

 Hello all,
 I am curious if anyone has ever had to write a
 servlet that listens for
 new files on the server and processes them upon
 appearence.  Basically, I
 need to write a server side program that detects
 when (our automated
 process) delivers a file to the server filesystem
 and then process the
 file.  I would sincerely appreciate any pointers on
 how this can be
 accomplished from within tomcat.
 
 
 Happy Holidays.
 
 
 Sincerely,
 Khawaja Shams
 


My theory is always copy something that is working
now.  Go to www.netbeans.org,download a source zip as
available here
(http://www.netbeans.info/downloads/download.php?a=np=2)
... maybe choose a daily build ... keep following the
arrows eventually you'll get to the download and be
able to select a source download...that or figure out
how to use their CVS repository, and then follow the
source directory structure to the directory (relative
obviously):
openide\fs\src\org\openide\filesystems

see the files:
FileChangeListener.java
FileChangeAdapter.java
FileEvent.java
AbstractFolder.java (this actually has the code to
watch the directory)

also the tomcat code watches directory contents and
files as well.  I don't know exactly where, but you'll
be looking for code that watches the webapps directory
for .war files and possibly other files.  Auto-deploy
of war files works this way.

Anyways, all you're doing is watching a directory for
files and storing previous states so you can compare
later to see what has happened.  You could store state
in a DB and use SQL to determine changes or store it
in memory.  This will all depend on what you need ...
speed vs. memory usage.  SQL and connections obviously
slower than an in memory map, but it should save you
on always keeping your memory used.

Hope it helps,

Wade


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



RE: detecting a new file

2005-12-26 Thread Wade Chandler
--- Daniel Blumenthal [EMAIL PROTECTED] wrote:

 A related question to this is, how can you set up a
 process within the
 servlet that fires off at X time, or every Y
 seconds?  The equivalent of a
 cron job inside the servlet.
 
 If you have high enough traffic, there's an easy
 hack - just store a Date
 object as a servlet-level attribute, and check on
 each request if the
 current time is greater than or equal.  But is there
 a cleaner solution?
 Also, it would be nice to have a little more precise
 control than hoping
 that a user will happen to come to the site at the
 right time.
 
 I suppose you could spin off a thread that sleeps
 for X amount of time,
 wakes to check on the situation, and goes back to
 sleep when done.
 
 To the specific question - I would guess
 (incorrectly?) that there's no Java
 file system listener.  But I could certainly be
 wrong... ?
 
 Daniel
 
  -Original Message-
  From: Khawaja Shams [mailto:[EMAIL PROTECTED] 
  Sent: Monday, December 26, 2005 8:20 PM
  To: Tomcat Users List
  Subject: detecting a new file
  
  Hello all,
  I am curious if anyone has ever had to write a
 servlet 
  that listens for new files on the server and
 processes them 
  upon appearence.  Basically, I need to write a
 server side 
  program that detects when (our automated
  process) delivers a file to the server filesystem
 and then 
  process the file.  I would sincerely appreciate
 any pointers 
  on how this can be accomplished from within
 tomcat.
  
  
  Happy Holidays.
  
  
  Sincerely,
  Khawaja Shams
  
There is no standard file system watcher...at least
not in standard API's which I know of.  Yes, you have
to use a thread or java.util.Timer (uses a thread
behind the abstraction and might make it easier for
you) to do this unless you use SharedMemory or TCP/IP
and spawn off a separate process so you don't break
the rule about not creating threads in the container
(but I don't want to complicate this discussion), but
I prefer to go by what I need when I need it vs the
spec ( ;-) ) utility threads like this are needed at
times depending on what you need/have to accomplish. 
I would use a thread for this as it's pretty simple
stuff.  Just make sure you protect the tread with good
try-catch so you don't bust out of the watching thread
on some goofy error...you'll have to weigh this
obviously.  Setup a simple event mechanism like:
public interface FileChangeListener extends
java.util.EventListener {
public void fileChanged(FileChangeEvent evt);
}

public class FileChangeEvent extends
java.util.EventObject {
public static final int TYPE_NEW = 1;
public static final int TYPE_MODIFIED = 2;
private int eventType = TYPE_NEW;
private MonitoredFile source = null;
private MonitoredFile watched = null;

public FileChangeEvent(){

}

public void setSource(MonitoredFile source){
this.source = source;
}

public MonitoredFile getSource(){
return this.source;
}
//...
//put other setters here for watched and type

}

public class MonitoredFile extends File {
public void
addFileChangeListener(FileChangeListener listener){
 //if using a JDK/JRE with
javax.swing.event.EventListenerList
 then use that for holding the events...just makes it
a little easier
}

public void
removeFileChangeListener(FileChangeListener listener){
   //use your javax.swing.event.EventListenerList

}

   public FileChangeListener[]
getFileChangeListeners(){
//use your javax.swing.event.EventListenerList

}

   public void fireFileChangeEvent(FileChangeEvent
evt) throws Throwable {
//get all the listeners set for FileChangeEvent
and call fileChanged(evt)
}

}



now all you would have to do is to create a class for
watching your directory which you can do different
things...either watch a directory and all sub
directoriesif you don't watch sub directories you
can simply call File.listFiles or File.list depending
on whether you want File objects or String objects. 
If you want to watch all the directories then you can
use this code I'll give you ... what the heck.
public static void enumerateFiles(Vector out,
String dir, int howDeep) throws Throwable {
enumerateFiles(out, dir, 0, howDeep);
}

/**
 *File used to recursively run over and sort a
directory hierarchy to flatten out the directory
 *structure of a file system into an array or in
this case a Vector.
 [EMAIL PROTECTED] out the Vector the enumerated file names
will be written to.  These will be sorted with each
 *   directory listing with
java.util.Arrays.sort(File[]) so see that method for
the format of the
 *   sort
 [EMAIL PROTECTED] dir the directory we want the listing for
 [EMAIL PROTECTED] deepCounter the counter for tracking how
deep we can go.  This should be 0 in normal calls
 [EMAIL PROTECTED] howDeep the number of directory levels
deep we want to return
 */
protected static 

Invalid keystore format

2005-12-26 Thread tam wei
Dear All,

I encouter the following error while I establish an SSL connection to
the other machine.

java.net.SocketException: Default SSL context init failed: Invalid
keystore format
at javax.net.ssl.DefaultSSLSocketFactory.createSocket(DashoA12275)
at sun.net.www.protocol.https.HttpsClient.doConnect(DashoA12275)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.protocol.https.HttpsClient.init(DashoA12275)
at sun.net.www.protocol.https.HttpsClient.a(DashoA12275)
at sun.net.www.protocol.https.HttpsClient.a(DashoA12275)
at sun.net.www.protocol.https.HttpsClient.a(DashoA12275)
at 
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.plainConnect(DashoA12275)
at 
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA12275)
at 
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:569)
at 
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl.getOutputStream(DashoA12275)
at 
com.gridnode.pdip.base.transport.helpers.OutputStreamThread.run(GNHttpConnection.java:130)

Did anyone encounter such problem before ?

Kindly for your reply

Thx

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