Re: [Resin-interest] Character encoding in root vs included JSP

2014-02-28 Thread Knut Forkalsrud
Traditionally the JSP spec has mandated ISO-8859-1 if nothing else is
explicitly specified.
However I notice recent versions have a facility to specify it more broadly
in web.xml
Case in point is section JSP.3.3.4 in version 2.2 of the spec:
http://download.oracle.com/otn-pub/jcp/jsp-2.2-mrel-eval-oth-JSpec/jsp-2_2-mrel-spec.pdf

The syntax would look something like


   /*
   UTF-8



I haven't used JSPs in years, and have no idea of whether Resin supports
this.

Knut Forkalsrud




On Fri, Feb 28, 2014 at 11:41 AM, Rick Mann  wrote:

>
> On Feb 28, 2014, at 08:55 , Scott Ferguson  wrote:
>
> > On 2/28/14, 4:47 AM, Rick Mann wrote:
> >> Hmm. Seems like if I <%@ include a file that contains
> >>
> >> <%@ page contentType="text/html; charset=UTF-8"%>
> >>
> >> Then it doesn't work. If I include that <@ page line directly, it gets
> the encoding right.
> >>
> >
> > I believe that's correct, though. The top page is responsible for
> deciding encoding.
>
> I found I need to include it in both the top page, AND the page that gets
> included. Wish there were a way to just set it once for the whole container.
>
> >
> > -- Scott
> >
> >>
> >> On Feb 28, 2014, at 04:45 , Rick Mann
> >> 
> >>  wrote:
> >>
> >>
> >>> I thought I had UTF-8 set throughout my app; source files are encoded
> in it, I set it everywhere I can think of (requests, responses, JVM, HTML
> and JSP tags).
> >>>
> >>> I we re-doing the HTML for my site, fancifying it with bootstrap and
> all that goodness, when I noticed that the copyright symbol I typed wasn't
> rendering correctly. It used to with the old HTML, so I investigated.
> >>>
> >>> Turns out, it only renders correctly if I  the HTML
> snippet that contains the symbol. If it's typed directly into the page, it
> doesn't work.
> >>>
> >>> Any ideas? Thanks!
> >>>
> >>> --
> >>> Rick
> >>>
> >>>
> >>>
> >>> ___
> >>> 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
> >
> > ___
> > resin-interest mailing list
> > resin-interest@caucho.com
> > http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>
> --
> Rick
>
>
>
>
> ___
> 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


[Resin-interest] (resin-3.1) One minute pause at server start

2013-08-14 Thread Knut Forkalsrud
I realize few are actively interested in the 3.1.x releases anymore, but
I'll describe the problem anyway.

When starting the server there if often a one minute pause before the
server handles the first request.  The reason appears to be a race
condition in startup.  In the source code for 3.1.8, and every other minor
release I have checked the interesting code is the class
com.caucho.server.port.Port, Port.java lines 1103 to 1105:

  thread.start();
  enable();

The run() method charges ahead from thread.start() and checks if the
lifecycle is active.  It isn't and the thread waits for up to a minute
before trying again.  Meanwhile we call enable() to set the state to
active, but alas to late.
I notice the corresponding code in resin 4.x has "enable" before "start":
https://github.com/mdaniel/svn-caucho-com-resin/blob/master/modules/resin/src/com/caucho/network/listen/TcpPort.java#L1281-1283

Also, according to the tags associated with the change
https://github.com/mdaniel/svn-caucho-com-resin/commit/edf3f676a5d8f1c2a748f5fd987705137728838c
I'm
inclined to believe the change made it into 3.0.28, 4.0.x and the
short-lived 3.2.x series, but missed 3.1.x completely.

I have patched the class locally and it seems to have made all the
difference.  I can now start and be immediately ready for traffic.

Regards,

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


Re: [Resin-interest] Configuration for scaling

2012-12-12 Thread Knut Forkalsrud
You probably want to run "ulimit -a" in your shell and see if you may be
running up against the limit for the number of open files per OS user.

Also, with small heaps (256MB) and very dynamic URLs I have found that
Resin's "invocation cache" takes almost the entire heap.  At least as of
version 3.1.8.  Luckily it is relatively easy to configure is smaller
().


Good luck,

Knut Forkalsrud



On Tue, Dec 11, 2012 at 8:39 PM, Rick Mann  wrote:

> Hi. I'm running resin 4.0.32 (?) on a couple of virtual hosts at Rackspace
> on Ubuntu. These are small machines, 512 MB of RAM, but they're pretty much
> only running their resin (free) instance.
>
> I'm doing some rudimentary load testing with JMeter. I have a script that
> makes three calls to the REST service implemented in my webapp. When I try
> to do 1000 simultaneous connections (via round-robin load balancing onto
> two nodes, so figure ~500 near-simultaneous connections), my app starts
> throwing exceptions about not being able to open connections to the DB:
>
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: User
> gcs already has more than 'max_user_connections' active connections
>
> So, clearly I need to expand the DB's capabilities.
>
> But JMeter also reports a nunch of these:
>
>  rc="Non HTTP response code: java.net.SocketException" rm="Non HTTP response
> message: Too many open files" tn="Thread Group 1-918" dt="text" by="1436"/>
>
> My configuration is basically out-of-the-box resin.xml.
>
> I can increase the amount of RAM available, there's no session state being
> stored. I'm wondering what config settings to look into increasing (number
> of threads? Connections allowed?) Any guidance on how much RAM one needs
> for a given number of threads and connections?
>
> Sorry for the rudimentary question, but this is the first time I've been
> responsible for making sure our web app stays up, and I don't have a good
> idea how many requests we might need to support.
>
> Thanks!
>
>
> --
> Rick
>
>
>
>
> ___
> 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] BEAST SSL Attack

2012-12-04 Thread Knut Forkalsrud
Actually, I got it wrong in my previous mail.  The feature should be
working.
There is a ticket describing the feature:
http://bugs.caucho.com/view.php?id=3593


On Tue, Dec 4, 2012 at 7:00 PM, Knut Forkalsrud
wrote:

> In the days of Resin 2.1.4 and 
> onwards<http://www.caucho.com/resin-3.1/changes/changes-2.xtp>there was such 
> a feature, however it seems to have lapsed.  I remember
> because there was a similar issue with MSIE
> http://support.microsoft.com/default.aspx?scid=kb;en-us;Q305217.
>
> I my good old copy of Resin 3.1.8 there are remains the feature.
> If you bring up the source code for
> com.caucho.vfs.JsseSSLFactory.create(host, port)
> you will find a block of code commented out.
>
> Then there was a second incarnation where you could specify cipher suites.
>  That seems to have dies some time around Aug 2009 with the commit:
> https://github.com/mdaniel/svn-caucho-com-resin/commit/96de31370ffd0153eb45fc49725a9b796bc11224#modules/resin/src/com/caucho/vfs/JsseSSLFactory.java
>
> I suspect you could get it going again if you have the fortitude to play
> around with Resin's source code and build your own.
>
> Good luck,
>
> Knut Forkalsrud
>
>
>
> On Mon, Dec 3, 2012 at 7:53 AM, Aaron Freeman wrote:
>
>> SSL BEAST
>
>
>
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] BEAST SSL Attack

2012-12-04 Thread Knut Forkalsrud
In the days of Resin 2.1.4 and
onwards<http://www.caucho.com/resin-3.1/changes/changes-2.xtp>there
was such a feature, however it seems to have lapsed.  I remember
because there was a similar issue with MSIE
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q305217.

I my good old copy of Resin 3.1.8 there are remains the feature.
If you bring up the source code for
com.caucho.vfs.JsseSSLFactory.create(host, port)
you will find a block of code commented out.

Then there was a second incarnation where you could specify cipher suites.
 That seems to have dies some time around Aug 2009 with the commit:
https://github.com/mdaniel/svn-caucho-com-resin/commit/96de31370ffd0153eb45fc49725a9b796bc11224#modules/resin/src/com/caucho/vfs/JsseSSLFactory.java

I suspect you could get it going again if you have the fortitude to play
around with Resin's source code and build your own.

Good luck,

Knut Forkalsrud



On Mon, Dec 3, 2012 at 7:53 AM, Aaron Freeman wrote:

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


Re: [Resin-interest] Managing Tenured Memory in Resin

2012-10-30 Thread Knut Forkalsrud
The max heap (set with the -Xmx parameter) is shared between all
generations, with
the typical Sun/Oracle JVM that is eden, survivor, tenured and permanent
generations.
The JVM usually does a pretty good job at adjusting the individual sizes
according to
how much garbage your app produces.

I think 2097M out of 3000M is quite reasonable for the tenured generation.
 You may need
to give it more memory.  Is it conceivable that your app has a resource
leak? If so you may
be able to get in shape for a while by restarting it.  The thread count
warnings may indicate
that a lot of your memory is going to call stacks for the threads.  If your
app was faster you
would see fewer threads and hence less memory used.

If you really want to get into tuning the memory/GC settings there is
http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html to
guide you,
but I don't recommend that.


Knut Forkalsrud



On Tue, Oct 30, 2012 at 10:14 AM, Keith Fetterman
wrote:

> Hi Everyone,
>
> I could use a little help troubleshooting some messages in my
> jvm-default.log.  I am seeing a lot of the following messages in our
> Resin logs.  We are currently running Resin 4.0.23 Pro.
>
> > INFO com.caucho.env.health.HealthService
> MemoryTenuredHealthCheck[WARNING:0.48% free (10.127M free, 2097.152M max,
> 2087.025M used)]
>
> I did a bit of research this morning about adjusting tenured memory
> limits, but I didn't find anything specific to adjusting the value. Does
> anyone know what property I need to adjust?  I currently have the
> following Java settings in my resin.xml file:
>
> > -J-server
> > -J-d64
> > -Xms3000M
> > -Xmx3000M
> > -XX:MaxPermSize=250M
>
> I could increase the -Xmx property, but I am wondering if there is a
> better property to tweak.
>
> I am also seeing the following warning messages:
>
> > WARNING com.caucho.health.analysis.AnomalyAnalyzer AnomalyAnalyzer
> JVM|Thread|JVM Blocked Count WARNING
> > WARNING com.caucho.health.analysis.AnomalyAnalyzer AnomalyAnalyzer
> JVM|Thread|JVM Runnable Count WARNING
>
> Does anyone have some advice on how to resolve these warnings?  I read
> the Resin documentation, but I didn't find something specific.
>
> Thanks for your help
>
> Keith
>
> --
> -
> Keith FettermanDirect: 206-319-9434
> Mariner Supply, Inc.   206-780-5670
> http://www.go2marine.com   kfetter...@go2marine.com
> http://www.go2hydraulics.com
> http://www.shoprvparts.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] share session in multiple domains application

2012-08-16 Thread Knut Forkalsrud
>   [^.]*\.[^.]*$
>
> Host: xxx.yyy.zzz.foo.com =  Set-Cookie domain: foo.com
> Host: zzz.foo.com =  Set-Cookie domain: foo.com
> Host: foo.com =  Set-Cookie domain: foo.com
> Host: bar.com =  Set-Cookie domain: bar.com

Does that mean
Host: foo.co.uk =  Set-Cookie domain: co.uk
Host: bar.co.uk =  Set-Cookie domain: co.uk

Host: foo.com.au =  Set-Cookie domain: com.au
Host: bar.com.au =  Set-Cookie domain: com.au

That seems sub-optimal.

Regards,

Knut Forkalsrud

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


Re: [Resin-interest] Db Pool freezes waiting on _pool (3.1.3)

2012-07-06 Thread Knut Forkalsrud
You may want to keep track of the DB pool statistics.  Active versus
maximum allocation counts.  If this is a connection leak you would notice
the number of active connection creeping upwards until it reaches max and
your freezing symptoms appear.

Knut Forkalsrud



On Fri, Jul 6, 2012 at 5:51 AM, Steven Cassidy wrote:

> Hi, I'm using resin-3.1.3 on a busy site. Periodically the site
> freezes. A jstack on the server shows most threads in this state:
>
> java.lang.Thread.State: TIMED_WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> at com.caucho.jca.ConnectionPool.create(ConnectionPool.java:897)
> - locked <0x2aaaba60be48> (a java.util.ArrayList)
> at com.caucho.jca.ConnectionPool.allocatePool(ConnectionPool.java:779)
> at com.caucho.jca.ConnectionPool.allocate(ConnectionPool.java:740)
> at
> com.caucho.jca.ConnectionPool.allocateConnection(ConnectionPool.java:551)
> at com.caucho.sql.DataSourceImpl.getConnection(DataSourceImpl.java:65)
> at com.caucho.sql.DBPool.getConnection(DBPool.java:669)
>
> It looks like no thread ever gets notified and all wait indefinitely.
> Resin generally restarts itself about 15 minutes later if left alone.
> The database itself apppears idle during this time.
>
> I wondered if this might be a known problem and if upgrading to 3.1.12
> would help? I don't think the pool is full. I noticed a pool timing
> issue was fixed in 3.1.10 (bug 3837) and the implementation of the
> allocate method changed, but that wasn't directly related to freezing.
> Perhaps we should just try it and see, but I figured I'd ask if this
> was noted / known behavior.
>
> Many thanks,
> Steven
>
> ___
> 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] Problems with rollover of logfile with log4j 1.2.16 and AsyncAppender

2012-02-27 Thread Knut Forkalsrud
You may find the discussion in
http://glueclue.blogspot.com/2007/01/log4j-asyncappender-is-not-always_31.html
 useful.

Knut Forkalsrud



On Mon, Feb 27, 2012 at 00:16, Jens Dueholm Christensen (JEDC) <
jens.dueh...@r-m.com> wrote:

> Bump? :)
>
> Regards,
> Jens Dueholm Christensen
> Rambøll Survey IT
>
>
> -Original Message-
> From: resin-interest-boun...@caucho.com [mailto:
> resin-interest-boun...@caucho.com] On Behalf Of Jens Dueholm Christensen
> (JEDC)
> Sent: Tuesday, February 21, 2012 9:01 PM
> To: General Discussion for the Resin application server
> Subject: Re: [Resin-interest] Problems with rollover of logfile with log4j
> 1.2.16 and AsyncAppender
>
> Hi Scott
>
> I'd really appreciate it, if you took the time to do that - I (and my
> coworkers) really quite baffled.
>
> We have had an increase of activity and load on the system during the last
> few weeks (more users and utilization, so nothing alarming), and now this
> problem has manifested itself, and I've never seen it before.
>
> My understanding of what's happening is that the blocking thread is
> waiting for an empty buffer so it can flush it's own full buffer, but that
> notification never comes.
>
> As the source for log4j shows the thread has called wait() on an ArrayList
> (the full buffer), and something has gone wrong, but what?
>
> We've seen it happen 3 or 4 times during the last week - always a few
> minutes after midnight when Resin performs its logrotation.
>
> In the stacktrace most of the threads that waits for the deadlocked thread
> is just (as is the deadlocked thread) doing a simple logger.info(String),
> so it might be possible to reproduce by spawning 10-20 threads that calls
> logger.info() and then have Resin perform a rollover once a minute.
>
> Regards,
> Jens Dueholm Christensen
> Rambøll Survey IT
>
> 
> From: resin-interest-boun...@caucho.com [resin-interest-boun...@caucho.com]
> On Behalf Of Scott Ferguson [f...@cauchomail.com]
> Sent: 21 February 2012 19:01
> To: resin-interest@caucho.com
> Subject: Re: [Resin-interest] Problems with rollover of logfile with log4j
> 1.2.16 and AsyncAppender
>
> On 02/20/2012 12:56 PM, Jens Dueholm Christensen (JEDC) wrote:
>
> Hi
>
> Lately we are seeing increased blocking behaviour from log4j when Resin
> performs the nightly rollover of logfiles.
>
> We're running Resin Pro 3.1 (license #1013826) in a pre .11 snapshot
> (resin-pro-3.1.s110225) (due to bug #4349 and a bit of waiting before
> 3.1.11 was released).
> Updating to 3.1.12 is planned, but the changelog (
> http://www.caucho.com/resin-3.1/changes/changes.xtp is the best I could
> find?) does not mention any fix for our current problem, so I'm looking for
> any insights or advise.
>
>
> I'd need to look at the log4j code to understand what it's doing.
>
> I don't think that wait() should be related to Resin (other than timing)
> but I'd need to look at their code to be certain, and I can't think of any
> logging that would help. (Logging the logging code is tricky :)
>
> 3.1.13 should be out next week, by the way.
>
> -- Scott
>
>
> We've configured resin to perform rollovers of this logfile:
>
>  timestamp="[%Y-%m-%d %H:%M:%S.%s]" rollover-period="1D"/>
>
> In our log4j configuration we log to stdout with:
>
>   
>  
>  
> 
>  
>   
>
>   
>  
>   
>
>   
>  
>  
>   
>
>   <>
>
> Some time after midnight when Resin performs the rollover, the JVM becomes
> unresponsive and a stacktrace shows multiple threads hanging, and we have
> to manually restart (it doesn't get picked up by the watchdog, and can/will
> hang for hours).
>
> A complete JVM stacktrace is attached to this mail.
>
> All threads that are attempting to log are waiting for access to the
> object blocked by this thread:
>
> "http-172.27.80.36:8080-30$1663241944" daemon prio=10
> tid=0x7f8804005800 nid=0x2a40 in Object.wait() [0x7f87a08ed000]
>   java.lang.Thread.State: WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   at java.lang.Object.wait(Object.java:485)
>   at org.apache.log4j.AsyncAppender.append(AsyncAppender.java:195)
>   - locked <0x0005ba882928> (a java.util.ArrayList)
>   at
> org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
>   - locked <0x0005b8d6db00> (a org.apache.log4j.AsyncAppender)
>   at
> org.apache.log4j.helpers.AppenderAttachableIm

Re: [Resin-interest] java.util.zip.ZipException: error in opening zip file

2012-02-07 Thread Knut Forkalsrud
Your code is probably leaking file/socket descriptors somewhere, leaving it
to the garbage collector to free them up eventually. There are some good
tips on how to hunt down this kind of problem at
http://stackoverflow.com/a/4194709/566556

-Knut


On Tue, Feb 7, 2012 at 13:54, Scott Ferguson  wrote:

> **
> On 02/07/2012 12:12 PM, Manidhar gudavalli wrote:
>
>
> I have these settings in my conf  files for ulimits.
>
> vi /etc/security/limits.conf
>
> * soft nofiles 1024000
> * hard nofiles 1024000
>
> rootsoftnofiles 1024000
> roothardnofiles 1024000
>
>
> Does the lsof show anything unusual? Like a surprising number of open
> descriptors to a specific file or socket?
>
> -- Scott
>
>
>
>  cat /proc/sys/fs/file-max
> 2188737
>
>
> On Tue, Feb 7, 2012 at 12:56 PM, Manidhar gudavalli wrote:
>
>> I checked with lsof -u root | wc -l and for login id and for mysql. All
>> are with in the limits less than 2400 . And, I set the limits too high at
>> 100,000.
>> thanks
>> Mani
>>
>> On Tue, Feb 7, 2012 at 12:51 PM, Knut Forkalsrud <
>> knut-cau...@forkalsrud.org> wrote:
>>
>>> You have too many open files.  Try "man ulimit" and "man lsof".
>>>
>>>  -Knut
>>>
>>>
>>>  On Tue, Feb 7, 2012 at 10:17, Manidhar gudavalli wrote:
>>>
>>>>  We are using resin 3.1.12 and java 6.  When the server is on heavy
>>>> load, we are getting frequent errors. Number of open files count is still
>>>> less. But we are seeing these errors. What could be the problem? There are
>>>> no memory issues.
>>>>
>>>> java.util.zip.ZipException: error in opening zip file
>>>> java.io.FileNotFoundException: /home/myuser/public_html/WEB-INF/web.xml
>>>> (Too many open files)
>>>>
>>>> java.lang.NoClassDefFoundError
>>>>
>>>> java.sql.SQLException: Unable to connect to any hosts due to exception:
>>>> java.net.SocketException: Too many open files
>>>>
>>>> ** BEGIN NESTED EXCEPTION **
>>>>
>>>> java.net.SocketException
>>>> MESSAGE: Too many open files
>>>>
>>>> thanks in advance
>>>> Mani
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>  ___
>>>> 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
>>>
>>>
>>
>>
>>
>>
>
>
> --
> Dr. Mani Gudavalli
> http://www.softschools.com
> 214 636 5824
>
>
> ___
> resin-interest mailing 
> listresin-interest@caucho.comhttp://maillist.caucho.com/mailman/listinfo/resin-interest
>
>
>
> ___
> 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] java.util.zip.ZipException: error in opening zip file

2012-02-07 Thread Knut Forkalsrud
You have too many open files.  Try "man ulimit" and "man lsof".

-Knut


On Tue, Feb 7, 2012 at 10:17, Manidhar gudavalli  wrote:

> We are using resin 3.1.12 and java 6.  When the server is on heavy load,
> we are getting frequent errors. Number of open files count is still less.
> But we are seeing these errors. What could be the problem? There are no
> memory issues.
>
> java.util.zip.ZipException: error in opening zip file
> java.io.FileNotFoundException: /home/myuser/public_html/WEB-INF/web.xml
> (Too many open files)
>
> java.lang.NoClassDefFoundError
>
> java.sql.SQLException: Unable to connect to any hosts due to exception:
> java.net.SocketException: Too many open files
>
> ** BEGIN NESTED EXCEPTION **
>
> java.net.SocketException
> MESSAGE: Too many open files
>
> thanks in advance
> Mani
>
>
>
>
>
>
> ___
> 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] Best Way to Track Down Random Resin Restarts

2011-02-11 Thread Knut Forkalsrud
I think we have seen similar symptoms, which turned out to be (unless my
memory deceives me) related to graphics.  Resin was started via an ssh
session with X11 forwarding.  After the app was up the ssh connection was
closed.  At some point the app would want to generate some image or
something, and the JVM proceeds to delegate to X11, which now is utterly
unavailable.  That in turned caused the JVM to abort abruptly.

That may be what happened, but don't quote me on that.

Knut Forkalsrud




On Fri, Feb 11, 2011 at 11:40, Scott Ferguson  wrote:

> Shane Cruz wrote:
> > We are running Resin Pro 3.0.25 on RHEL 5.5 and using 64-bit Sun JDK
> > 1.6.0_05.  Recently, we have started seeing several incidents where
> > the Resin JVM seems to just randomly get restarted.  There is nothing
> > in the logs to indicate that the JVM was shutdown cleanly or a restart
> > was attempted, the log files just go from displaying regular log lines
> > to displaying the following:
> The logging for 4.0 is much more informative. With 3.0 it's a bit trickier.
> >
> > [11:24:18.095] com.caucho.log.EnvironmentLogger.log Server[myserver]
> > starting
> >
> > Things that have already been checked:
> >
> > 1. There doesn’t appear to be a JVM crash as no HotSpot Error log
> > files are created as they usually would be.
> >
> > 2. There are no signs in the sudo logs that anyone is manually
> > restarting the JVM.
> >
> > 3. There are no signs in the logs that Resin is restarting itself even
> > though we have a “min-free-memory” setting of 1M.  With higher values
> > of that setting we have seen the JVM get restarted due to low memory,
> > but I am pretty sure logging always indicated that the JVM was
> > restarting when this happened before.
> >
> > 4. We are not using the resin “ping” check that might restart the JVM
> > if it is unresponsive.
> >
> > 5. Kernel logging is enabled and it doesn't look like the kernel
> > is killing it for any reason
> >
> > It almost seems as if the JVM is just getting a kill -9 and then the
> > wrapper script is starting it back up.  What is the best way to track
> > down what might be killing the JVM?  We are in the process of testing
> > an upgrade to a newer version of the JDK, but I am not very confident
> > that will fix the problem.  I am going to try to turn on full Resin
> > debug logging, but I thought I would reach out in case anyone else had
> > an idea of how to track this down.  Is there a way to wrap the Linux
> > kill command to find out if that is being run?  Any other suggestions
> > on where to look?
> Since a phantom kill is pretty unlikely, I wouldn't spend too much time
> on that theory.
>
> Since you're not getting a hs_* error, the most likely would be either
> something calling System.exit or System.halt, possibly Resin itself for
> something like running out of threads or memory (although, as you
> pointed out, that should be logged.)
>
> Other than that, the restart should only happen if the config files
> change (theoretically something like NFS or 'touch' could trigger that,
> but I assume that's not happening.)
>
> -- Scott
> > 
> >
> > ___
> > 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
>
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] Problem with com.caucho.log.EnvironmentLogger

2010-02-06 Thread Knut Forkalsrud
Dear Cognoscenti,

I believe I have found a bug.
The situation is a webapp with BerkeleyDB[1] (from Sleepycat software,
now Oracle).
Running it in Resin 3.1.8 fails during initialization and the culprit
is the method com.caucho.log.EnvironmentLogger.getHandlers().
BerkeleyDB plays around with the loggers (java.util.logging) and the
expectation[2] in the code base is that an array is always returned
from getHandlers(), never null.  That seems to be a valid assumption,
the method in EnvironmentLogger overrides a method in
java.util.logging.Logger[3], which does indeed make sure return an
empty array instead of null.

>From what I can tell the fix is relatively simple, unless I am
mistaken it is just a matter of making the default value an empty
array. In other words the constructor of EnvironmentLogger should
call:

_localHandlers.setGlobal(new Handler[0]);

That approach could affect how "parent" environments work, so maybe
the fix should be a little bit more like the implementation in
java.util.logging.Logger.  I don't understand the code well enough to
make that judgement.

The workaround is not entirely simple, I ended up grabbing all 8
loggers used by BerkeleyDB in this configuration and add a dummy
handler to each of them.

Thanks,

Knut Forkalsrud

[1]: http://download.oracle.com/maven/com/sleepycat/je/4.0.92/je-4.0.92.jar
[2]: 
https://www.docjar.com/html/api/com/sleepycat/je/utilint/LoggerUtils.java.html#151
[3]: http://www.docjar.com/html/api/java/util/logging/Logger.java.html#1211


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


Re: [Resin-interest] java unicode problem in cross-plateform situation

2010-01-18 Thread Knut Forkalsrud
On Sun, Jan 17, 2010 at 22:47, Riccardo Cohen wrote:

> Using numeric is more difficult because I have to make a program to
> write these values as I don't know them,


You most likely will have to know which characters you want to replace,
I don't see any way around that.  Anyway the more interesting change
is probably to replace a character at a time instead of a byte at a time.
How to specify each character literal in your source file is a separate
problem.


> But
> in the same time, source code is not used at run time, and the problem
> is at run time.
>

In general, the problem could be at compile time even if you don't see
the symptoms until runtime.


> I checked my locales on unix and there is no other locale installed than
> UTF-8. On mac it is more difficult to check.


Try "man locale" in your terminal window.

Good luck,

-Knut

PS: If you get all the character set issues under control you probably don't
even need to replace characters in the URLs.  See for example Wikipedia
with URLs like 
http://en.wikipedia.org/wiki/Sebastián_Piñera
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] java unicode problem in cross-plateform situation

2010-01-15 Thread Knut Forkalsrud
You may want to double check if you really have UTF-8 in your environment in
all circumstances.
Here you also depend on the character set of the source file, which is
unnecessary.
And your code could be simpler.

char[] urlset3a = {0xc0,\u00c1,    // either numeric literals or unicode
escapes
char[] urlset3b = {'a','a'

String s = ;
for (int i=0; iwrote:

> Hello
> I wrote a piece of code to remove diacritics :
>
> String urlset3a[]={"À","Á"
> String urlset3b[]={"a","a"
> for (idx=0;idx {
>  String lit=null;
>  try{lit=new String(urlset3a[idx].getBytes(),"UTF-8");}catch(Exception
> ex){}
>  if (lit!=null)
>   sb_replace(ret,lit,urlset3b[idx]);
> }
>
> This code works perfectly on macosx and on linux when compiled on the
> plateform it is run on.
>
> javac com/adl/java/utils/Stringutils.java
> java com.adl.java.utils.Stringutils "aÄaé° ç%Щx"
> URL:aaae-cx
>
> But when I compile this class on macosx and if I copy and use this
> .class on linux, the accents and special characters are no more replaced
> correctly (same in the other way) :
>
> Mac class used on linux :
> java com.adl.java.utils.Stringutils "aÄaé° ç%Щx"
> aäaé°-çx
>
> Linux class used on mac :
> java com.adl.java.utils.Stringutils "aÄaé° ç%Щx"
> URL:a?a??-?x
>
> My LANG env var is fr_FR.UTF-8 on both plateforms. java version
> "1.5.0_17" on linux and "1.5.0_22" on mac
>
>
> Does anybody know why and how to correct this ? (this class is in a jar
> that is copied to the server and not compiled by resin)
> Thanks
> --
> Riccardo Cohen
> Architecte du Logiciel
> http://www.architectedulogiciel.fr
> +33 (0)6.09.83.64.49
> Membre du réseau http://www.reflexe-conseil-centre.org
>
>
>
>
> ___
> 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] Resin 3.0.x and PCI Compliance

2009-12-29 Thread Knut Forkalsrud
Back in the 2.1 days you could choose which to enable with attributes on the
HTTP tag:

You could try, with a little luck it may still work with 3.0.x

If you want to switch to OpenSSL you can extract your JSSE key/cert,
although
last time I tried the "keytool" shipped with the JDK did not offer an easy
way.
The solution was to use the java libraries to extract the key directly and
some openssl
utility to convert to the typical ascii format.

-Knut


On Tue, Dec 29, 2009 at 05:49, Aaron Freeman wrote:

> I am a bit baffled.  For PCI compliance we must restrict weak ciphers,
> but I see no mechanism to do that with JSSE, which we have been using
> for years.  It appears we can do this with openssl on Resin 3.0.x  Is
> that correct?
>
> Does that mean I need to purchase a new certificate or can we easily
> switch to openssl using the certificate we already have.
>
> Did the person's query about fixing JSSE's cipher-suite issue in Resin
> 3.1.x get resolved in Resin 4.0.2?
>
> Thanks,
>
> Aaron
>
>
>
>
> ___
> 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] Large negative range in the HTTP request

2009-11-16 Thread Knut Forkalsrud
On Mon, Nov 16, 2009 at 15:44, Scott Ferguson  wrote:
>> Out of curiosity, what's the actual size of the file? And what kind of
>> application? Just browser download or some kind of fancy streaming client.

The file is small, about 50 bytes.  The app is not fancy, however it
isn't using the typical path mapping constructs in web.xml.  The
reason is that there is business logic related to the hostname (and
path) that is better described in application code than in exotic path
mappings.  As a fallback the requests I don't handle specifically are
forwarded to the file servlet.

> One specific reason I'm curious is because the 4.0.2 benchmarks vs nginx
> are very, very close even for large static files. (We're already faster
> for small files.)

I'm more than happy with the current performance ;-)

-Knut


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


Re: [Resin-interest] Large negative range in the HTTP request

2009-11-16 Thread Knut Forkalsrud
Dear Cognoscenti,
We have recently been getting a few requests with abnormal Range
request headers.  For example:

           Accept-Language: zh-cn,zh-hk,zh-tw,en-us
           User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
           Accept: */*
           Host: www.mydomain.com
           Connection: Keep-Alive
           Range: bytes=-335544320--1162852624
           Accept-Encoding: gzip
           X-Forwarded-For: 124.115.0.146

This results in an exception like this:

java.lang.ArrayIndexOutOfBoundsException
  at java.lang.System.arraycopy(Native Method)
  at com.caucho.vfs.WriteStream.write(WriteStream.java:301)
  at 
com.caucho.server.connection.ResponseStream.writeNext(ResponseStream.java:445)
  at 
com.caucho.server.connection.ToByteResponseStream.write(ToByteResponseStream.java:336)
  at 
com.caucho.server.connection.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:67)
  at com.caucho.vfs.ReadStream.writeToStream(ReadStream.java:899)
  at com.caucho.servlets.FileServlet.handleRange(FileServlet.java:498)
  at com.caucho.servlets.FileServlet.service(FileServlet.java:325)
  at 
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
  at 
com.caucho.server.webapp.NamedDispatcherImpl.forward(NamedDispatcherImpl.java:108)
  at com.mydomain.www.MyServlet.doGet(BaseServlet.java:167)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:114)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
  at 
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
  at 
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
  at 
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
  at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)
  at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)
  at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730)
  at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649)
  at java.lang.Thread.run(Thread.java:595)

(I'm forwarding the request to the FileServlet).  No harm done here,
the requests seems to fail
without causing any other side effects, but I'm wondering if the
FileServlet should handle the
situation a little more gracefully and give a 4xx response code
instead of throwing an exception,
which ends up being a 5xx response code.

This is Resin 3.1.8 btw.

Thanks,

Knut Forkalsrud


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


[Resin-interest] Large negative range in the HTTP request

2009-11-16 Thread Knut Forkalsrud
Dear Cognoscenti,

We have recently been getting a few requests with abnormal Range request
headers.  For example

  Accept-Language: zh-cn,zh-hk,zh-tw,en-us
  User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
  Accept: */*
  Host: www.mydomain.com
  Connection: Keep-Alive
  Range: bytes=-335544320--1162852624
  Accept-Encoding: gzip
  X-Forwarded-For: 124.115.0.146

This results in an exception like this:

java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at com.caucho.vfs.WriteStream.write(WriteStream.java:301)
at
com.caucho.server.connection.ResponseStream.writeNext(ResponseStream.java:445)

at
com.caucho.server.connection.ToByteResponseStream.write(ToByteResponseStream.java:336)

at
com.caucho.server.connection.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:67)

at com.caucho.vfs.ReadStream.writeToStream(ReadStream.java:899)
at com.caucho.servlets.FileServlet.handleRange(FileServlet.java:498)
at com.caucho.servlets.FileServlet.service(FileServlet.java:325)
at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)

at
com.caucho.server.webapp.NamedDispatcherImpl.forward(NamedDispatcherImpl.java:108)

at com.mydomain.www.MyServlet.doGet(BaseServlet.java:167)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:114)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)

at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)

at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)

at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649)
at java.lang.Thread.run(Thread.java:595)
   *Description*
2009-11-14 14:21:58,125 ERROR [http-httpd-12180-7$799557599]
estalea.bucket.servlet.BaseServlet : HTTPRequest  Request: GET /
Session Id: none  Attributes:   javax.servlet.error.servlet_name
= resin-file  Headers:   Accept-Language:
zh-cn,zh-hk,zh-tw,en-us   User-Agent: Mozilla/4.0 (compatible; MSIE
6.0; Windows NT 5.1)   Accept: */*   Host: ojrq.net
 Connection: Keep-Alive   Range: bytes=-335544320--1162852624
   Accept-Encoding: gzip   X-Forwarded-For: 124.115.0.146  Host:
10.16.4.8 at address 10.16.4.8  java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method) at
com.caucho.vfs.WriteStream.write(WriteStream.java:301) at
com.caucho.server.connection.ResponseStream.writeNext(ResponseStream.java:445)
at
com.caucho.server.connection.ToByteResponseStream.write(ToByteResponseStream.java:336)
at
com.caucho.server.connection.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:67)
at com.caucho.vfs.ReadStream.writeToStream(ReadStream.java:899) at
com.caucho.servlets.FileServlet.handleRange(FileServlet.java:498) at
com.caucho.servlets.FileServlet.service(FileServlet.java:325) at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
at
com.caucho.server.webapp.NamedDispatcherImpl.forward(NamedDispatcherImpl.java:108)
at
estalea.ir.tracking.click.BrandedUrlServlet.doService(BrandedUrlServlet.java:64)
at estalea.bucket.servlet.BaseServlet.serviceWrapper(BaseServlet.java:191)
at estalea.bucket.servlet.BaseServlet.doGet(BaseServlet.java:167) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:114) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:91) at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273) at
com.caucho.server.port.TcpConnection.run(TcpConnection.java:682) at
com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730) at
com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649) at
java.lang.Thread.run(Thread.java:595)
Show » <https://jira.estalea.net/jira/browse/IRT-2667>


(I'm forwarding the request to the FileServlet).  No harm done here, the
requests seems to fail
without causing any other side effects, but I'm wondering if the FileServlet
should handle the
situation a little more gracefully and give a 4xx response code instead of
throwing an exception,
which ends up being a 5xx response code.

This is Resin 3.1.8 btw.

Thanks,

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


Re: [Resin-interest] resin 4.0.1 : Chinese UTF8 characters problems in Quercus

2009-10-22 Thread Knut Forkalsrud
javac assumes the source file is latin-1 unless anything else is explicitly
specified.
The easiest way to deal with that is to use unicode
escapesin
the java source.

-Knut



On Thu, Oct 22, 2009 at 01:38, Илья Казначеев  wrote:
> On Tuesday 06 October 2009 00:15:44 smallufo wrote:
>
>> Both of my java and php file are encoded in UTF8
>> It seems Chinese words in php can successfully pass to java side ,
>> BUT , java side cannot correctly pass Chinese words back.
>> see my attachments for detail .
>>
>> If you cannot see the attachment , I uploaded to here :
>>
>> http://i273.photobucket.com/albums/jj212/smallufo/quercus_Chinese_bug.gif
>
> Are you sure your javac encoding is set to utf-8?
> It should match your source encoding, or else.
>
> And it can still be latin-1.
>
>
> ___
> 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] Can't seem to get character encoding right.

2009-07-29 Thread Knut Forkalsrud
I may be out of date, last time I used JSPs was in 2005 or so.
Back then the default assumed page encoding was *ISO-8859-1*., not the same
as contentType.
The spec (JSP 1.2)
http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.pdf
also indicated that (near the top of page 18.

JSP 2.0 also indicates the same:
http://java.sun.com/products/jsp/syntax/2.0/syntaxref2010.html#1001361

-Knut


On Wed, Jul 29, 2009 at 14:41, Scott Ferguson  wrote:

> The charset in the contentType is the default value of the
> pageEncoding.  So it shouldn't matter.
>
> You can check the parsing, by the way, by looking at the generated
> *.java file.  Those characters will be the parsed unicode values.
>
> -- Scott
>
>
> On Jul 29, 2009, at 2:27 PM, Rick Mann wrote:
>
> > Gah! Thank you! I feel like I should've known this, or did know it
> > once upon a time and just forgot.
> >
> > On Jul 29, 2009, at 14:23:03, Knut Forkalsrud wrote:
> >
> >> Try adding either of these:
> >>
> >> <%@ page pageEncoding="ISO-8859-1" %>
> >> <%@ page pageEncoding="UTF-8" %>
> >>
> >> One of them might do the trick
> >>
> >> -Knut
> >>
> >>
> >>
> >> <%@ page
> >> [ language="java" ]
> >> [ extends="package.class" ]
> >> [ import="{package.class | package.*}, ..." ]
> >> [ session="true|false" ]
> >> [ buffer="none|8kb|sizekb" ]
> >> [ autoFlush="true|false" ]
> >> [ isThreadSafe="true|false" ]
> >> [ info="text" ]
> >> [ errorPage="relativeURL" ]
> >> [ contentType="mimeType [ ; charset=characterSet ]" |
> >> "text/html ; charset=ISO-8859-1" ]
> >> [ isErrorPage="true|false" ]
> >> [ pageEncoding="characterSet |ISO-8859-1" ]
> >> %>
> >>
> >>
> >> On Wed, Jul 29, 2009 at 14:06, Rick Mann 
> >> wrote:
> >> So, I created two dirt-simple files, identical in content, one ending
> >> in .jsp, one ending in .html. I have no filters or other processing
> >> in
> >> my webapp. Resin 4.0 seems to re-encode the UTF-8 copyright symbol,
> >> and I get four bytes "C3 82 C2 A9", when I should have two: "C2 A9",
> >> but ony in the .jsp, not in the .html.
> >>
> >> I figure at some point a conversion is happening where something is
> >> having the wrong encoding applied.
> >>
> >> Any suggestions?
> >>
> >>
> >> On Jul 28, 2009, at 18:19:24, Rick Mann wrote:
> >>
> >>> I'm running Resin 4.0 on Mac OS X. I have a .jsp file encoded as
> >>> UTF-8, and I pass -Dfile.encoding=utf-8 to the jvm. At the top of my
> >>> JSPs, I have
> >>>
> >>> <%@ page contentType="application/xhtml+xml; charset=UTF-8"%>
> >>>
> >>> I've verified that the JSP thinks the request and response encodings
> >>> are UTF-8 with:
> >>>
> >>> <%
> >>>
> >> org.apache.log4j.Logger.getLogger("com.latencyzero").warn("Encoding:
> >>> "+ request.getCharacterEncoding());
> >>>
> >> org.apache.log4j.Logger.getLogger("com.latencyzero").warn("resp
> >>> Encoding: "+ response.getCharacterEncoding());
> >>> %>
> >>>
> >>> But, the copyright symbol in my source file, which looks fine in my
> >>> UTF-8 aware text editor, renders as a capital A with a grave accent,
> >>> and the copyright symbol.
> >>>
> >>> What aspect of the encoding am I forgetting?
> >>>
> >>> TIA,
> >>> Rick
> >>>
> >>>
> >>>
> >>> ___
> >>> 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
> >>
> >> ___
> >> 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
>
>
>
> ___
> 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] Can't seem to get character encoding right.

2009-07-29 Thread Knut Forkalsrud
Try adding either of these:

<%@ page pageEncoding="ISO-8859-1" %>
<%@ page pageEncoding="UTF-8" %>

One of them might do the trick

-Knut



<%@ page
[ language="java" ]
[ extends="package.class" ]
[ import="{package.class | package.*}, ..." ]
[ session="true|false" ]
[ buffer="none|8kb|sizekb" ]
[ autoFlush="true|false" ]
[ isThreadSafe="true|false" ]
[ info="text" ]
[ errorPage="relativeURL" ]
[ contentType="mimeType [ ; charset=characterSet ]" |
"text/html ; charset=ISO-8859-1" ]
[ isErrorPage="true|false" ]
[ pageEncoding="characterSet |ISO-8859-1" ]
%>


On Wed, Jul 29, 2009 at 14:06, Rick Mann  wrote:

> So, I created two dirt-simple files, identical in content, one ending
> in .jsp, one ending in .html. I have no filters or other processing in
> my webapp. Resin 4.0 seems to re-encode the UTF-8 copyright symbol,
> and I get four bytes "C3 82 C2 A9", when I should have two: "C2 A9",
> but ony in the .jsp, not in the .html.
>
> I figure at some point a conversion is happening where something is
> having the wrong encoding applied.
>
> Any suggestions?
>
>
> On Jul 28, 2009, at 18:19:24, Rick Mann wrote:
>
> > I'm running Resin 4.0 on Mac OS X. I have a .jsp file encoded as
> > UTF-8, and I pass -Dfile.encoding=utf-8 to the jvm. At the top of my
> > JSPs, I have
> >
> > <%@ page contentType="application/xhtml+xml; charset=UTF-8"%>
> >
> > I've verified that the JSP thinks the request and response encodings
> > are UTF-8 with:
> >
> > <%
> >
> org.apache.log4j.Logger.getLogger("com.latencyzero").warn("Encoding:
> > "+ request.getCharacterEncoding());
> >   org.apache.log4j.Logger.getLogger("com.latencyzero").warn("resp
> > Encoding: "+ response.getCharacterEncoding());
> > %>
> >
> > But, the copyright symbol in my source file, which looks fine in my
> > UTF-8 aware text editor, renders as a capital A with a grave accent,
> > and the copyright symbol.
> >
> > What aspect of the encoding am I forgetting?
> >
> > TIA,
> > Rick
> >
> >
> >
> > ___
> > 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
>
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] resin xss issue

2009-04-06 Thread Knut Forkalsrud
The easiest thing is probably to delete the resin-doc folder.

-Knut


On Mon, Apr 6, 2009 at 3:23 PM, Durmus, Emre  wrote:

>  Hi,
>
> We are currently using Resin3.0.25 and we could not pass PCI Compliance
> scan due to the following problem (The message below is taken from the scan
> results):
>
> ---
> Synopsis : The remote web server contains a Java Servlet that is affected
> by a cross-site scripting vulnerability. Description : The remote host is
> running Resin, an application server. The 'viewfile' Servlet included with
> the version of Resin installed on the remote host fails to sanitize user
> input to the 'file' parameter before including it in dynamic HTML output. An
> attacker may be able to leverage this issue to inject arbitrary HTML and
> script code into a user's browser to be executed within the security context
> of the affected site. Note that the affected Servlet is part of the Resin
> documentation, which should not be installed on production servers. See also
> : http://www.kb.cert.org/vuls/id/305208 
> http://www.securitymetrics.com/u?2ea1b70
> f  *Solution*: Upgrade to Resin
> or Resin Pro version 3.1.4  / 3.0.25 or later.
> ---
>
> If you try to view the following on a browser, it runs the script on our
> servers, causing XSS security problem 
> (.../resin-doc/viewfile?file=SMetricsalert('This
> is vulnerable to 
> XSS')
> ).
>
>
> They are suggesting that we should use Resin3.0.25 and we are already using
> that version.
> Is there a way to overcome this issue without upgrading to version 3.1 or
> higher? Or is it possible to restrict access to /resin-doc folder?
>
> I would appreciate it a lot, if you could help me out.
>
>
> Thank you.
>
> Emre Durmus
>
>
>
> PRIVILEGED AND CONFIDENTIAL
> PLEASE NOTE: The information contained in this message is privileged and
> confidential, and is intended only for the use of the individual to whom it
> is addressed and others who have been specifically authorized to receive it.
> If you are not the intended recipient, you are hereby notified that any
> dissemination, distribution or copying of this communication is strictly
> prohibited. If you have received this communication in error, or if any
> problems occur with transmission, please contact sender. Thank you.
>
> P   Please consider the environment before printing this e-mail.
>
>
>
> ___
> 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] light image processing in resin application

2009-03-20 Thread Knut Forkalsrud
On Fri, Mar 20, 2009 at 10:01 AM, Riccardo Cohen wrote:

> I need someting very light, quick and safe, what do you suggest ?
>

I'm not familiar with JAI, so I'll leave that for others to assess.
For a server side application you may want to stick with imageio over
java.awt.Toolkit.
The Toolkit approach is very system dependent, but potentially faster, since
it delegates
to (potentially hardware accelerated) system libraries.

In any case you will want to be aware of the aliasing effects you get when
scaling
either up or down in large steps.  Details are at:

http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html<%20%20%20%20http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html>

Good luck,

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


Re: [Resin-interest] LDAP Connection Pooling

2009-03-06 Thread Knut Forkalsrud
You probably already found this with a google search, but I'll point it out
anyway.  Sun describes simple pooling for the JNDI/LDAP stuff:
http://java.sun.com/products/jndi/tutorial/ldap/connect/pool.html

In addition the Spring framework has their own take on LDAP connection
pooling:
http://www.springsource.org/ldap

Disclaimer: I haven't used any of these.

-Knut


On Fri, Mar 6, 2009 at 10:04 AM, Matt White  wrote:

> On Fri, Mar 6, 2009 at 11:48 AM, Scott Ferguson  wrote:
>
> > No, Resin doesn't have LDAP pools.  I'm not sure if it's possible.
> > Because the LDAP implementations directly hook into javax.naming,
> > there's nowhere for Resin to insert itself to pool the connections.
>
> Thanks Scott!
>
> Thanks what I needed to know.
>
> - Matt
>
>
> ___
> 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] Why watchdog restart app server with no reason

2009-02-05 Thread Knut Forkalsrud
Here are some steps to troubleshoot:
Look for any calls to System.exit(int) in your code and/or libraries you
use.
Look for files called hs_errXXX.pid in the server root directory, it could
be a JVM crash.

-Knut




On Thu, Feb 5, 2009 at 8:14 PM, 万毅(Winy.Wan) wrote:

>Hi guys,
>I have read the resin-doc,it says "The watchdog automatically
> restarts Resin if the Resin JVM ever crashes or exits",
> but I do not find any exception in out jvm log. In watchdog log , i find a
> strange things that sometimes watchdog restart
> resin after a minutes on my app server completely start up.
>anyone can help me ,thks!
>
> --
> 2009-02-06
>
> Wayne Wan
>
>
>
>
>
> ___
> 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] implicit stack memory size?

2009-01-08 Thread Knut Forkalsrud
On Thu, Jan 8, 2009 at 1:52 PM, Jay Ballinger  wrote:
> - When a thread is created, does it grab all of the stack memory, or can
> the stack memory start small and grow to the default or -Xss size?

If I'm not mistaken the memory is allocated, but it is virtual memory,
so unless it is actually used there is no penalty.

The only problem with allocating too much stack space is that you can
run out of address space on a 32 bit JVM.

With typically 2GB max addressable for the app and 10 MBytes per stack
you are limited to 200 threads.

-Knut


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


Re: [Resin-interest] Caucho servlet-mapping url-pattern

2009-01-06 Thread Knut Forkalsrud
With Resin 2.1 you may want to check out
<http://www.caucho.com/resin-2.1/ref/http-config.xtp#url-character-encoding>.
For spelling out the mapping in web.xml I think you want to spell it
out in text rather than the %xx url syntax.  To avoid any text file
encoding problems you may want to use XML entity escapes (&#ddd;).

-Knut


On Tue, Jan 6, 2009 at 11:32 AM, Tanya Huang  wrote:
> Hi Knut,
>
> Thanks for the lightening fast response!
>
> This really helps clarify the issue. We're running resin 2. Time to
> upgrade :)
>
> thanks,
> Tanya
>
> On Tue, 2009-01-06 at 11:35 -0800, Knut Forkalsrud wrote:
>> I think the old URL spec (I forget the RFC number ) didn't specify any
>> character set.
>> Apparently the new one (RFC 3986) does.  But there has been a bug in Resin 
>> which
>> has since been fixed. See <http://bugs.caucho.com/view.php?id=1596>.  Make 
>> sure
>> you run version 3.1.2 or later.
>>
>> -Knut
>>
>>
>>
>> On Tue, Jan 6, 2009 at 11:03 AM, Tanya Huang  wrote:
>> > Hello All,
>> >
>> > I combed the mailing list archive and read the Caucho documentation but
>> > still no answer for this issue, so here it is:
>> >
>> > I need to match a url pattern to forward to resin. The interesting part
>> > is the pattern contains foreign characters.
>> >
>> > I used the UTF-8 url encoded pattern, but the pattern did not get
>> > matched. Here's an example:
>> >
>> >  > > servlet-name='search'/>
>> >
>> > I've also tried it without url encoding (Russian in this case):
>> >
>> >  
>> >
>> > Everything I read says Caucho supports UTF-8 by default. Any suggestion
>> > on what else to try will be greatly appreciated.
>> >
>> > thanks,
>> > Tanya
>> >
>> >
>> >
>> > ___
>> > 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
>
>
>
> ___
> 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] Caucho servlet-mapping url-pattern

2009-01-06 Thread Knut Forkalsrud
I think the old URL spec (I forget the RFC number ) didn't specify any
character set.
Apparently the new one (RFC 3986) does.  But there has been a bug in Resin which
has since been fixed. See .  Make sure
you run version 3.1.2 or later.

-Knut



On Tue, Jan 6, 2009 at 11:03 AM, Tanya Huang  wrote:
> Hello All,
>
> I combed the mailing list archive and read the Caucho documentation but
> still no answer for this issue, so here it is:
>
> I need to match a url pattern to forward to resin. The interesting part
> is the pattern contains foreign characters.
>
> I used the UTF-8 url encoded pattern, but the pattern did not get
> matched. Here's an example:
>
>   servlet-name='search'/>
>
> I've also tried it without url encoding (Russian in this case):
>
>  
>
> Everything I read says Caucho supports UTF-8 by default. Any suggestion
> on what else to try will be greatly appreciated.
>
> thanks,
> Tanya
>
>
>
> ___
> 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] HTTPS/SSL Client authentication

2008-12-22 Thread Knut Forkalsrud
On Mon, Dec 22, 2008 at 10:32 AM, Victor Chugunov wrote:
...
> Does it mean if I set a flag of authenticate-client = "true" in  in
> resin.conf, all clients of other web applications, which are running on this
> server and using SSL, will be required to provide client certificate for
> authentications?

If I have understood things correctly that is exactly what happens.  The TCP
connection will be rejected if no valid client certificate is presented.

> Do I need a separate instance of resin for the application which required
> ssl client authentication in case the other applications would use server
> authentication?

You would need a separate listening port with a separate SSL configuration.
I think you could do it in the same instance, although I have never tried.

-Knut


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


Re: [Resin-interest] content-type's set

2008-10-20 Thread Knut Forkalsrud
You may be looking for the tag "character-encoding": <
http://caucho.com/resin/doc/env-tags.xtp#character-encoding>

-Knut



2008/10/20 蒋剑峰 <[EMAIL PROTECTED]>

> http://www.architectedulogiciel.fr/tutorials/resinutf8.php
> I already read the page.but I only get a solution that use  the configure
> of encoding in resin.conf as instead of typing "<%@ page
> contentType="text/html; charset=**"%>" in  .jsp  file.
> thanks
>
>
>
>
> 2008/10/20 Riccardo Cohen <[EMAIL PROTECTED]>
>
> There is a small tutorial to build a full utf-8 application with
>> resin/mysql here :
>> http://www.architectedulogiciel.fr/tutorials/resinutf8.php
>>
>> 蒋剑峰 wrote:
>> > hi,
>> > In oder to set all page with the same charset,
>> > I want to set content-type in configure file (eg. resin.conf) ,rather
>> > than type "<%@ page contentType="text/html; charset=**"%>" in all .jsp
>> file.
>> > how can I do?
>> > Are there the special filter in resin,that can transform the contentType
>> > of page?
>> > Thanks!
>> >
>> >
>> > 
>> >
>> > ___
>> > resin-interest mailing list
>> > resin-interest@caucho.com
>> > http://maillist.caucho.com/mailman/listinfo/resin-interest
>>
>> --
>> Riccardo Cohen
>> Architecte du Logiciel
>> http://www.architectedulogiciel.fr
>> +33 (0)6.09.83.64.49
>>
>>
>>
>> ___
>> 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
>
>
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] SSL - Different cert per virtual host?

2008-09-29 Thread Knut Forkalsrud
I have heard (rumors) that it is possible even with only one IP address
these days.  It requires a special certificate which contains all the host
names you represent.  

-Knut




On Mon, Sep 29, 2008 at 3:34 AM, Andrea Sodomaco <[EMAIL PROTECTED]> wrote:

>  it can be done also with one IP but using different ports.
>
> It is inpossible to use Name Virtual hosts on same socket (this is a https
> limit not a resin or apache limit)
>
>
> Riccardo Cohen wrote:
>
> yes but it can't be the same IP. your serveur must have several IP, one
> for each certificate.
>
> Mattias Jiderhamn wrote:
>
>
>  Hi, I want to know if it is possible to set up Resin to use multiple SSL
> certificates on the same server, each used for a different (virtual) host?
>
> That is, I want the same Resin instance to correspond both to foo.com
> with its SSL certificate and bar.com with its SSL certificate (on the
> same port). Is that possible? How?
>
>  /Mattias
>
>
> ___
> resin-interest mailing [EMAIL 
> PROTECTED]://maillist.caucho.com/mailman/listinfo/resin-interest
>
>
>
> ___
> 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] configuring webdav

2008-09-25 Thread Knut Forkalsrud
>
> On Sep 23, 2008, at 7:23 AM, Gary Lawrence Murphy wrote:
>
> > 
> ...
> > but when I use a browser to access localhost:8080/webdav I get
> > a 404 Not-Found error.
> ...
> > what did I miss?
>


It could be as simple as adding a trailing slash in your URL, after all
there is an explicit slash in the servlet mapping.

-Knut

PS: It would be nice if Resin's WebDAV servlet implemented the LOCK
operation such that MacOSX would mount a WebDAV server as a read/write file
system.
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] questing regarding connecting to different computers

2008-08-15 Thread Knut Forkalsrud
On Fri, Aug 15, 2008 at 3:07 AM, makubex <[EMAIL PROTECTED]>wrote:

>
> i also used the internet to check for my ipaddress it returned the same ip
> address for the 2 computer
>

If you are behind a NAT (network address translation) firewall you need to
open up the firewall for inbound traffic on the port you're inerested in
(8080 in your case).  Some firewalls can also do port mapping to take
incoming traffic on port 80 (default port for http) and forward it on port
8080.  That should make one server work.

To use several servers to back one website you need a load balancer.

and i also tried to use the command prompt and type in ipconfig to see my
> ipadd and nothing helps


I assume your two servers have different IP addresses.  Both different from
the external address of you firewall.


> am i doing something wrong?
>

I think reading a tutorial on TCP/IP would be in order.  This stuff has
little to do with Resin as an application server.

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


Re: [Resin-interest] 3.1.5 watchdog memory usage

2008-04-18 Thread Knut Forkalsrud
Eric Kreiser wrote:
> ... about 40M of physical memory... and about 650M of virtual memory.  
> ... how it could be using 650M in swap.
>
> Is anyone else see this?  Am I misunderstanding something?

Virtual memory is not swap space.  Think of it as address space.  Memory 
imagined, but not used.  It also incorporates things like shared 
libraries, that is memory shared by different applications.

-Knut




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


Re: [Resin-interest] Profiling...

2008-04-08 Thread Knut Forkalsrud

Andrew Fritz wrote:
Regardless, I still get a "Could not find agent library on the library 
path or in the local directory: jprofilerti".


The profiler likely comes with a binary, a file whose name end in .so, 
at least for Linux.  For jprofilerti the file name would be 
libjprofilerti.so I think.  Make sure that file is available to the 
dynamic loader by for example setting the environment variable 
LD_LIBRARY_PATH (Linux) or DYLD_LIBRARY_PATH (Mac if I remember 
correctly) or just copy it to ${resin.home}/libexec/ if you have such a 
directory.


-Knut

PS: I still think removing -Xdebug is worth an attempt.  I had very 
similar symptoms and that change did the trick.


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


Re: [Resin-interest] Memory and slowdown...

2008-04-07 Thread Knut Forkalsrud



On Apr 7, 2008, at 9:18 AM, Sandeep Ghael wrote:

-Xdebug


In my experience the debug switch sometimes causes the JVM to behave 
erratically under heavy load.  I would get rid of it and try again.


-Knut


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


Re: [Resin-interest] Locking the EnvironmentClassLoader

2008-04-02 Thread Knut Forkalsrud

This was with version 3.1.4, I haven't tried 3.1.5 yet.

-Knut



Knut Forkalsrud wrote:

Just a comment on this, we found similar problems not too long ago.
Performance under load turned out to be limited by the synchronized
lock in EnvironmentClassloader.  So our fancy new 8 core systems
suddenly were reduced to single thread performance.  Some profiling
highlighted two major offenders.

 - Hibernate's "classic" HQL query parser (which is a legacy thing, the
   default Hibernate configuration no longer uses it).
 - Beanshell.  We had a lot of beanshell interpreters running in the 
system.


The common denominator for these two was that they do a lot of lookups
(Class.forName()) on names that are not actual class names.  We ended
up (among other counter measures) writing our own class loader to cache
all sorts of class lookups, blatantly violating all sorts of class 
loading rules.

We will probably never be able to reload our app cleanly, but performance
improved at least 10x.

-Knut


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


Re: [Resin-interest] Locking the EnvironmentClassLoader

2008-04-02 Thread Knut Forkalsrud

Just a comment on this, we found similar problems not too long ago.
Performance under load turned out to be limited by the synchronized
lock in EnvironmentClassloader.  So our fancy new 8 core systems
suddenly were reduced to single thread performance.  Some profiling
highlighted two major offenders.

- Hibernate's "classic" HQL query parser (which is a legacy thing, the
  default Hibernate configuration no longer uses it).
- Beanshell.  We had a lot of beanshell interpreters running in the system.

The common denominator for these two was that they do a lot of lookups
(Class.forName()) on names that are not actual class names.  We ended
up (among other counter measures) writing our own class loader to cache
all sorts of class lookups, blatantly violating all sorts of class 
loading rules.

We will probably never be able to reload our app cleanly, but performance
improved at least 10x.

-Knut


PS: Perhaps obvious, but be careful running the JVM in debug mode to enable
on-the-fly reloading of classes. Under load the debug JVM has a tendency
to lock up in bad ways (at least the latest incarnations of Sun 1.5 for 
Linux).





Scott Ferguson wrote:

On Apr 1, 2008, at 11:26 PM, Don Willis wrote:

  

Hi all,

We have an application running on Resin 3.0.23.  Lately it has been
slowing down to a crawl on a regular basis.  Thread dumps when it's
slow show lots of threads (~30 to 100) waiting to lock the
EnvironmentClassLoader.  Like this one:



If it's possible, can you try to reproduce this in 3.1.5?  There are a  
good number of changes to speed up the classloading, so it would be  
useful to know if it's already resolved, or if you're seeing a new  
issue.


-- Scott

  

"resin-tcp-connection-j2ee.confluence.atlassian.com:8080-843" daemon
prio=10 tid=0x2aab391d1000 nid=0x22a7 waiting for monitor entry
[0x50f13000..0x50f15b90]
   java.lang.Thread.State: BLOCKED (on object monitor)
at com.caucho.loader.DynamicClassLoader.loadClass
(DynamicClassLoader.java:1044)
- waiting to lock <0x2aaac72eaf18> (a
com.caucho.loader.EnvironmentClassLoader)
at com.caucho.loader.DynamicClassLoader.loadClass
(DynamicClassLoader.java:1021)


The causes for loading classes are wide and varied, and they are
succeeding.  That is, in successive thread dumps the thread locking
the EnvironmentClassLoader changes, but many threads are still
waiting to lock it 20 seconds later.  My belief is that the Class
Loading is just taking way too long, and we're doing too much of it.
While I do think the app is a bit demanding of the ClassLoader, I
will, predictably, assure you that we haven't encountered this
bottleneck on other App Servers (or even any other deployments to
Resin as far as I've heard.)  Something that may be quite peculiar is
that the app does a lot of requests to load classes that aren't
there.  These seem to be particularly slow.

Are there any likely environmental factors that would affect the
speed of the EnvironmentClassLoader?
Is there any way to remove the bottleneck on the  
EnvironmentClassLoader?


We've lately changed the GC from concurrent to parallel and increased
the -Xmx on the app, for theoretically unrelated reasons.  There have
been none of these lock-ups since that change.  I'd really like to
put the -Xmx back down.  Does anybody have a compelling argument why
having less memory would dramatically slow down Resin's class loading?

Cheers,
Don


___
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
  


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


Re: [Resin-interest] simple utf8 question

2008-03-28 Thread Knut Forkalsrud
Riccardo Cohen wrote:
> 2) search
>
> it fails to find any record :
>
> qr=globalaction.m_manager.createQuery("select u from userinfo u where
> u.lastname like '"+catalogchapter+"%' order by lastname");
>
> when catalogchapter is £ I find the record, when it is א or 种 it
> returns zero record without any error (result list count=0).
>   

This must be a MySQL issue, either in the JDBC driver or on the server.
Make sure your table deals with extended unicode ranges.  For example try:

  show create table userinfo \G


You should get output like

CREATE TABLE userinfo (
.
) ENGINE=InnoDB AUTO_INCREMENT=6796 DEFAULT CHARSET=latin1


If the charset is latin1 like in my example you may have problems 
dealing with the Chinese characters.


-Knut



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


Re: [Resin-interest] simple utf8 question

2008-03-27 Thread Knut Forkalsrud
Riccardo Cohen wrote:
> what do you suggest for strings localization ? the docs does not tell 
> how to use xml for resourcebundle... or how to change encoding for text 
> resource bundle...
>   

One approach is to use the \u codes for any character outside 
Latin-1 ( are the hex digits of the code point in the Unicode tables).

That may make your resource bundle file less than ideal in terms or 
readability, but you may chose that for robustness.  You may even want 
to use the \u codes for every non-ascii character if you don't want 
other user's errors to affect you.

The other approach is to get familiar with the class loading scheme for 
resource bundles and write your own implementation.  


> 2) receiving
>
> the html page specify charset=UTF-8 in head content, and when typing £ 
> sign I get C2 A3. I suppose it is utf8 even if not exactly the code you 
> gave.

Correct, typo on my part.

> With that string the search succeed, but with the chinese 
> character 务 it fails.
>   

Fails, how?  I believe that is character 0x52a1 
, which 
should be perfectly representable in Java's 16 bit characters.

> I added utf-8 in resin.conf, 
> and it did some change (before that, the returned search string was not 
> equal to the sent search string). But the search still fails with 
> chinese char. Maybe this is an issue with amber/mysql ?
>   

Possibly.  Hard to say from here.

-Knut



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


Re: [Resin-interest] simple utf8 question

2008-03-26 Thread Knut Forkalsrud

Riccardo Cohen wrote:
I have an utf-8 html form that searches in the database, and produces 
result in an utf-8 html page.
  
I have 2 conversion problems :


1) displaying items
  


response.setContentType("text/html;charset=utf-8") may be enough.  It 
will set the response writer/output stream conversion to utf-8.



How do you convert a string to utf8 ?
  

utf8bytes = name.getBytes("UTF8") gives you the UTF-8 output.  If you pass that 
directly to response.getOutputStream() that should be it.  Don't try to convert it back 
to a String once you have done the UTF-8 encoding.  If your view is dealing with strings 
or characters instead of bytes, let the view take care of the UTF-8 encoding.  If your 
view is JSP there are page directives for this.  If your view relies or 
response.getWriter() setting the desired charset in the content type should be enough.  
If your view relies on response.getOutputStream() you need to take care of it yourself, 
buy you also will write bytes to the output, not characters.


in the form I receive a string wich is encoded in utf8 by the browser, 
but it is not recognized as utf8 by the server.


You may want to specify what character encoding your resin environment 
expects  .  
Browsers typically return the form data encoded by whatever character 
set the html document holding the form had, so if you present your form 
in UFT-8 you can be reasonably sure you get utf-8 data back in the 
submission.  Just make sure you indeed have UTF-8 data in the form, with 
a GET request the £ (GBP) character should show up as %C2%A9.



I cannot convert it to  utf8 for mysql.
  


Let the mysql JDBC driver get the String, it will deal with any UTF-8 
encoding internally by itself.  Don't try to force it.



-Knut

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


Re: [Resin-interest] 3.1.3

2008-02-14 Thread Knut Forkalsrud

your http request, is it "GET /food/", or is there more in the path, such as
"GET /food/dinner.html".  If so, you should have wildcards in the 
mapping, for

example:


servlet-name="Categories"/>


-Knut





Arthur Naylor wrote:
servlet-name="Categories"/> 

does not work either 



On Feb 14, 2008, at 6:55 PM, Knut Forkalsrud wrote:


Arthur Naylor wrote:
if i use the url-pattern such as in the following ...  

   
  
   

things work fine ... the servlet is called and the page is delivered 
... 

if i try using the regexp as it in the following ... the servlet is 
not called ... 

  servlet-name="Categories"/> 

Spaces?  Maybe a URL like /food%20/ or /%20travel%20/ will work.  Or 
url-regexp="/(food|travel|wine)/"


-Knut

___
resin-interest mailing list
resin-interest@caucho.com <mailto: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
  


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


Re: [Resin-interest] 3.1.3

2008-02-14 Thread Knut Forkalsrud

Arthur Naylor wrote:
if i use the url-pattern such as in the following ...  

   
  
   

things work fine ... the servlet is called and the page is delivered ... 

if i try using the regexp as it in the following ... the servlet is 
not called ... 

  servlet-name="Categories"/> 

Spaces?  Maybe a URL like /food%20/ or /%20travel%20/ will work.  Or 
url-regexp="/(food|travel|wine)/"


-Knut

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


Re: [Resin-interest] 2008-02-11 snapshot

2008-02-12 Thread Knut Forkalsrud
Daniel López wrote:
> Knut, you seem to have a setup quite similar to ours, are you using 3.1 
> already or staying if 3.0? If you are using 3.1, are you experiencing 
> similiar issues or is it just me? ;).
>   

We're on 3.0, but one of my short term objectives is to get us migrated
to 3.1.  I think we're almost there, although when I saw your mails
about watchdog problems I paused for an extra check :-).  The problems
you describe haven't struck us, at least not so far.  Then we haven't
had the JVM freeze on us either.  We probably will not run into it
either as long as we insist on different OS users/watchdogs per JVM.

The confusion over watchdog port caught us by surprise as well, it took
a second or third close reading of the documentation to find that one.

-Knut



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


Re: [Resin-interest] 2008-02-11 snapshot

2008-02-11 Thread Knut Forkalsrud
I wouldn't classify my setup as ISP environment.  We have a handful of 
web applications that have a more or less independent lifecycle in terms 
of upgrades, availability requirements and so on.  Also I have always 
favored running each application compartmentalized as much as reasonably 
possible.  For me that means separate JVM, running as a separate user on 
the server.  A chroot jail could be useful as well, but I haven't 
pursued that yet.  The code in question is all our own, so we trust all 
the apps to be well behaved.  Still we want to keep them separate, so 
for example an out of memory condition will only affect one app.  I 
haven't done any work involving the security manager, other than a dirty 
hack to allow one brain dead library to work.  We're on Linux servers.


-Knut



Mktg. Incorporate Fast wrote:

Hello Knut,

Are you hosting in an ISP environment?  If, so I am trying to enable resin
to do the same.  Can you please help me by describing the OS and method that
you are using resin in an ISP environment to allow multiple hosts on 1
server?

I am having difficulty with enabling resin in an ISP environment because of
the security issues with JAVA.  I am enabling JRE w/ the security manager
during testing but that appears to be quite slow.  With your environment are
you able to provide a fully secure virtual host environment?

If so I'd love to hear any suggestions that you may have to help me setup
this.

Thanks,

Joey

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Knut Forkalsrud
Sent: Monday, February 11, 2008 4:01 PM
To: General Discussion for the Resin application server
Subject: Re: [Resin-interest] 2008-02-11 snapshot

Scott Ferguson wrote:
  
I thought #2410 was different.  If the watchdog-port is the same for 
several instances (or unset) it was possible for a server to get 
stuck, so you couldn't start or stop it.  Since that would be an 
annoying situation, I'd like to track that down an fix it.



Ok, here is a scenario:  User A and user B have their files hidden from 
each other (as in chmod go-r).

User A starts Resin, thereby starting the watchdog.
User B tries to start its own Resin instance, which fails, because the 
(already running) watchdog cannot see the files owned by B.  Instead B 
gets an error message saying something like "No such file or directory: 
/home/B/web/conf/resin.conf"


-Knut



___
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
  


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


Re: [Resin-interest] 2008-02-11 snapshot

2008-02-11 Thread Knut Forkalsrud
Scott Ferguson wrote:
> I thought #2410 was different.  If the watchdog-port is the same for 
> several instances (or unset) it was possible for a server to get 
> stuck, so you couldn't start or stop it.  Since that would be an 
> annoying situation, I'd like to track that down an fix it.

Ok, here is a scenario:  User A and user B have their files hidden from 
each other (as in chmod go-r).
User A starts Resin, thereby starting the watchdog.
User B tries to start its own Resin instance, which fails, because the 
(already running) watchdog cannot see the files owned by B.  Instead B 
gets an error message saying something like "No such file or directory: 
/home/B/web/conf/resin.conf"

-Knut



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


Re: [Resin-interest] 2008-02-11 snapshot

2008-02-11 Thread Knut Forkalsrud

Scott Ferguson wrote:
There have been some changes to the watchdog.  I haven't been  
able to duplicate the exact failure scenarios yet, so it would be very  
helpful if someone who can reproduce the failures can give me a simple  
sequence to test.
  


I believe the issues in http://bugs.caucho.com/view.php?id=2409 and 
http://bugs.caucho.com/view.php?id=2410 turned out to be a 
misunderstanding about the difference between the watchdog port and the 
cluster port.  At least that is what I read out of message id 
<[EMAIL PROTECTED]> (attached).


-Knut

--- Begin Message ---
Hi,

Scott Ferguson escribió:
> On Feb 7, 2008, at 9:27 AM, Daniel Lopez wrote:
> 
>> Would then be the recommended way to work to set all watchdog ports on
>> all resin.conf files to be the same one? I'm thinking that might be
>> causing some of the issues as "side effect".
> 
> It currently defaults to use the same one.  I'm not sure I understand.

Ummm my bad, the port I'm configuring different for each instance is the 
"server port":

I confused the concepts. That is probably the port used by the watchdog 
process to contact this server instance, so having it different on each 
instance is the right way to go.
I understand now, thanks to Bill Au's reminder, that in order to change 
the watchdog port, there's another setting.

However, that would probably mean 2 JMV instances per "server", right? 
One for the watchdog process and another for the app. server itself. 
That would probably be too much overhead, as having many perl processes 
was a not a problem before, but JVM processes are not that light :).

So I'll wait for the issues to be dealt with, and then stay with one 
watchdog process and several instances.

Thanks all for your help,
D.


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


[Resin-interest] Resin 3.1.4 management interface incomplete?

2008-02-08 Thread Knut Forkalsrud
I'm trying to get some statistics out of my Resin instance through the 
JMX beans.
Some of the interesting metrics on PortMXBean seem to be missing, 
notably the

following properties:

requestCountTotal
requestCountKeepalive
requestCountClientDisconnect
requestTimeTotal
requestBytesRead
requestBytesWritten

I've tried to trace the source code for where they're updated, but I 
can't find any
code that does that.  The attached jsp page illustrates the issue.  As I 
load the
page over and over the metrics do not change, they're always zero.  I've 
run this
on 3.1.4 and 3.0.23, and they're both the same in this respect.  Is 
there a trick

I need to invoke to get this going, or is it simply not implemented?

Thanks

Knut Forkalsrud

<%@ page contentType="text/plain; charset=UTF-8" %>
<%@ page info="stats.jsp" %>
<%@ page import="java.util.*, com.caucho.jmx.Jmx, 
com.caucho.management.server.*" %>
<%!

  void println(JspWriter out, String name, Object value) throws 
java.io.IOException {
  out.println(name + ": " + String.valueOf(value));
  }

%>
<%
 ResinMXBean _resin = (ResinMXBean) Jmx.findGlobal("resin:type=Resin");
 ServerMXBean _server = (ServerMXBean) Jmx.findGlobal("resin:type=Server");
 ProxyCacheMXBean _proxyCache = (ProxyCacheMXBean) 
Jmx.findGlobal("resin:type=ProxyCache");
 ThreadPoolMXBean _threadPool = (ThreadPoolMXBean) 
Jmx.findGlobal("resin:type=ThreadPool");


println(out, "version",  com.caucho.Version.VERSION);
println(out, "server id", _server.getId());
println(out, "configFile", _resin.getConfigFile());
println(out, "startTime", _server.getStartTime());
println(out, "invocationCache.hit", _server.getInvocationCacheHitCountTotal());
println(out, "invocationCache.miss", 
_server.getInvocationCacheMissCountTotal());
if (_proxyCache != null) {
println(out, "proxyCache.hit", _proxyCache.getHitCountTotal());
println(out, "proxyCache.miss", _proxyCache.getMissCountTotal());
}
println(out, "threads.active", _threadPool.getThreadActiveCount());
println(out, "threads.idle", _threadPool.getThreadIdleCount());
println(out, "threads.total", _threadPool.getThreadCount());
println(out, "threads.max", _threadPool.getThreadMax());

PortMXBean[] portList = _server.getPorts();
for (PortMXBean bean : portList) {
String p = String.valueOf(bean.getPort());
println(out, "port." + p + ".state", bean.getState());
println(out, "port." + p + ".host", bean.getAddress() != null ? 
bean.getAddress() : "*");
println(out, "port." + p + ".protocol", bean.getProtocolName());
println(out, "port." + p + ".requestCountTotal", 
bean.getRequestCountTotal());
println(out, "port." + p + ".requestCountKeepalive", 
bean.getKeepaliveCountTotal());
println(out, "port." + p + ".requestCountClientDisconnect", 
bean.getClientDisconnectCountTotal());
println(out, "port." + p + ".requestTimeTotal", bean.getRequestTimeTotal());
println(out, "port." + p + ".requestBytesRead", bean.getReadBytesTotal());
println(out, "port." + p + ".requestBytesWritten", 
bean.getWriteBytesTotal());
}
%>
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] Resin 3.1.4 management interface incomplete?

2008-02-08 Thread Knut Forkalsrud
I'm trying to get some statistics out of my Resin instance through the JMX
beans.
Some of the interesting metrics on PortMXBean seem to be missing, notably
the
following properties:

requestCountTotal
requestCountKeepalive
requestCountClientDisconnect
requestTimeTotal
requestBytesRead
requestBytesWritten

I've tried to trace the source code for where they're updated, but I can't
find any
code that does that.  The attached jsp page illustrates the issue.  As I
load the
page over and over the metrics do not change, they're always zero.  I've run
this
on 3.1.4 and 3.0.23, and they're both the same in this respect.  Is there a
trick
I need to invoke to get this going, or is it simply not implemented?

Thanks

Knut Forkalsrud


stats.jsp
Description: Binary data
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] R: How to set default/global response encoding? + forms encoding

2007-06-30 Thread Knut Forkalsrud
Andrea Sodomaco wrote:
> How to set globally the pageEncoding to UTF-8?
>
> I have another problem how to set resin parsing of forms POST to UTF-8?
>   
In Resin 2.1 there was a "character-encoding" attribute.  See

http://www.caucho.com/resin-2.1/ref/app-config.xtp#character-encoding



-Knut



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


Re: [Resin-interest] resin maven plugin like jetty

2007-06-11 Thread Knut Forkalsrud
Tony Field wrote:
> Does anyone know of a resin maven plugin that works similar to the  
> way the jetty plugin works?

There is something called Cargo (cargo.codehaus.org).  I don't know 
enough about the Jetty plugin to tell if it is what you're looking for 
though.

> If one doesn't exist, is anyone interested in working on one with me?
>   

I'm sure there will be some interest as soon as people see a proof of 
concept.


-Knut



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


Re: [Resin-interest] too many servlet includes

2007-06-02 Thread Knut Forkalsrud

You probably have a cycle in your includes.
either  page includes itself
orpage A includes page B which includes page A
or ...

-Knut


Mário Coelho wrote:

javax.servlet.ServletException: too many servlet includes
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] ssl port

2007-06-01 Thread Knut Forkalsrud
Michael Fortin wrote:
> What  do you mean by 'request adapter'?
>   
I mean the Wrapper or Decorator pattern, more specifically
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequestWrapper.html

Subclass this one and override isSecure().  Then use a filter to inject 
the wrapped request
making that what the rest of your webapp sees.

-Knut


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


Re: [Resin-interest] ssl port

2007-06-01 Thread Knut Forkalsrud
Michael Fortin wrote:
> How do I configure resin to know the request on 8443 is secure?
>   

If your advanced load balancer can inject an HTTP header in the SSL
requests
you can use a servlet filter to add a request adapter that overrides the
isSecure method.

-Knut




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


Re: [Resin-interest] java.util.zip.ZipException: Too many open files. Resin 3.0.14

2007-03-22 Thread Knut Forkalsrud
I would think "lsof" can give you the information.  Otherwise the /proc 
file system has nodes for introspection of lots of stuff like this.  
Unfortunately I'm not a black-belt sysadmin, so I don't know the details 
on how to find it.


-Knut


Yogesh Gowdra wrote:


I don’t see any SNMP agents running in our applications, do you see 
any tools in Linux which I can use and run it against these open 
socket to get more information, like who and when did they opened?


 




*From:* [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] *On Behalf Of *Knut Forkalsrud

*Sent:* Tuesday, March 20, 2007 6:28 PM
*To:* General Discussion for the Resin application server
*Subject:* Re: [Resin-interest] java.util.zip.ZipException: Too many 
open files. Resin 3.0.14


 


Scott Ferguson wrote:

 


On Mar 20, 2007, at 5:54 PM, Yogesh Gowdra wrote:

...

Also, can you make out any thing more from the description of file 
handles like, are they unclosed POP3 connections or URL connection to 
external sites?




HTTP, POP and SMTP all use TCP, so those are likely not the culprit.  
SNMP uses UDP, so if you have an SNMP agent going in the app that 
might be something to look into.


-Knut



___
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] java.util.zip.ZipException: Too many open files. Resin 3.0.14

2007-03-20 Thread Knut Forkalsrud

Scott Ferguson wrote:


On Mar 20, 2007, at 5:54 PM, Yogesh Gowdra wrote:

...


Also, can you make out any thing more from the description of file 
handles like, are they unclosed POP3 connections or URL connection to 
external sites?




HTTP, POP and SMTP all use TCP, so those are likely not the culprit.  
SNMP uses UDP, so if you have an SNMP agent going in the app that might 
be something to look into.


-Knut

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


Re: [Resin-interest] How to start Resin at bootup time with non-root user

2007-03-13 Thread Knut Forkalsrud
For changing users there is "su".  Near the top of my (2.x and 3.x) 
startup scripts I have something like:


   mandatory_user=webserveruser
   username=`id -un`

   # restart with right user if needed
   if [ "$username" != "$mandatory_user" ]; then
 exec su -c "$0 $*" - $mandatory_user
   fi

   # ... rest of httpd.sh


This works well as long as there is only one argument to the script 
(start, stop, status, -v, etc.)
I never figured out how to get the arguments properly escaped for the 
second round invocation.
bash has $@ for that, and to be hones I no longer remember what exactly 
didn't work right.


-Knut



Michael Bachers wrote:

Hi,

I'm running Resin 3.1.0 on Debian and would like to automate Resin  
startups after a reboot.  I'm currently starting Resin as a non-root  
user on a non-root port, then using iptables to redirect traffic to  
port 80.  I know how to start Resin as root at bootup but am not sure  
how to do this as non-root.


Anyone doing this?

Thanks,
mike


___
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] Resin plugin for Eclipse?

2007-03-08 Thread Knut Forkalsrud
The simplest is probably to run Resin as any other java application, 
from the Run... dialog.  The
main class is com.caucho.server.http.ResinServer (at least in version 
3.0.x) you just need to
add a system proerty for logging: 
-Djava.util.logging.manager=com.caucho.log.LogManagerImpl
This lets you run resin, debug, profile, and so on.

-Knut


Bjørn Hanch Sollie wrote:
> What is currently the best option for deploying projects to Resin from 
> Eclipse? I've come across a couple of plugins out there, but they were 
> both quite old solutions which didn't work satisfactory for me. Can 
> anyone here provide me with a hint about their preferred solution?
>
>   


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


Re: [Resin-interest] How to start Resin with specified user?

2007-02-26 Thread Knut Forkalsrud
David Campbell wrote:
> You think using iptables is better than the server doing it itself?
> How can this possibly be true?
>   

Because this comes from the restriction that only root can bind to port 
numbers < 1024,
which I believe is not an eternal truth, I mentioned it before in 
http://www.caucho.com/support/resin-interest/0605/0078.html

-Knut



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


Re: [Resin-interest] How to start Resin with specified user?

2007-02-26 Thread Knut Forkalsrud
Scott Ferguson wrote:
> On Feb 24, 2007, at 10:59 PM, askxuefeng wrote:
>   
>> How can I start resin not using root? Thanks!
>> 

Also, on Linux you can use iptables which IMO is a better approach thant
the  tag:
http://www.caucho.com/resin-3.1/doc/config-scrapbook.xtp

-Knut




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


Re: [Resin-interest] php and resin.

2007-02-18 Thread Knut Forkalsrud
This is relatively well described in the documentation, specifically the 
"Quick Start" guide:

http://www.caucho.com/resin-3.1/doc/starting.xtp#Adding Content 


Does that help?

-Knut



Steve Burrus wrote:
> well however much this helps. my os platform is windows xp professional. and 
> i just simply wanna know which of the folders in the whole resin server 
> installation I should be putting the php file into to be able to then see it 
> in my web  browser.
>
>   


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


Re: [Resin-interest] php and resin.

2007-02-18 Thread Knut Forkalsrud

And Mattias Jiderhamn tried to help you:

   "Your question is so general, it is easy to assume you have not read
   the documentation yet, or do not know the basic concepts about
   web/J2EE servers.
   (Re-)Read the documentation. Try the out-of-the-box settings. Try a
   static HTML page. If your still having trouble, try to be more
   specific. (For example, include your operating system, what you have
   tried etc)."

Did you do any of this?

-Knut


Steve Burrus wrote:
I tried/attempted a long time ago to get someone to respond to me concerning 
getting a php file viewed in my web browser with the resin server. I have 
put the php file into the main installation folder of resin, the "httpdocs" 
folder, but I still was not able to view it. PleaSE help me with this.


  


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


Re: [Resin-interest] Resin... ?????

2007-01-15 Thread Knut Forkalsrud
I would guess heap space is your problem.  Have you made absolutely sure 
you're not running out of heap space?


-Knut



Akila Amarathunga wrote:

Hi Knut,

JVM sets the -Xss to 1 Megabytes.. It has open 1028 files (REG) at the
time of giving the error..
At the moment my app open lots of Jar files which uses 10 mb of
space... 


java27042   xxx844rREG 9,1 1189992
11814189//WEB-INF/lib/wicket-1.2.1.jar

Am I geeting the 503 error cos of that ?

Thanks,
Akila

On Sun, 2007-01-14 at 12:13 -0800, Knut Forkalsrud wrote:
  
You might want to try "jconsole" or something to figure out if you're 
running out of heap space.  Depending on what your application does 512 
MBytes may not be enough.  With 2GB of physical RAM on the machine you 
can probably afford to allow the JVM more memory.


When you get close to 1024 open files, try to figure out what those file 
handles represent, with a command like "lsof -p 32335 | awk '{ print $5 
}' | sort | uniq -c" where 32335 is the process id of the JVM.  Are they 
all files (REG) or sockets (IPv4/IPv6)?


A long shot: I assume the stack size you report is from "ulimit -s" 
which reports in kilobytes.  Resin's startup script by default sets the 
"-Xss" switch for the JVM to limit the stack size to 1 Megabyte.  Make 
sure that is the case for your installation as well, for example with 
"cat /proc/32335/cmdline | tr \\0 \\n | fgrep -- -Xss" where 32335 is 
the Resin JVM process id.  Otherwise you have up to 2048 threads * 
10MB/thread = 20GByte of address space.  If you're on a 32 bit CPU that 
won't work.  You're likely to have problems at 2GByte (the OS, JVM, etc 
want some address space too), which means about 200 simultaneous threads.


-Knut


[EMAIL PROTECTED] wrote:


hi All,

Well I used resin for few months now ... but i'm really sorry to say its a
bad experience. At the moment my settings are,
Server - RHEL (with 2 pros.)
RAM - 2 GB
Resin-pro-3.0.21
stack size 10240
Heap - 256 MB - 512 MB
Open files limit (ulimit -n) - 2048
Threads - 2048

If the number of files open by resin exceeds (used lsof) 1024, apache
gives 503 server down for maintenance error.
Please tell me what I'm doing wrong here..?

Regards,
Akila


___
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





___
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] Resin... ?????

2007-01-14 Thread Knut Forkalsrud
You might want to try "jconsole" or something to figure out if you're 
running out of heap space.  Depending on what your application does 512 
MBytes may not be enough.  With 2GB of physical RAM on the machine you 
can probably afford to allow the JVM more memory.

When you get close to 1024 open files, try to figure out what those file 
handles represent, with a command like "lsof -p 32335 | awk '{ print $5 
}' | sort | uniq -c" where 32335 is the process id of the JVM.  Are they 
all files (REG) or sockets (IPv4/IPv6)?

A long shot: I assume the stack size you report is from "ulimit -s" 
which reports in kilobytes.  Resin's startup script by default sets the 
"-Xss" switch for the JVM to limit the stack size to 1 Megabyte.  Make 
sure that is the case for your installation as well, for example with 
"cat /proc/32335/cmdline | tr \\0 \\n | fgrep -- -Xss" where 32335 is 
the Resin JVM process id.  Otherwise you have up to 2048 threads * 
10MB/thread = 20GByte of address space.  If you're on a 32 bit CPU that 
won't work.  You're likely to have problems at 2GByte (the OS, JVM, etc 
want some address space too), which means about 200 simultaneous threads.

-Knut


[EMAIL PROTECTED] wrote:
> hi All,
>
> Well I used resin for few months now ... but i'm really sorry to say its a
> bad experience. At the moment my settings are,
> Server - RHEL (with 2 pros.)
> RAM - 2 GB
> Resin-pro-3.0.21
> stack size 10240
> Heap - 256 MB - 512 MB
> Open files limit (ulimit -n) - 2048
> Threads - 2048
>
> If the number of files open by resin exceeds (used lsof) 1024, apache
> gives 503 server down for maintenance error.
> Please tell me what I'm doing wrong here..?
>
> Regards,
> Akila
>
>
> ___
> 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] Resin 3.1.0's bug in html charset

2007-01-06 Thread Knut Forkalsrud
askxuefeng wrote:
> But how to resolve html files with utf-8 and iso-8859-1? I mean, some files
> have utf-8 encoding, and some is iso-8859-1, and even more. 
>   
I don't think Resin offers a clever way of doing that, but you could
probably implement a filter.  The filter could for example buffer the
first few lines of the response, inspect the META tag for content type
and set that content type on the response.  That will of course only
work for HTML files with a META tag for the Content-Type.  Other
strategies could be used as well, such as looking for the
redundant/optional UTF-8 byte order mark (BOM) at the beginning of the
file.  Scanning the entire file for known byte encodings of common
characters may also work as circumstantial evidence for a text file's
character set.

-Knut



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


Re: [Resin-interest] java memory

2006-12-01 Thread Knut Forkalsrud
With a 32 bit JVM and/or CPU you can not address more than 4 GB of memory.
The operating system typically claims between 1 GB and 2 GB of the address
space, leaving perhaps as little as 2 GB to the JVM.  The JVM also needs 
some
address space for its internals, so your maximum heap size typically ends up
near 1.5 GB.  (At least on a stock Red Had linux system a couple of 
years back.)

-Knut



Riccardo Cohen wrote:
> Hi
> We tried to change the jvm memory default values :
>
> httpd.sh -Xss128k -Xms256M -Xmx2048M  start
>
> Now this works but if I put -Xmx4000M then resin does not start. Our server 
> has 4Gb of 
> memory, and I use resin 3.0.18 with sun jvm 1.5
> Thanks for any info
>
>
>   


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


Re: [Resin-interest] WebDAV

2006-11-01 Thread Knut Forkalsrud
Thomas Moorer wrote:
> Is anyone out there using the WebDAV
> http://www.caucho.com/resin-3.0/servlet/webdav.xtp ?
>
> Can anyone point me to a tutorial or a starting point for this?
>   
There isn't much to it.  Below is a simple config that works for me.  My 
problem is that the Mac OSX WebDAV client won't attempt to write unless 
the server provides locking facilities.  The Resin WebDAV servlet 
doesn't implement locks at all :-(



webdav
com.caucho.servlets.webdav.WebDavServlet

write
webdav 
false
/path/to/data






com.caucho.server.security.XmlAuthenticator

   username:password:webdav
   none




basic







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