Cannot see cluster MBean

2009-08-31 Thread Landry Stephane Zeng Eyindanga

Hello,
I have started tomcat with tcp cluster enabled, but I cannot see the 
cluster MBean. Has the Object Name changed ? I'm about to open a bug ? 
Any Idea ?


Stephane Zeng.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



java.lang.UnsatisfiedLinkError: running tomcat on java headless?

2009-08-31 Thread method8

Dear all,

I'm using the iText library to generate pdfs from a database on the fly.
Whenever I use some 

of it's features that require simple things like java.awt.Color, I get an 

java.lang.UnsatisfiedLinkError as shown:

java.lang.UnsatisfiedLinkError:
/usr/lib/jvm/java-1.5.0-sun-1.5.0.18/jre/lib/amd64/libawt.so: 

libmlib_image.so: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at
sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1509)
at java.awt.Toolkit.clinit(Toolkit.java:1530)
at java.awt.Color.clinit(Color.java:250)
at tablereport.processRequest(tablereport.java:55)
at tablereport.doGet(tablereport.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter

(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter

(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke

(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke

(StandardContextValve.java:172)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at 

org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection

(Http11BaseProtocol.java:665)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt

(LeaderFollowerWorkerThread.java:81)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)

After some research and verifying that libawt.so physically exists I read
somewhere that 

whenever java is installed no a linux box without x (in my case it's a
remote vps) java omits 

certain graphics related libraries like AWT (naturally).

I also read that you can run java headless to avoid the dependencies to X.
Now is there a way 

to run tomcat (or add variables to tomcat's startup.sh) to avoid having
these dependencies?

Thanks for your help,

William
-- 
View this message in context: 
http://www.nabble.com/java.lang.UnsatisfiedLinkError%3A-running-tomcat-on-java-headless--tp25220313p25220313.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Hosting multiple domains on a single application

2009-08-31 Thread mailvgarg

Hey,

I have a webapplication with different pages for each client which is
accessible from URL

www.myDomain.com/action/clientId
client Id is different for each client.

Now I want to provide different domains to these clients and want to map
them to these URLs.. So that
www.domain1.com  automatically hit my application at
www.myDomain.com/action/client1
www.domain2.com automatically hit my application at
www.myDomain.com/action/client2

and in the browser the URL should be www.domain1.com only.

can any body tell me what should be the process to handle such mapping.

Thanks in advance.

Regards
Vikas Garg
-- 
View this message in context: 
http://www.nabble.com/Hosting-multiple-domains-on-a-single-application-tp25220862p25220862.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Is resource-ref really needed?

2009-08-31 Thread Robert Whane
On Mon, Aug 31, 2009 at 2:27 AM, Martin Gaintymgai...@hotmail.com wrote:
 you can enter a documentation change to correct either
 1)duplicate behaviour of ApplicationContext.xml Resource by web.xml 
 resource-ref
 2)or make the documentation a bit clearer on what is required and what is 
 optional

That's not a bad idea really, but before I feel qualified to make such
a proposal I first need to understand it myself ;)

 mgi interpret this as ContextResource parameter is mandatory

Hmmm, now you're talking. IF those attributes on ContextResource
are mandatory, then what on earth is the use of resource-ref? Does
Tomcat even look at that element? I guess so, but if resource-ref is
completely optional and contains no new information in no possible
use-cases, then you could just as well be instructed to put a file
called nobody-reads-this.txt in your root and enter those values
there in free-format, couldn't you?

There has to be some use of that resource-ref element. All the Tomcat
examples and tutorials instruct you to create this element. Someone
really badly wants you to use it, yet it seemingly has not function
whatsoever. Something just doesn't add up, or maybe it's just me...

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?

2009-08-31 Thread Michael Ludwig

method8 schrieb:


I'm using the iText library to generate pdfs from a database on the
fly. Whenever I use some of it's features that require simple things
like java.awt.Color, I get an java.lang.UnsatisfiedLinkError as shown:

java.lang.UnsatisfiedLinkError:
/usr/lib/jvm/java-1.5.0-sun-1.5.0.18/jre/lib/amd64/libawt.so:

libmlib_image.so: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
[...]
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1509)



After some research and verifying that libawt.so physically exists


But what about libmlib_image.so? That's the one it's complaining about.
Here's what I can see on a non-X Linux system:

$ ldd /usr/lib/jvm/java-1.5.0-sun-1.5.0.17/jre/lib/i386/libawt.so
linux-gate.so.1 =  (0xb7f67000)
libmlib_image.so = not found
libjvm.so = not found
libm.so.6 = /lib/i686/cmov/libm.so.6 (0xb7eb1000)
libdl.so.2 = /lib/i686/cmov/libdl.so.2 (0xb7ead000)
libjava.so = not found
libc.so.6 = /lib/i686/cmov/libc.so.6 (0xb7d52000)
/lib/ld-linux.so.2 (0xb7f68000)

Still, compiling and running a color example works fine for me. (From
the command line, that is.) It works because of the built-in value for
the system property java.library.path.

m...@seestern:~  /usr/lib/jvm/java-1.5.0-sun/jre/bin/java LibraryPath
/usr/lib/jvm/java-1.5.0-sun-1.5.0.17/jre/lib/i386/client
/usr/lib/jvm/java-1.5.0-sun-1.5.0.17/jre/lib/i386
/usr/lib/jvm/java-1.5.0-sun-1.5.0.17/jre/../lib/i386

Download an example that *I think* requires AWT.

http://itextdocs.lowagie.com/examples/com/lowagie/examples/directcontent/colors/SpotColors.java

m...@seestern:~  javac -target 5 -bootclasspath \
  /usr/lib/jvm/java-1.5.0-sun/jre/lib/rt.jar \
  com/lowagie/examples/directcontent/colors/SpotColors.java

m...@seestern:~  /usr/lib/jvm/java-1.5.0-sun/jre/bin/java \
  com/lowagie/examples/directcontent/colors/SpotColors
Pantone example : Spot Color

The result looks fine!


I read somewhere that whenever java is installed no a linux box
without x (in my case it's a remote vps) java omits certain graphics
related libraries like AWT (naturally).


There is no X11 server on that machine; the Sun Java is installed via
the package manager; everything seems fine.


I also read that you can run java headless to avoid the dependencies
to X. Now is there a way to run tomcat (or add variables to tomcat's
startup.sh) to avoid having these dependencies?


Aren't the dependencies simply required? I think the JVM wants to load
libmlib_image.so because it is needed.

--
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Is resource-ref really needed?

2009-08-31 Thread Michael Ludwig

Robert Whane schrieb:


There has to be some use of that resource-ref element. All the Tomcat
examples and tutorials instruct you to create this element. Someone
really badly wants you to use it, yet it seemingly has not function
whatsoever. Something just doesn't add up, or maybe it's just me...


It's not just you. I've also been wondering why you should need it when
obviously you don't as your Resource works without a resource-ref.

--
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?

2009-08-31 Thread method8

- But what about libmlib_image.so? That's the one it's complaining about.

I can see that as well. This is the whole list of files in
/usr/lib/jvm/java-1.5.0-sun-1.5.0.18/jre/lib/amd64

awt_robot  libcmm.so  libinstrument.so libjava.so 
libjsig.solibnative_chmod.so  librmi.so motif21
gtkhelper  libdcpr.so libioser12.solibjawt.so 
libjsoundalsa.so  libnet.so   libsaproc.so  native_threads
headless   libdt_socket.solibj2pkcs11.so   libJdbcOdbc.so 
libjsound.so  libnio.so   libunpack.so  server
jvm.cfglibfontmanager.so  libjaas_unix.so  libjdwp.so 
libmanagement.so  libodbcinst.so  libverify.so  xawt
libawt.so  libhprof.solibjava_crw_demo.so  libjpeg.so 
libmlib_image.so  libodbc.so  libzip.so

Could it be it's just Debian the problem? I develop on windows and deploy on
a debian machine, and had some problems in the past with policies and socket
permissions.
-- 
View this message in context: 
http://www.nabble.com/java.lang.UnsatisfiedLinkError%3A-running-tomcat-on-java-headless--tp25220313p25221584.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?

2009-08-31 Thread Michael Ludwig

method8 schrieb:

- But what about libmlib_image.so? That's the one it's complaining
about.

I can see that as well.


So check the value of java.library.path. Just to be sure.


Could it be it's just Debian the problem? I develop on windows and
deploy on a debian machine, and had some problems in the past with
policies and socket permissions.


Try running your Itext examples from the command-line on your server. If
that works, I'd look for the issue in how you set up the environment for
Tomcat.

I don't know if that could be a problem, but is there more than one Java
installation on your machine? Do Java library directories show up in the
output of ldconfig -p? Could that confuse the JVM about what library to
load?

--
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Query on Tomcat Server.xml

2009-08-31 Thread Tk, Pramod (NSN - IN/Bangalore)
Hello All,

 

The below tag is used to for making use of keystore on snmartcard. It
works fine

 

Connector port=443 protocol=HTTP/1.1 SSLEnabled=true

 maxThreads=150 scheme=https secure=true

 clientAuth=false sslProtocol=TLS protocols=TLSv1 

 algorithm=SunX509 

 keystore=NONE keystoreType=PKCS11 keystoreProvider=smartcard
provider keystorePass=X  

/

But ,

 

What I want to make is to remove keystorePass=X tag and give
this keystore password when tomcat starts up. 

 

I presume this type of hardcoding in server.xml is security loop hole.  

 

Apache asks keystore password during its start up.

 

Any suggestions to avoid the hard coding  of the password in tomcat will
appreciated.

 

 

Thanks :-),

Pramod TK



Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?

2009-08-31 Thread method8

this is the output of ldconfig -p

libz.so.1 (libc6,x86-64) = /usr/lib/libz.so.1
libxtables.so.0 (libc6,x86-64) = /lib/libxtables.so.0
libxml2.so.2 (libc6,x86-64) = /usr/lib/libxml2.so.2
libxcb.so.1 (libc6,x86-64) = /usr/lib/libxcb.so.1
libxcb-xlib.so.0 (libc6,x86-64) = /usr/lib/libxcb-xlib.so.0
libxcb-render.so.0 (libc6,x86-64) = /usr/lib/libxcb-render.so.0
libxcb-render-util.so.0 (libc6,x86-64) =
/usr/lib/libxcb-render-util.so.0
libxapian.so.15 (libc6,x86-64) = /usr/lib/libxapian.so.15
libwrap.so.0 (libc6,x86-64) = /lib/libwrap.so.0
libvolume_id.so.0 (libc6,x86-64) = /lib/libvolume_id.so.0
libuuid.so.1 (libc6,x86-64) = /lib/libuuid.so.1
libutil.so.1 (libc6,x86-64, OS ABI: Linux 2.6.8) =
/lib/libutil.so.1
libusb-0.1.so.4 (libc6,x86-64) = /lib/libusb-0.1.so.4
libusb-0.1.so.4 (libc6,x86-64) = /usr/lib/libusb-0.1.so.4
libuniquewm-1.0.so.0 (libc6,x86-64) = /usr/lib/libuniquewm-1.0.so.0
libts-0.0.so.0 (libc6,x86-64) = /usr/lib/libts-0.0.so.0
libtre.so.4 (libc6,x86-64) = /usr/lib/libtre.so.4
libtiff.so.4 (libc6,x86-64) = /usr/lib/libtiff.so.4
libticw.so.5 (libc6,x86-64) = /lib/libticw.so.5
libtic.so.5 (libc6,x86-64) = /lib/libtic.so.5
libthread_db.so.1 (libc6,x86-64, OS ABI: Linux 2.6.8) =
/lib/libthread_db.so.1
libthai.so.0 (libc6,x86-64) = /usr/lib/libthai.so.0
libtcl8.4.so.0 (libc6,x86-64) = /usr/lib/libtcl8.4.so.0
libtasn1.so.3 (libc6,x86-64) = /usr/lib/libtasn1.so.3
libsysfs.so.2 (libc6,x86-64) = /lib/libsysfs.so.2
libstdc++.so.6 (libc6,x86-64) = /usr/lib/libstdc++.so.6
libssl.so.0.9.8 (libc6,x86-64) = /usr/lib/libssl.so.0.9.8
libss.so.2 (libc6,x86-64) = /lib/libss.so.2
libsqlite3.so.0 (libc6,x86-64) = /usr/lib/libsqlite3.so.0
libslang.so.2 (libc6,x86-64) = /lib/libslang.so.2
libsigc-2.0.so.0 (libc6,x86-64) = /usr/lib/libsigc-2.0.so.0
libsepol.so.1 (libc6,x86-64) = /lib/libsepol.so.1
libselinux.so.1 (libc6,x86-64) = /lib/libselinux.so.1
libsasl2.so.2 (libc6,x86-64) = /usr/lib/libsasl2.so.2
librt.so.1 (libc6,x86-64, OS ABI: Linux 2.6.8) = /lib/librt.so.1
libresolv.so.2 (libc6,x86-64, OS ABI: Linux 2.6.8) =
/lib/libresolv.so.2
libreadline.so.5 (libc6,x86-64) = /lib/libreadline.so.5
libpython2.5.so.1.0 (libc6,x86-64) = /usr/lib/libpython2.5.so.1.0
libpthread.so.0 (libc6,x86-64, OS ABI: Linux 2.6.8) =
/lib/libpthread.so.0
libproc-3.2.7.so (libc6,x86-64) = /lib/libproc-3.2.7.so
libpq.so.5 (libc6,x86-64) = /usr/lib/libpq.so.5
libpostfix-util.so.1 (libc6,x86-64) = /usr/lib/libpostfix-util.so.1
libpostfix-tls.so.1 (libc6,x86-64) = /usr/lib/libpostfix-tls.so.1
libpostfix-master.so.1 (libc6,x86-64) =
/usr/lib/libpostfix-master.so.1
libpostfix-global.so.1 (libc6,x86-64) =
/usr/lib/libpostfix-global.so.1
libpostfix-dns.so.1 (libc6,x86-64) = /usr/lib/libpostfix-dns.so.1
libpopt.so.0 (libc6,x86-64) = /lib/libpopt.so.0
libpng12.so.0 (libc6,x86-64) = /usr/lib/libpng12.so.0
libpixman-1.so.0 (libc6,x86-64) = /usr/lib/libpixman-1.so.0
libperl.so.5.10 (libc6,x86-64) = /usr/lib/libperl.so.5.10
libpcreposix.so.3 (libc6,x86-64) = /usr/lib/libpcreposix.so.3
libpcre.so.3 (libc6,x86-64) = /usr/lib/libpcre.so.3
libpcprofile.so (libc6,x86-64, OS ABI: Linux 2.6.8) =
/lib/libpcprofile.so
libpangoxft-1.0.so.0 (libc6,x86-64) = /usr/lib/libpangoxft-1.0.so.0
libpangox-1.0.so.0 (libc6,x86-64) = /usr/lib/libpangox-1.0.so.0
libpangoft2-1.0.so.0 (libc6,x86-64) = /usr/lib/libpangoft2-1.0.so.0
libpangocairo-1.0.so.0 (libc6,x86-64) =
/usr/lib/libpangocairo-1.0.so.0
libpango-1.0.so.0 (libc6,x86-64) = /usr/lib/libpango-1.0.so.0
libpanelw.so.5 (libc6,x86-64) = /usr/lib/libpanelw.so.5
libpanel.so.5 (libc6,x86-64) = /usr/lib/libpanel.so.5
libpamc.so.0 (libc6,x86-64) = /lib/libpamc.so.0
libpam_misc.so.0 (libc6,x86-64) = /lib/libpam_misc.so.0
libpam.so.0 (libc6,x86-64) = /lib/libpam.so.0
libodbcinst.so.1 (libc6,x86-64) = /usr/lib/libodbcinst.so.1
libodbccr.so.1 (libc6,x86-64) = /usr/lib/libodbccr.so.1
libodbc.so.1 (libc6,x86-64) = /usr/lib/libodbc.so.1
libnss_nisplus.so.2 (libc6,x86-64, OS ABI: Linux 2.6.8) =
/lib/libnss_nisplus.so.2
libnss_nis.so.2 (libc6,x86-64, OS ABI: Linux 2.6.8) =
/lib/libnss_nis.so.2
libnss_mdns6_minimal.so.2 (libc6,x86-64) =
/lib/libnss_mdns6_minimal.so.2
libnss_mdns6.so.2 (libc6,x86-64) = /lib/libnss_mdns6.so.2
libnss_mdns4_minimal.so.2 (libc6,x86-64) =
/lib/libnss_mdns4_minimal.so.2
libnss_mdns4.so.2 (libc6,x86-64) = /lib/libnss_mdns4.so.2
libnss_mdns_minimal.so.2 (libc6,x86-64) =
/lib/libnss_mdns_minimal.so.2
libnss_mdns.so.2 (libc6,x86-64) = 

Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?

2009-08-31 Thread Tim Funk

http://wiki.apache.org/tomcat/FAQ/Linux_Unix

-Tim

method8 wrote:

Dear all,

I'm using the iText library to generate pdfs from a database on the fly.
Whenever I use some 

of it's features that require simple things like java.awt.Color, I get an 


java.lang.UnsatisfiedLinkError as shown:



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to set header (directly) before response is committed

2009-08-31 Thread Martin Grotzke

http://github.com/magro/memcached-session-manager/blob/de2f6d6749226c685eef38b985411c00b11fe452/src/main/java/de/javakaffee/web/msm/CommitInterceptingActionHook.java
http://github.com/magro/memcached-session-manager/blob/de2f6d6749226c685eef38b985411c00b11fe452/src/main/java/de/javakaffee/web/msm/SessionTrackerValve.java


On Sun, 2009-08-30 at 17:34 -0700, Bill Barker wrote:
 Martin Grotzke martin.grot...@javakaffee.de wrote in message 
 news:1251665502.4485.70.ca...@localhost.localdomain.tld...
 
 On Sun, 2009-08-30 at 14:57 -0400, Christopher Schultz wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
  
  Martin,
  
  On 8/30/2009 1:50 PM, Martin Grotzke wrote:
   I found the ActionHook within the coyote response, so I'd try to wrap
   this and intercept the action with ActionCode.ACTION_COMMIT.
   
   Is this the correct approach for solving this problem?
  
  Sounds like it has a decent chance of working. Have you tried it?
 Not yet, but I'll start this evening hopefully.
 
 
 Yes, this should work.  It is the contract for ACTION_COMMIT that it sends 
 the headers down the wire regardless of which Connector you are using.
I implemented this and it's working - great!

My wrapping hook defines just an abstract method beforeCommit. This
hook is set on the coyote response (if a session was requested, just as
an optimization), and restores the original action hook at the end of
beforeCommit.

The hook can be seen here: http://is.gd/2JcSh
The usage of the hook from within the valve is here: http://is.gd/2JcVD

 
 
  Doing this kind of thing is always a risky proposition, since there are
  lots of cases to test.
 Hmm, which cases do you have in mind?
 
 
 The main one I'd worry about is that it isn't guaranteed that ACTION_COMMIT 
 won't be invoked more than once on a request (although it is rare), so you 
 need to be able to handle this case.  The second time it is called, the 
 o.a.coyote.Response object will show itself as committed, so that is all you 
 need to check.  I'd keep a reference to the Response in my ActionHookWrapper 
 to keep my sanity, but it should also be the 'param' value to the action 
 method (but I haven't check if this is true in all Connectors).
Yes, that's exactly what I did, and I also checked for the isCommitted
property and additionally restored the original hook after the
intercepting hook was invoked.

 
 The other one would be that Tomcat reuses instances of it's low-level 
 internal objects.  So the Valve that wraps the ActionHook needs to check 
 that it isn't re-wrapping an instance of your ActionHookWrapper.
Uuh, good to know, this might lead to weird issues. I'll add a check for
this.

Thx  cheers,
Martin


 
 
   Any other thoughts on this?
  
  Two related thoughts:
  
  1. Do you need all of the content to be generated before this header is
set? If so, you'll need another strategy for 100% response buffering
 in order to meet your needs (say, calculating a cryptographic hash of
 the response content to include in a header).
  
  2. If you don't need #1, then why do you want to delay the header
 setting as long as possible?
 To answer this, I need some more words. Basically, I'd like to add the
 cookie only under certain conditions, but then after all session
 modifications are definitely done. So what am I trying to do in more
 detail?
 
 I'm creating the memcached-session-manager ([1]) as a session-failover
 solution when running on tomcat. The memcached-session-manager is
 basically storing a session additionally in a memcached node after the
 request was processed - as a backup of the session. Normally, the
 session is read from the jvm local session map. But if a request shall
 be served for an unknown session id, the session is looked up in the
 memcached and restored if found. Sessions are still kept locally to have
 only one roundtrip to memcached for each request. As there might be
 several memcached nodes used for session backup, the memcached node is
 encoded in the session id, so that the appropriate memcached node is
 selected for backup or restore.
 In the case of a memcached failover, the memcached-session-manager
 selects another memcached node for session backup, and changes the
 session id accordingly. To let the client know that the session id has
 changed, it must send a new JSESSIONID cookie with the new session id.
 
 So for this case, I want to defer the memcached-failure detection as
 long as possible, until the response is committed. If I have a memcached
 node in failure state, the response will also get a cookie with the new
 session id, and at the end of the request the session id will be
 migrated to the new memcached node.
 
 Cheers,
 Martin
 
 
 [1] http://code.google.com/p/memcached-session-manager/
 
 
 
 
  - -chris
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1.4.9 (MingW32)
  Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
  

Re: How to set header (directly) before response is committed

2009-08-31 Thread Martin Grotzke
On Mon, 2009-08-31 at 13:36 +0200, Martin Grotzke wrote:
 http://github.com/magro/memcached-session-manager/blob/de2f6d6749226c685eef38b985411c00b11fe452/src/main/java/de/javakaffee/web/msm/CommitInterceptingActionHook.java
 http://github.com/magro/memcached-session-manager/blob/de2f6d6749226c685eef38b985411c00b11fe452/src/main/java/de/javakaffee/web/msm/SessionTrackerValve.java
Sorry, I forgot to remove these links here, I just pasted them into this
mail for using the short versions below - sorry for confusion!

Cheers,
Martin


 
 
 On Sun, 2009-08-30 at 17:34 -0700, Bill Barker wrote:
  Martin Grotzke martin.grot...@javakaffee.de wrote in message 
  news:1251665502.4485.70.ca...@localhost.localdomain.tld...
  
  On Sun, 2009-08-30 at 14:57 -0400, Christopher Schultz wrote:
   -BEGIN PGP SIGNED MESSAGE-
   Hash: SHA1
   
   Martin,
   
   On 8/30/2009 1:50 PM, Martin Grotzke wrote:
I found the ActionHook within the coyote response, so I'd try to wrap
this and intercept the action with ActionCode.ACTION_COMMIT.

Is this the correct approach for solving this problem?
   
   Sounds like it has a decent chance of working. Have you tried it?
  Not yet, but I'll start this evening hopefully.
  
  
  Yes, this should work.  It is the contract for ACTION_COMMIT that it sends 
  the headers down the wire regardless of which Connector you are using.
 I implemented this and it's working - great!
 
 My wrapping hook defines just an abstract method beforeCommit. This
 hook is set on the coyote response (if a session was requested, just as
 an optimization), and restores the original action hook at the end of
 beforeCommit.
 
 The hook can be seen here: http://is.gd/2JcSh
 The usage of the hook from within the valve is here: http://is.gd/2JcVD
 
  
  
   Doing this kind of thing is always a risky proposition, since there are
   lots of cases to test.
  Hmm, which cases do you have in mind?
  
  
  The main one I'd worry about is that it isn't guaranteed that ACTION_COMMIT 
  won't be invoked more than once on a request (although it is rare), so you 
  need to be able to handle this case.  The second time it is called, the 
  o.a.coyote.Response object will show itself as committed, so that is all 
  you 
  need to check.  I'd keep a reference to the Response in my 
  ActionHookWrapper 
  to keep my sanity, but it should also be the 'param' value to the action 
  method (but I haven't check if this is true in all Connectors).
 Yes, that's exactly what I did, and I also checked for the isCommitted
 property and additionally restored the original hook after the
 intercepting hook was invoked.
 
  
  The other one would be that Tomcat reuses instances of it's low-level 
  internal objects.  So the Valve that wraps the ActionHook needs to check 
  that it isn't re-wrapping an instance of your ActionHookWrapper.
 Uuh, good to know, this might lead to weird issues. I'll add a check for
 this.
 
 Thx  cheers,
 Martin
 
 
  
  
Any other thoughts on this?
   
   Two related thoughts:
   
   1. Do you need all of the content to be generated before this header is
 set? If so, you'll need another strategy for 100% response buffering
  in order to meet your needs (say, calculating a cryptographic hash of
  the response content to include in a header).
   
   2. If you don't need #1, then why do you want to delay the header
  setting as long as possible?
  To answer this, I need some more words. Basically, I'd like to add the
  cookie only under certain conditions, but then after all session
  modifications are definitely done. So what am I trying to do in more
  detail?
  
  I'm creating the memcached-session-manager ([1]) as a session-failover
  solution when running on tomcat. The memcached-session-manager is
  basically storing a session additionally in a memcached node after the
  request was processed - as a backup of the session. Normally, the
  session is read from the jvm local session map. But if a request shall
  be served for an unknown session id, the session is looked up in the
  memcached and restored if found. Sessions are still kept locally to have
  only one roundtrip to memcached for each request. As there might be
  several memcached nodes used for session backup, the memcached node is
  encoded in the session id, so that the appropriate memcached node is
  selected for backup or restore.
  In the case of a memcached failover, the memcached-session-manager
  selects another memcached node for session backup, and changes the
  session id accordingly. To let the client know that the session id has
  changed, it must send a new JSESSIONID cookie with the new session id.
  
  So for this case, I want to defer the memcached-failure detection as
  long as possible, until the response is committed. If I have a memcached
  node in failure state, the response will also get a cookie with the new
  session id, and at the end of the request the session id will be
  migrated to 

RE: Is resource-ref really needed?

2009-08-31 Thread Martin Gainty

https://issues.apache.org/bugzilla/show_bug.cgi?id=47769

Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 Date: Mon, 31 Aug 2009 12:45:28 +0200
 From: m...@as-guides.com
 To: users@tomcat.apache.org
 Subject: Re: Is resource-ref really needed?
 
 Robert Whane schrieb:
 
  There has to be some use of that resource-ref element. All the Tomcat
  examples and tutorials instruct you to create this element. Someone
  really badly wants you to use it, yet it seemingly has not function
  whatsoever. Something just doesn't add up, or maybe it's just me...
 
 It's not just you. I've also been wondering why you should need it when
 obviously you don't as your Resource works without a resource-ref.
 
 -- 
 Michael Ludwig
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

_
Windows Live: Make it easier for your friends to see what you’re up to on 
Facebook.
http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_facebook:082009

Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?

2009-08-31 Thread Michael Ludwig

Tim Funk schrieb:

http://wiki.apache.org/tomcat/FAQ/Linux_Unix


You're probably alluding to:

  How do I run without an X server and still get graphics?

  You either need to run headless or run an alternate X-server. [...] if
  your are using a JVM 1.4 or better, you can use the system property
  java.awt.headless=true

Indeed, isHeadless() returns true for my Java 5 and 6 installations.

import java.awt.GraphicsEnvironment;
// http://mindprod.com/jgloss/headless.html
public class Headless {
  public static void main( String[] args) {
boolean headless = GraphicsEnvironment.isHeadless();
System.out.println( Ohne Tastatur, Maus, GUI?  + headless);
String p = java.awt.headless;
System.out.println( p + ?  + System.getProperty( p));
  }
}

The iText color test (which produces graphics in a PDF) still works when
I specify java.awt.headless=false, which also makes isHeadless() return
false. So it seems to work with or without this headless property. So
why does it not work for Method8 (the OP)?

--
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Query on Tomcat Server.xml

2009-08-31 Thread Caldarale, Charles R
 From: Tk, Pramod (NSN - IN/Bangalore) [mailto:pramod...@nsn.com]
 Subject: Query on Tomcat Server.xml
 
 I presume this type of hardcoding in server.xml is security loop hole.

Not really.

If you don't put the password in server.xml, where are you going to put it?  
The server.xml file can have the same access constraints applied to it as any 
other location for the password.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Hosting multiple domains on a single application

2009-08-31 Thread Caldarale, Charles R
 From: mailvgarg [mailto:mailvg...@gmail.com]
 Subject: Hosting multiple domains on a single application
 
 can any body tell me what should be the process to handle such mapping.

Try this:
http://tuckey.org/urlrewrite/

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?

2009-08-31 Thread Tim Funk
1) Are you passing -Djava.awt.headless=true to tomcat via CATALINA_OPTS 
 (or JAVA_OPTS)
2) I have found that even if you are headless, you can't use all the 
Graphics/awt stuff. I wish I could recall what it was, but I thought the 
death was in  similar manner. (But this was also a few years ago). Of 
course -  since you are using iText - this shouldn't be an issue.


-Tim

Michael Ludwig wrote:

Tim Funk schrieb:

http://wiki.apache.org/tomcat/FAQ/Linux_Unix


You're probably alluding to:

  How do I run without an X server and still get graphics?

  You either need to run headless or run an alternate X-server. [...] if
  your are using a JVM 1.4 or better, you can use the system property
  java.awt.headless=true

Indeed, isHeadless() returns true for my Java 5 and 6 installations.

import java.awt.GraphicsEnvironment;
// http://mindprod.com/jgloss/headless.html
public class Headless {
  public static void main( String[] args) {
boolean headless = GraphicsEnvironment.isHeadless();
System.out.println( Ohne Tastatur, Maus, GUI?  + headless);
String p = java.awt.headless;
System.out.println( p + ?  + System.getProperty( p));
  }
}

The iText color test (which produces graphics in a PDF) still works when
I specify java.awt.headless=false, which also makes isHeadless() return
false. So it seems to work with or without this headless property. So
why does it not work for Method8 (the OP)?



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to set header (directly) before response is committed

2009-08-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Martin,

On 8/30/2009 4:51 PM, Martin Grotzke wrote:
 On Sun, 2009-08-30 at 14:57 -0400, Christopher Schultz wrote:
 
 Doing this kind of thing is always a risky proposition, since there are
 lots of cases to test.

 Hmm, which cases do you have in mind?

Well, you have to test it when you have a tiny response (including
things like redirects, 304s, etc.), when you have a huge response (large
static file, perhaps), when you have a large response AND a redirect
(which might actually fail on its own), etc.

 2. If you don't need #1, then why do you want to delay the header
setting as long as possible?

 To answer this, I need some more words. Basically, I'd like to add the
 cookie only under certain conditions, but then after all session
 modifications are definitely done.

I would recommend that you re-think your architecture if this is a
concern. It's best to do all your state-changes on the server /before/
any response is generated. If you stick to this rule, then you can set
your cookie before the 1st byte of the response is even emitted, and it
will significantly uncomplicate your life.

 So what am I trying to do in more detail?
 
 I'm creating the memcached-session-manager ([1]) as a session-failover
 solution when running on tomcat. The memcached-session-manager is
 basically storing a session additionally in a memcached node after the
 request was processed - as a backup of the session. Normally, the
 session is read from the jvm local session map. But if a request shall
 be served for an unknown session id, the session is looked up in the
 memcached and restored if found. Sessions are still kept locally to have
 only one roundtrip to memcached for each request. As there might be
 several memcached nodes used for session backup, the memcached node is
 encoded in the session id, so that the appropriate memcached node is
 selected for backup or restore.
 In the case of a memcached failover, the memcached-session-manager
 selects another memcached node for session backup, and changes the
 session id accordingly. To let the client know that the session id has
 changed, it must send a new JSESSIONID cookie with the new session id.
 
 So for this case, I want to defer the memcached-failure detection as
 long as possible, until the response is committed. If I have a memcached
 node in failure state, the response will also get a cookie with the new
 session id, and at the end of the request the session id will be
 migrated to the new memcached node.

Shouldn't you know when you first try to access the session that a
memcached-failure condition has been detected? If so, you don't have to
wait until the end of the response to put that into a header (and why do
you even need it in the header)?

This doesn't sound like you need any delayed processing whatsoever.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqb3ywACgkQ9CaO5/Lv0PB5SACgv1z/VjTRA1l++og0GNmMfR4B
ILgAnROBRRgRuP1SRuV+EEXEC4je9WGm
=zBml
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat 4.1.31 problem

2009-08-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jamez,

On 8/30/2009 11:40 PM, jamez smith wrote:
 The strange thing I have is Tomcat 4.1 works when I set docBase tag to
 local, myApp's working directory. docBase = C:\myAppWokingDir, but it is
 not working when I set docBase = myApp.  There is no error,  just when I
 run startup.bat, the DOS window quickly close itself before I can see any
 exceptions.

There's probably an error occurring in there. Instead of running
startup.bat from Start | Run... or double-clicking it, start yourself a
CMD window and type startup.bat from there: you'll be able to see the
output. Post whatever errors are shown there if you still need help.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqb4HgACgkQ9CaO5/Lv0PBlIwCcDgBVraR5y53WFVIHdH2xmMFt
MaMAoIrTRRzLmxkvPu0xkfpzwkRd5274
=3pmb
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Query on Tomcat Server.xml

2009-08-31 Thread Mikolaj Rydzewski

Caldarale, Charles R wrote:

Not really.

If you don't put the password in server.xml, where are you going to put it?  
The server.xml file can have the same access constraints applied to it as any 
other location for the password.
  
I think that OP wants Tomcat to read keystore during startup and then 
pull out smart card from computer.


--
Mikolaj Rydzewski m...@ceti.pl


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Hosting multiple domains on a single application

2009-08-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Vikas,

On 8/31/2009 5:53 AM, mailvgarg wrote:
 I have a webapplication with different pages for each client which is
 accessible from URL
 
 www.myDomain.com/action/clientId
 client Id is different for each client.
 
 Now I want to provide different domains to these clients and want to map
 them to these URLs.. So that
 www.domain1.com  automatically hit my application at
 www.myDomain.com/action/client1
 www.domain2.com automatically hit my application at
 www.myDomain.com/action/client2

Other than Chuck's suggestion to use the Tuckey's venerable url-rewrite,
you could also deploy your webapps differently, like this:

Host name=www.domain1.com appBase=./domain1 /
Host name=www.domain2.com appBase=./domain2 /
Host name=www.domain3.com appBase=./domain3 /

...and then deploy your webapp into each of the appBase directories as
the ROOT webapp. Of course, each one would need to be configured to
act as the appropriate webapp for that client id. I'm not sure how
complicated that would be for you.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqb4TIACgkQ9CaO5/Lv0PBJ8ACdHO/O4JeQi41JvpZ0DwkV2lyX
Jk4An0baSPLJOXG4NSYDFC/rMGj60EcT
=J7ra
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Query on Tomcat Server.xml

2009-08-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pramod,

On 8/31/2009 7:19 AM, Tk, Pramod (NSN - IN/Bangalore) wrote:
 What I want to make is to remove keystorePass=X tag and give
 this keystore password when tomcat starts up. 

I think you'll have to write your own code that reads the keystore
password from the console (and displays it, since I don't think Java can
control a pty device very well) and then sets up Tomcat. If you're
trying to be cute, you could pop-up a tiny GUI window to get the
password, but that will significantly increase the amount of memory
required just to get Tomcat started because the GUI subsystem must be
started.

Or, you could hack Tomcat's existing bootstrap classes to do the same
thing, but it might end up being more complicated than you think
(because IIRC Tomcat uses commons-digester to configure everything).

In either case, you'll have to figure out how to get Tomcat into the
background after accepting the password, too, unless you just expect
users to press CTLR-Z and then type bg or whatever.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqb42AACgkQ9CaO5/Lv0PBI3QCdHFh4oSYRuRtbjrnb5xp4OMCO
wuUAnijsqsTyNrw5I7VKWFIzOxKt/+HU
=oFqy
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?

2009-08-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

William,

On 8/31/2009 6:58 AM, method8 wrote:
 Could it be it's just Debian the problem? I develop on windows and deploy on
 a debian machine, and had some problems in the past with policies and socket
 permissions.

You might want to consider developing on the same platform you are
targeting for production. Yes, Java is supposed to run everywhere but
there are certain environmental factors that can ruin your day (like X
libraries). Note that Microsoft Windows always has X-ish capabilities
available because the console runs a windowing system.

Running Java headless doesn't mean X is not required: it just means
that X doesn't have to be /running/. Some X libraries may still be
required to use certain functions. You used to have to run xvfb if you
wanted any kind of AWT interaction. Now, that restriction has been lifed
(by going headless) but I think the libraries still need to be available.

Have you tried asking the iText folks? They are much more likely to know
the answer to this. Tomcat, as you might guess, has no requirements for
X whatsoever.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqb5WkACgkQ9CaO5/Lv0PA1xwCfcWn86XD/yEbT/ziF4BgKFupF
zvkAnijcPFMmiPoep+bJlOoZVhY98aPk
=XXgx
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: java.lang.UnsatisfiedLinkError: running tomcat on java headless?

2009-08-31 Thread Michael Ludwig

Tim Funk schrieb:

1) Are you passing -Djava.awt.headless=true to tomcat via
CATALINA_OPTS (or JAVA_OPTS)


I'm passing this option to my tests on the command line. The OP was the
one with the Tomcat issue; I suggested he run the iText tests on the
command line as well to be sure at least that works.


2) I have found that even if you are headless, you can't use all the
Graphics/awt stuff.


After reading the following, I have a clearer understanding of what this
headless thing is all about.

http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/


Of course -  since you are using iText - this shouldn't be an issue.


Indeed, and it isn't for me - only for the OP.

--
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Db connection issue due to firewall

2009-08-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chandra,

On 8/27/2009 7:50 AM, chandra ganta wrote:
   Resource name=jdbc/oracle auth=Container
   type=javax.sql.DataSource
 driverClassName=oracle.jdbc.OracleDriver
  factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
 url=jdbc:oracle:thin:@ip-address:1521:sid
 username=xxx password=xxx maxActive=100
 maxIdle=20 maxWait=-1 minIdle=0
   validationQuery =select 1 from dual
   testOnBorrow =true
   testOnReturn =true
   testWhileIdle =true
   removeAbandoned=true
   timeBetweenEvictionRunsMillis =60
   numTestsPerEvictionRun =3
   minEvictableIdleTimeMillis =65
   moveAbandonedTimeout=180 logAbandoned=true /

You shouldn't have to specify the 'factory'. Is there a reason you do?

You also shouldn't need testOnReturn and testWhileIdle, though I
understand you're probably desperate.

When I start my Tomcat, I get a message like this in catalina.out:

AbandonedObjectPool is used
(org.apache.tomcat.dbcp.dbcp.abandonedobjectp...@153b098)
   LogAbandoned: true
   RemoveAbandoned: true
   RemoveAbandonedTimeout: 30

Do you get a similar message? If so, please post it. Unfortunately, it
doesn't look like it dumps its test configuration.

I can't imagine that it matters, but you might want to take out the
spaces after the = signs in your XML (like validationQuery =true).

You could also try writing some code like this:

org.apache.tomcat.dbcp.dbcp.DataSource ds = ctx.lookup(jcbd/oracle);
System.out.println(validationQuery= + ds.getValidationQuery());
System.out.println(testOnBorrow= + ds.getTestOnBorrow());
System.out.println(testOnReturn= + ds.getTestOnReturn());
System.out.println(testWhileIdle= + ds.getTestWhileIdle());

...and see what it emits. I suspect something is wrong with your
validation query being set on the data source.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqb6nwACgkQ9CaO5/Lv0PBtcwCeOuYgDBrEiY8MNZjTjeqbBkmt
/6AAnRYvN27bEf/tiAZFs9HyJ0KhZFx5
=doLY
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Unable to access files outside Webapp directory in tomcat

2009-08-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Akash,

On 8/30/2009 12:34 PM, asingla4 wrote:
 I have kept all the documents and images outside the root directory
 of the application. How can I access these files in my
 application[?]

What have you already tried?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEUEARECAAYFAkqb848ACgkQ9CaO5/Lv0PDYKQCVFFj6UJlSTTEFn0qemuv5J3R0
3gCggNJlZP3lGSIgZ+syit2FrKcV/88=
=yW0Z
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



maling list archives and bug tracker dumps for academic research evaluation

2009-08-31 Thread Iqbal, Aftab

Hi,

I am a PhD student at DERI (http://www.deri.ie), Galway, Ireland. We are 
working here on a research to address some issues in
software development processes and how can make software development and 
specially its management efficient[1]. For the
evaluation of our research, we are looking for data from mailing list archives, 
bug trackers, source code, subversion logs of an open source, live long project 
such as Apache Tomcat.

Although, we have Web access to the subversion repository of Apache Tomcat but 
we require dumps of the bug tracker of Apache Tomcat development and mailing 
list archives to do our evaluation.

Your help will be highly appreciated and we will be very happy to share the 
results of our evaluation with you.

If this mailing list is not intended for this email then please guide me to 
whom i can contact for it.

thanks and looking forward for your kind response.

regards
Aftab Iqbal
http://www.deri.ie/about/team/member/aftab_iqbal/

[1] http://sw-app.org/pub/seke09-ld2sd.pdf

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Client SSL certificate chain in Tomcat 6 when using AJP

2009-08-31 Thread iam
Bill, Thanks for your prompt response.
I see that it will be available in Tomcat 6.0.21 onwards. Do you know when will 
it be available for download ?

Also, does it resolve the 8k size limit on AJP connector or if there is a way 
around it ?
We are using Soap headers and with cert-chain I am thinking this will be a big 
issue !

Thanks

A t u l




From: Bill Barker billwbar...@verizon.net
To: users@tomcat.apache.org
Sent: Thursday, August 27, 2009 8:40:14 PM
Subject: Re: Client SSL certificate chain in Tomcat 6 when using AJP


atul techat...@yahoo.com wrote in message 
news:216148.14679...@web36801.mail.mud.yahoo.com...
 I've a setup where Apache 2.2 is fronting Tomcat 6.0.20. They are talking 
 AJP/1.3
 Using mod_proxy_ajp.
 I've a URL protected by client SSL. Apache prompts for client certificate 
 and I can get to the cert in my webapp (servlet).
 However, when the cert have intermediate CAs, I still only get the leaf 
 cert and Not the cert-chain in my tomcat webapp !

 Could not find a setting on apache (mod_proxy_ajp) to send cert-chain.
 And even if it did, the tomcat code looks like it only wants to get single 
 cert!
 org.apache.jk.core.MsgContext public void action(ActionCode actionCode, 
 Object param) {...

} else if( actionCode==ActionCode.ACTION_REQ_SSL_ATTRIBUTE ) {
Request req=(Request)param;

// Extract SSL certificate information (if requested)
MessageBytes certString = 
 (MessageBytes)req.getNote(WorkerEnv.SSL_CERT_NOTE);
if( certString != null  !certString.isNull() ) {
ByteChunk certData = certString.getByteChunk();
ByteArrayInputStream bais =
new ByteArrayInputStream(certData.getBytes(),
 certData.getStart(),
 certData.getLength());

// Fill the first element.
X509Certificate jsseCerts[] = null;
try {
CertificateFactory cf =
CertificateFactory.getInstance(X.509);
X509Certificate cert = (X509Certificate)
cf.generateCertificate(bais);
jsseCerts =  new X509Certificate[1];
jsseCerts[0] = cert;
} catch(java.security.cert.CertificateException e) {
log.error(Certificate convertion failed , e );
return;
}

 Can possibly change it to something like (assuming the cert-chain gets 
 passed in   WorkerEnv.SSL_CERT_NOTE)
Collection ? extends Certificate certCollection = 
 cf.generateCertificates(bais);
X509Certificate [] certs = new 
 X509Certificate[certCollection.size()];
int i = 0;
for (Certificate cert: certCollection) {
certs[i] = (X509Certificate)cert;
i++;
}


 I tried it w/ Tomcat 5.5.27 as well with similar result.
 Also, tried with original Java connector 
 org.apache.jk.server.JkCoyoteHandle  the new 
 org.apache.coyote.ajp.AjpProtocol with similar results.

 Seems like a bug ?? Or am I missing anything ?


Yes, it's a bug. Specifically 
https://issues.apache.org/bugzilla/show_bug.cgi?id=39637.  With mod_jk, the
JkOptions +ForwardSSLCertChain directive works.  I'm too lazy to see 
if it has been implemented in mod_proxy_ajp.


 Any prompt help is appreciated.


 Thanks


 




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


  

Re: 100% usage and hanging on startup of Spring/Hibernate app in Tomcat 5.5 on Ubuntu 7

2009-08-31 Thread Bradley Wagner
Ok, I have some information to add here. I was able to get thread dumps with
jstack pid (very handy!) because kill -3 wouldn't work on a hung
process.
I've listed 3 consecutive tests that I run and the thread is blocked at the
time the process is hung.

Test 1

Thread 21348: (state = BLOCKED)
 - java.lang.StringCoding$CharsetSE.encode(char[], int, int) @bci=15,
line=334 (Compiled frame)
 - java.lang.StringCoding.encode(java.lang.String, char[], int, int)
@bci=123, line=378 (Compiled frame)
 - java.lang.String.getBytes(java.lang.String) @bci=25, line=812 (Compiled
frame)
 - java.io.UnixFileSystem.getBooleanAttributes0(java.io.File) @bci=0
(Compiled frame)
 - java.io.UnixFileSystem.getBooleanAttributes(java.io.File) @bci=2,
line=228 (Compiled frame)
 - java.io.File.exists() @bci=20, line=702 (Compiled frame)

This is the main thread and it is hung on startup during the Spring
initialization process.

Test 2

Thread 24193: (state = BLOCKED)
 - java.lang.String.init(char[], int, int) @bci=50, line=208 (Compiled
frame)
 - java.io.DataInputStream.readUTF() @bci=1, line=522 (Compiled frame)
 - org.aspectj.apache.bcel.classfile.ClassParser.readConstantPool() @bci=9,
line=186 (Interpreted frame)
 - org.aspectj.apache.bcel.classfile.ClassParser.parse() @bci=9, line=131
(Interpreted frame)
 -
org.aspectj.apache.bcel.util.NonCachingClassLoaderRepository.loadClass(java.lang.String)
@bci=100, line=226 (Compiled frame)
 -
org.aspectj.apache.bcel.util.NonCachingClassLoaderRepository.loadClass(java.lang.Class)
@bci=5, line=237 (Interpreted frame)
 -
org.aspectj.weaver.reflect.Java15AnnotationFinder.getParameterAnnotationTypes(java.lang.reflect.Member)
@bci=21, line=353 (Compiled frame)

Once again hung on an I/O operation this time in String's constructor

Test 3

Thread 24365: (state = BLOCKED)
 - java.lang.String.init(char[], int, int) @bci=50, line=208 (Compiled
frame)
 - net.sf.cglib.proxy.Enhancer.access$300(net.sf.cglib.proxy.Enhancer,
net.sf.cglib.core.CodeEmitter, int) @bci=3, line=60 (Interpreted frame)
 - net.sf.cglib.proxy.Enhancer$6.emitCallback(net.sf.cglib.core.CodeEmitter,
int) @bci=6, line=913 (Interpreted frame)
 -
net.sf.cglib.proxy.InvocationHandlerGenerator.generate(net.sf.cglib.core.ClassEmitter,
net.sf.cglib.proxy.CallbackGenerator$Context, java.util.List) @bci=85,
line=44 (Compiled frame)
 - net.sf.cglib.proxy.Enhancer.emitMethods(net.sf.cglib.core.ClassEmitter,
java.util.List, java.util.List) @bci=415, line=942 (Interpreted frame)
 - net.sf.cglib.proxy.Enhancer.generateClass(net.sf.cglib.asm.ClassVisitor)
@bci=353, line=498 (Interpreted frame)
 -
net.sf.cglib.core.DefaultGeneratorStrategy.generate(net.sf.cglib.core.ClassGenerator)
@bci=11, line=25 (Interpreted frame)
 - net.sf.cglib.core.AbstractClassGenerator.create(java.lang.Object)
@bci=182, line=216 (Interpreted frame)
 - net.sf.cglib.proxy.Enhancer.createHelper() @bci=105, line=377
(Interpreted frame)
 - net.sf.cglib.proxy.Enhancer.createClass() @bci=6, line=317 (Interpreted
frame)

with the last line in the Catalina log reading:

2009-08-31 14:35:46,261 INFO  [SettingsFactory] : Named query checking :
enabled
2009-08-31 14:35:46,284 INFO  [SessionFactoryImpl] : building session
factory

In all examples, the software appears to be hung on fairly innocuous methods
in the java framework itself. Test 1 and 2 both originate from calls in the
IO package and the third test from the CGlib framework that we used from
Hibernate. In all instances, there is a call to a method/constructor on the
String object in the stack.

I'm about to try Java 6 to see if it makes a difference.

Thanks,
Bradley

On Sun, Aug 30, 2009 at 2:56 AM, Peter Crowther peter.crowt...@melandra.com
 wrote:

 2009/8/28 Bradley Wagner bradley.wag...@hannonhill.com

  I have a Spring/Hibernate app running in Tomcat 5.5.20 that we've tested
 in
  many environments that is currently faltering when running in a Ubuntu 7
  VM.
  Basically on startup, frequently, the startup process will halt when
 trying
  to read Hibernate's HBM files and in various other places in startup
  process. When it stops both CPUs are pegged at 200% usage by the java
  process (from 'top'). At this point, the only recourse is to kill the app
  with kill -9 pid. Occasionally the app will start all the way up.
 Then,
  I can trigger a re-index of the content in the app's database using
 Lucene
  and the app will freeze again.
 
  The only thing I've been able to find in common about these operations is
  that they seem to be heavy I/O.


 One trick would be to take a thread dump when the app locks up.  kill -3
 pid will trigger such a dump.  The output will be in one of Tomcat's
 logfiles (catalina.out by default, I think).  That might allow you to get
 debugging information, as you're getting the data without having to enable
 JPDA.

 Sometimes it's useful to take several thread dumps, a few seconds apart,
 and
 analyse them.  However, given your suspicions of a race condition, I'm not
 sure that's appropriate 

Re: Db connection issue due to firewall

2009-08-31 Thread Michael Ludwig
Christopher Schultz schrieb am 31.08.2009 um 11:21:32 (-0400):

Resource name=jdbc/oracle auth=Container
[...]
validationQuery =select 1 from dual
testOnBorrow =true
testOnReturn =true
testWhileIdle =true
removeAbandoned=true
timeBetweenEvictionRunsMillis =60
numTestsPerEvictionRun =3
minEvictableIdleTimeMillis =65
moveAbandonedTimeout=180 logAbandoned=true /

 You also shouldn't need testOnReturn and testWhileIdle, though I
 understand you're probably desperate.

 I can't imagine that it matters, but you might want to take out the
 spaces after the = signs in your XML (like validationQuery =true).

Superstition! The spaces are allowed, if uncommon.

I know desperation can get you to do such things, but unfortunately
hardware and software systems lack both humor and compassion :-)

-- 
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: maling list archives and bug tracker dumps for academic research evaluation

2009-08-31 Thread Mark Thomas
Iqbal, Aftab wrote:
 Hi,
 
 I am a PhD student at DERI (http://www.deri.ie), Galway, Ireland. We are 
 working here on a research to address some issues in
 software development processes and how can make software development and 
 specially its management efficient[1]. For the
 evaluation of our research, we are looking for data from mailing list 
 archives, bug trackers, source code, subversion logs of an open source, live 
 long project such as Apache Tomcat.
 
 Although, we have Web access to the subversion repository of Apache Tomcat 
 but we require dumps of the bug tracker of Apache Tomcat development and 
 mailing list archives to do our evaluation.
 
 Your help will be highly appreciated and we will be very happy to share the 
 results of our evaluation with you.
 
 If this mailing list is not intended for this email then please guide me to 
 whom i can contact for it.

The Apache Infrastructure Team usually handles requests like this but
since I am also a member of that team as well as a Tomcat committer I
should be able to get this for you.

Could you provide a time frame for the data you are interested in? To
give you an idea of the volumes involved, in compressed form the
complete dev archive is 121MB, the users archive 233MB and the announce
archive 15KB.

For the bugs it will be easier to give you a complete dump of the
Bugzilla database. That was about 300MB (compressed) the last time I
took a copy.

The easiest thing for me to do is to put this somewhere under
http://people.apache.org/~markt and let you download it.

Mark




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: 100% usage and hanging on startup of Spring/Hibernate app in Tomcat 5.5 on Ubuntu 7

2009-08-31 Thread Mark Thomas
Bradley Wagner wrote:
 Ok, I have some information to add here. I was able to get thread dumps with
 jstack pid (very handy!) because kill -3 wouldn't work on a hung
 process.
 I've listed 3 consecutive tests that I run and the thread is blocked at the
 time the process is hung.

That isn't the way to analyse this. It is almost impossible to detect a
hung thread from a single thread dump.

For a single hang, take three thread dumps ~10s apart and then examine
those to see which thread(s) has(have) not progressed between dumps.

Mark




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: 100% usage and hanging on startup of Spring/Hibernate app in Tomcat 5.5 on Ubuntu 7

2009-08-31 Thread Bradley Wagner
Mark,
Sorry, I should have mentioned this before, but in all cases I tried the
thread dumps 2-3 times at least 30s apart and none of the threads have
progressed at all.

- Bradley

On Mon, Aug 31, 2009 at 3:52 PM, Mark Thomas ma...@apache.org wrote:

 Bradley Wagner wrote:
  Ok, I have some information to add here. I was able to get thread dumps
 with
  jstack pid (very handy!) because kill -3 wouldn't work on a hung
  process.
  I've listed 3 consecutive tests that I run and the thread is blocked at
 the
  time the process is hung.

 That isn't the way to analyse this. It is almost impossible to detect a
 hung thread from a single thread dump.

 For a single hang, take three thread dumps ~10s apart and then examine
 those to see which thread(s) has(have) not progressed between dumps.

 Mark




 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




-- 
Hannon Hill - CMS Experience You Can Trust
(678) 904-6900 ext 115
http://www.hannonhill.com


Not compiling JSP's

2009-08-31 Thread Carl
My environment (fresh install) (this is a backup server that can be used for 
testing and to allow us to upgrade the current production server running Tomcat 
5.5):

Slackware 12
Java 1.6.0_13 (Actually installed in May)
Tomcat 6.0.18

My development system:

Windows XP
Java 1.6.0_07
Tomcat 6.0.16
NetBeans 6.5

The problem:

Tomcat will compile the first few JSP's.  Then, it stops compiling them. 
Nothing in the logs says there is a problem compiling the JSP.  They are the 
same JSP's run in the development environment.  If I copy the .java and .class 
files from the work directory on the development computer, that JSP will run 
just fine.  The Jasper flags in web.xml (in the tomcat/conf directory) are all 
default except I added modificationTestInterval = 0 (didn't seem to have any 
effect.)

The war was built using NetBeans 5.5 and Java 1.5.0_07 (I have been doing this 
so I didn't have to deal with the compatibility issues on the production 
server.)

I am baffled and ready to accept help from any and all sources.

TIA,

Carl



Re: 100% usage and hanging on startup of Spring/Hibernate app in Tomcat 5.5 on Ubuntu 7

2009-08-31 Thread Mark Thomas
Bradley Wagner wrote:
 Mark,
 Sorry, I should have mentioned this before, but in all cases I tried the
 thread dumps 2-3 times at least 30s apart and none of the threads have
 progressed at all.

Hmm. That smells like a JVM issue to me, particularly if it goes away
when you use JPDA.

Things to try:
- use a 1.6 JVM
- try different JVM settings, particularly GC related ones
- switch to/from client from/to server JVM

Mark


 
 - Bradley
 
 On Mon, Aug 31, 2009 at 3:52 PM, Mark Thomas ma...@apache.org wrote:
 
 Bradley Wagner wrote:
 Ok, I have some information to add here. I was able to get thread dumps
 with
 jstack pid (very handy!) because kill -3 wouldn't work on a hung
 process.
 I've listed 3 consecutive tests that I run and the thread is blocked at
 the
 time the process is hung.
 That isn't the way to analyse this. It is almost impossible to detect a
 hung thread from a single thread dump.

 For a single hang, take three thread dumps ~10s apart and then examine
 those to see which thread(s) has(have) not progressed between dumps.

 Mark




 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 
 




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: 100% usage and hanging on startup of Spring/Hibernate app in Tomcat 5.5 on Ubuntu 7

2009-08-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bradley,

On 8/31/2009 4:02 PM, Bradley Wagner wrote:
 Sorry, I should have mentioned this before, but in all cases I tried the
 thread dumps 2-3 times at least 30s apart and none of the threads have
 progressed at all.

I agree with Mark: the three threads you showed were different
(different ids), and showing different call stacks. Are you saying that
each thread dump you took represents multiple thread dumps where that
particular thread didn't progress /at all/ over your multi-dump sample?

You might even want to run strace to see which library function calls
are actually completing.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqcMT0ACgkQ9CaO5/Lv0PBokQCeOJzGRtwS5a9tx6N3KRCnP/L/
wp4AoLQFItwFOAGWygNNCMizlArc3n66
=jz8W
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Db connection issue due to firewall

2009-08-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Michael,

On 8/31/2009 3:47 PM, Michael Ludwig wrote:
 Christopher Schultz schrieb am 31.08.2009 um 11:21:32 (-0400):
 
   Resource name=jdbc/oracle auth=Container
   [...]
   validationQuery =select 1 from dual
   testOnBorrow =true
   testOnReturn =true
   testWhileIdle =true
   removeAbandoned=true
   timeBetweenEvictionRunsMillis =60
   numTestsPerEvictionRun =3
   minEvictableIdleTimeMillis =65
   moveAbandonedTimeout=180 logAbandoned=true /
 
 You also shouldn't need testOnReturn and testWhileIdle, though I
 understand you're probably desperate.
 
 I can't imagine that it matters, but you might want to take out the
 spaces after the = signs in your XML (like validationQuery =true).
 
 Superstition! The spaces are allowed, if uncommon.

Hey, I'll shake a turkey in my underwear if it'll get something to work
that just won't work otherwise. Of course spaces are allowed in XML, but
bugs have been known to exist in both parsers and the digester. Anyhow,
the OP is grasping at straws, so I figured I'd hand him/her a few more.

 I know desperation can get you to do such things, but unfortunately
 hardware and software systems lack both humor and compassion :-)

We'll see what the debugging code I suggested shows.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqcMfYACgkQ9CaO5/Lv0PA+SQCgvzschnUuFZCr2WYVYBxLXosS
ucsAoKJAiJNdUIjp7P7FbGJS2lHSr3Tu
=z2iJ
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Not compiling JSP's

2009-08-31 Thread Martin Gainty

1)
possible incompatibility in JDK versions 
what happens if you upgrade your NB JDK from 1.5.0_07 to 1.6.0_13?

2)
  !--   modificationTestInterval   --
  !--   Causes a JSP (and its dependent files) to not  --
  !--   be checked for modification during the --
  !--   specified time interval (in seconds) from the  --
  !--   last time the JSP was checked for  --
  !--   modification. A value of 0 will cause the JSP  --
  !--   to be checked on every access. --
  !--   Used in development mode only. [4] --
i would leave that 0 for until your jsps compile cleanly

do you see any errors/exceptions in $TOMCAT_HOME/log/localhost*.log
or Tomcat console ?
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 From: c...@etrak-plus.com
 To: users@tomcat.apache.org
 Subject: Not compiling JSP's
 Date: Mon, 31 Aug 2009 16:16:44 -0500
 
 My environment (fresh install) (this is a backup server that can be used for 
 testing and to allow us to upgrade the current production server running 
 Tomcat 5.5):
 
 Slackware 12
 Java 1.6.0_13 (Actually installed in May)
 Tomcat 6.0.18
 
 My development system:
 
 Windows XP
 Java 1.6.0_07
 Tomcat 6.0.16
 NetBeans 6.5
 
 The problem:
 
 Tomcat will compile the first few JSP's.  Then, it stops compiling them. 
 Nothing in the logs says there is a problem compiling the JSP.  They are the 
 same JSP's run in the development environment.  If I copy the .java and 
 .class files from the work directory on the development computer, that JSP 
 will run just fine.  The Jasper flags in web.xml (in the tomcat/conf 
 directory) are all default except I added modificationTestInterval = 0 
 (didn't seem to have any effect.)
 
 The war was built using NetBeans 5.5 and Java 1.5.0_07 (I have been doing 
 this so I didn't have to deal with the compatibility issues on the production 
 server.)
 
 I am baffled and ready to accept help from any and all sources.
 
 TIA,
 
 Carl
 

_
Hotmail® is up to 70% faster. Now good news travels really fast. 
http://windowslive.com/online/hotmail?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_faster:082009

Re: How to set header (directly) before response is committed

2009-08-31 Thread Martin Grotzke
On Mon, 2009-08-31 at 10:33 -0400, Christopher Schultz wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Martin,
 
 On 8/30/2009 4:51 PM, Martin Grotzke wrote:
  On Sun, 2009-08-30 at 14:57 -0400, Christopher Schultz wrote:
  
  Doing this kind of thing is always a risky proposition, since there are
  lots of cases to test.
 
  Hmm, which cases do you have in mind?
 
 Well, you have to test it when you have a tiny response (including
 things like redirects, 304s, etc.), when you have a huge response (large
 static file, perhaps), when you have a large response AND a redirect
 (which might actually fail on its own), etc.
Yes, these are good things to check, I'll write tests for such cases.

 
  2. If you don't need #1, then why do you want to delay the header
 setting as long as possible?
 
  To answer this, I need some more words. Basically, I'd like to add the
  cookie only under certain conditions, but then after all session
  modifications are definitely done.
 
 I would recommend that you re-think your architecture if this is a
 concern. It's best to do all your state-changes on the server /before/
 any response is generated. If you stick to this rule, then you can set
 your cookie before the 1st byte of the response is even emitted, and it
 will significantly uncomplicate your life.
As I'm creating a library that shall be usable in different projects,
it's not on me to decide when the session is accessed and when the
response is created.

However, if there will be issues with the current approach (intercepting
the response.commit) I'll have to reconsider a different way.

 
  So what am I trying to do in more detail?
  
  I'm creating the memcached-session-manager ([1]) as a session-failover
  solution when running on tomcat. The memcached-session-manager is
  basically storing a session additionally in a memcached node after the
  request was processed - as a backup of the session. Normally, the
  session is read from the jvm local session map. But if a request shall
  be served for an unknown session id, the session is looked up in the
  memcached and restored if found. Sessions are still kept locally to have
  only one roundtrip to memcached for each request. As there might be
  several memcached nodes used for session backup, the memcached node is
  encoded in the session id, so that the appropriate memcached node is
  selected for backup or restore.
  In the case of a memcached failover, the memcached-session-manager
  selects another memcached node for session backup, and changes the
  session id accordingly. To let the client know that the session id has
  changed, it must send a new JSESSIONID cookie with the new session id.
  
  So for this case, I want to defer the memcached-failure detection as
  long as possible, until the response is committed. If I have a memcached
  node in failure state, the response will also get a cookie with the new
  session id, and at the end of the request the session id will be
  migrated to the new memcached node.
 
 Shouldn't you know when you first try to access the session that a
 memcached-failure condition has been detected?
Nope, the memcached might fail directly in the *moment* after the
session was created but before the session is going to be stored for
backup - of course this is not very probable, but possible. And for long
running requests the probability increases.

  If so, you don't have to
 wait until the end of the response to put that into a header (and why do
 you even need it in the header)?

Just copying what I already wrote:

  In the case of a memcached failover, the memcached-session-manager
  selects another memcached node for session backup, and changes the
  session id accordingly. To let the client know that the session id has
  changed, it must send a new JSESSIONID cookie with the new session id.

Cheers,
Martin


 
 This doesn't sound like you need any delayed processing whatsoever.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAkqb3ywACgkQ9CaO5/Lv0PB5SACgv1z/VjTRA1l++og0GNmMfR4B
 ILgAnROBRRgRuP1SRuV+EEXEC4je9WGm
 =zBml
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


signature.asc
Description: This is a digitally signed message part


Re: Not compiling JSP's

2009-08-31 Thread Carl

Martin,

Thanks for your quick reply.  I am presently downloading the latest JDK (to 
the box that is building the war) to see if that makes a difference.


There are no error messages in any of the logs, including the 
localhost*.log.


Thanks,

Carl

- Original Message - 
From: Martin Gainty mgai...@hotmail.com

To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, August 31, 2009 3:30 PM
Subject: RE: Not compiling JSP's



1)
possible incompatibility in JDK versions
what happens if you upgrade your NB JDK from 1.5.0_07 to 1.6.0_13?

2)
 !--  
  --
 !--   Causes a JSP (and its dependent files) to 
ot  --
 !--   be checked for modification during 
   --
 !--   specified time interval (in seconds) from 
he  --
 !--   last time the JSP was checked 
   --
 !--   modification. A value of 0 will cause the 
SP  --
 !--   to be checked on every 
   --
 !--   Used in development mode only. 
   --

i would leave that 0 for until your jsps compile cleanly

do you see any errors/exceptions in $TOMCAT_HOME/log/localhost*.log
or Tomcat console ?
Martin Gainty
__
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene 
Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte 
Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht 
dient lediglich dem Austausch von Informationen und entfaltet keine 
rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von 
E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire 
informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie 
de ceci est interdite. Ce message sert à l'information seulement et n'aura 
pas n'importe quel effet légalement obligatoire. Étant donné que les email 
peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
aucune responsabilité pour le contenu fourni.






From: c...@etrak-plus.com
To: users@tomcat.apache.org
Subject: Not compiling JSP's
Date: Mon, 31 Aug 2009 16:16:44 -0500

My environment (fresh install) (this is a backup server that can be used 
for testing and to allow us to upgrade the current production server 
running Tomcat 5.5):


Slackware 12
Java 1.6.0_13 (Actually installed in May)
Tomcat 6.0.18

My development system:

Windows XP
Java 1.6.0_07
Tomcat 6.0.16
NetBeans 6.5

The problem:

Tomcat will compile the first few JSP's.  Then, it stops compiling them. 
Nothing in the logs says there is a problem compiling the JSP.  They are 
the same JSP's run in the development environment.  If I copy the .java 
and .class files from the work directory on the development computer, that 
JSP will run just fine.  The Jasper flags in web.xml (in the tomcat/conf 
directory) are all default except I added modificationTestInterval = 0 
(didn't seem to have any effect.)


The war was built using NetBeans 5.5 and Java 1.5.0_07 (I have been doing 
this so I didn't have to deal with the compatibility issues on the 
production server.)


I am baffled and ready to accept help from any and all sources.

TIA,

Carl



_
Hotmail® is up to 70% faster. Now good news travels really fast.
http://windowslive.com/online/hotmail?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_faster:082009 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: 100% usage and hanging on startup of Spring/Hibernate app in Tomcat 5.5 on Ubuntu 7

2009-08-31 Thread Peter Crowther
2009/8/31 Christopher Schultz ch...@christopherschultz.net

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Bradley,

 On 8/31/2009 4:02 PM, Bradley Wagner wrote:
  Sorry, I should have mentioned this before, but in all cases I tried the
  thread dumps 2-3 times at least 30s apart and none of the threads have
  progressed at all.

 I agree with Mark: the three threads you showed were different
 (different ids), and showing different call stacks. Are you saying that
 each thread dump you took represents multiple thread dumps where that
 particular thread didn't progress /at all/ over your multi-dump sample?

 You might even want to run strace to see which library function calls
 are actually completing.


Agree.

The other interesting point is that all of those are hung in places where
they would naturally be allocating an object or have very recently allocated
an object, and the JVM *might* in theory be growing the heap.  Bradley, are
your initial and maximum heap sizes identical (I suspect not from your
original message)?  If not, what happens if you make them so?

- Peter


RE: Db connection issue due to firewall

2009-08-31 Thread Caldarale, Charles R
 From: chandra ganta [mailto:chandrasekhar...@gmail.com]
 Subject: Re: Db connection issue due to firewall
 
 Connector
  address=ip-address
 port=80
 redirectPort=8443
 minSpareThreads=25
 connectionTimeout=2
 maxSpareThreads=75
 maxThreads=150
 /Connector
 Connector
  address=ip-address
 port=80
 redirectPort=8443
 minSpareThreads=25
 connectionTimeout=2
 maxSpareThreads=75
 maxThreads=150
 /Connector
 Connector
  address=ip-address
 port=80
 redirectPort=8443
 minSpareThreads=25
 connectionTimeout=2
 maxSpareThreads=75
 maxThreads=150
 /Connector

I hope all of the above ip-address entries are different.

   Host
   appBase=webapps
   name=localhost
   /Host
  Host
   appBase=webapps/intradesample
   name=intrade.eskilstuna.se
   /Host
  Host
   appBase=webapps/intradetest
   name=intradetest.eskilstuna.se
   /Host
   Host
   appBase=webapps/intradeutv
   name=intradeutv.eskilstuna.se
   /Host
   Host
   appBase=webapps/jpivot
   name=intraderapport.eskilstuna.se
   /Host

The above nested appBase settings are not allowed, but probably don't 
contribute to the issue at hand.  You must not have one Host's appBase inside 
another's.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Not compiling JSP's

2009-08-31 Thread Martin Gainty

i try to sync the dev jdk with the deploy jdk so when jsps are compiled
you're compiling your generated JspServlets (with the same jdk
so class signatures will be the same)

hth
Martin Gainty 
__ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und 
Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 From: c...@etrak-plus.com
 To: users@tomcat.apache.org
 Subject: Re: Not compiling JSP's
 Date: Mon, 31 Aug 2009 16:32:54 -0500
 
 Martin,
 
 Thanks for your quick reply.  I am presently downloading the latest JDK (to 
 the box that is building the war) to see if that makes a difference.
 
 There are no error messages in any of the logs, including the 
 localhost*.log.
 
 Thanks,
 
 Carl
 
 - Original Message - 
 From: Martin Gainty mgai...@hotmail.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Monday, August 31, 2009 3:30 PM
 Subject: RE: Not compiling JSP's
 
 
 
 1)
 possible incompatibility in JDK versions
 what happens if you upgrade your NB JDK from 1.5.0_07 to 1.6.0_13?
 
 2)
   !--  
--
   !--   Causes a JSP (and its dependent files) to 
 ot  --
   !--   be checked for modification during 
 --
   !--   specified time interval (in seconds) from 
 he  --
   !--   last time the JSP was checked 
 --
   !--   modification. A value of 0 will cause the 
 SP  --
   !--   to be checked on every 
 --
   !--   Used in development mode only. 
 --
 i would leave that 0 for until your jsps compile cleanly
 
 do you see any errors/exceptions in $TOMCAT_HOME/log/localhost*.log
 or Tomcat console ?
 Martin Gainty
 __
 Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene 
 Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte 
 Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht 
 dient lediglich dem Austausch von Informationen und entfaltet keine 
 rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von 
 E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
 Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
 destinataire prévu, nous te demandons avec bonté que pour satisfaire 
 informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie 
 de ceci est interdite. Ce message sert à l'information seulement et n'aura 
 pas n'importe quel effet légalement obligatoire. Étant donné que les email 
 peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
 aucune responsabilité pour le contenu fourni.
 
 
 
 
  From: c...@etrak-plus.com
  To: users@tomcat.apache.org
  Subject: Not compiling JSP's
  Date: Mon, 31 Aug 2009 16:16:44 -0500
 
  My environment (fresh install) (this is a backup server that can be used 
  for testing and to allow us to upgrade the current production server 
  running Tomcat 5.5):
 
  Slackware 12
  Java 1.6.0_13 (Actually installed in May)
  Tomcat 6.0.18
 
  My development system:
 
  Windows XP
  Java 1.6.0_07
  Tomcat 6.0.16
  NetBeans 6.5
 
  The problem:
 
  Tomcat will compile the first few JSP's.  Then, it stops compiling them. 
  Nothing in the logs says there is a problem compiling the JSP.  They are 
  the same JSP's run in the development environment.  If I copy the .java 
  and .class files from the work directory on the development computer, that 
  JSP will run just fine.  The Jasper 

Re: 100% usage and hanging on startup of Spring/Hibernate app in Tomcat 5.5 on Ubuntu 7

2009-08-31 Thread Bradley Wagner

 - use a 1.6 JVM


Tried with Sun 1.6 JVM. Same problems. Not the same exact stack traces but
for example:

Thread 24427: (state = BLOCKED)
- java.lang.String.toCharArray() @bci=4, line=2725 (Compiled frame)
- java.beans.Introspector.decapitalize(java.lang.String) @bci=46, line=252
(Compiled frame)
- org.hibernate.property.BasicPropertyAccessor.getterMethod(java.lang.Class,
java.lang.String) @bci=47, line=325 (Compiled frame)
-
org.hibernate.property.BasicPropertyAccessor.getGetterOrNull(java.lang.Class,
java.lang.String) @bci=33, line=297 (Interpreted frame)
-
org.hibernate.property.BasicPropertyAccessor.getGetterOrNull(java.lang.Class,
java.lang.String) @bci=71, line=304 (Interpreted frame)
- org.hibernate.property.BasicPropertyAccessor.setterMethod(java.lang.Class,
java.lang.String) @bci=2, line=251 (Interpreted frame)
-
org.hibernate.property.BasicPropertyAccessor.getSetterOrNull(java.lang.Class,
java.lang.String) @bci=33, line=230 (Interpreted frame)
- org.hibernate.property.BasicPropertyAccessor.createSetter(java.lang.Class,
java.lang.String) @bci=2, line=214 (Interpreted frame)
- org.hibernate.property.BasicPropertyAccessor.getSetter(java.lang.Class,
java.lang.String) @bci=2, line=209 (Interpreted frame)
- org.hibernate.mapping.Property.getSetter(java.lang.Class) @bci=10,
line=277 (Interpreted frame)
-
org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertySetter(org.hibernate.mapping.Property,


- try different JVM settings, particularly GC related ones


Any thoughts on which GC parameters I should change.


 - switch to/from client from/to server JVM


Have tried with -server flag. Same problems.

I agree with you on JVM problem especially given that all the blocked
threads are blocked in calls to the String object. Problem is I'm not doing
anything exotic with the JVM. We simply did an apt-get to get the latest
Sun JVM for Ubuntu. I've been searching their forums as well for any mention
of incompatibilities with Sun's JVM.

Thanks for your help so far.

- Bradley

On Mon, Aug 31, 2009 at 4:22 PM, Mark Thomas ma...@apache.org wrote:

 Bradley Wagner wrote:
  Mark,
  Sorry, I should have mentioned this before, but in all cases I tried the
  thread dumps 2-3 times at least 30s apart and none of the threads have
  progressed at all.

 Hmm. That smells like a JVM issue to me, particularly if it goes away
 when you use JPDA.

 Things to try:
 - use a 1.6 JVM
 - try different JVM settings, particularly GC related ones
 - switch to/from client from/to server JVM

 Mark


 
  - Bradley
 
  On Mon, Aug 31, 2009 at 3:52 PM, Mark Thomas ma...@apache.org wrote:
 
  Bradley Wagner wrote:
  Ok, I have some information to add here. I was able to get thread
dumps
  with
  jstack pid (very handy!) because kill -3 wouldn't work on a hung
  process.
  I've listed 3 consecutive tests that I run and the thread is blocked
at
  the
  time the process is hung.
  That isn't the way to analyse this. It is almost impossible to detect a
  hung thread from a single thread dump.
 
  For a single hang, take three thread dumps ~10s apart and then examine
  those to see which thread(s) has(have) not progressed between dumps.
 
  Mark
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 




 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



Strange problem with data source Tomcat 6.0.18

2009-08-31 Thread Schalk
Hi everyone,

I sincerely hope someone can point me in the right direction here. I have
set-up a data source using the context.xml file located inside my META-INF
and added the relevant entry in the web apps web.xml. I also have the MySQL
connector/j driver inside my own apps lib as well as inside the server's
lib(same version). When running the app on my local machine it works without
any hassles b.t.w. I am connecting to the remote db server from my local
machine.

Now when I deploy the .war to the server in which the db is running, the
archive is deployed but when I now try to get a connection to the same db
and same server as from my local machine I get:

Cannot create JDBC driver of class '' for connect URL 'null'

I do test whether I can get a context before trying to connect to the db:

try {
Context initialContext = new InitialContext();
Context envContext = (Context)initialContext.lookup(java:comp/env);
if(envContext != null) {
DataSource dataSource =
(DataSource)envContext.lookup(jdbc/wuMaps);
conn = dataSource.getConnection();
} else {
log.error(Houston we have a problem No Context!);
}

The name jdbc/wuMaps is also exactly the same in the web.xml as well as the
context.xml, any ideas why the app cannot find the data source on the
server? I look forward to hearing from everyone.

--
Kind Regards
Schalk Neethling



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: slight problem with Tomcat and Httpd working together.

2009-08-31 Thread Caldarale, Charles R
 From: Josh Gooding [mailto:josh.good...@gmail.com]
 Subject: Re: slight problem with Tomcat and Httpd working together.
 
 Something that I am not understanding.  If the context.xml files are
 truly ignored how can each of the companies be able to login?

You appear to have answered your own question, since you don't really have the 
Context elements in server.xml.

 You're saying if I create the conf/Catalina/[host]/[appName].xml
 I can add them on the fly?

You can always add webapps on the fly, if you have autoDeploy set.

 would it be something like conf/Catalina/localhost/xyzcompany.xml?
 Isn't this for JAAS type realm?

The location of the Context element has nothing to do with whatever Realm 
is being used.

 I know best practice is keeping the webapps directory inside of
 $CATALINA_HOME.

That's not best practice, just the default one.

 What would I have to change in my configuration to be able to 
 serve new projects under the new displaced webapps folder

Just the appBase attribute of the Host element; point it to the location of 
your webapps.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Strange problem with data source Tomcat 6.0.18

2009-08-31 Thread Caldarale, Charles R
 From: sch...@afrigis.co.za [mailto:sch...@afrigis.co.za]
 Subject: Strange problem with data source Tomcat 6.0.18
 
 I also have the MySQL connector/j driver inside my own apps lib
 as well as inside the server's lib(same version).

Don't ever do that.  A given class must appear in only *one* place in any 
particular branch of the classloader tree.  A picture of the tree is here:
http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html

Until you correct that duplication, nothing you try will be reliable.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Strange problem with data source Tomcat 6.0.18

2009-08-31 Thread Michael Ludwig
sch...@afrigis.co.za schrieb am 31.08.2009 um 23:16:48 (+0200):

 I have set-up a data source using the context.xml file located inside
 my META-INF and added the relevant entry in the web apps web.xml. I
 also have the MySQL connector/j driver inside my own apps lib as well
 as inside the server's lib(same version).

That's wrong. The driver must not be in both locations. It must be made
available to the common classloader, which provides classes to both the
server and the applications.

Discard the driver from your application.

 Now when I deploy the .war to the server in which the db is running,
 the archive is deployed but when I now try to get a connection to the
 same db and same server as from my local machine I get:
 
 Cannot create JDBC driver of class '' for connect URL 'null'

Are you doing a proper deploy using the manager application? Or removing
the WAR and properly waiting for Tomcat to discover this?

Or are you improperly clobbering the WAR? That would leave a stale
context.xml for your application in place.

-- 
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Strange problem with data source Tomcat 6.0.18

2009-08-31 Thread Schalk
Hey Chuck,

Thanks for the quick reply :) Which one would you recommend removing, I
guess removing it from my app and leaving it in the server's lib makes it
available to all apps but then I may break some other folks apps who deploy
their app with the jar, h Looking forward to hearing from you.

--
Kind Regards
Schalk Neethling

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: 31 August 2009 11:26 PM
To: Tomcat Users List
Subject: RE: Strange problem with data source Tomcat 6.0.18

 From: sch...@afrigis.co.za [mailto:sch...@afrigis.co.za]
 Subject: Strange problem with data source Tomcat 6.0.18
 
 I also have the MySQL connector/j driver inside my own apps lib
 as well as inside the server's lib(same version).

Don't ever do that.  A given class must appear in only *one* place in any
particular branch of the classloader tree.  A picture of the tree is here:
http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html

Until you correct that duplication, nothing you try will be reliable.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

AfriGIS e-mail facility may not be used for the distribution of chain
letters or offensive email. AfriGIS hereby distances itself from and accepts
no liability for the unauthorized use of its e-mail facility or the sending
of e-mail communications for other than strictly business purposes. AfriGIS
furthermore disclaims liability for any unauthorized instruction for which
permission was not granted. Required as per Sec 50 Companies Act 61 of 1973
Afrigis Pty LTD Reg No 1997/0067/1607.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: 100% usage and hanging on startup of Spring/Hibernate app in Tomcat 5.5 on Ubuntu 7

2009-08-31 Thread Bradley Wagner

 I agree with Mark: the three threads you showed were different

(different ids), and showing different call stacks. Are you saying that

each thread dump you took represents multiple thread dumps where that

particular thread didn't progress /at all/ over your multi-dump sample?


The three thread dumps were from three different occurrences of the same
problem and three consecutive startup attempts.

With each occurrence, the startup process hangs in the middle of
initialization. I took 2-3 jstack dumps that were identical each time. After
that, I killed the process (kill -9 pid) and started it again.

So, while it's not hanging in the same place every time, it's definitely
hanging every time. And because it's the main initialization thread that is
hanging, once it hangs, it never gets any further.

Sorry for the confusion and thanks for the help!

On Mon, Aug 31, 2009 at 4:23 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Bradley,

 On 8/31/2009 4:02 PM, Bradley Wagner wrote:
  Sorry, I should have mentioned this before, but in all cases I tried the
  thread dumps 2-3 times at least 30s apart and none of the threads have
  progressed at all.

 I agree with Mark: the three threads you showed were different
 (different ids), and showing different call stacks. Are you saying that
 each thread dump you took represents multiple thread dumps where that
 particular thread didn't progress /at all/ over your multi-dump sample?

 You might even want to run strace to see which library function calls
 are actually completing.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkqcMT0ACgkQ9CaO5/Lv0PBokQCeOJzGRtwS5a9tx6N3KRCnP/L/
 wp4AoLQFItwFOAGWygNNCMizlArc3n66
 =jz8W
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: 100% usage and hanging on startup of Spring/Hibernate app in Tomcat 5.5 on Ubuntu 7

2009-08-31 Thread Bradley Wagner

 The other interesting point is that all of those are hung in places where

they would naturally be allocating an object or have very recently allocated

an object, and the JVM *might* in theory be growing the heap.  Bradley, are

your initial and maximum heap sizes identical (I suspect not from your

original message)?  If not, what happens if you make them so?


From my original post, I'm setting the following memory parameters:

-Xmx512M -XX:MaxPermSize=128m

so I'm not setting an initial heap size at all. If I remember correctly,
Tomcat's initial heap size default's to 64MB or something.

I'll try to set the initial and max to the same to see if that has any
effect.

Thanks,
Bradley

On Mon, Aug 31, 2009 at 4:59 PM, Peter Crowther peter.crowt...@melandra.com
 wrote:

 2009/8/31 Christopher Schultz ch...@christopherschultz.net

  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  Bradley,
 
  On 8/31/2009 4:02 PM, Bradley Wagner wrote:
   Sorry, I should have mentioned this before, but in all cases I tried
 the
   thread dumps 2-3 times at least 30s apart and none of the threads have
   progressed at all.
 
  I agree with Mark: the three threads you showed were different
  (different ids), and showing different call stacks. Are you saying that
  each thread dump you took represents multiple thread dumps where that
  particular thread didn't progress /at all/ over your multi-dump sample?
 
  You might even want to run strace to see which library function calls
  are actually completing.
 

 Agree.

 The other interesting point is that all of those are hung in places where
 they would naturally be allocating an object or have very recently
 allocated
 an object, and the JVM *might* in theory be growing the heap.  Bradley, are
 your initial and maximum heap sizes identical (I suspect not from your
 original message)?  If not, what happens if you make them so?

 - Peter


RE: Strange problem with data source Tomcat 6.0.18

2009-08-31 Thread Schalk
Hi there Michael,

Ok, I removed the mysql jar from my app and left it in tomcat/lib

I also undeployed and then redeployed the war file via the manager app but
the problem persists.

--
Kind Regards
Schalk Neethling


-Original Message-
From: Michael Ludwig [mailto:mil...@gmx.de] 
Sent: 31 August 2009 11:28 PM
To: users@tomcat.apache.org
Subject: Re: Strange problem with data source Tomcat 6.0.18

sch...@afrigis.co.za schrieb am 31.08.2009 um 23:16:48 (+0200):

 I have set-up a data source using the context.xml file located inside
 my META-INF and added the relevant entry in the web apps web.xml. I
 also have the MySQL connector/j driver inside my own apps lib as well
 as inside the server's lib(same version).

That's wrong. The driver must not be in both locations. It must be made
available to the common classloader, which provides classes to both the
server and the applications.

Discard the driver from your application.

 Now when I deploy the .war to the server in which the db is running,
 the archive is deployed but when I now try to get a connection to the
 same db and same server as from my local machine I get:
 
 Cannot create JDBC driver of class '' for connect URL 'null'

Are you doing a proper deploy using the manager application? Or removing
the WAR and properly waiting for Tomcat to discover this?

Or are you improperly clobbering the WAR? That would leave a stale
context.xml for your application in place.

-- 
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

AfriGIS e-mail facility may not be used for the distribution of chain
letters or offensive email. AfriGIS hereby distances itself from and accepts
no liability for the unauthorized use of its e-mail facility or the sending
of e-mail communications for other than strictly business purposes. AfriGIS
furthermore disclaims liability for any unauthorized instruction for which
permission was not granted. Required as per Sec 50 Companies Act 61 of 1973
Afrigis Pty LTD Reg No 1997/0067/1607.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Strange problem with data source Tomcat 6.0.18

2009-08-31 Thread Michael Ludwig
sch...@afrigis.co.za schrieb am 31.08.2009 um 23:57:07 (+0200):
 Hi there Michael,
 
 Ok, I removed the mysql jar from my app and left it in tomcat/lib
 
 I also undeployed and then redeployed the war file via the manager app
 but the problem persists.

Then I suspect a typo in your resource definition. I once had
Resource/@url instead of Resource/@uri with the MySQL driver.
The error was just:

  Cannot create JDBC driver of class 'com.mysql.jdbc.Driver'
  for connect URL 'null'

Double-check your resource definition.

-- 
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: 100% usage and hanging on startup of Spring/Hibernate app in Tomcat 5.5 on Ubuntu 7

2009-08-31 Thread Leon Rosenberg
Hello,
This indeed sounds like you have problems with one of the spaces,
please add following option to the JAVA_OPTS (or whatever you are
using) to seubmit jvm parameters:
-XX:+PrintGCDetails

And, no tomcat's initial heap size don't default to 64Mb. The JVM
allocateds a heap dependent on your computer type, for example the 1.5
VM would identify a 2 core 2 GB machine as 'server' and allocated more
memory than with 1 core cpu.

http://72.5.124.55/docs/hotspot/gc5.0/ergo5.html

regards
Leon

P.S. I know the link looks strange it come ups from google:
http://www.google.de/search?q=hotspot+memory+ergonomicsie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-a

P.P.S I had a similar situation once, as a client had set space sizes
manually (new and old) and the old space was full. The VM was only
full garbage collecting which led to 100% CPU usage and strange thread
dumps. The above option would help you in this case to identify the
full gc runs previously and during the hangup.



On Mon, Aug 31, 2009 at 11:34 PM, Bradley
Wagnerbradley.wag...@hannonhill.com wrote:

 The other interesting point is that all of those are hung in places where

 they would naturally be allocating an object or have very recently allocated

 an object, and the JVM *might* in theory be growing the heap.  Bradley, are

 your initial and maximum heap sizes identical (I suspect not from your

 original message)?  If not, what happens if you make them so?


 From my original post, I'm setting the following memory parameters:

 -Xmx512M -XX:MaxPermSize=128m

 so I'm not setting an initial heap size at all. If I remember correctly,
 Tomcat's initial heap size default's to 64MB or something.

 I'll try to set the initial and max to the same to see if that has any
 effect.

 Thanks,
 Bradley

 On Mon, Aug 31, 2009 at 4:59 PM, Peter Crowther peter.crowt...@melandra.com
 wrote:

 2009/8/31 Christopher Schultz ch...@christopherschultz.net

  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  Bradley,
 
  On 8/31/2009 4:02 PM, Bradley Wagner wrote:
   Sorry, I should have mentioned this before, but in all cases I tried
 the
   thread dumps 2-3 times at least 30s apart and none of the threads have
   progressed at all.
 
  I agree with Mark: the three threads you showed were different
  (different ids), and showing different call stacks. Are you saying that
  each thread dump you took represents multiple thread dumps where that
  particular thread didn't progress /at all/ over your multi-dump sample?
 
  You might even want to run strace to see which library function calls
  are actually completing.
 

 Agree.

 The other interesting point is that all of those are hung in places where
 they would naturally be allocating an object or have very recently
 allocated
 an object, and the JVM *might* in theory be growing the heap.  Bradley, are
 your initial and maximum heap sizes identical (I suspect not from your
 original message)?  If not, what happens if you make them so?

 - Peter


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Is resource-ref really needed?

2009-08-31 Thread Robert Whane
On Mon, Aug 31, 2009 at 1:50 PM, Martin Gaintymgai...@hotmail.com wrote:

 https://issues.apache.org/bugzilla/show_bug.cgi?id=47769

That's a very good start. Thanks!

There is however still one vital piece of information missing in the
proposed documentation update. It now clearly states that resource-ref
in the web.xml deployment descriptor is optional, but it still doesn't
explain what exactly it is that using resource-ref buys me.

Okay, it's optional, so I don't HAVE to use, but if I DO use it, what
possible advantage does it have?

Don't get me wrong, I'm not trying to be clever, just honestly
wondering about this. But consider the following analogy. Putting a
file called 'nobody-reads-this.txt' in your root directory is
obviously optional too. I mean, you -can- put this file there, but if
you do that nothing happens. It's a filename I just made up and of
course Tomcat doesn't know about it. To me, using resource-ref feels
exactly like this. You -can- put this in your web.xml, but as far as I
can see nothing changes.

Now, maybe, just maybe, it has something to do with compatibility with
other servlet containers? I have tried war archives with Jboss, and at
least on Jboss resource-ref isn't needed either. DataSources appear in
the java: JNDI space, just as in Tomcat. Only the exact location is
different, but resource-ref does not seem capable of doing any name
aliasing and thus can't be used for that purpose either.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Strange problem with data source Tomcat 6.0.18

2009-08-31 Thread Schalk
Hi there Michael,

I am starting to think it might very well have to do with my context.xml
file. I just saw in the logs that Tomcat was actually giving error saying
that it could not deploy myapp.xml. After reading some on the web I
discovered that this is actually my context.xml that Tomcat is picking up
and then renames to my app's name but then something goes wrong Here is
my context.xml file, I have changed it slightly since I saw the error
removing path and docbase and adding factory, going to try this one out now
and see whether that resolves the problem but just in case, here it is,
maybe you spot something I am missing btw. Might there be an ever so
slightly different way that this is handled with Tomcat on Linux as opposed
to Windows?

context debug=5 reloadable=true crossContext=true
Resource name=jdbc/wuMaps auth=Container
type=javax.sql.DataSource
factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory maxActive=100
maxIdle=30 maxWait=1 removeAbandoned=true
removeAbandonedTimeout=100 logAbandoned=true username=root
password=password driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://196.0.0.23:3306/wuadmin_development /
/context

--
Kind Regards
Schalk Neethling

-Original Message-
From: Michael Ludwig [mailto:mil...@gmx.de] 
Sent: 01 September 2009 12:13 AM
To: Tomcat Users List
Subject: Re: Strange problem with data source Tomcat 6.0.18

sch...@afrigis.co.za schrieb am 31.08.2009 um 23:57:07 (+0200):
 Hi there Michael,
 
 Ok, I removed the mysql jar from my app and left it in tomcat/lib
 
 I also undeployed and then redeployed the war file via the manager app
 but the problem persists.

Then I suspect a typo in your resource definition. I once had
Resource/@url instead of Resource/@uri with the MySQL driver.
The error was just:

  Cannot create JDBC driver of class 'com.mysql.jdbc.Driver'
  for connect URL 'null'

Double-check your resource definition.

-- 
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

AfriGIS e-mail facility may not be used for the distribution of chain
letters or offensive email. AfriGIS hereby distances itself from and accepts
no liability for the unauthorized use of its e-mail facility or the sending
of e-mail communications for other than strictly business purposes. AfriGIS
furthermore disclaims liability for any unauthorized instruction for which
permission was not granted. Required as per Sec 50 Companies Act 61 of 1973
Afrigis Pty LTD Reg No 1997/0067/1607.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Strange problem with data source Tomcat 6.0.18

2009-08-31 Thread Michael Ludwig
sch...@afrigis.co.za schrieb am 01.09.2009 um 00:29:34 (+0200):

 I am starting to think it might very well have to do with my
 context.xml file. I just saw in the logs that Tomcat was actually
 giving error saying that it could not deploy myapp.xml. After reading
 some on the web I discovered that this is actually my context.xml that
 Tomcat is picking up and then renames to my app's name but then
 something goes wrong Here is my context.xml file, I have changed
 it slightly since I saw the error removing path

http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

  The value of this field must not be set except when statically
  defining a Context in server.xml, as it will be inferred from the
  filenames used for either the .xml context file or the docBase.

 and docbase

  The value of this field must not be set when the Context is configured
  using a META-INF/context.xml file as it will be inferred by the
  automatic deployment process.

 and adding factory

Probably not necessary.

 Might there be an ever so slightly different way that this is handled
 with Tomcat on Linux as opposed to Windows?

There are some slight differences pertaining to case-insensitive
filesystems, but that's probably not relevant here.

 context debug=5 reloadable=true crossContext=true

Try capitalizing context to Context.

-- 
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Not compiling JSP's

2009-08-31 Thread Carl

Martin,

On the theory that the problem was the JDK, I clean/built the war using my 
development computer (Java 1.6.0_11) and deployed it to the test server 
(Java 1.6.0_13).  I test compiled all the JSP's on the development computer 
just to be certain there wasn't some failure there.  When the war is 
deployed to the test server, there are essentially no files in the Tomcat 
work directory (as expected).  The system runs perfectly on the development 
computer but shows the same problems on the test server (creates a few .java 
files, compiles them properly and then stops compiling the JSP's.)


This is the startup of Tomcat from the catalina log:

Aug 31, 2009 5:25:57 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal 
performance in production environments was not found on the 
java.library.path: /usr/loc

al/jdk1.6.0_13/jre/lib/i386/server:/usr/local/jdk1.6.0_13/jre/lib/i386:/usr/local/jdk1.6.0_13/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
Aug 31, 2009 5:25:57 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Aug 31, 2009 5:25:57 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 667 ms
Aug 31, 2009 5:25:57 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Aug 31, 2009 5:25:57 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
Aug 31, 2009 5:25:58 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Aug 31, 2009 5:25:59 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8008
Aug 31, 2009 5:25:59 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/33  config=null
Aug 31, 2009 5:25:59 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1465 ms
Aug 31, 2009 5:36:46 PM org.apache.catalina.startup.HostConfig 
checkResources

INFO: Undeploying context [/test]
Aug 31, 2009 5:37:53 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive test.war
~

This looks very normal to me.

There are no errors in the catalina.out or the localhost log.

I have set modificationTestInterval to 0.

Odd that some JSP's get compiled and some won't.  Note that it is always the 
same JSP's that will not compile.


Have installed Tomcat several times and never had problems.

Any help is appreciated.

TIA,

Carl



- Original Message - 
From: Martin Gainty mgai...@hotmail.com

To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, August 31, 2009 4:13 PM
Subject: RE: Not compiling JSP's



i try to sync the dev jdk with the deploy jdk so when jsps are compiled
you're compiling your generated JspServlets (with the same jdk
so class signatures will be the same)

hth
Martin Gainty
__
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und 
Vertraulichkeitanmerkung/Note de déni et de confidentialité

Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene 
Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte 
Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht 
dient lediglich dem Austausch von Informationen und entfaltet keine 
rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von 
E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire 
informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie 
de ceci est interdite. Ce message sert à l'information seulement et n'aura 
pas n'importe quel effet légalement obligatoire. Étant donné que les email 
peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
aucune responsabilité pour le contenu fourni.






From: c...@etrak-plus.com
To: users@tomcat.apache.org
Subject: Re: Not compiling JSP's
Date: Mon, 31 Aug 2009 16:32:54 -0500

Martin,

Thanks for your quick reply.  I am presently downloading the latest JDK 
(to

the box that is building the war) to see if that makes a difference.

There are no error messages in any of the logs, including the
localhost*.log.

Thanks,

Carl

- Original Message - 
From: Martin Gainty mgai...@hotmail.com

To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, August 31, 2009 3:30 PM
Subject: RE: Not compiling JSP's



1)
possible incompatibility in JDK versions
what happens if you 

RE: Strange problem with data source Tomcat 6.0.18

2009-08-31 Thread Schalk
Hi there Michael,

Thanks so much for all of your assistance. I am going to try all of these
suggestions and let you know what the results are. One thing though, with
what you just mentioned I technically do not have to include the Context
definition bit at all in the context.xml and can basically just use the
Resource definitions on its own and Tomcat will figure out all of the rest.

--
Kind Regards
Schalk Neethling
Developer - AfriGIS - Mobile
Skype: volume4
www.afrigis.co.za


-Original Message-
From: Michael Ludwig [mailto:mil...@gmx.de] 
Sent: 01 September 2009 12:56 AM
To: Tomcat Users List
Subject: Re: Strange problem with data source Tomcat 6.0.18

sch...@afrigis.co.za schrieb am 01.09.2009 um 00:29:34 (+0200):

 I am starting to think it might very well have to do with my
 context.xml file. I just saw in the logs that Tomcat was actually
 giving error saying that it could not deploy myapp.xml. After reading
 some on the web I discovered that this is actually my context.xml that
 Tomcat is picking up and then renames to my app's name but then
 something goes wrong Here is my context.xml file, I have changed
 it slightly since I saw the error removing path

http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

  The value of this field must not be set except when statically
  defining a Context in server.xml, as it will be inferred from the
  filenames used for either the .xml context file or the docBase.

 and docbase

  The value of this field must not be set when the Context is configured
  using a META-INF/context.xml file as it will be inferred by the
  automatic deployment process.

 and adding factory

Probably not necessary.

 Might there be an ever so slightly different way that this is handled
 with Tomcat on Linux as opposed to Windows?

There are some slight differences pertaining to case-insensitive
filesystems, but that's probably not relevant here.

 context debug=5 reloadable=true crossContext=true

Try capitalizing context to Context.

-- 
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

AfriGIS e-mail facility may not be used for the distribution of chain
letters or offensive email. AfriGIS hereby distances itself from and accepts
no liability for the unauthorized use of its e-mail facility or the sending
of e-mail communications for other than strictly business purposes. AfriGIS
furthermore disclaims liability for any unauthorized instruction for which
permission was not granted. Required as per Sec 50 Companies Act 61 of 1973
Afrigis Pty LTD Reg No 1997/0067/1607.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Strange problem with data source Tomcat 6.0.18

2009-08-31 Thread Schalk
Hi Michael,

A combination of factors did it and this is definitely one of those moments
where you want to kick your own *ss ;)Basically what I did was make all
references everywhere, and I mean everywhere, to wuMaps to wumaps. So this
is in the resource reference in the web.xml in the Java class, the path as
well as docbase and walla! Thanks again!

--
Kind Regards
Schalk Neethling


-Original Message-
From: Michael Ludwig [mailto:mil...@gmx.de] 
Sent: 01 September 2009 12:56 AM
To: Tomcat Users List
Subject: Re: Strange problem with data source Tomcat 6.0.18

sch...@afrigis.co.za schrieb am 01.09.2009 um 00:29:34 (+0200):

 I am starting to think it might very well have to do with my
 context.xml file. I just saw in the logs that Tomcat was actually
 giving error saying that it could not deploy myapp.xml. After reading
 some on the web I discovered that this is actually my context.xml that
 Tomcat is picking up and then renames to my app's name but then
 something goes wrong Here is my context.xml file, I have changed
 it slightly since I saw the error removing path

http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

  The value of this field must not be set except when statically
  defining a Context in server.xml, as it will be inferred from the
  filenames used for either the .xml context file or the docBase.

 and docbase

  The value of this field must not be set when the Context is configured
  using a META-INF/context.xml file as it will be inferred by the
  automatic deployment process.

 and adding factory

Probably not necessary.

 Might there be an ever so slightly different way that this is handled
 with Tomcat on Linux as opposed to Windows?

There are some slight differences pertaining to case-insensitive
filesystems, but that's probably not relevant here.

 context debug=5 reloadable=true crossContext=true

Try capitalizing context to Context.

-- 
Michael Ludwig

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

AfriGIS e-mail facility may not be used for the distribution of chain
letters or offensive email. AfriGIS hereby distances itself from and accepts
no liability for the unauthorized use of its e-mail facility or the sending
of e-mail communications for other than strictly business purposes. AfriGIS
furthermore disclaims liability for any unauthorized instruction for which
permission was not granted. Required as per Sec 50 Companies Act 61 of 1973
Afrigis Pty LTD Reg No 1997/0067/1607.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Not compiling JSP's

2009-08-31 Thread Martin Gainty

will take a look if you can post the problematic jsp (and post the web.xml)

check permissions on work folder make sure the user that started Tomcat
has write,read,execute rights to work folder

thanks,
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 From: c...@etrak-plus.com
 To: users@tomcat.apache.org
 Subject: Re: Not compiling JSP's
 Date: Mon, 31 Aug 2009 19:04:23 -0500
 
 Martin,
 
 On the theory that the problem was the JDK, I clean/built the war using my 
 development computer (Java 1.6.0_11) and deployed it to the test server 
 (Java 1.6.0_13).  I test compiled all the JSP's on the development computer 
 just to be certain there wasn't some failure there.  When the war is 
 deployed to the test server, there are essentially no files in the Tomcat 
 work directory (as expected).  The system runs perfectly on the development 
 computer but shows the same problems on the test server (creates a few .java 
 files, compiles them properly and then stops compiling the JSP's.)
 
 This is the startup of Tomcat from the catalina log:
 
 Aug 31, 2009 5:25:57 PM org.apache.catalina.core.AprLifecycleListener init
 INFO: The APR based Apache Tomcat Native library which allows optimal 
 performance in production environments was not found on the 
 java.library.path: /usr/loc
 al/jdk1.6.0_13/jre/lib/i386/server:/usr/local/jdk1.6.0_13/jre/lib/i386:/usr/local/jdk1.6.0_13/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
 Aug 31, 2009 5:25:57 PM org.apache.coyote.http11.Http11Protocol init
 INFO: Initializing Coyote HTTP/1.1 on http-8080
 Aug 31, 2009 5:25:57 PM org.apache.catalina.startup.Catalina load
 INFO: Initialization processed in 667 ms
 Aug 31, 2009 5:25:57 PM org.apache.catalina.core.StandardService start
 INFO: Starting service Catalina
 Aug 31, 2009 5:25:57 PM org.apache.catalina.core.StandardEngine start
 INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
 Aug 31, 2009 5:25:58 PM org.apache.coyote.http11.Http11Protocol start
 INFO: Starting Coyote HTTP/1.1 on http-8080
 Aug 31, 2009 5:25:59 PM org.apache.jk.common.ChannelSocket init
 INFO: JK: ajp13 listening on /0.0.0.0:8008
 Aug 31, 2009 5:25:59 PM org.apache.jk.server.JkMain start
 INFO: Jk running ID=0 time=0/33  config=null
 Aug 31, 2009 5:25:59 PM org.apache.catalina.startup.Catalina start
 INFO: Server startup in 1465 ms
 Aug 31, 2009 5:36:46 PM org.apache.catalina.startup.HostConfig 
 checkResources
 INFO: Undeploying context [/test]
 Aug 31, 2009 5:37:53 PM org.apache.catalina.startup.HostConfig deployWAR
 INFO: Deploying web application archive test.war
 ~
 
 This looks very normal to me.
 
 There are no errors in the catalina.out or the localhost log.
 
 I have set modificationTestInterval to 0.
 
 Odd that some JSP's get compiled and some won't.  Note that it is always the 
 same JSP's that will not compile.
 
 Have installed Tomcat several times and never had problems.
 
 Any help is appreciated.
 
 TIA,
 
 Carl
 
 
 
 - Original Message - 
 From: Martin Gainty mgai...@hotmail.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Monday, August 31, 2009 4:13 PM
 Subject: RE: Not compiling JSP's
 
 
 
 i try to sync the dev jdk with the deploy jdk so when jsps are compiled
 you're compiling your generated JspServlets (with the same jdk
 so class signatures will be the same)
 
 hth
 Martin Gainty
 __
 Jogi és Bizalmassági kinyilatkoztatás/Verzicht und 
 Vertraulichkeitanmerkung/Note de déni et de confidentialité
  Ez az
 üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
 jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
 készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
 semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
 könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
 ezen üzenet tartalma miatt.
 
 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene 
 Empfaenger 

RE: Strange problem with data source Tomcat 6.0.18

2009-08-31 Thread Caldarale, Charles R
 From: Michael Ludwig [mailto:mil...@gmx.de]
 Subject: Re: Strange problem with data source Tomcat 6.0.18
 
 Try capitalizing context to Context.

Also make sure there is no conf/Catalina/[host]/myapp.xml file lying around; if 
so, it will override your META-INF/context.xml file.  The copy in 
conf/Catalina/[host] is created during deployment, and removed when the webapp 
is undeployed.  However, if you're simply replacing the webapp, the old 
myapp.xml file may hang around.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Strange problem with data source Tomcat 6.0.18

2009-08-31 Thread Caldarale, Charles R
 From: sch...@afrigis.co.za [mailto:sch...@afrigis.co.za]
 Subject: RE: Strange problem with data source Tomcat 6.0.18
 
 I technically do not have to include the Context definition bit
 at all in the context.xml and can basically just use the Resource
 definitions on its own and Tomcat will figure out all of the rest.

Depends on how wide a scope you want for the Resource.  If it's intended to 
be for just one webapp, the Resource element must be nested inside the 
Context element for that webapp.  If you want the Resource to be available 
to all webapps, you can place it inside a GlobalNamingResources element which 
itself must be inside the Server element; in this case, you will need a 
ResourceLink element inside the Context of each webapp that you want to 
give access to said Resource.  Regardless, you do need the Context element.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: 100% usage and hanging on startup of Spring/Hibernate app in Tomcat 5.5 on Ubuntu 7

2009-08-31 Thread Caldarale, Charles R
 From: Bradley Wagner [mailto:bradley.wag...@hannonhill.com]
 Subject: Re: 100% usage and hanging on startup of Spring/Hibernate app
 in Tomcat 5.5 on Ubuntu 7
 
 So, while it's not hanging in the same place every time, it's
 definitely hanging every time.

Try running JConsole against the Tomcat process; this should give you a good 
idea about what's going on inside the JVM, including heap usage and GC activity.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat 4.1.31 problem

2009-08-31 Thread jamez smith
Hi Chris,

Thanks for helping.

I have tried to type startup.bat in DOS under $CATALINA_HOME/bin, the
window quickly closed itself again.  I also tried to type catalina run,
and saw the exception, but it does not look helpful too.


C:\Tomcat 4.1\bincatalina run
Using CATALINA_BASE:   ..
Using CATALINA_HOME:   ..
Using CATALINA_TMPDIR: ..\temp
Using JAVA_HOME:   C:\j2sdk1.4.2_15
Sep 1, 2009 10:13:39 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.31
Catalina.start: LifecycleException:  Context startup failed due to previous
erro
rs
LifecycleException:  Context startup failed due to previous errors
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3
578)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316
)
at
org.apache.catalina.core.StandardService.start(StandardService.java:4
50)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:214
3)
at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)
Stopping service Tomcat-Standalone
Catalina.stop: LifecycleException:  Coyote connector has not been started
LifecycleException:  Coyote connector has not been started
at
org.apache.coyote.tomcat4.CoyoteConnector.stop(CoyoteConnector.java:1
296)
at
org.apache.catalina.core.StandardService.stop(StandardService.java:49
9)
at
org.apache.catalina.core.StandardServer.stop(StandardServer.java:2178
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:494)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)

I am running it immediatly starting up my PC.  How do we know what the
previous error is?  I did remember I had such exception before, but I just
can never trigger the same error again.

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'null', cause:
java.lang.NullPointerException
 at COM.ibm.db2.jdbc.app.DB2Driver.acceptsURL(Unknown Source)
 at java.sql.DriverManager.getDriver(DriverManager.java:232)
 at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:743)

I post the datasource configuration in the server.xml again:

Context docBase=myApp path=/myApp  reloadable=true debug=1 
Logger className=org.apache.catalina.logger.FileLogger
  prefix=procurement_log. suffix=.txt  timestamp=true/


 Resource name=jdbc/test_DS auth=Container
type=javax.sql.DataSource/


 ResourceParams name=jdbc/test_DS
 parameter
   namefactory/name
   valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter
 !-- Maximum number of dB connections in pool. Set to 0 for no limit.
--
 parameter
   namemaxActive/name
   value40/value
 /parameter

 !-- Maximum number of idle dB connections to retain in pool.
  Set to 0 for no limit.
  --
 parameter
   namemaxIdle/name
   value10/value
 /parameter

 !-- Maximum time to wait for a dB connection to become available
  (10 seconds). An Exception is thrown if this timeout is exceeded.
Set to -1 to wait indefinitely.
  --
 parameter
   namemaxWait/name
   value1/value
 /parameter

 !-- DB username and password for dB connections  --
 parameter
  nameusername/name
  valuetestuser/value
 /parameter
 parameter
  namepassword/name
  valuehello/value
 /parameter

 !-- Class name for JDBC driver --
 parameter
namedriverClassName/name
   valueCOM.ibm.db2.jdbc.app.DB2Driver/value
 /parameter

 !-- The JDBC connection url for connecting 

Re: Query on Tomcat Server.xml

2009-08-31 Thread Bhuvanesh Pattanashetti
Hi, Even i have similar problem..
I wanted to create the connector/ element. At the time of tomcat start up
using Tomcat's existing bootstrap classes rather than loading them using
sever.xml.
I wanted to create a https connector. using Http11NioProtocol for the
connector.

Please let me know if any documentation is available on that? or any body
who has implemented the similar ones...

Thanks..
Bhuvan





On Mon, Aug 31, 2009 at 8:21 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Pramod,

 On 8/31/2009 7:19 AM, Tk, Pramod (NSN - IN/Bangalore) wrote:
  What I want to make is to remove keystorePass=X tag and give
  this keystore password when tomcat starts up.

 I think you'll have to write your own code that reads the keystore
 password from the console (and displays it, since I don't think Java can
 control a pty device very well) and then sets up Tomcat. If you're
 trying to be cute, you could pop-up a tiny GUI window to get the
 password, but that will significantly increase the amount of memory
 required just to get Tomcat started because the GUI subsystem must be
 started.

 Or, you could hack Tomcat's existing bootstrap classes to do the same
 thing, but it might end up being more complicated than you think
 (because IIRC Tomcat uses commons-digester to configure everything).

 In either case, you'll have to figure out how to get Tomcat into the
 background after accepting the password, too, unless you just expect
 users to press CTLR-Z and then type bg or whatever.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkqb42AACgkQ9CaO5/Lv0PBI3QCdHFh4oSYRuRtbjrnb5xp4OMCO
 wuUAnijsqsTyNrw5I7VKWFIzOxKt/+HU
 =oFqy
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org