[Resin-interest] packaging EB3 application with Resin
Hello, I am trying to package an EAR application in Resin. So far, I have achieved this kind of package : a WAR project embedded in a EAR project (specifying the 'ear-deploy' tag in the resin.conf). Project_EAR - project_WAR I now want to to the following : one EAR project holding one EJB-JAR project (for the entity beans and session beans), some WAR projects for the pages and servlets. Project_EAR - project_EJB-JAR - project_1_WAR - project_2_WAR Is it possible to achieve this in Resin ? (If I need to use http://www.caucho.com/resin/admin/jar-repository.xtp, is there an example we can follow ?) Thank you. Regards -- Vincent LAUGIER Email : vincent.laug...@helmet.fr Téléphone : 01 75 43 92 52 Fax : 01 79 75 01 12 (www.monfax.com) www.helmet.fr ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] packaging EB3 application with Resin
On 2009-11-16, at 8:09 AM, Vincent LAUGIER wrote: Hello, I am trying to package an EAR application in Resin. So far, I have achieved this kind of package : a WAR project embedded in a EAR project (specifying the 'ear-deploy' tag in the resin.conf). Project_EAR - project_WAR I now want to to the following : one EAR project holding one EJB-JAR project (for the entity beans and session beans), some WAR projects for the pages and servlets. Project_EAR - project_EJB-JAR - project_1_WAR - project_2_WAR Is it possible to achieve the same in Resin ? Resin supports the ear layout as well as defining ejbs in resin-web.xml (If we need to use http://www.caucho.com/resin/admin/jar-repository.xtp, is there an example we can follow ?) This is only available in Resin 4. I don't believe there is a separate example, however there is a detailed draft of spec published on the blog: http://blog.caucho.com/?p=225 Thanks, Alex Thank you. Regards -- Vincent LAUGIER Email : vincent.laug...@helmet.fr Téléphone : 01 75 43 92 52 Fax : 01 79 75 01 12 (www.monfax.com) www.helmet.fr ___ 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] packaging EB3 application with Resin
As a longtime J2EE developer, let me suggest that life is far more pleasant if you abandon the atrocious EAR packaging morass and build your applications in one or more WARs. Just put all your classes in WEB-INF/classes (ejbs, servlets, etc), make sure you have WEB-INF/classes/META-INF/beans.xml and WEB-INF/classes/META-INF/ejb-jar.xml, and it all works the way you would expect. Note that separate WARs will be in separate classloader scopes, so inter-WAR calls will be Hessian not local method calls. But this makes life a lot easier when you want to relocate a WAR to a different server. Jeff On Mon, Nov 16, 2009 at 10:02 AM, Vincent LAUGIER vincent.laug...@helmet.fr wrote: Hello Alex, then we are waiting for the resin 4 stable release (we need to stick to resin 3 for the moment because of problem with the persistence context injection, see http://forum.caucho.com/showthread.php?t=1927). Resin supports the ear layout as well as defining ejbs in resin-web.xml What do you mean by defining ejbs in resin-web.xml ? Could this be a workaround to package the project in differents WARs (one WAR for the entity beans, another for the session beans...) ? regards Vincent This is only available in Resin 4. I don't believe there is a separate example, however there is a detailed draft of spec published on the blog: http://blog.caucho.com/?p=225 ___ 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] packaging EB3 application with Resin
Hello Alex, then we are waiting for the resin 4 stable release (we need to stick to resin 3 for the moment because of problem with the persistence context injection, see http://forum.caucho.com/showthread.php?t=1927). Resin supports the ear layout as well as defining ejbs in resin-web.xml What do you mean by defining ejbs in resin-web.xml ? Could this be a workaround to package the project in differents WARs (one WAR for the entity beans, another for the session beans...) ? It's best to package an ear when there is more then one web-app. With a single web-app there is a possibility of deploying EJBs in a web-app. The ejb-jar.xml in that case is placed in to web-app and configured via ejb-server ejb-descriptor , see http://caucho.com/resin/reference/env-tags.xtp#ejb-server for ejb-server doc and http://caucho.com/resin-3.1/examples/ejb-stateless/index.xtp for Best Regards, Alex regards Vincent This is only available in Resin 4. I don't believe there is a separate example, however there is a detailed draft of spec published on the blog: http://blog.caucho.com/?p=225 ___ 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] packaging EB3 application with Resin
Vincent LAUGIER wrote: What do you mean by defining ejbs in resin-web.xml ? Could this be a workaround to package the project in differents WARs (one WAR for the entity beans, another for the session beans...) ? Many/most applications only need a single .war file. Packaging a single ..war file in an .ear just to get EJB support is silly. The JavaEE 6 specs have finally caught up to this concept. I have no idea why you would want to package your session beans in a different .war file from the rest of your application. -- Scott regards Vincent This is only available in Resin 4. I don't believe there is a separate example, however there is a detailed draft of spec published on the blog: http://blog.caucho.com/?p=225 ___ 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] Large negative range in the HTTP request
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] Large negative range in the HTTP request
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
Re: [Resin-interest] Large negative range in the HTTP request
Knut, Thanks for reporting this. I've filed a bug: http://bugs.caucho.com/view.php?id=3766 Alex On 2009-11-16, at 2:59 PM, Knut Forkalsrud wrote: 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 mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Large negative range in the HTTP request
Knut Forkalsrud wrote: 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 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. -- Scott 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 mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Large negative range in the HTTP request
Scott Ferguson wrote: Knut Forkalsrud wrote: 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 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. 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.) That may mean we can look at competing in streaming large files directly from Resin. -- Scott -- Scott 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 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
On Mon, Nov 16, 2009 at 15:44, Scott Ferguson f...@caucho.com 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