[Resin-interest] Error Handling on Per Directory Basis?

2009-08-06 Thread graemerae



I've got a sub folder under a main folder that handles a mobile version of
our site.

In resin.conf I've got

error-page error-code='500' location='/error.jsp'/

For the main site,

but what I need to do is have a different location for the mobile site:
(something like)

error-page error-code='500' location='/errorMobile.jsp'/


In apache I'd put it in a Directory tag or put a line in an apache
.htaccess file in that folder, but that won't work here.  Is there an
equivalent tag or method for Resin?

Thanks in advance!




(PS - running resin 2.1.4 - yeah I know, it's old, but it works great!)
-- 
View this message in context: 
http://www.nabble.com/Error-Handling-on-Per-Directory-Basis--tp24855159p24855159.html
Sent from the Resin mailing list archive at Nabble.com.



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Error while deploying a web application on Resin 3.1.6

2008-07-11 Thread Emil Ong
On Thu, Jul 10, 2008 at 08:13:05PM -0700, George Wei wrote:
 
 All items in my classpath are as follows:
 

[snip]

Hi George,

I don't see the hibernate jar in there... is it perhaps in your webapp's
lib?  

If Resin is compiling your Java source for you, you might try deleting
the class files in your webapp to force recompilation.  Getting rid of
the WEB-INF/work might also help.

BTW, I'm not sure if this is the right version of Hibernate, but I found
the method you're referring to:

http://www.hibernate.org/hib_docs/annotations/api/org/hibernate/cfg/AnnotationConfiguration.html#addProperties(java.util.Properties)

Best,
Emil

 As you can understand, D:\Java\JDK150\ is where I install JDK 1.5.0 and
 E:\Applications\resin-3.1.6\ is where I install Resin 3.1.6. It looks there
 are not any strange jars in my classpath. Any other clues?
 
 George
 
 
 Scott Ferguson wrote:
  
  
  There's probably an old jar somewhere in your classpath.  If you start  
  Resin with -verbose, you'll see the system classpath, which might help  
  track down the extra jar.
  
  Resin itself couldn't create that error.  It's due to some class  
  compiled against an old version of a method.
  
  -- Scott
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/Error-while-deploying-a-web-application-on-Resin-3.1.6-tp18376474p18395860.html
 Sent from the Resin mailing list archive at Nabble.com.
 
 
 
 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest


Emil Ong
Chief Evangelist
Caucho Technology, Inc.
Tel. (858) 361-2436
mailto:[EMAIL PROTECTED]
http://blog.caucho.com/

Caucho: Reliable Open Source
-- Resin: application server
-- Quercus: PHP in Java
-- Hessian Web Services


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Error while deploying a web application on Resin 3.1.6

2008-07-11 Thread George Wei

Yes, you're right. Thank you and Scott.

The reason is I added Hibernate Annotations 3.3.0 GA and EntityManager 3.3.2
GA in my project. As describled in the compatibility matrix on Hibernate's
website, EntityManager 3.3.2 GA is compatible with Annotations 3.3.x, so I
believe they are REALLY compatible. But EntityManager 3.3.2 GA tries to call
the method org.hibernate.cfg.AnnotationConfiguration.addProperties() which
is only available in Annotations 3.3.1 GA, and this causes Resin failed to
load my application.

George


Emil Ong wrote:
 
 On Thu, Jul 10, 2008 at 08:13:05PM -0700, George Wei wrote:
 
 All items in my classpath are as follows:
 
 
 [snip]
 
 Hi George,
 
 I don't see the hibernate jar in there... is it perhaps in your webapp's
 lib?  
 
 If Resin is compiling your Java source for you, you might try deleting
 the class files in your webapp to force recompilation.  Getting rid of
 the WEB-INF/work might also help.
 
 BTW, I'm not sure if this is the right version of Hibernate, but I found
 the method you're referring to:
 
 http://www.hibernate.org/hib_docs/annotations/api/org/hibernate/cfg/AnnotationConfiguration.html#addProperties(java.util.Properties)
 
 Best,
 Emil
 
 Emil Ong
 Chief Evangelist
 Caucho Technology, Inc.
 Tel. (858) 361-2436
 mailto:[EMAIL PROTECTED]
 http://blog.caucho.com/
 
 Caucho: Reliable Open Source
 -- Resin: application server
 -- Quercus: PHP in Java
 -- Hessian Web Services
 
 
 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest
 
 

-- 
View this message in context: 
http://www.nabble.com/Error-while-deploying-a-web-application-on-Resin-3.1.6-tp18376474p18415104.html
Sent from the Resin mailing list archive at Nabble.com.



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Error on web application startup with aweb-service-client tag

2008-07-10 Thread Monson, Ron
Try this format instead:
 
remote-client name=myWebSvc interface=example.MyWebService
uri=hessian:url=${webApp.url}/mywebsvc//

 

Regards, 
Ron Monson
EDS - Homeland Security  Justice
Systems Architecture  Development
Dept. Of Homeland Security, SEVIS Project
800 K St. NW, Suite 830, Washington, DC 20001
Mobile (202) 437-2157
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]  




From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sashidhar Guduri
Sent: Thursday, July 10, 2008 8:27 AM
To: General Discussion for the Resin application server
Subject: [Resin-interest] Error on web application startup with
aweb-service-client tag


I get the following error when I start up resin: 

[2008/07/10 08:22:22.454]
/usr/resin/resin-pro-3.1.6/conf/webservices.conf:11: 'url' is an unknown
property of 'com.caucho.remote.client.RemoteClient'.
[2008/07/10 08:22:22.454] 
[2008/07/10 08:22:22.454] 10: web-service-client
jndi-name=service/CosignService
[2008/07/10 08:22:22.454] 11:
urlhessian:http://172.20.57.97/test.msis.ws/services/CosignService/ur
l
[2008/07/10 08:22:22.454] 12:
interfaceedu.umich.authentication.cosign.CosignService/interface
[2008/07/10 08:22:22.454] 13: /web-service-client

If I don't give a url, it complains that url is required. Is
there a bug in resin 3.1.6 to not handle the url tag properly?

Thanks
Sashi

___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Error on web application startup with aweb-service-client tag

2008-07-10 Thread Sashidhar Guduri
Thanks for the reply but that format does not expose it using jndi. Is there
a way to expose using jndi for remote client tag?
Sashi

On Thu, Jul 10, 2008 at 8:43 AM, Monson, Ron [EMAIL PROTECTED] wrote:

  Try this format instead:


 
 remote-client name=myWebSvc interface=example.MyWebService uri=
 hessian:url=${webApp.url}/mywebsvc//



 Regards,
 *Ron Monson***
 EDS - Homeland Security  Justice
 Systems Architecture  Development
 Dept. Of Homeland Security, SEVIS Project
 800 K St. NW, Suite 830, Washington, DC 20001
 Mobile (202) 437-2157
 [EMAIL PROTECTED] [EMAIL PROTECTED]

  --
 *From:* [EMAIL PROTECTED] [mailto:
 [EMAIL PROTECTED] *On Behalf Of *Sashidhar Guduri
 *Sent:* Thursday, July 10, 2008 8:27 AM
 *To:* General Discussion for the Resin application server
 *Subject:* [Resin-interest] Error on web application startup with
 aweb-service-client tag

 I get the following error when I start up resin:
  [2008/07/10 08:22:22.454]
 /usr/resin/resin-pro-3.1.6/conf/webservices.conf:11: 'url' is an unknown
 property of 'com.caucho.remote.client.RemoteClient'.
 [2008/07/10 08:22:22.454]
 [2008/07/10 08:22:22.454] 10: web-service-client
 jndi-name=service/CosignService
 [2008/07/10 08:22:22.454] 11: urlhessian:
 http://172.20.57.97/test.msis.ws/services/CosignService/url
 [2008/07/10 08:22:22.454] 12:
 interfaceedu.umich.authentication.cosign.CosignService/interface
 [2008/07/10 08:22:22.454] 13: /web-service-client

 If I don't give a url, it complains that url is required. Is there a bug in
 resin 3.1.6 to not handle the url tag properly?

 Thanks
 Sashi


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest




-- 
Sashidhar Guduri, App Analyst Lead
UM Medical School Information Services
skype: guduri-umich
Office 734.615-6019 | Cell 734.604-3255 | Fax 734.615-5171
http://www.med.umich.edu/medschool/msis/
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Error on web application startup withaweb-service-client tag

2008-07-10 Thread Monson, Ron
Yep, I believe you are correct. It should be registered with WebBeans
and the preferred method these days is dependency injection.  Have you
considered that instead? Frankly I'm not sure if it's possible to have
Resin register it in JNDI after the 3.1.5 refactoring.  Maybe someone
else can weigh in before I get a chance to test a few more things out.
 
Ron




From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sashidhar Guduri
Sent: Thursday, July 10, 2008 8:49 AM
To: General Discussion for the Resin application server
Subject: Re: [Resin-interest] Error on web application startup
withaweb-service-client tag


Thanks for the reply but that format does not expose it using
jndi. Is there a way to expose using jndi for remote client tag? 

Sashi


On Thu, Jul 10, 2008 at 8:43 AM, Monson, Ron
[EMAIL PROTECTED] wrote:


Try this format instead:
 


remote-client name=myWebSvc
interface=example.MyWebService
uri=hessian:url=${webApp.url}/mywebsvc// 

 

Regards, 
Ron Monson
EDS - Homeland Security  Justice
Systems Architecture  Development
Dept. Of Homeland Security, SEVIS Project
800 K St. NW, Suite 830, Washington, DC 20001
Mobile (202) 437-2157
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]  




From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sashidhar Guduri
Sent: Thursday, July 10, 2008 8:27 AM
To: General Discussion for the Resin application
server
Subject: [Resin-interest] Error on web
application startup with aweb-service-client tag


I get the following error when I start up resin:


[2008/07/10 08:22:22.454]
/usr/resin/resin-pro-3.1.6/conf/webservices.conf:11: 'url' is an unknown
property of 'com.caucho.remote.client.RemoteClient'.
[2008/07/10 08:22:22.454] 
[2008/07/10 08:22:22.454] 10:
web-service-client jndi-name=service/CosignService
[2008/07/10 08:22:22.454] 11:
urlhessian:http://172.20.57.97/test.msis.ws/services/CosignService/ur
l
[2008/07/10 08:22:22.454] 12:
interfaceedu.umich.authentication.cosign.CosignService/interface
[2008/07/10 08:22:22.454] 13:
/web-service-client

If I don't give a url, it complains that url is
required. Is there a bug in resin 3.1.6 to not handle the url tag
properly?

Thanks
Sashi


___
resin-interest mailing list
resin-interest@caucho.com

http://maillist.caucho.com/mailman/listinfo/resin-interest






-- 
Sashidhar Guduri, App Analyst Lead
UM Medical School Information Services
skype: guduri-umich
Office 734.615-6019 | Cell 734.604-3255 | Fax 734.615-5171
http://www.med.umich.edu/medschool/msis/ 

___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Error while deploying a web application on Resin 3.1.6

2008-07-10 Thread Scott Ferguson

On Jul 9, 2008, at 11:03 PM, George Wei wrote:


 Dear all,

 I've created a web application and deployed it on Tomcat 6.0.x, it  
 works
 fine. Then I tried to deploy the same war file on Resin 3.1.6, I got  
 the
 following error messages:


 It seems method com.caucho.server.webapp.WebApp.addServlet() tries  
 to call
 org.hibernate.cfg.AnnotationConfiguration.addProperties(), but can  
 not find
 it. In fact, I've checked the API doc of Hibernate Annotations 3.3.0  
 GA,
 this method does NOT exist. So is there some wrong with Resin  
 itself? If
 not, how can I fix this problem? Thanks for any clues.

There's probably an old jar somewhere in your classpath.  If you start  
Resin with -verbose, you'll see the system classpath, which might help  
track down the extra jar.

Resin itself couldn't create that error.  It's due to some class  
compiled against an old version of a method.

-- Scott



 Regards,
 George
 -- 
 View this message in context: 
 http://www.nabble.com/Error-while-deploying-a-web-application-on-Resin-3.1.6-tp18376474p18376474.html
 Sent from the Resin mailing list archive at Nabble.com.



 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Error on web application startup withaweb-service-client tag

2008-07-10 Thread Scott Ferguson


On Jul 10, 2008, at 6:35 AM, Sashidhar Guduri wrote:

Resin documentation seems to have fallen behind. It looks like I  
can't depend on the documentation but instead experiment. Anyway  
here is what I found and I am getting a new exception now when I  
startup. I was able to use jndi-name for remote-client tag. My  
remote-client looks like this now:


remote-client jndi-name=service/CosignService
interfaceedu.umich.authentication.cosign.CosignService/ 
interface
urihessian:url=https://172.20.57.97/test.msis.ws/services/CosignService 
/uri

/remote-client


That's the correct configuration.


I get the followng exception when the app starts up


[2008/07/10 09:33:38.822] Caused by: java.lang.ClassCastException:  
com.caucho.remote.hessian.HessianProtocolProxyFactory$BeanProxy  
cannot be cast to edu.umich.authentication.cosign.CosignService
[2008/07/10 09:33:38.822] 	at  
edu 
.umich 
.authentication 
.cosign 
.filter 
.CosignAuthenticationFilter.init(CosignAuthenticationFilter.java:181)
[2008/07/10 09:33:38.822] 	at  
com 
.caucho 
.server.dispatch.FilterManager.createFilter(FilterManager.java:144)

[2008/07/10 09:33:38.822]   ... 19 more


That looks like a Resin bug.  I've filed it as 
http://bugs.caucho.com/view.php?id=2780

It looks like Resin is registering the wrong object (the factory) with  
JNDI.


-- Scott



Thanks
Sashi

On Thu, Jul 10, 2008 at 9:22 AM, Monson, Ron [EMAIL PROTECTED]  
wrote:
Yep, I believe you are correct. It should be registered with  
WebBeans and the preferred method these days is dependency  
injection.  Have you considered that instead? Frankly I'm not sure  
if it's possible to have Resin register it in JNDI after the 3.1.5  
refactoring.  Maybe someone else can weigh in before I get a chance  
to test a few more things out.


Ron

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
] On Behalf Of Sashidhar Guduri

Sent: Thursday, July 10, 2008 8:49 AM

To: General Discussion for the Resin application server
Subject: Re: [Resin-interest] Error on web application startup  
withaweb-service-client tag


Thanks for the reply but that format does not expose it using jndi.  
Is there a way to expose using jndi for remote client tag?


Sashi

On Thu, Jul 10, 2008 at 8:43 AM, Monson, Ron [EMAIL PROTECTED]  
wrote:

Try this format instead:



remote-client name=myWebSvc interface=example.MyWebService  
uri=hessian:url=${webApp.url}/mywebsvc//


Regards,
Ron Monson
EDS - Homeland Security  Justice
Systems Architecture  Development
Dept. Of Homeland Security, SEVIS Project
800 K St. NW, Suite 830, Washington, DC 20001
Mobile (202) 437-2157
[EMAIL PROTECTED]


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
] On Behalf Of   Sashidhar Guduri

Sent: Thursday, July 10, 2008 8:27 AM
To: General Discussion for the Resin application server
Subject: [Resin-interest] Error on web application startup with aweb- 
service-client tag


I get the following error when I start up resin:

[2008/07/10 08:22:22.454] /usr/resin/resin-pro-3.1.6/conf/ 
webservices.conf:11: 'url' is an unknown property of  
'com.caucho.remote.client.RemoteClient'.

[2008/07/10 08:22:22.454]
[2008/07/10 08:22:22.454] 10: web-service-client jndi- 
name=service/CosignService
[2008/07/10 08:22:22.454] 11: urlhessian:http://172.20.57.97/test.msis.ws/services/CosignService 
/url
[2008/07/10 08:22:22.454] 12:  
interfaceedu.umich.authentication.cosign.CosignService/interface

[2008/07/10 08:22:22.454] 13: /web-service-client

If I don't give a url, it complains that url is required. Is there a  
bug in resin 3.1.6 to not handle the url tag properly?


Thanks
Sashi

___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest




--
Sashidhar Guduri, App Analyst Lead
UM Medical School Information Services
skype: guduri-umich
Office 734.615-6019 | Cell 734.604-3255 | Fax 734.615-5171
http://www.med.umich.edu/medschool/msis/

___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest




--
Sashidhar Guduri, App Analyst Lead
UM Medical School Information Services
skype: guduri-umich
Office 734.615-6019 | Cell 734.604-3255 | Fax 734.615-5171
http://www.med.umich.edu/medschool/msis/
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Error while deploying a web application on Resin 3.1.6

2008-07-10 Thread George Wei

All items in my classpath are as follows:

.
D:\Java\JDK150\lib\tools.jar
D:\Java\JDK150\jre\lib\rt.jar
E:\Applications\resin-3.1.6\classes
E:\Applications\resin-3.1.6\lib\resin.jar
E:\Applications\resin-3.1.6\lib\activation.jar
E:\Applications\resin-3.1.6\lib\ejb-15.jar
E:\Applications\resin-3.1.6\lib\hessian.jar
E:\Applications\resin-3.1.6\lib\j2ee-management-10.jar
E:\Applications\resin-3.1.6\lib\javamail-14.jar
E:\Applications\resin-3.1.6\lib\jaxrpc-15.jar
E:\Applications\resin-3.1.6\lib\jaxws-api.jar
E:\Applications\resin-3.1.6\lib\jca-15.jar
E:\Applications\resin-3.1.6\lib\jms-11.jar
E:\Applications\resin-3.1.6\lib\jpa-15.jar
E:\Applications\resin-3.1.6\lib\jsdk-15.jar
E:\Applications\resin-3.1.6\lib\jsf-12.jar
E:\Applications\resin-3.1.6\lib\jsr88.jar
E:\Applications\resin-3.1.6\lib\jstl-11.jar
E:\Applications\resin-3.1.6\lib\jta-101.jar
E:\Applications\resin-3.1.6\lib\jws-15.jar
E:\Applications\resin-3.1.6\lib\portlet-10.jar
E:\Applications\resin-3.1.6\lib\quercus.jar
E:\Applications\resin-3.1.6\lib\resin-deploy.jar
E:\Applications\resin-3.1.6\lib\resin-util.jar
E:\Applications\resin-3.1.6\lib\saaj.jar
E:\Applications\resin-3.1.6\lib\script-10.jar
E:\Applications\resin-3.1.6\lib\webbeans-16.jar
E:\Applications\resin-3.1.6\lib\webutil.jar

As you can understand, D:\Java\JDK150\ is where I install JDK 1.5.0 and
E:\Applications\resin-3.1.6\ is where I install Resin 3.1.6. It looks there
are not any strange jars in my classpath. Any other clues?

George


Scott Ferguson wrote:
 
 
 There's probably an old jar somewhere in your classpath.  If you start  
 Resin with -verbose, you'll see the system classpath, which might help  
 track down the extra jar.
 
 Resin itself couldn't create that error.  It's due to some class  
 compiled against an old version of a method.
 
 -- Scott
 

-- 
View this message in context: 
http://www.nabble.com/Error-while-deploying-a-web-application-on-Resin-3.1.6-tp18376474p18395860.html
Sent from the Resin mailing list archive at Nabble.com.



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] Error 503 - Service unavailable

2007-11-13 Thread Andreas Røsdal
Hello!

I have a problem with Resin and Apache, where Apache generates the 
following 503 error message at random points in time:

Service unavailable! The server is temporarily unable to service your 
request due to maintenance downtime or capacity problems...

The server is setup with in a three layer configuration, with a web cache 
and Apache web server on one machine, and Resin 2.1.17 on another.

The error message occurs at random times, but only when the browser 
refreshes a page by itself (ie. meta refresh or using javascript to 
change the URL of one frame in a frameset.) When refireshing the page 
after the error has occured, then the problem doesn't happen.

My question is really, how do I go about debugging this error message?
I realize that the error comes from Apache, but I've not been able to find 
out what the problem is. The server is not under much load, and no 
relevant thresholds (number of connections etc) are pushed to the limit.

How do I debug Apache / Resin to resolve this problem?


  - Andreas


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] error

2007-06-08 Thread Mário Coelho
to many servelet.

what is this error?

___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Error

2007-02-12 Thread Sam
 500 Servlet Exception
 javax.servlet.ServletException: too many servlet includesI use tomcat
 and I like to change to resin.But the jsp return this mensseger.

Debug logging will be very helpful here, you can enable it by adding
the following line in resin.conf:

  logger name= level=fine/

A level of finer will give even more information.

The debug log will show the urls that are being used in the forward, and
will help to trace down the source of the problem.

-- Sam



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Error using custom log formatter

2006-12-08 Thread Scott Ferguson

On Dec 7, 2006, at 6:05 PM, jason rutherglen wrote:


 Where org.apache.solr.cluster.ClusterLogFormatter extends  
 java.util.logging.Formatter.  Get this error:

 [17:49:24.453] com.caucho.config.LineConfigException: WEB-INF/ 
 web.xml:16: java.l
 ang.IllegalAccessException: Class  
 com.caucho.config.BeanTypeStrategy can not acc
 ess a member of class java.util.logging.Formatter with modifiers  
 protected


I've added this as a bug report.  It definitely looks like an  
introspection issue, but I'm not sure why the introspection would not  
be allowed.

-- Scott

 -- 
 


 package org.apache.solr.cluster;

 import java.util.logging.*;
 import java.io.*;
 import java.text.*;
 import java.util.Date;
 import java.sql.SQLException;
 import java.util.concurrent.locks.*;
 import org.apache.commons.lang.exception.*;
 import org.apache.commons.dbutils.DbUtils;

 /**
  * Prints out full stack traces of all nested exceptions
  *
  * @author jasonr
  */
 public class ClusterLogFormatter extends java.util.logging.Formatter {
   Date dat = new Date();
   private final static String format = {0,date} {0,time};
   private MessageFormat formatter;
   private ReentrantLock lock = new ReentrantLock();

   private Object args[] = new Object[1];

   public static void main(String[] args) {
 LogManager logManager = LogManager.getLogManager();
 //logManager.
   }

   // Line separator string.  This is the value of the line.separator
   // property at the moment that the SimpleFormatter was created.
   private String lineSeparator = (String)  
 java.security.AccessController.doPrivileged(
   new sun.security.action.GetPropertyAction 
 (line.separator));


   public ClusterLogFormatter() {
 super();
   }

   public String format(LogRecord record) {
 lock.lock();
 try {
   StringBuffer sb = new StringBuffer();
   // Minimize memory allocations here.
   dat.setTime(record.getMillis());
   args[0] = dat;
   StringBuffer text = new StringBuffer();
   if (formatter == null) {
 formatter = new MessageFormat(format);
   }
   formatter.format(args, text, null);
   sb.append(text);
   sb.append( );
   if (record.getSourceClassName() != null) {
 sb.append(record.getSourceClassName());
   } else {
 sb.append(record.getLoggerName());
   }
   if (record.getSourceMethodName() != null) {
 sb.append( );
 sb.append(record.getSourceMethodName());
   }
   sb.append(lineSeparator);
   String message = formatMessage(record);
   sb.append(record.getLevel().getLocalizedName());
   sb.append(: );
   sb.append(message);
   sb.append(lineSeparator);
   if (record.getThrown() != null) {
 Throwable throwable = record.getThrown();
 if (throwable instanceof SQLException) {
   SQLException sqlException = (SQLException)throwable;
   StringWriter stringWriter = new StringWriter();
   DbUtils.printStackTrace(sqlException, new PrintWriter 
 (stringWriter));
   sb.append(stringWriter.toString());
 } else {
   String string = ExceptionUtils.getFullStackTrace(throwable);
   sb.append(string);
 }
 /**
  * try {
  * StringWriter sw = new StringWriter();
  * PrintWriter pw = new PrintWriter(sw);
  * record.getThrown().printStackTrace(pw);
  * pw.close();
  * sb.append(sw.toString());
  * } catch (Exception ex) {
  * }
  **/
   }
   return sb.toString();
 } finally {
   lock.unlock();
 }
   }
 }

 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest