[Resin-interest] Are you blogging about Resin?
Do you have a blog entry about Resin, Quercus, Hessian, or any other Caucho product? Let us know! Feel free to let people know about it on this list. If you don't feel like spamming the list ;-), you can send a link to your blog directly to me. We'll soon have blogs from me and other Caucho engineers and we're looking for interesting posts to link to. Happy blogging! Emil Emil Ong Chief Evangelist Caucho Technology, Inc. Tel. (858) 456-0300 mailto:[EMAIL PROTECTED] Caucho: Reliable Open Source --> Resin: application server --> Quercus: PHP in Java --> Hessian Web Services ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Resin 3.1.4: Old classloaders do not recycle resulting in OutOfMemory
On Jan 16, 2008, at 1:59 PM, Ilya Kasnacheev wrote: > I've got a weird problem for which I don't have enough knowlege. > > We've got a rich webapp (CMS) which uses servlet, xalan, hibernate, > struts1, a > few rhino, log4j. Right now I'm testing new version, old one was less > advanced and ran on resin 2. This sounds related to a classloader/GC issue that was introduced in 3.1.4 (and is fixed in the snapshot.) Try rolling back to 3.1.3 and see if you still have the issue (you could try the snapshot, although the snapshot is a bit unstable at the moment.) The specific problem is the _scanListeners field in EnvironmentClassLoader, which wasn't getting cleared in the destroy() call. > P.P.P.S. Sorry for my possibly lame questions. Heh. No, these are the opposite of lame questions. -- 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] Resin 3.1.4: Old classloaders do not recycle resulting in OutOfMemory
I've got a weird problem for which I don't have enough knowlege. We've got a rich webapp (CMS) which uses servlet, xalan, hibernate, struts1, a few rhino, log4j. Right now I'm testing new version, old one was less advanced and ran on resin 2. I've noticed that sometimes resin eats all allowed memory and refuses to work anymore. After some heap dump digging I've found that when I restart web-app by touching web.xml for example, resin creates new classloader and populates it with classes and data, but old classloader doesn't go away, ever. So after some development effort I would have around ten classloaders with all classes and stuff which would cause 'out of PermGen space' error. It looks like this in jhat: select e._id.toString() from com.caucho.loader.EnvironmentClassLoader e web-app:http://w3.uw.ru host:http://w3.uw.ru web-app:http://w3.uw.ru web-app:http://w3.uw.ru web-app:http://w3.uw.ru web-app:http://w3.uw.ru web-app:http://w3.uw.ru web-app:http://w3.uw.ru web-app:http://w3.uw.ru cluster:app-tier After some more digging I've found that EnvironmentClassLoader is referenced from apache-commons LogFactory.factories Hashtable. A-ha, thought I, that must be why. I've added LogFactory.release() to the code that is supposed to be executed when web-app is shut down. Running corrected version revealed that classloaders aren't still recycled, while I've got rid of that Hashtable reference. Still standing references, when I filter out all 'class Foo' and 'ProtectionDomain' lines, are like this: [EMAIL PROTECTED] (113 bytes) : field _parentLoader [EMAIL PROTECTED] (16 bytes) : field _loader [EMAIL PROTECTED] (33 bytes) : field _loader [EMAIL PROTECTED] (159 bytes) : field _owner [EMAIL PROTECTED] (159 bytes) : field _owner [EMAIL PROTECTED] (64 bytes) : field _classLoader [EMAIL PROTECTED] (48 bytes) : field loader ...about 30 Package's more... [EMAIL PROTECTED] (48 bytes) : field loader [EMAIL PROTECTED] (24 bytes) : field referent [EMAIL PROTECTED] (36 bytes) : field referent [EMAIL PROTECTED] (36 bytes) : field referent [EMAIL PROTECTED] (36 bytes) : field referent [EMAIL PROTECTED] (50 bytes) : field parent I wonder if there is something which keeps classloader from being marked as garbage. All com.caucho objects as I understand are app-wide and aren't referenced from outside, I would check that but I'm not sure I'm going the right way. So my questions are: Why might that all happen? How would I debug the specific reason of my problem? How to spot it? Are there anything else interesting about classloaders that I should better know? Maybe my problem isn't related to ClassLoader directly, maybe something else gets lost in cache somewhere and never dereferenced? Any clues for that case? P.S. Wiki say: If the error occurs only after the redeployment and restart of new applications, then the likely cause is that the JVM cannot garbage collect old classes that are replaced because there are references to the old classes, as discussed in [[Classloader references]]. Where there is no such article. Where is that classloader reference, if it exists at all? I would appreciate any help. P.P.S. Unrelated directly, but still interesting. "Common application errors include: Singleton or static hash maps and caches, esp check for clearing web-app restarts. web-app variables (like the "application (variable)" variable), stored in a static member of a class ThreadLocal variables that are not properly cleared at the end of each request." Aren't singletons and static hash maps referenced from webapp classes are supposed to be dropped completely, reloaded and repopulated when web-app restarts? Why would not I store web-app variables as static members of webapp classes, if those classes are supposed to be dropped-and-reread when web-app restarts anyway? What's wrong with static infinite-lifetime ThreadLocal variables? I thought there would be one per thread, and if I have something like ten threads under that classloader, I think ten unmutable variables aren't going to eat up all memory even if they're never destroyed. P.P.P.S. Sorry for my possibly lame questions. ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Webbeans interceptor exceptions
I wrote an interceptor for some webbeans component. code: ==The InterceptorBindingType @InterceptorBindingType @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface BlockCachable { } The Interceptor= @BlockCachable @Interceptor public class BlockModelCacheInterceptor { private static final Log log = LogFactory.getLog(BlockModelCacheInterceptor.class); public BlockModelCacheInterceptor() { } @AroundInvoke @SuppressWarnings(value = "unchecked") public Object invoke(final InvocationContext invocation) throws Throwable { log.info("intercepted"); return invocation.getTarget(); } } ===The component should be intercepted @Component public class MyBean{ @BlockCachable public void execute() { // do something } } Note: all interceptors were registed in web-beans.xml. When starting Resin, resin produce exceptions. Stacktrace: java.lang.RuntimeException: java.io.FileNotFoundException: \tmp\caucho\qa\temp.class (The system cannot find the path specified) at com.caucho.webbeans.bytecode.InterceptorGenerator.generateProxy(InterceptorGenerator.java:185) at com.caucho.webbeans.bytecode.InterceptorGenerator.gen(InterceptorGenerator.java:80) at com.caucho.webbeans.component.ClassComponent.bind(ClassComponent.java:354) at com.caucho.webbeans.cfg.WbWebBeans.bind(WbWebBeans.java:276) at com.caucho.webbeans.manager.WebBeansContainer.bind(WebBeansContainer.java:702) at com.caucho.webbeans.manager.WebBeansContainer.environmentStart(WebBeansContainer.java:732) at com.caucho.loader.EnvironmentClassLoader.start(EnvironmentClassLoader.java:567) at com.caucho.server.webapp.WebApp.start(WebApp.java:1798) at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:667) at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72) at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:549) at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:160) at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:675) at com.caucho.server.host.Host.start(Host.java:437) at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:667) at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72) at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:549) at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:160) at com.caucho.server.host.HostContainer.start(HostContainer.java:479) at com.caucho.server.cluster.Server.start(Server.java:1171) at com.caucho.server.cluster.Cluster.startServer(Cluster.java:708) at com.caucho.server.cluster.ClusterServer.startServer(ClusterServer.java:529) at com.caucho.server.resin.Resin.start(Resin.java:694) at com.caucho.server.resin.Resin.initMain(Resin.java:1124) at com.caucho.server.resin.Resin.main(Resin.java:1326) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) Caused by: java.io.FileNotFoundException: \tmp\caucho\qa\temp.class (The system cannot find the path specified) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.java:179) at java.io.FileOutputStream.(FileOutputStream.java:131) at com.caucho.vfs.FilePath.openWriteImpl(FilePath.java:470) at com.caucho.vfs.Path.openWrite(Path.java:1076) at com.caucho.webbeans.bytecode.InterceptorGenerator.generateProxy(InterceptorGenerator.java:175) ... 29 more java.lang.RuntimeException: java.io.FileNotFoundException: \tmp\caucho\qa\temp.class (The system cannot find the path specified) at com.caucho.webbeans.bytecode.InterceptorGenerator.generateProxy(InterceptorGenerator.java:185) at com.caucho.webbeans.bytecode.InterceptorGenerator.gen(InterceptorGenerator.java:80) at com.caucho.webbeans.component.ClassComponent.bind(ClassComponent.java:354) at com.caucho.webbeans.cfg.WbWebBeans.bind(WbWebBeans.java:276) at com.caucho.webbeans.manager.WebBeansContainer.bind(WebBeansContainer.java:702) at com.caucho.webbeans.manager.WebBeansContainer.environmentStart(WebBeansContainer.java:732) at com.caucho.loader.EnvironmentClassLoader.start(EnvironmentClassLoader.java:567)
Re: [Resin-interest] Resin clustered session store
We're using Xfire 1.2.6. I don't have a simple app you can deploy to test. I'll try and put one together tomorrow if I have a chance. This is unlikely as I'm pretty swamped right now :-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Emil Ong Sent: 16 January 2008 18:38 To: General Discussion for the Resin application server Subject: Re: [Resin-interest] Resin clustered session store Hi Richard, Which version of XFire are you using? Also, is there any chance you have a sample service that exhibits this behavior? I'll see if I can find the message you referenced on the XFire list... Thanks, Emil On Mon, Jan 14, 2008 at 05:56:57PM -, Richard Grantham wrote: > We would send valid SOAP requests but XFire was not interpretting > parameters correctly. > > Eg. This SOAP request: > > http://www.w3.org/2001/XMLSchema"; >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; >xmlns:xsd="http://www.w3.org/2001/XMLSchema";> > > > false > > > > > would give this response: > > 2007-08-08 09:59:03,894 ERROR [resin-tcp-connection-*:80-14] > (DefaultFaultHandler.java:35) - Fault occurred! > org.codehaus.xfire.XFireRuntimeException: Invalid boolean value: > at > org.codehaus.xfire.aegis.AbstractMessageReader.getValueAsBoolean(Abstr > ac > tMessageReader.java:115) > at > org.codehaus.xfire.aegis.type.basic.BooleanType.readObject(BooleanType > .j > ava:16) > at > org.codehaus.xfire.aegis.AegisBindingProvider.readParameter(AegisBindi > ng > Provider.java:169) > at > org.codehaus.xfire.service.binding.AbstractBinding.read(AbstractBinding. > java:206) > at > org.codehaus.xfire.service.binding.WrappedBinding.readMessage(WrappedB > in > ding.java:51) > at > org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler > .j > ava:42) > at > org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java > :1 > 31) > at > org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint > .j > ava:64) > at > org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.j > av > a:38) > at > org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireS > er > vletController.java:304) > at > org.codehaus.xfire.transport.http.XFireServletController.doService(XFi > re > ServletController.java:129) > at > org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java: > 116) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:153) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:91) > at > com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterCh > ai > n.java:103) > > The only difference would be the version of Resin used. I think > someone else posted a question about it to the XFire mailing list and > didn't receive a response. > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Emil Ong > Sent: 14 January 2008 17:38 > To: General Discussion for the Resin application server > Subject: Re: [Resin-interest] Resin clustered session store > > On Mon, Jan 14, 2008 at 04:54:19PM -, Richard Grantham wrote: > > Thanks for the response Scott. We did some firewall reconfiguration > > with regards to connections and sessions and the issue appears to > > have > > > gone away. > > > > I've not tried the 3.1 branch in a while as we found it didn't play > > well with XFire, but I will upgrade to 3.0.25 ASAP. > > Hi Richard, > > What problems did you run into with XFire and 3.1? We want to make > sure they work well together. > > Thanks, > Emil > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Scott > > Ferguson > > Sent: 14 January 2008 16:45 > > To: General Discussion for the Resin application server > > Subject: Re: [Resin-interest] Resin clustered session store > > > > > > On Jan 10, 2008, at 4:19 AM, Richard Grantham wrote: > > > > > Hi list, > > > > > > I'm using Resin Pro 3.0.23 (2 servers, load balanced/distributed > > > sessions) and I've seen this error a few times in the log file: > > > > We've made a few fixes to the synchronization/timing of the > > clustered session. Some in 3.0.25, but many more in 3.1. > > > > However, I was never able to reproduce that exact error here, so if > > anyone runs into this on 3.1.4 or later, it would be very helpful to > > send a bug report on the issue with as much detail as possible. > > > > -- Scott > > > > > > > > [2008-01-10 11:31:01.379] java.io.EOFException > > > [2008-01-10 11:31:01.379] at > > > java.io.ObjectInputStream$PeekInputStream.readFully > > > (ObjectInputStream.ja > > > va:2279) > > > [2008-01-10 11:31:01.379] at > > > java.io.ObjectInputStream$BlockDataI
Re: [Resin-interest] Resin clustered session store
Hi Richard, Which version of XFire are you using? Also, is there any chance you have a sample service that exhibits this behavior? I'll see if I can find the message you referenced on the XFire list... Thanks, Emil On Mon, Jan 14, 2008 at 05:56:57PM -, Richard Grantham wrote: > We would send valid SOAP requests but XFire was not interpretting > parameters correctly. > > Eg. This SOAP request: > > http://www.w3.org/2001/XMLSchema"; >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; >xmlns:xsd="http://www.w3.org/2001/XMLSchema";> > > > false > > > > > would give this response: > > 2007-08-08 09:59:03,894 ERROR [resin-tcp-connection-*:80-14] > (DefaultFaultHandler.java:35) - Fault occurred! > org.codehaus.xfire.XFireRuntimeException: Invalid boolean value: > at > org.codehaus.xfire.aegis.AbstractMessageReader.getValueAsBoolean(Abstrac > tMessageReader.java:115) > at > org.codehaus.xfire.aegis.type.basic.BooleanType.readObject(BooleanType.j > ava:16) > at > org.codehaus.xfire.aegis.AegisBindingProvider.readParameter(AegisBinding > Provider.java:169) > at > org.codehaus.xfire.service.binding.AbstractBinding.read(AbstractBinding. > java:206) > at > org.codehaus.xfire.service.binding.WrappedBinding.readMessage(WrappedBin > ding.java:51) > at > org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler.j > ava:42) > at > org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:1 > 31) > at > org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.j > ava:64) > at > org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.jav > a:38) > at > org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireSer > vletController.java:304) > at > org.codehaus.xfire.transport.http.XFireServletController.doService(XFire > ServletController.java:129) > at > org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java: > 116) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:153) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:91) > at > com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChai > n.java:103) > > The only difference would be the version of Resin used. I think someone > else posted a question about it to the XFire mailing list and didn't > receive a response. > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Emil Ong > Sent: 14 January 2008 17:38 > To: General Discussion for the Resin application server > Subject: Re: [Resin-interest] Resin clustered session store > > On Mon, Jan 14, 2008 at 04:54:19PM -, Richard Grantham wrote: > > Thanks for the response Scott. We did some firewall reconfiguration > > with regards to connections and sessions and the issue appears to have > > > gone away. > > > > I've not tried the 3.1 branch in a while as we found it didn't play > > well with XFire, but I will upgrade to 3.0.25 ASAP. > > Hi Richard, > > What problems did you run into with XFire and 3.1? We want to make sure > they work well together. > > Thanks, > Emil > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Scott Ferguson > > Sent: 14 January 2008 16:45 > > To: General Discussion for the Resin application server > > Subject: Re: [Resin-interest] Resin clustered session store > > > > > > On Jan 10, 2008, at 4:19 AM, Richard Grantham wrote: > > > > > Hi list, > > > > > > I'm using Resin Pro 3.0.23 (2 servers, load balanced/distributed > > > sessions) and I've seen this error a few times in the log file: > > > > We've made a few fixes to the synchronization/timing of the clustered > > session. Some in 3.0.25, but many more in 3.1. > > > > However, I was never able to reproduce that exact error here, so if > > anyone runs into this on 3.1.4 or later, it would be very helpful to > > send a bug report on the issue with as much detail as possible. > > > > -- Scott > > > > > > > > [2008-01-10 11:31:01.379] java.io.EOFException > > > [2008-01-10 11:31:01.379] at > > > java.io.ObjectInputStream$PeekInputStream.readFully > > > (ObjectInputStream.ja > > > va:2279) > > > [2008-01-10 11:31:01.379] at > > > java.io.ObjectInputStream$BlockDataInputStream.readShort > > > (ObjectInputStre > > > am.java:2748) > > > [2008-01-10 11:31:01.379] at > > > > java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780) > > > [2008-01-10 11:31:01.379] at > > > java.io.ObjectInputStream.(ObjectInputStream.java:280) > > > [2008-01-10 11:31:01.379] at > > > com.caucho.server.cluster.ClusterObject > > > $DistributedObjectInputStream. > > it>(ClusterObject.java:474) > > > [2008-01-10 11:31:01.379]
Re: [Resin-interest] Resin clustered session store
I've upgraded to 3.0.25 but I'm still seeing lots of session issues. One little bit or weirdness that I hope someone can answer is how the session database managed to shrink from around the 500MB mark to the 20MB mark. This seems to be a major drop in the space used. Also, I got an error whereby it tried to write an object of over 64mb to the file store, which gave an error. Now, I've checked through my application and I'm pretty sure that nothing is storing an object of that size in the session. I saw this bug: http://bugs.caucho.com/view.php?id=848 Could they be related? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard Grantham Sent: 14 January 2008 16:54 To: General Discussion for the Resin application server Subject: Re: [Resin-interest] Resin clustered session store Thanks for the response Scott. We did some firewall reconfiguration with regards to connections and sessions and the issue appears to have gone away. I've not tried the 3.1 branch in a while as we found it didn't play well with XFire, but I will upgrade to 3.0.25 ASAP. rgds, Richard -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Ferguson Sent: 14 January 2008 16:45 To: General Discussion for the Resin application server Subject: Re: [Resin-interest] Resin clustered session store On Jan 10, 2008, at 4:19 AM, Richard Grantham wrote: > Hi list, > > I'm using Resin Pro 3.0.23 (2 servers, load balanced/distributed > sessions) and I've seen this error a few times in the log file: We've made a few fixes to the synchronization/timing of the clustered session. Some in 3.0.25, but many more in 3.1. However, I was never able to reproduce that exact error here, so if anyone runs into this on 3.1.4 or later, it would be very helpful to send a bug report on the issue with as much detail as possible. -- Scott > > [2008-01-10 11:31:01.379] java.io.EOFException > [2008-01-10 11:31:01.379] at > java.io.ObjectInputStream$PeekInputStream.readFully > (ObjectInputStream.ja > va:2279) > [2008-01-10 11:31:01.379] at > java.io.ObjectInputStream$BlockDataInputStream.readShort > (ObjectInputStre > am.java:2748) > [2008-01-10 11:31:01.379] at > java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780) > [2008-01-10 11:31:01.379] at > java.io.ObjectInputStream.(ObjectInputStream.java:280) > [2008-01-10 11:31:01.379] at > com.caucho.server.cluster.ClusterObject > $DistributedObjectInputStream. it>(ClusterObject.java:474) > [2008-01-10 11:31:01.379] at > com.caucho.server.cluster.ClusterObject.load(ClusterObject.java:286) > [2008-01-10 11:31:01.379] at > com.caucho.server.cluster.FileBacking.loadSelf(FileBacking.java:318) > [2008-01-10 11:31:01.379] at > com.caucho.server.cluster.ClusterStore.load(ClusterStore.java:423) > [2008-01-10 11:31:01.379] at > com.caucho.server.cluster.ClusterObject.load(ClusterObject.java:259) > [2008-01-10 11:31:01.379] at > com.caucho.server.session.SessionImpl.load(SessionImpl.java:702) > [2008-01-10 11:31:01.379] at > com.caucho.server.session.SessionManager.getSession > (SessionManager.java: > 1278) > [2008-01-10 11:31:01.379] at > com.caucho.server.connection.AbstractHttpRequest.createSession > (AbstractH > ttpRequest.java:1444) > [2008-01-10 11:31:01.379] at > com.caucho.server.connection.AbstractHttpRequest.getSession > (AbstractHttp > Request.java:1256) > [2008-01-10 11:31:01.379] at > com.caucho.server.connection.AbstractHttpResponse.writeHeaders > (AbstractH > ttpResponse.java:1556) > [2008-01-10 11:31:01.379] at > com.caucho.server.connection.ResponseStream.writeHeaders > (ResponseStream. > java:216) > [2008-01-10 11:31:01.379] at > com.caucho.server.connection.ResponseStream.writeNext > (ResponseStream.jav > a:401) > [2008-01-10 11:31:01.379] at > com.caucho.server.connection.ToByteResponseStream.flushByteBuffer > (ToByte > ResponseStream.java:518) > [2008-01-10 11:31:01.379] at > com.caucho.server.connection.ToByteResponseStream.flushBuffer > (ToByteResp > onseStream.java:424) > [2008-01-10 11:31:01.379] at > com.caucho.server.connection.ResponseStream.finish > (ResponseStream.java:6 > 64) > [2008-01-10 11:31:01.379] at > com.caucho.server.connection.ResponseStream.close > (ResponseStream.java:79 > 6) > [2008-01-10 11:31:01.379] at > com.caucho.server.connection.AbstractHttpResponse.finish > (AbstractHttpRes > ponse.java:1956) > [2008-01-10 11:31:01.379] at > com.caucho.server.connection.AbstractHttpResponse.close > (AbstractHttpResp > onse.java:260) > [2008-01-10 11:31:01.379] at > com.caucho.server.webapp.WebAppFilterChain.doFilter > (WebAppFilterChain.ja > va:190) > [2008-01-10 11:31:01.379] at > com.caucho.server.dispatch.ServletInvocation.service > (ServletInvocation.j > ava:229) > [2008-01-10 11:31:01.379] at > com.caucho.server.http.HttpRequest.handle
Re: [Resin-interest] How to get non-singleton WebBeans inQuercus/PHP?
On Jan 16, 2008, at 9:07 AM, wesley wrote: > Thanks Scott. > I've known that java_bean("myBean") would work ONLY MyBean is > annotated with > @Singleton or registed in resin-web.xml. > How can I get a MyBean instance when MyBean is a NON-SINGLETON bean? It should work with a non-singleton bean as well. Resin will create a new instance of the bean automatically. If the bean has a scope, Resin will add the new bean to the scope (or use an old instance from the scope if it exists.) -- Scott > > - Original Message - > From: "Scott Ferguson" <[EMAIL PROTECTED]> > To: "General Discussion for the Resin application server" > > Sent: Thursday, January 17, 2008 12:36 AM > Subject: Re: [Resin-interest] How to get non-singleton WebBeans > inQuercus/PHP? > > >> >> On Jan 16, 2008, at 5:27 AM, wesley wrote: >> >>> For instance: >>> >>> I want to get a configured web-bean instance by class name in php >>> file >>> below: >>> = >>> >> echo java_bean("com.mycompany.MyBean"); >>> ?> >>> = >>> package com.mycompany; >>> @Component >>> // no @Singleton >>> public class MyBean { >> >> The default name of the bean is "myBean" according to the WebBeans >> specification, so try using: >> >> > >> echo java_bean("myBean"); >> >> ?> >> >> You can override the default name with @Named("my-name") as a class >> annotation. >> >> Also, if you turn on "fine" logging, you should see the bean get >> registered in the logs, and it should show the name that Resin's >> assigned. >> >> -- Scott >> >>> private String greetings = "Hello world."; >>> public MyBean() { >>> } >>> public String getGreetings() { >>> return greetings; >>> } >>> } >>> = >>> It won't work because java_bean() method only accept a singleton >>> bean name. >>> >>> >>> I tried to add a static method in >>> com.caucho.quercus.lib.ResinModule like >>> this: >>> = >>> public class ResinModule extends AbstractQuercusModule { >>> ... >>> public static Object webbeans(String className) >>> { >>> System.out.println(className); >>> WebBeansContainer _webBeans = WebBeansContainer.create(); >>> >>> try { >>>Class clazz = Class.forName(className); >>> >>> ComponentFactory component = _webBeans.resolveByType(clazz); >>> >>> if (component == null) { >>> component = _webBeans.createTransient(clazz); >>> } >>> return component.get(); >>> } catch (Exception t) { >>>t.printStackTrace(System.out); >>>return null; >>> } >>> } >>> >>> ... >>> } >>> = >>> >> echo webbeans("com.mycompany.MyBean"); >>> ?> >>> = >>> >>> >>> When refresh the php page, ResinModule cannot find the class, >>> printing >>> stacktrace: >>> >>> >>> com.mycompany.MyBean >>> java.lang.ClassNotFoundException: com.mycompany.MyBean >>> at java.net.URLClassLoader$1.run(URLClassLoader.java:200) >>> at java.security.AccessController.doPrivileged(Native Method) >>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188) >>> at java.lang.ClassLoader.loadClass(ClassLoader.java:306) >>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) >>> at java.lang.ClassLoader.loadClass(ClassLoader.java:251) >>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Class.java:169) >>> at com.caucho.quercus.lib.ResinModule.webbeans(ResinModule.java: >>> 131) >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at >>> sun.reflect.NativeMethodAccessorImpl.invoke >>> (NativeMethodAccessorImpl.java:39) >>> at >>> sun.reflect.DelegatingMethodAccessorImpl.invoke >>> (DelegatingMethodAccessorImpl.java:25) >>> at java.lang.reflect.Method.invoke(Method.java:597) >>> at com.caucho.quercus.module.StaticFunction.invoke >>> (StaticFunction.java:129) >>> at com.caucho.quercus.env.JavaInvoker.callMethod(JavaInvoker.java: >>> 604) >>> at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:539) >>> at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java: >>> 182) >>> at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:126) >>> at com.caucho.quercus.expr.MethodCallExpr.eval(MethodCallExpr.java: >>> 92) >>> at com.caucho.quercus.program.EchoStatement.execute >>> (EchoStatement.java:57) >>> at >>> com.caucho.quercus.program.BlockStatement.execute >>> (BlockStatement.java:99) >>> at >>> com.caucho.quercus.program.QuercusProgram.execute >>> (QuercusProgram.java:239) >>> at com.caucho.quercus.page.InterpretedPage.execute >>> (InterpretedPage.java:61) >>> at com.caucho.quercus.page.QuercusPage.executeTop(QuercusPage.java: >>> 119) >>> at >>> com.caucho.quercus.servlet.ResinQ
Re: [Resin-interest] How to get non-singleton WebBeans inQuercus/PHP?
Thanks Scott. I've known that java_bean("myBean") would work ONLY MyBean is annotated with @Singleton or registed in resin-web.xml. How can I get a MyBean instance when MyBean is a NON-SINGLETON bean? - Original Message - From: "Scott Ferguson" <[EMAIL PROTECTED]> To: "General Discussion for the Resin application server" Sent: Thursday, January 17, 2008 12:36 AM Subject: Re: [Resin-interest] How to get non-singleton WebBeans inQuercus/PHP? > > On Jan 16, 2008, at 5:27 AM, wesley wrote: > >> For instance: >> >> I want to get a configured web-bean instance by class name in php file >> below: >> = >> > echo java_bean("com.mycompany.MyBean"); >> ?> >> = >> package com.mycompany; >> @Component >> // no @Singleton >> public class MyBean { > > The default name of the bean is "myBean" according to the WebBeans > specification, so try using: > > > echo java_bean("myBean"); > > ?> > > You can override the default name with @Named("my-name") as a class > annotation. > > Also, if you turn on "fine" logging, you should see the bean get > registered in the logs, and it should show the name that Resin's > assigned. > > -- Scott > >> private String greetings = "Hello world."; >> public MyBean() { >> } >> public String getGreetings() { >> return greetings; >> } >> } >> = >> It won't work because java_bean() method only accept a singleton >> bean name. >> >> >> I tried to add a static method in >> com.caucho.quercus.lib.ResinModule like >> this: >> = >> public class ResinModule extends AbstractQuercusModule { >> ... >> public static Object webbeans(String className) >> { >> System.out.println(className); >> WebBeansContainer _webBeans = WebBeansContainer.create(); >> >> try { >>Class clazz = Class.forName(className); >> >> ComponentFactory component = _webBeans.resolveByType(clazz); >> >> if (component == null) { >> component = _webBeans.createTransient(clazz); >> } >> return component.get(); >> } catch (Exception t) { >>t.printStackTrace(System.out); >>return null; >> } >> } >> >> ... >> } >> = >> > echo webbeans("com.mycompany.MyBean"); >> ?> >> = >> >> >> When refresh the php page, ResinModule cannot find the class, printing >> stacktrace: >> >> >> com.mycompany.MyBean >> java.lang.ClassNotFoundException: com.mycompany.MyBean >> at java.net.URLClassLoader$1.run(URLClassLoader.java:200) >> at java.security.AccessController.doPrivileged(Native Method) >> at java.net.URLClassLoader.findClass(URLClassLoader.java:188) >> at java.lang.ClassLoader.loadClass(ClassLoader.java:306) >> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) >> at java.lang.ClassLoader.loadClass(ClassLoader.java:251) >> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) >> at java.lang.Class.forName0(Native Method) >> at java.lang.Class.forName(Class.java:169) >> at com.caucho.quercus.lib.ResinModule.webbeans(ResinModule.java:131) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke >> (NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke >> (DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at com.caucho.quercus.module.StaticFunction.invoke >> (StaticFunction.java:129) >> at com.caucho.quercus.env.JavaInvoker.callMethod(JavaInvoker.java: >> 604) >> at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:539) >> at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java: >> 182) >> at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:126) >> at com.caucho.quercus.expr.MethodCallExpr.eval(MethodCallExpr.java: >> 92) >> at com.caucho.quercus.program.EchoStatement.execute >> (EchoStatement.java:57) >> at >> com.caucho.quercus.program.BlockStatement.execute >> (BlockStatement.java:99) >> at >> com.caucho.quercus.program.QuercusProgram.execute >> (QuercusProgram.java:239) >> at com.caucho.quercus.page.InterpretedPage.execute >> (InterpretedPage.java:61) >> at com.caucho.quercus.page.QuercusPage.executeTop(QuercusPage.java: >> 119) >> at >> com.caucho.quercus.servlet.ResinQuercusServlet.service >> (ResinQuercusServlet.java:146) >> at >> com.caucho.quercus.servlet.QuercusServlet.service >> (QuercusServlet.java:353) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:91) >> at >> com.caucho.server.dispatch.ServletFilterChain.doFilter >> (ServletFilterChain.java:103) >> at >> com.caucho.server.webapp.DispatchFilterChain.doFilter >> (DispatchFilterChain.java:97) >> at >> com.caucho.server.dispatch.ServletInvocation.serv
Re: [Resin-interest] How to get non-singleton WebBeans in Quercus/PHP?
On Jan 16, 2008, at 5:27 AM, wesley wrote: > For instance: > > I want to get a configured web-bean instance by class name in php file > below: > = > echo java_bean("com.mycompany.MyBean"); > ?> > = > package com.mycompany; > @Component > // no @Singleton > public class MyBean { The default name of the bean is "myBean" according to the WebBeans specification, so try using: You can override the default name with @Named("my-name") as a class annotation. Also, if you turn on "fine" logging, you should see the bean get registered in the logs, and it should show the name that Resin's assigned. -- Scott > private String greetings = "Hello world."; > public MyBean() { > } > public String getGreetings() { > return greetings; > } > } > = > It won't work because java_bean() method only accept a singleton > bean name. > > > I tried to add a static method in > com.caucho.quercus.lib.ResinModule like > this: > = > public class ResinModule extends AbstractQuercusModule { > ... > public static Object webbeans(String className) > { > System.out.println(className); > WebBeansContainer _webBeans = WebBeansContainer.create(); > > try { >Class clazz = Class.forName(className); > > ComponentFactory component = _webBeans.resolveByType(clazz); > > if (component == null) { > component = _webBeans.createTransient(clazz); > } > return component.get(); > } catch (Exception t) { >t.printStackTrace(System.out); >return null; > } > } > > ... > } > = > echo webbeans("com.mycompany.MyBean"); > ?> > = > > > When refresh the php page, ResinModule cannot find the class, printing > stacktrace: > > > com.mycompany.MyBean > java.lang.ClassNotFoundException: com.mycompany.MyBean > at java.net.URLClassLoader$1.run(URLClassLoader.java:200) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:169) > at com.caucho.quercus.lib.ResinModule.webbeans(ResinModule.java:131) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at com.caucho.quercus.module.StaticFunction.invoke > (StaticFunction.java:129) > at com.caucho.quercus.env.JavaInvoker.callMethod(JavaInvoker.java: > 604) > at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:539) > at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java: > 182) > at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:126) > at com.caucho.quercus.expr.MethodCallExpr.eval(MethodCallExpr.java: > 92) > at com.caucho.quercus.program.EchoStatement.execute > (EchoStatement.java:57) > at > com.caucho.quercus.program.BlockStatement.execute > (BlockStatement.java:99) > at > com.caucho.quercus.program.QuercusProgram.execute > (QuercusProgram.java:239) > at com.caucho.quercus.page.InterpretedPage.execute > (InterpretedPage.java:61) > at com.caucho.quercus.page.QuercusPage.executeTop(QuercusPage.java: > 119) > at > com.caucho.quercus.servlet.ResinQuercusServlet.service > (ResinQuercusServlet.java:146) > at > com.caucho.quercus.servlet.QuercusServlet.service > (QuercusServlet.java:353) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:91) > at > com.caucho.server.dispatch.ServletFilterChain.doFilter > (ServletFilterChain.java:103) > at > com.caucho.server.webapp.DispatchFilterChain.doFilter > (DispatchFilterChain.java:97) > at > com.caucho.server.dispatch.ServletInvocation.service > (ServletInvocation.java:266) > at > com.caucho.server.webapp.RequestDispatcherImpl.forward > (RequestDispatcherImpl.java:280) > at > com.caucho.server.webapp.RequestDispatcherImpl.forward > (RequestDispatcherImpl.java:108) > at > org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute > (ServletDispatcherResult.java:139) > > > > It seems ResinModule runs in the Resin container and will not load > classes > in any webapp's library, > and the WebBeansContainer only maintains singleton component > instances and > save them in > "private HashMap _namedComponentMap". > > > > __
Re: [Resin-interest] java.lang.IllegalStateException: forward() not allowed after buffer has committed.
On Jan 15, 2008, at 1:45 PM, Huitang Li wrote: > Hi, > > When we upgrade to resin3.1.4 from resin 2, we got the following error > when we access a page: > > java.lang.IllegalStateException: forward() not allowed after buffer > has > committed. > [14:20:59.218] at > com.caucho.jsp.PageContextImpl.include(PageContextImpl.java:1002) > [14:20:59.218] at > _jsp._aaa._bbb._ccc__jsp._jspService(_ddd__jsp.java:128) > ( <= corresponding to ddd.jsp ) > .. > > In ddd.jsp, the line is > > You might need to set flush="false" (although I thought we'd reversed that change). The exception is thrown when you try to forward/redirect after some data has been flushed to the browser (which makes forwarding/ redirection impossible.) -- Scott > > > I debugged with resin 3.1.4 source code, and found that the exception > is thrown from the following lines in the class > RequestDispatcherImpl in > package com.caucho.server.webapp: > >if (res.isCommitted() && method == null) { > IllegalStateException exn; > exn = new IllegalStateException("forward() not allowed after > buffer has committed."); > > if (cauchoRes == null || ! cauchoRes.hasError()) { > if (cauchoRes != null) > cauchoRes.setHasError(true); > throw exn; > } > > _webApp.log(exn.getMessage(), exn); > } > > One interesting thing is that when the jsp page is accessed for the > first time, it is forwarded to the error page with such exception. > However, the jsp page is correctly rendered in following requests > even > though the same exception is generated. > > Does anyone know the solution? > > Thanks. > > > > > > > > > > > > > ___ > 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] Password authentication
On Jan 16, 2008, at 5:58 AM, umgill28 wrote: > > Hi, > > I'm having trouble with using the XmlAuthenticator for putting a > war-deployed ROOT application behind digest authentication. Below > is my > host config. If I leave the web-app tag out, the war file named > ROOT.war > deploys and runs correctly at www.xxx.com. If I add the web-app > tag in as > shown, I get prompted for credentials. When I enter the correct > credentials, I get: "index.do was not found on this server". How > can I > apply digest authentication to an entire domain that is deployed as > a root > war? Can you turn on "finer" logging? Once the digest is authenticated, the control should be exactly like any other authentication method. -- Scott > > >xxx.com > > jdbc/xxx > > > jdbc:postgresql://localhost:5432/xxx?protocolVersion=2 > xxx > xxx > > > > >type="com.caucho.server.security.XmlAuthenticator"> > > yyy:zzz==:user > > > > > /* > > > > > > > -- > View this message in context: http://www.nabble.com/Password- > authentication-tp14881284p14881284.html > Sent from the Resin mailing list archive at Nabble.com. > > > > ___ > resin-interest mailing list > resin-interest@caucho.com > http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] JMS problem with many messages: ArrayIndexOutOfBoundsException
On Jan 16, 2008, at 7:19 AM, Erlend Akre wrote: Hi, I am trying out Resin and the JMS part. I’ve successfully set up a queue that uses the default disk database. Thanks. I've added this as a bug at http://bugs.caucho.com/view.php? id=2337 It's not really corrupted, but the database query is missing a needed limit clause. -- Scott I’m doing the sending and receiving from php using the very simple examples: $queue = new JMSQueue("jms/myqueue"); $queue->send(…) and $queue->receive(); Everything works fine. But when doing some stress testing I start running into problems. Using send() in a for loop works fine with 500,800,1000,2000 repetitions.. If I set this higher (5000 repetitions) the page is never returned (which means the loops stops executing?) I removed the database and started off clean.. I slowly added 500 messages each time with around 30 sec apart. There where no problems with sending, and the filesize of the database increased every time. When I run the .php file with the receive() in it, I get an ArrayIndexOutOfBoundsException. This is not fixed by stopping and starting server, I actually have to delete the database on disk to get it to work again. Anyone else had this kind of problem, that heavy use corrupts the database? Error message from receive(): 500 Servlet Exception java.lang.ArrayIndexOutOfBoundsException: 128 at com.caucho.db.sql.SelectResult.write(SelectResult.java: 1013) at com.caucho.db.sql.SelectResult.writeBlob (SelectResult.java:919) at com.caucho.db.table.BlobColumn.evalToResult (BlobColumn.java:351) at com.caucho.db.table.TableIterator.evalToResult (TableIterator.java:424) at com.caucho.db.sql.IdExpr.evalToResult(IdExpr.java:226) at com.caucho.db.sql.SelectQuery.execute(SelectQuery.java:194) at com.caucho.db.sql.SelectQuery.execute(SelectQuery.java:161) at com.caucho.db.jdbc.PreparedStatementImpl.execute (PreparedStatementImpl.java:335) at com.caucho.db.jdbc.PreparedStatementImpl.executeQuery (PreparedStatementImpl.java:302) at com.caucho.sql.UserPreparedStatement.executeQuery (UserPreparedStatement.java:89) at com.caucho.jms.jdbc.JdbcQueueConsumer.receiveImpl (JdbcQueueConsumer.java:266) at com.caucho.jms.session.MessageConsumerImpl.receiveNoWait (MessageConsumerImpl.java:254) at com.caucho.jms.session.MessageConsumerImpl.receive (MessageConsumerImpl.java:222) at com.caucho.quercus.lib.jms.JMSQueue.receive (JMSQueue.java:154) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.caucho.quercus.env.JavaMethod.invoke(JavaMethod.java: 97) at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java: 615) at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java: 622) at com.caucho.quercus.program.JavaClassDef.callMethod (JavaClassDef.java:542) at com.caucho.quercus.env.JavaValue.callMethod (JavaValue.java:294) at com.caucho.quercus.env.Var.callMethod(Var.java:1166) at _quercus._get__php.execute(usr/local/resin-pro-3.1.3/ webapps/ROOT/get.php:10) at com.caucho.quercus.page.QuercusPage.executeTop (QuercusPage.java:119) at com.caucho.quercus.servlet.ResinQuercusServlet.service (ResinQuercusServlet.java:146) at com.caucho.quercus.servlet.QuercusServlet.service (QuercusServlet.java:353) 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:178) at com.caucho.server.dispatch.ServletInvocation.service (ServletInvocation.java:241) at com.caucho.server.http.HttpRequest.handleRequest (HttpRequest.java:268) at com.caucho.server.port.TcpConnection.run (TcpConnection.java:586) at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java: 690) at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:612) at java.lang.Thread.run(Thread.java:619) Regards Erlend ___ 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] JMS problem with many messages: ArrayIndexOutOfBoundsException
Hi, I am trying out Resin and the JMS part. I've successfully set up a queue that uses the default disk database. I'm doing the sending and receiving from php using the very simple examples: $queue = new JMSQueue("jms/myqueue"); $queue->send(...) and $queue->receive(); Everything works fine. But when doing some stress testing I start running into problems. Using send() in a for loop works fine with 500,800,1000,2000 repetitions.. If I set this higher (5000 repetitions) the page is never returned (which means the loops stops executing?) I removed the database and started off clean.. I slowly added 500 messages each time with around 30 sec apart. There where no problems with sending, and the filesize of the database increased every time. When I run the .php file with the receive() in it, I get an ArrayIndexOutOfBoundsException. This is not fixed by stopping and starting server, I actually have to delete the database on disk to get it to work again. Anyone else had this kind of problem, that heavy use corrupts the database? Error message from receive(): 500 Servlet Exception java.lang.ArrayIndexOutOfBoundsException: 128 at com.caucho.db.sql.SelectResult.write(SelectResult.java:1013) at com.caucho.db.sql.SelectResult.writeBlob(SelectResult.java:919) at com.caucho.db.table.BlobColumn.evalToResult(BlobColumn.java:351) at com.caucho.db.table.TableIterator.evalToResult(TableIterator.java:424) at com.caucho.db.sql.IdExpr.evalToResult(IdExpr.java:226) at com.caucho.db.sql.SelectQuery.execute(SelectQuery.java:194) at com.caucho.db.sql.SelectQuery.execute(SelectQuery.java:161) at com.caucho.db.jdbc.PreparedStatementImpl.execute(PreparedStatementImpl.j ava:335) at com.caucho.db.jdbc.PreparedStatementImpl.executeQuery(PreparedStatementI mpl.java:302) at com.caucho.sql.UserPreparedStatement.executeQuery(UserPreparedStatement. java:89) at com.caucho.jms.jdbc.JdbcQueueConsumer.receiveImpl(JdbcQueueConsumer.java :266) at com.caucho.jms.session.MessageConsumerImpl.receiveNoWait(MessageConsumer Impl.java:254) at com.caucho.jms.session.MessageConsumerImpl.receive(MessageConsumerImpl.j ava:222) at com.caucho.quercus.lib.jms.JMSQueue.receive(JMSQueue.java:154) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.caucho.quercus.env.JavaMethod.invoke(JavaMethod.java:97) at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:615) at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:622) at com.caucho.quercus.program.JavaClassDef.callMethod(JavaClassDef.java:542 ) at com.caucho.quercus.env.JavaValue.callMethod(JavaValue.java:294) at com.caucho.quercus.env.Var.callMethod(Var.java:1166) at _quercus._get__php.execute(usr/local/resin-pro-3.1.3/webapps/ROOT/get.ph p:10) at com.caucho.quercus.page.QuercusPage.executeTop(QuercusPage.java:119) at com.caucho.quercus.servlet.ResinQuercusServlet.service(ResinQuercusServl et.java:146) at com.caucho.quercus.servlet.QuercusServlet.service(QuercusServlet.java:35 3) at javax.servlet.http.HttpServlet.service(HttpServlet.java:91) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChai n.java:103) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.ja va:178) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.j ava:241) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:268) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:586) at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:690) at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:612) at java.lang.Thread.run(Thread.java:619) Regards Erlend ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Password authentication
Hi, I'm having trouble with using the XmlAuthenticator for putting a war-deployed ROOT application behind digest authentication. Below is my host config. If I leave the web-app tag out, the war file named ROOT.war deploys and runs correctly at www.xxx.com. If I add the web-app tag in as shown, I get prompted for credentials. When I enter the correct credentials, I get: "index.do was not found on this server". How can I apply digest authentication to an entire domain that is deployed as a root war? xxx.com jdbc/xxx jdbc:postgresql://localhost:5432/xxx?protocolVersion=2 xxx xxx yyy:zzz==:user /* -- View this message in context: http://www.nabble.com/Password-authentication-tp14881284p14881284.html Sent from the Resin mailing list archive at Nabble.com. ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] How to get non-singleton WebBeans in Quercus/PHP?
For instance: I want to get a configured web-bean instance by class name in php file below: = = package com.mycompany; @Component // no @Singleton public class MyBean { private String greetings = "Hello world."; public MyBean() { } public String getGreetings() { return greetings; } } = It won't work because java_bean() method only accept a singleton bean name. I tried to add a static method in com.caucho.quercus.lib.ResinModule like this: = public class ResinModule extends AbstractQuercusModule { ... public static Object webbeans(String className) { System.out.println(className); WebBeansContainer _webBeans = WebBeansContainer.create(); try { Class clazz = Class.forName(className); ComponentFactory component = _webBeans.resolveByType(clazz); if (component == null) { component = _webBeans.createTransient(clazz); } return component.get(); } catch (Exception t) { t.printStackTrace(System.out); return null; } } ... } = = When refresh the php page, ResinModule cannot find the class, printing stacktrace: com.mycompany.MyBean java.lang.ClassNotFoundException: com.mycompany.MyBean at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at com.caucho.quercus.lib.ResinModule.webbeans(ResinModule.java:131) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.caucho.quercus.module.StaticFunction.invoke(StaticFunction.java:129) at com.caucho.quercus.env.JavaInvoker.callMethod(JavaInvoker.java:604) at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:539) at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:182) at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:126) at com.caucho.quercus.expr.MethodCallExpr.eval(MethodCallExpr.java:92) at com.caucho.quercus.program.EchoStatement.execute(EchoStatement.java:57) at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:99) at com.caucho.quercus.program.QuercusProgram.execute(QuercusProgram.java:239) at com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:61) at com.caucho.quercus.page.QuercusPage.executeTop(QuercusPage.java:119) at com.caucho.quercus.servlet.ResinQuercusServlet.service(ResinQuercusServlet.java:146) at com.caucho.quercus.servlet.QuercusServlet.service(QuercusServlet.java:353) at javax.servlet.http.HttpServlet.service(HttpServlet.java:91) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103) at com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:97) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:266) at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:280) at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:108) at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:139) It seems ResinModule runs in the Resin container and will not load classes in any webapp's library, and the WebBeansContainer only maintains singleton component instances and save them in "private HashMap _namedComponentMap". ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest