Re: [Resin-interest] Resin JSP include handling changed between 3.1.2 and 3.1.5
Are you sure the issue is with include, rather than the attribute ID having changed...? That is, have you verified that application.getAttribute(caucho.authenticator) in header.jsp returns something other than null...? /Mattias John Steel wrote (2008-05-02 20:09): Hi all, A recent attempt to upgrade some 3.1.2 Pro servers broke them due to some changes in the include handling of JSP's. The attempt was made to use 3.1.5, which failed. The simplest case of what we are doing: -- index.jsp: %@ include file='/header.jsp' % table width='100%' cellPadding='0' cellSpacing='0' border='0' tr td class='maintableleft' background='images/left-back.jpg' %@ include file='/left.jsp' % /td ... /tr /table %@ include file='/footer.jsp' % -- header.jsp: %@ page import=java.util.*, java.text.*, ...%% if (session != null) { try { if (request.getParameter(logout).equals(true)) { DbAuthenticator auth = (DbAuthenticator) application.getAttribute(caucho.authenticator); if (auth != null) { auth.logout(request, response, application, request.getUserPrincipal()); } session.invalidate(); response.sendRedirect(index.jsp); } } catch (Exception e) { } } PageManager pm = new PageManager(pageContext.getOut()); pm.setName(request.getRequestURL().toString().substring(request.getRequestURL().toString().lastIndexOf('/') + 1)); DbAuthenticator auth = (DbAuthenticator) application.getAttribute(caucho.authenticator); java.security.Principal user = request.getUserPrincipal(); %html -- left.jsp: table border='0' cellPadding='0' cellSpacing='0' width='130' tr td width='10'nbsp;/td td width='120' % if (auth.isUserInRole(request, response, getServletContext(), user, MANAGER)) { out.print(trtdhr/td/tr); pm.writeSideEntry(summary.jsp, Summary); ... pm.writeSideEntry(prices.jsp, Prices); } % DbAuthenticator is a custom child of com.caucho.http.security.JdbcAuthenticator. Its working fine. The problem is, in 3.1.5 or later a visit to index.jsp results in: java.lang.NullPointerException at _jsp._index__jsp._jspService(left.jsp:100) at com.caucho.jsp.JavaPage.service(JavaPage.java:61) at com.caucho.jsp.Page.pageservice(Page.java:578) at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:192) at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:187) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:181) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:266) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:269) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:603) at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:721) at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:643) at java.lang.Thread.run(Thread.java:619) left.jsp line 100 is if (auth.isUserInRole(request, response, getServletContext(), user, MANAGER)) { If I trace auth and user they are both null at that point. So, is there something else I should be doing, or should have been doing all along (possibly related to declaring session scope etc of the variables) or is this really a bug? ___ 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] Ant and JSPCompiler
Hi I'm trying to precompile my JSPs before the deploy phase, integrating this precompilation in my ANT build script. I'm using Resin 3.0.19 so I can't use the new resin-ant.jar but I think that this ANT target should work: target name=precompile-jsp description=precompile jsp echo message=precompiling JSPs: app-dir=${home.war}/ java classname=com.caucho.jsp.JspCompiler fork=true classpath refid=resin.classpath / arg line=-app-dir ${home.war} / /java /target But unfortunately it doesn't work: this generate the work and tmp directory but they're empty. I have try passing a JSP and the JSP is precompiled without problem: target name=precompile-jsp description=precompile jsp echo message=precompiling JSPs: app-dir=${home.war}/ java classname=com.caucho.jsp.JspCompiler fork=true classpath refid=resin.classpath / arg line=-app-dir ${home.war} / arg line=${home.war}/index.jsp / /java /target So my question is: have I to pass ALL my JSPs to JSPCompiler? Can't I just point to the root of my web app and just have all my JSP precompiled? -- View this message in context: http://www.nabble.com/Ant-and-JSPCompiler-tp17061443p17061443.html Sent from the Resin mailing list archive at Nabble.com. ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Ant and JSPCompiler
Try target name=precompile-jsp description=precompile jsp echo message=precompiling JSPs: app-dir=${home.war}/ java classname=com.caucho.jsp.JspCompiler fork=true classpath refid=resin.classpath / arg line=-app-dir ${home.war} ${home.war} / /java /target Note the extra ${home.war} in the arg line which means compile this dir (and subdirs). /Mattias Jiderhamn rafael.munoz wrote (2008-05-05 15:17): Hi I'm trying to precompile my JSPs before the deploy phase, integrating this precompilation in my ANT build script. I'm using Resin 3.0.19 so I can't use the new resin-ant.jar but I think that this ANT target should work: target name=precompile-jsp description=precompile jsp echo message=precompiling JSPs: app-dir=${home.war}/ java classname=com.caucho.jsp.JspCompiler fork=true classpath refid=resin.classpath / arg line=-app-dir ${home.war} / /java /target But unfortunately it doesn't work: this generate the work and tmp directory but they're empty. I have try passing a JSP and the JSP is precompiled without problem: target name=precompile-jsp description=precompile jsp echo message=precompiling JSPs: app-dir=${home.war}/ java classname=com.caucho.jsp.JspCompiler fork=true classpath refid=resin.classpath / arg line=-app-dir ${home.war} / arg line=${home.war}/index.jsp / /java /target So my question is: have I to pass ALL my JSPs to JSPCompiler? Can't I just point to the root of my web app and just have all my JSP precompiled? ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Ant and JSPCompiler
I think the Resin 3.0 JspCompiler needs the JSP files as arguments. We have accomplished that in this way: !-- Definition of JSP files that should be precompiled to servlets -- fileset dir=${build.dir} id=jsp.precompile.fileset include name=**/*.jsp/ /fileset !-- Convert fileset to single property, separated by space -- pathconvert pathsep= property=jsp.precompile.files refid=jsp.precompile.fileset /pathconvert echoBatch Precompile of JSP Files/echo java classname=com.caucho.jsp.JspCompiler classpathref=resin.jspc.classpath fork=true failonerror=true sysproperty key=java.util.logging.config.file value=${jsp.logging.properties}/ arg value=-app-dir/ arg value=${build.dir}/ arg line=${jsp.precompile.files}/ /java Please note, that this might fail on Windows Platform as there is a limitation of the argument length. But it works on our Unix Platform. Regards, Steffen -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von rafael.munoz Gesendet: Montag, 5. Mai 2008 15:17 An: resin-interest@caucho.com Betreff: [Resin-interest] Ant and JSPCompiler Hi I'm trying to precompile my JSPs before the deploy phase, integrating this precompilation in my ANT build script. I'm using Resin 3.0.19 so I can't use the new resin-ant.jar but I think that this ANT target should work: target name=precompile-jsp description=precompile jsp echo message=precompiling JSPs: app-dir=${home.war}/ java classname=com.caucho.jsp.JspCompiler fork=true classpath refid=resin.classpath / arg line=-app-dir ${home.war} / /java /target But unfortunately it doesn't work: this generate the work and tmp directory but they're empty. I have try passing a JSP and the JSP is precompiled without problem: target name=precompile-jsp description=precompile jsp echo message=precompiling JSPs: app-dir=${home.war}/ java classname=com.caucho.jsp.JspCompiler fork=true classpath refid=resin.classpath / arg line=-app-dir ${home.war} / arg line=${home.war}/index.jsp / /java /target So my question is: have I to pass ALL my JSPs to JSPCompiler? Can't I just point to the root of my web app and just have all my JSP precompiled? -- View this message in context: http://www.nabble.com/Ant-and-JSPCompiler-tp17061443p17061443.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] database config should beinitializedbeforeany singleton beans
On May 4, 2008, at 8:39 PM, wesley wrote: I've set logging to finer and found datasource being initialized after AmberContainer parsing persistence.xml. After some tracing, I think the issue is also an order problem. After resin server initialized, it began to init the webapp, at the order below: 1. Look at persistence.xml and try to init an AmberContainer. 2. Parse resin-web.xml to init DataSource, JCA connectors, EJBs and Singletons. Note, at the first step method getJtaDataSource() of com.caucho.amber.cfg.PersistenceUnitConfig will be called. It tried to find a DataSource in JNDI and failed, because a DataSource will be available in JNDI until the 2nd step finished. Ok. This use of PersistenceUnitConfig should be lazy. Resin can register the PersistenceUnit/PersistenceContext before initializing the provider. thanks, I'd missed that case. http://bugs.caucho.com/view.php?id=2648 I'm using hibernate persistence provider. Now I'm frustrated. How could we managed to garantee these init orders? 1. First of all, DataSource in resin-web.xml to make sure a DataSource being registered. 2. persisence.xml to make sure any @PersistenceUnit and @PersistenceContext injection available. * This would be split into two parts: registering the @PersistenceUnit and a later start() phase. 3. JCA connectors (if any) in resin-web.xml. * 4. EJBs in resin-web.xml (if any). Why should EJBs be initialized after persistence.xml? It may need to inject a @PersistenceUnit. EJBs also have a 2-phase init process, so the same idea applies. -- Scott 5. Singletons in resin-web.xml. * 2 3 may be reversed. Any ideas? -Wesley - Original Message - From: Scott Ferguson [EMAIL PROTECTED] To: General Discussion for the Resin application server resin-interest@caucho.com Sent: Monday, May 05, 2008 6:11 AM Subject: Re: [Resin-interest] database config should beinitializedbeforeany singleton beans On May 4, 2008, at 1:17 PM, wesley wrote: Hi Scott, Is this issue resolved in snapshot0502? I've tried 0502 snapshot and found my singleton beans still throwing the same exception: java.lang.UnsupportedOperationException: The user must supply a JDBC connection I believe that the same problem still exists: DataSource SHOULD be initialized and be put in JNDI registry before the singletons try to find it. That should be a different issue. That stack trace is happening at the end of the initialization, so all the data sources would already be initialized. If you set the logging to finer do you see the database getting registered? -- Scott stacktrace at web-app initialing phase == [04:08:57.373] {resin-15} java.lang.UnsupportedOperationException: The user must supply a JDBC connection [04:08:57.373] {resin-15} at org .hibernate .connection .UserSuppliedConnectionProvider .getConnection(UserSuppliedConnectionProvider.java:30) [04:08:57.373] {resin-15} at org .hibernate .jdbc.ConnectionManager.openConnection(ConnectionManager.java:423) [04:08:57.373] {resin-15} at org .hibernate .jdbc.ConnectionManager.getConnection(ConnectionManager.java:144) [04:08:57.373] {resin-15} at org .hibernate .jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java: 139) [04:08:57.373] {resin-15} at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547) [04:08:57.373] {resin-15} at org.hibernate.loader.Loader.doQuery(Loader.java:673) [04:08:57.373] {resin-15} at org .hibernate .loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java: 236) [04:08:57.373] {resin-15} at org.hibernate.loader.Loader.doList(Loader.java:2213) [04:08:57.373] {resin-15} at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) [04:08:57.373] {resin-15} at org.hibernate.loader.Loader.list(Loader.java:2099) [04:08:57.373] {resin-15} at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378) [04:08:57.373] {resin-15} at org .hibernate .hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java: 338) [04:08:57.373] {resin-15} at org .hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java: 172) [04:08:57.373] {resin-15} at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) [04:08:57.373] {resin-15} at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) [04:08:57.373] {resin-15} at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65) [04:08:57.373] {resin-15} at com .buysou .jpa.PersistenceStrategy.getResultList(PersistenceStrategy.java:584) [04:08:57.373] {resin-15} at com .buysou .stock .business.stock.GlobalStockCalendar.reload(GlobalStockCalendar.java: 41) [04:08:57.373] {resin-15} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [04:08:57.373] {resin-15} at sun .reflect .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [04:08:57.373]
Re: [Resin-interest] [Q] Why isn't resin binding to 6800 when it's started with start?
Filed as bug http://bugs.caucho.com/view.php?id=2646. I just upgraded to resin 3.1.5 with a default configuration on Linux x64 and it works only when I start it manually. As the resin user, I start resin on the command line as follows: /opt/sun-jdk-1.6.0.06/bin/java -jar /usr/share/resin/lib/resin.jar -conf /etc/resin/resin.conf -resin-home /usr/lib/resin -verbose I see that it's listening on port 6800, but there is nothing on the watchdog port 6600, so I am assuming that the watchdog runs only when it's started. Anyway, here it talks fine with apache in this state. But if I start with the start option to run it in the background, /opt/sun-jdk-1.6.0.06/bin/java -jar /usr/share/resin/lib/resin.jar -conf /etc/resin/resin.conf -resin-home /usr/lib/resin -verbose start then it doesn't bind to 6800, but only to 6600. I set debugging to all, but I don't see any reference to its binding on any port. -- Maurice Volaski, [EMAIL PROTECTED] Computing Support, Rose F. Kennedy Center Albert Einstein College of Medicine of Yeshiva University ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Does Resin comet support work with non-blocking IO?
Hey Guys, I wonder, does anyone know if Resin's comet support works with non- blocking IO? What are peoples experiences with Resin's comet support? Cheers, Tim ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Does Resin comet support work with non-blocking IO?
I've experienced the same problem. thread-max is set to 2048 in resin.conf and I could not run more than 2048 simultaneous comet clients because of the blocking IO. Any ideas? -Wesley - Original Message - From: Tim Perrett [EMAIL PROTECTED] To: resin-interest@caucho.com Sent: Tuesday, May 06, 2008 5:12 AM Subject: [Resin-interest] Does Resin comet support work with non-blocking IO? Hey Guys, I wonder, does anyone know if Resin's comet support works with non- blocking IO? What are peoples experiences with Resin's comet support? Cheers, Tim ___ 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] [Q] Why isn't resin binding to 6800 when it's started with start?
On May 5, 2008, at 12:39 PM, Maurice Volaski wrote: Filed as bug http://bugs.caucho.com/view.php?id=2646. I just upgraded to resin 3.1.5 with a default configuration on Linux x64 and it works only when I start it manually. I just checked with 3.1.6 and it's working fine for me. -- Scott As the resin user, I start resin on the command line as follows: /opt/sun-jdk-1.6.0.06/bin/java -jar /usr/share/resin/lib/resin.jar -conf /etc/resin/resin.conf -resin-home /usr/lib/resin -verbose I see that it's listening on port 6800, but there is nothing on the watchdog port 6600, so I am assuming that the watchdog runs only when it's started. Anyway, here it talks fine with apache in this state. But if I start with the start option to run it in the background, /opt/sun-jdk-1.6.0.06/bin/java -jar /usr/share/resin/lib/resin.jar -conf /etc/resin/resin.conf -resin-home /usr/lib/resin -verbose start then it doesn't bind to 6800, but only to 6600. I set debugging to all, but I don't see any reference to its binding on any port. -- Maurice Volaski, [EMAIL PROTECTED] Computing Support, Rose F. Kennedy Center Albert Einstein College of Medicine of Yeshiva University ___ 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] Does Resin comet support work with non-blocking IO?
On May 5, 2008, at 2:20 PM, wesley wrote: I've experienced the same problem. thread-max is set to 2048 in resin.conf and I could not run more than 2048 simultaneous comet clients because of the blocking IO. Any ideas? As long as you're returning from the resume call, the comet support doesn't use a thread. So there's no blocking I/O at all, and thread- max shouldn't apply. The only place where non-blocking I/O would apply would be for reads, and Resin's comet doesn't currently support async reads. -- Scott -Wesley - Original Message - From: Tim Perrett [EMAIL PROTECTED] To: resin-interest@caucho.com Sent: Tuesday, May 06, 2008 5:12 AM Subject: [Resin-interest] Does Resin comet support work with non- blocking IO? Hey Guys, I wonder, does anyone know if Resin's comet support works with non- blocking IO? What are peoples experiences with Resin's comet support? Cheers, Tim ___ 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