Tomcat 7 and JIoEndpoint as used in ssl

2012-07-05 Thread Hermes Flying
Hi,

I have build a custom SSL implementation and I use that for the SSL 
connectivity in Tomcat.
This was build back in Tomcat 5 and it works in Tomcat 6
But now that we are trying to migrate in Tomcat 7 a change has been done that 
breaks my implementation.
Specifically the 
org.apache.tomcat.util.netSSLImplementation#getServerSocketFactory() has been 
changed to 

org.apache.tomcat.util.netSSLImplementation#getServerSocketFactory(AbstractEndpoint
 endpoint)
at least this is a first difference I found so far.

My question is: What is the need/use of this change? In the previous version 
(with no params) my implementation handled everything. Am I supposed to do 
something with the AbstractEndpoint endpoint? I see that this normally is 
JIoEndpoint. Am I supposed to pass some information back to it? Or has this 
been done just in case someone would need to do that.
What is the functionality of JIoEndpoint?

Thank you


Re: Any way to deal with too many request per second?

2012-07-05 Thread burghard.britzke
a Filter may help. But the clients must handle the situations if they are 
rejected because of the load. 

burghard@iSir

Am 05.07.2012 um 02:35 schrieb Christopher Schultz 
ch...@christopherschultz.net:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Brian,
 
 On 6/29/12 7:57 PM, Brian Braun wrote:
 I created a RESTfull service. My clients are sending me HTTP
 requests, and I return them responses. Usually, a client makes at
 the most 1-2 requests per second which is totally fine, but some
 clients sometimes make about 30 requests per second and that makes
 my server suffer, even though I'm using a load balancer with two
 servers behind it. I would like to find a way to deal with this.
 The best thing would be to delay them when they do that, not to
 totally stop or ban them, but to slow them somehow. Maybe creating
 a queue for them, or maybe putting them in a lower priority, until
 they slow their requests. I could program this myself, but I guess
 there is already a solution somewhere. Maybe a Tomcat valve could
 do it? Does anybody know one? Or maybe some kind of filter? Any
 suggestions?
 
 You are looking for a feature called traffic shaping or quality of
 service (QOS), which is something Tomcat does not do (at least not
 directly). You should look at your load balancer's options to support
 either of these features.
 
 If not, you could look at something like mod_qos for Apache httpd. It
 will require another component, but it will get the job done. The
 alternative to something off-the-shelf like that, of course, is to
 implement it yourself.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAk/04WMACgkQ9CaO5/Lv0PB/ZQCgkhHv+tpYxptkT0ZPAkLcvF7S
 0ZYAnjTYPxAdFM3nUbVRC8+vio+jyDg3
 =YjE6
 -END PGP SIGNATURE-
 
 -
 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: Tomcat 7 and JIoEndpoint as used in ssl

2012-07-05 Thread Konstantin Kolinko
2012/7/5 Hermes Flying flyingher...@yahoo.com:
 Hi,

 I have build a custom SSL implementation and I use that for the SSL 
 connectivity in Tomcat.
 This was build back in Tomcat 5 and it works in Tomcat 6
 But now that we are trying to migrate in Tomcat 7 a change has been done that 
 breaks my implementation.
 Specifically the 
 org.apache.tomcat.util.netSSLImplementation#getServerSocketFactory() has been 
 changed to

 org.apache.tomcat.util.netSSLImplementation#getServerSocketFactory(AbstractEndpoint
  endpoint)
 at least this is a first difference I found so far.

 My question is: What is the need/use of this change?

http://svn.apache.org/viewvc?view=revisionrevision=1044058

 In the previous version (with no params) my implementation handled 
 everything. Am I supposed to do something with the AbstractEndpoint endpoint? 
 I see that this normally is JIoEndpoint. Am I supposed to pass some 
 information back to it? Or has this been done just in case someone would need 
 to do that.

org.apache.tomcat.util.net.jsse.JSSEImplementation extends SSLImplementation {
(...)
@Override
public ServerSocketFactory getServerSocketFactory(AbstractEndpoint
endpoint)  {
return new JSSESocketFactory(endpoint);
}
}

and JSSESocketFactory uses endpoint a lot.

 What is the functionality of JIoEndpoint?

The same as of AbstractEndpoint plus a bit more.

Endpoint
1. represents the server socket, on which Tomcat connector listens.
2. is responsible for socket management regardless of protocol (HTTP,
AJP), especially the server socket management.
3. naturally serves as the storage for certain set of configurations
options (the ones that are protocol-agnostic and ones that relate to
socket management).



Best regards,
Konstantin Kolinko

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



: setting tomcat in iis

2012-07-05 Thread Ricardo Simões
 

Hi everyone, I think there was a guide that explain how to set tomcat 6 with
IIS but iv seem to lost the link, does anyone have it?

Thanks

Ricardo Simões


Description: C:\Users\Ricardo\AppData\Roaming\Microsoft\Stationery\logo.gif

Coimbra Coordinating Centre for Clinical Research 
AIBILI - Association for Innovation and Biomedical Research on Light and
Image 
Azinhaga de Santa Comba, Celas . 3000-548 Coimbra . Portugal 
Tel: +351 239 480 141 
Fax: +351 239 480 117 
E-mail: rsim...@aibili.pt 
Url: www.aibili.pt 

Este e-mail e todos os arquivos anexos são confidenciais e deverão ser lidos
unicamente pelo indivíduo ou entidade a quem são dirigidos. Se não for o
receptor original, todo o uso, disseminação, reenvio, impressão, ou cópia
deste e-mail é estritamente proibido. Se receber este e-mail por engano,
notifique por favor o remetente. 

This e-mail and any files transmitted with it are confidential and are
intended solely for the use of the individual or entity to which they are
addressed. If you are not the original recipient, any use, dissemination,
forwarding, printing, or copying of this e-mail is strictly prohibited. If
you received this e-mail in error, please notify the originator. 



Re: : setting tomcat in iis

2012-07-05 Thread Casper Wandahl Schmidt

http://lmgtfy.com/?q=tomcat+6+iis

Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 05-07-2012 14:48, Ricardo Simões skrev:


Hi everyone, I think there was a guide that explain how to set tomcat 
6 with IIS but iv seem to lost the link, does anyone have it?


Thanks

Ricardo Simões

Description: 
C:\Users\Ricardo\AppData\Roaming\Microsoft\Stationery\logo.gif


/Coimbra Coordinating Centre for Clinical Research
AIBILI - Association for Innovation and Biomedical Research on Light 
and I//mage

Azinhaga de Santa Comba, Celas . 3000-548 Coimbra . Portugal/
Tel:/+351 239 480 141/
Fax:/+351 239 480 117/
E-mail: /rsim...@aibili.pt/
Url: /www.aibili.pt www.aibili.pt/4c_about.php/

Este e-mail e todos os arquivos anexos são confidenciais e deverão ser 
lidos unicamente pelo indivíduo ou entidade a quem são dirigidos. Se 
não for o receptor original, todo o uso, disseminação, reenvio, 
impressão, ou cópia deste e-mail é estritamente proibido. Se receber 
este e-mail por engano, notifique por favor o remetente.


This e-mail and any files transmitted with it are confidential and are 
intended solely for the use of the individual or entity to which they 
are addressed. If you are not the original recipient, any use, 
dissemination, forwarding, printing, or copying of this e-mail is 
strictly prohibited. If you received this e-mail in error, please 
notify the originator.







Re: Tomcat 7 and JIoEndpoint as used in ssl

2012-07-05 Thread Hermes Flying
Ok I will read these thank you.
So essentially you are saying that I can not get away by justo overriding the 
new method delegating to the old one? I.e.

public ServerSocketFactory getServerSocketFactory(AbstractEndpoint endpoint){
  return getServerSocketFactory();//the existing and worked fine in 
older Tomcat version

}

and call my existing implementation and just ignore the endpoint parameter?






 From: Konstantin Kolinko knst.koli...@gmail.com
To: Tomcat Users List users@tomcat.apache.org 
Sent: Thursday, July 5, 2012 3:25 PM
Subject: Re: Tomcat 7 and JIoEndpoint as used in ssl
 
2012/7/5 Hermes Flying flyingher...@yahoo.com:
 Hi,

 I have build a custom SSL implementation and I use that for the SSL 
 connectivity in Tomcat.
 This was build back in Tomcat 5 and it works in Tomcat 6
 But now that we are trying to migrate in Tomcat 7 a change has been done that 
 breaks my implementation.
 Specifically the 
 org.apache.tomcat.util.netSSLImplementation#getServerSocketFactory() has been 
 changed to

 org.apache.tomcat.util.netSSLImplementation#getServerSocketFactory(AbstractEndpoint
  endpoint)
 at least this is a first difference I found so far.

 My question is: What is the need/use of this change?

http://svn.apache.org/viewvc?view=revisionrevision=1044058

 In the previous version (with no params) my implementation handled 
 everything. Am I supposed to do something with the AbstractEndpoint endpoint? 
 I see that this normally is JIoEndpoint. Am I supposed to pass some 
 information back to it? Or has this been done just in case someone would need 
 to do that.

org.apache.tomcat.util.net.jsse.JSSEImplementation extends SSLImplementation {
(...)
    @Override
    public ServerSocketFactory getServerSocketFactory(AbstractEndpoint
endpoint)  {
        return new JSSESocketFactory(endpoint);
    }
}

and JSSESocketFactory uses endpoint a lot.

 What is the functionality of JIoEndpoint?

The same as of AbstractEndpoint plus a bit more.

Endpoint
1. represents the server socket, on which Tomcat connector listens.
2. is responsible for socket management regardless of protocol (HTTP,
AJP), especially the server socket management.
3. naturally serves as the storage for certain set of configurations
options (the ones that are protocol-agnostic and ones that relate to
socket management).



Best regards,
Konstantin Kolinko

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

Re: Tomcat 7 and JIoEndpoint as used in ssl

2012-07-05 Thread Konstantin Kolinko
2012/7/5 Hermes Flying flyingher...@yahoo.com:
 Ok I will read these thank you.
 So essentially you are saying that I can not get away by justo overriding the 
 new method delegating to the old one? I.e.

 public ServerSocketFactory getServerSocketFactory(AbstractEndpoint endpoint){
   return getServerSocketFactory();//the existing and worked fine in 
 older Tomcat version

 }

 and call my existing implementation and just ignore the endpoint parameter?

Yes.  ServerSocketFactory does not expose any references to endpoint,
so you can ignore this parameter if you do not need it.

There are 2 implementations of ServerSocketFactory in Tomcat:
DefaultServerSocketFactory,
JSSESocketFactory.
The first one ignores the endpoint. The second one uses it to get some options.


Best regards,
Konstantin Kolinko

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



RE: : setting tomcat in iis

2012-07-05 Thread Ricardo Simões
Thanks, I've done a previous search but couldn't find what I was looking.

Also I explain my self badly I need to use openclinica that runs in Tomcat
and I'm installing it on a windows server 2008 r2 with iis7, iv installed
tomcat and it works great with iis closed, I've tried some of the
configurations on the web they don’t seem to work.

Isn't there a way that I would create a website and point it to tomcat
statup?

thanks


-Original Message-
From: Casper Wandahl Schmidt [mailto:kalle.pri...@gmail.com] 
Sent: quinta-feira, 5 de Julho de 2012 13:52
To: users@tomcat.apache.org
Subject: Re: : setting tomcat in iis

http://lmgtfy.com/?q=tomcat+6+iis

Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 05-07-2012 14:48, Ricardo Simões skrev:

 Hi everyone, I think there was a guide that explain how to set tomcat
 6 with IIS but iv seem to lost the link, does anyone have it?

 Thanks

 Ricardo Simões

 Description: 
 C:\Users\Ricardo\AppData\Roaming\Microsoft\Stationery\logo.gif

 /Coimbra Coordinating Centre for Clinical Research AIBILI - 
 Association for Innovation and Biomedical Research on Light and 
 I//mage Azinhaga de Santa Comba, Celas . 3000-548 Coimbra . Portugal/
 Tel:/+351 239 480 141/
 Fax:/+351 239 480 117/
 E-mail: /rsim...@aibili.pt/
 Url: /www.aibili.pt www.aibili.pt/4c_about.php/

 Este e-mail e todos os arquivos anexos são confidenciais e deverão ser 
 lidos unicamente pelo indivíduo ou entidade a quem são dirigidos. Se 
 não for o receptor original, todo o uso, disseminação, reenvio, 
 impressão, ou cópia deste e-mail é estritamente proibido. Se receber 
 este e-mail por engano, notifique por favor o remetente.

 This e-mail and any files transmitted with it are confidential and are 
 intended solely for the use of the individual or entity to which they 
 are addressed. If you are not the original recipient, any use, 
 dissemination, forwarding, printing, or copying of this e-mail is 
 strictly prohibited. If you received this e-mail in error, please 
 notify the originator.





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



Re: : setting tomcat in iis

2012-07-05 Thread Konstantin Kolinko
2012/7/5 Ricardo Simões rsim...@aibili.pt:
 Thanks, I've done a previous search but couldn't find what I was looking.


You can limit your search by adding site:tomcat.apache.org

See
tomcat.apache.org - Documentation - Tomcat Connectors - IIS.

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



Re: Tomcat 7 and JIoEndpoint as used in ssl

2012-07-05 Thread Hermes Flying
Great! So the AbstractEndpoint is only passed in to be accessed if needed and 
if I don't need to use it I am ok!
I will try this. Hopefully nothing will break!




 From: Konstantin Kolinko knst.koli...@gmail.com
To: Tomcat Users List users@tomcat.apache.org 
Sent: Thursday, July 5, 2012 4:24 PM
Subject: Re: Tomcat 7 and JIoEndpoint as used in ssl
 
2012/7/5 Hermes Flying flyingher...@yahoo.com:
 Ok I will read these thank you.
 So essentially you are saying that I can not get away by justo overriding the 
 new method delegating to the old one? I.e.

 public ServerSocketFactory getServerSocketFactory(AbstractEndpoint endpoint){
           return getServerSocketFactory();//the existing and worked fine in 
older Tomcat version

 }

 and call my existing implementation and just ignore the endpoint parameter?

Yes.  ServerSocketFactory does not expose any references to endpoint,
so you can ignore this parameter if you do not need it.

There are 2 implementations of ServerSocketFactory in Tomcat:
DefaultServerSocketFactory,
JSSESocketFactory.
The first one ignores the endpoint. The second one uses it to get some options.


Best regards,
Konstantin Kolinko

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

Re: tomcat filters

2012-07-05 Thread Pid *
On 5 Jul 2012, at 01:51, Christopher Schultz
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Pid,

 On 7/2/12 6:15 PM, Pid wrote:
 On 02/07/2012 18:34, Varrun Ramani wrote:
 Hi

 I am in the process developing a web application firewall(WAF)
 for tomcat similar to what mod security does, and am planning to
 use the filter API already present in tomcat to intercept
 requests and do the filtering. Are there any existing efforts at
 doing this for tomcat?

 Quite a few yes.  Acegi Security (now called Spring Security) for
 example.

 Forgive my ignorance, for I've never used Spring [anything]... does
 ACEGI/SpringSecurity provide features like mod_security, or is it a
 replacement for container-managed J2EE security (or both)?

Bit of both and more.


p



 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAk/05PUACgkQ9CaO5/Lv0PCYYgCgt0kEVBouJW+C82IdECGowzw/
 ghsAoJJuzr2+9PqGrmWuHqO+anyPUPCP
 =szuF
 -END PGP SIGNATURE-

 -
 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: [EXTERNAL] Re: General Architecture Question for multiple websites on a single RedHat server

2012-07-05 Thread Simon, Leonard
Chris,

I don't envision us using that but thanks anyway.
We are looking more at a vendor supported solution because of the many
things the system administration group supports and do not have the
expertise nor time for customized solutions.

But again thanks for offering.

We need to figure out what is causing Tomcat to use 100% of the CPU for
what we currently have in place. We were able to capture a thread dump at
the time of slowdown using a kill -3 but when the logs rotated we lost the
data. Will have to wait for the next slowdown.

On Wed, Jul 4, 2012 at 9:02 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Leonard,

 On 7/2/12 4:32 PM, Simon, Leonard wrote:
  Our goals are as follows:
 
  The operating system will be RHEL 6.X.
 
  We want to run Apache and Tomcat on a single server running five
  websites using different ports for each.
 
  Our goal is to manage each web server independently, i.e.,
  separate shutdown and startup scripts and hopefully  different log
  files for each web server.
 
  We noticed the bundled Apache/Tomcat with RedHat might only give us
  a standard install. Is there a way to do an alternate path
  install?
 
  Thanks and look forward to some ideas on how to accomplish this.

 I periodically threaten to post my multi-instance Apache Ant scripts
 to the list. I have recently split my build process into multiple
 build scripts including a build-tomcat.xml which will manage that kind
 of thing for you. It's still not a perfect separation, but it allows
 you to do things like define 'projectname.property=value' in
 ~/.ant.properties, set project name=name in build.xml, then
 duplicate the whole thing over and over again.

 So, I have, for instance, myproject1.tomcat-port and
 myproject1.tomcat-shutdown-port, etc. and then (near) duplicates for
 each project. Each developer on a shared dev server gets a batch of
 port numbers assigned for their own uses and then sets those up
 accordingly. Each webapp can also have a separate projectX.tomcat-home
 and projectX.java-home property, so that simply typing 'ant
 tomcat-start' in any project's directory will build an appropriate
 CATALINA_BASE (ports and all) for that webapp and then launch the
 webapp in that instance.

 All of this requires a fair amount of infrastructure to set up (build
 scripts, environment-specific server.xml, etc. files, etc.) but once
 it's done it makes your life so much easier.

 I can share what I've got, but it will likely require you to heavily
 modify it to work in your environment since it's so deeply integrated
 into our complete build process.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAk/055sACgkQ9CaO5/Lv0PCr/QCbBAC4LQmZxoMzdtarFxBXHbb8
 qjEAn3ldY08iFkVxlWrEkTLDgfxA7qql
 =ev/P
 -END PGP SIGNATURE-

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




Error Starting webapp. FAIL - Application at context path /cyclos could not be started.

2012-07-05 Thread Rick Bragg
Hi,

After upgrading one of my web applications (cyclos) I can no longer start up the
web application.  I get the following error:

FAIL - Application at context path /cyclos could not be started.

I tried undoing my upgrade, but I still get errors.  Has anybody run into this? 
What would be the best way to find a solution?

The following is in my catalina log:

-
Jul 5, 2012 1:03:22 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Jul 5, 2012 1:03:22 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/cyclos] startup failed due to previous errors
Jul 5, 2012 1:03:23 PM org.apache.catalina.loader.WebappClassLoader
clearReferencesJdbc
SEVERE: A web application registered the JBDC driver [com.mysql.jdbc.Driver] but
failed to unregister it when the web application was stopped. To prevent a 
memory
leak, the JDBC Driver has been forcibly unregistered.
Jul 5, 2012 1:03:23 PM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: A web application appears to have started a thread named [MySQL 
Statement
Cancellation Timer] but has failed to stop it. This is very likely to create a
memory leak.
Jul 5, 2012 1:03:23 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap
SEVERE: A web application created a ThreadLocal with key of type
[java.lang.ThreadLocal] (value [java.lang.ThreadLocal@50ba0dfc]) and a value of
type [org.apache.cxf.bus.CXFBusImpl] (value
[org.apache.cxf.bus.CXFBusImpl@66ec44cb]) but failed to remove it when the web
application was stopped. To prevent a memory leak, the ThreadLocal has been
forcibly removed.

-

Also, the following is in my localhost log:

-

Jul 5, 2012 1:03:10 PM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: start: Starting web application at '/cyclos'
Jul 5, 2012 1:03:11 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jul 5, 2012 1:03:22 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of 
class
org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with
name 'sessionFactory' defined in class path resource
[nl/strohalm/cyclos/spring/persistence.xml]: Invocation of init method failed;
nested exception is java.lang.NoClassDefFoundError:
org/hibernate/type/StandardBasicTypes
Caused by: java.lang.NoClassDefFoundError: org/hibernate/type/StandardBasicTypes
at 
nl.strohalm.cyclos.utils.hibernate.PeriodType.clinit(PeriodType.java:35)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at 
org.hibernate.type.CompositeCustomType.init(CompositeCustomType.java:69)
at org.hibernate.type.TypeFactory.heuristicType(TypeFactory.java:265)
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:283)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:276)
at org.hibernate.mapping.Property.isValid(Property.java:207)
at 
org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:458)
at org.hibernate.mapping.RootClass.validate(RootClass.java:215)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1149)
at 
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1334)
at
org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
at
nl.strohalm.cyclos.spring.CustomSessionFactoryBean.newSessionFactory(CustomSessionFactoryBean.java:61)
at
org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
at
org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1203)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at

Re: Error Starting webapp. FAIL - Application at context path /cyclos could not be started.

2012-07-05 Thread Tim Watts
Hi Rick,

On Thu, 2012-07-05 at 13:15 -0400, Rick Bragg wrote:
 Hi,
 
 After upgrading one of my web applications (cyclos) I can no longer start up 
 the
 web application.  I get the following error:
 
 FAIL - Application at context path /cyclos could not be started.
 
 I tried undoing my upgrade, but I still get errors.  Has anybody run into 
 this? 
 What would be the best way to find a solution?
 
Based on the logs you included the root problem is that the Hibernate
class org.hibernate.type.StandardBasicTypes is missing.  If it were me
administering this system I'd start by contacting the vendor with this
log output and ask them to help me get it fixed.

Hibernate is a commonly used framework for accessing objects in a
database.


 The following is in my catalina log:
 
 -
 Jul 5, 2012 1:03:22 PM org.apache.catalina.core.StandardContext start
 SEVERE: Error listenerStart
 Jul 5, 2012 1:03:22 PM org.apache.catalina.core.StandardContext start
 SEVERE: Context [/cyclos] startup failed due to previous errors
 Jul 5, 2012 1:03:23 PM org.apache.catalina.loader.WebappClassLoader
 clearReferencesJdbc
 SEVERE: A web application registered the JBDC driver [com.mysql.jdbc.Driver] 
 but
 failed to unregister it when the web application was stopped. To prevent a 
 memory
 leak, the JDBC Driver has been forcibly unregistered.
 Jul 5, 2012 1:03:23 PM org.apache.catalina.loader.WebappClassLoader
 clearReferencesThreads
 SEVERE: A web application appears to have started a thread named [MySQL 
 Statement
 Cancellation Timer] but has failed to stop it. This is very likely to create a
 memory leak.
 Jul 5, 2012 1:03:23 PM org.apache.catalina.loader.WebappClassLoader
 clearThreadLocalMap
 SEVERE: A web application created a ThreadLocal with key of type
 [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@50ba0dfc]) and a value 
 of
 type [org.apache.cxf.bus.CXFBusImpl] (value
 [org.apache.cxf.bus.CXFBusImpl@66ec44cb]) but failed to remove it when the web
 application was stopped. To prevent a memory leak, the ThreadLocal has been
 forcibly removed.
 
 -
 
 Also, the following is in my localhost log:
 
 -
 
 Jul 5, 2012 1:03:10 PM org.apache.catalina.core.ApplicationContext log
 INFO: HTMLManager: start: Starting web application at '/cyclos'
 Jul 5, 2012 1:03:11 PM org.apache.catalina.core.ApplicationContext log
 INFO: Initializing Spring root WebApplicationContext
 Jul 5, 2012 1:03:22 PM org.apache.catalina.core.StandardContext listenerStart
 SEVERE: Exception sending context initialized event to listener instance of 
 class
 org.springframework.web.context.ContextLoaderListener
 org.springframework.beans.factory.BeanCreationException: Error creating bean 
 with
 name 'sessionFactory' defined in class path resource
 [nl/strohalm/cyclos/spring/persistence.xml]: Invocation of init method failed;
 nested exception is java.lang.NoClassDefFoundError:
 org/hibernate/type/StandardBasicTypes
 Caused by: java.lang.NoClassDefFoundError: 
 org/hibernate/type/StandardBasicTypes
   at 
 nl.strohalm.cyclos.utils.hibernate.PeriodType.clinit(PeriodType.java:35)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at java.lang.Class.newInstance0(Class.java:355)
   at java.lang.Class.newInstance(Class.java:308)
   at 
 org.hibernate.type.CompositeCustomType.init(CompositeCustomType.java:69)
   at org.hibernate.type.TypeFactory.heuristicType(TypeFactory.java:265)
   at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:283)
   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:276)
   at org.hibernate.mapping.Property.isValid(Property.java:207)
   at 
 org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:458)
   at org.hibernate.mapping.RootClass.validate(RootClass.java:215)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:1149)
   at 
 org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1334)
   at
 org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
   at
 nl.strohalm.cyclos.spring.CustomSessionFactoryBean.newSessionFactory(CustomSessionFactoryBean.java:61)
   at
 org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
   at
 org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
   at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1203)
   at
 

confused by tomcat6/7 docs

2012-07-05 Thread Russ Tremain

Hi Oliver,

I must say I'm a bit confused by the examples  docs for tomcat7-maven-plugin.

I see reference to a war:explode goal, which doesn't seem to exist. 
The reference is here:


http://tomcat.apache.org/maven-plugin-2.0-beta-1/context-goals.html

But when I dump the plugin documentation [1], I see no such goal.

What I would like to find out about the possibility to deploy an 
exploded war image to a local tomcat instance.


I've been successfully using the deploy (tomcat7:deploy) goal, but my 
developers are complaining that it is too slow.  I need to work out a 
method to use an exploded war.


Any help appreciated...

thanks!
-Russ

[1] mvn -Dplugin=tomcat7 -DgroupId=org.apache.tomcat.maven -Dfull help:describe
...
[INFO] org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-beta-1

Name: Apache Tomcat Maven Plugin :: Tomcat 7.x
Description: The Tomcat Maven Plugin provides goals to manipulate WAR
  projects within the Tomcat 7.x servlet container.
Group Id: org.apache.tomcat.maven
Artifact Id: tomcat7-maven-plugin
Version: 2.0-beta-1
Goal Prefix: tomcat7

This plugin has 8 goals:

tomcat7:deploy
  Description: Deploy a WAR to Tomcat.
  Implementation: org.apache.tomcat.maven.plugin.tomcat7.deploy.DeployMojo
  Language: java
  Before this mojo executes, it will call:
Phase: 'package'

  Available parameters:

charset (Default: ISO-8859-1)
  The URL encoding charset to use when communicating with Tomcat manager.

contextFile
  The path of the Tomcat context XML file. This is not used for war
  deployment mode.

ignorePackaging (Default: false)
  If set to true ignore if packaging of project is not 'war'.

mode (Default: war)
  The deployment mode to use. This must be either war to deploy the war,
  context to deploy the context XML file, or both to deploy the war with
  the context XML file.

password
  The password to use for deployment

path (Default: /${project.artifactId})
  The webapp context path to use for the web application being run. This
  must always start with a forward-slash ('/').

server
  The server id in settings.xml to use when authenticating with Tomcat
  manager, or null to use defaults of username admin and no password.

tag
  The Tomcat webapp tag name to use.

update (Default: false)
  Whether Tomcat should automatically undeploy webapps that already exist
  when deploying.

url (Default: http://localhost:8080/manager/html)
  The full URL of the Tomcat manager instance to use.

username
  The tomcat username to use for deployment

warFile
  The path of the WAR file to deploy.

tomcat7:deploy-only
  Description: Deploy a WAR to Tomcat witjout forking the package lifecycle
  Implementation: org.apache.tomcat.maven.plugin.tomcat7.deploy.DeployOnlyMojo
  Language: java

  Available parameters:

charset (Default: ISO-8859-1)
  The URL encoding charset to use when communicating with Tomcat manager.

contextFile
  The path of the Tomcat context XML file. This is not used for war
  deployment mode.

ignorePackaging (Default: false)
  If set to true ignore if packaging of project is not 'war'.

mode (Default: war)
  The deployment mode to use. This must be either war to deploy the war,
  context to deploy the context XML file, or both to deploy the war with
  the context XML file.

password
  The password to use for deployment

path (Default: /${project.artifactId})
  The webapp context path to use for the web application being run. This
  must always start with a forward-slash ('/').

server
  The server id in settings.xml to use when authenticating with Tomcat
  manager, or null to use defaults of username admin and no password.

tag
  The Tomcat webapp tag name to use.

update (Default: false)
  Whether Tomcat should automatically undeploy webapps that already exist
  when deploying.

url (Default: http://localhost:8080/manager/html)
  The full URL of the Tomcat manager instance to use.

username
  The tomcat username to use for deployment

warFile
  The path of the WAR file to deploy.

tomcat7:exec-war
  Description: (no description available)
  Implementation: org.apache.tomcat.maven.plugin.tomcat7.run.ExecWarMojo
  Language: java
  Before this mojo executes, it will call:
Phase: 'package'

  Available parameters:

accessLogValveFormat (Default: %h %l %u %t )
  see http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html

attachArtifact (Default: true)
  Attach or not the generated artifact to the build (use true if you want
  to install or deploy it)

attachArtifactClassifier (Default: exec-war)
  the classifier to use for the attached/generated artifact

attachArtifactClassifierType (Default: jar)
  the type to use for the attached/generated artifact

buildDirectory (Default: