Re: [Resin-interest] trouble getting caching to work

2008-01-15 Thread Scott Ferguson

On Jan 15, 2008, at 2:13 PM, Gerard Lynch wrote:

>
> Hi Scott,
>Thanks for your reply - actually, the problem there is that if I
> don't set it explictly, Resin puts the "private" header
> in there, which as I understand it, will definitely force it to be not
> cached.  This I can't figure out either actually, as there are no
> cookies or session for this jsp, so why does it set it as private?

Can you check for any filters?  level="finer" might help.  Resin  
shouldn't set Cache-Control: private unless it's generating a cookie.

-- Scott


>
> Gerard
>
>
>
>
>
>>>
>>> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
>>>pageEncoding="ISO-8859-1" session="false"%>
>>> <%! int counter; %>
>>> <%
>>> response.setHeader("Cache-Control", "max-age=15");
>>> response.addHeader("Cache-Control", "public");
>>> %>
>>> Count: <%= counter++ %>
>>> >> "http://www.w3.org/TR/html4/loose.dtd";>
>>> 
>>> 
>>> 
>>> cache test
>>> 
>>> 
>>> test
>>> 
>>> 
>>> 
>>>
>>>
>>> The cache.log is created, but logs only a startup message:
>>>
>>> [2008/01/13 22:50:56.169] Proxy Cache disk-size=1024M memory- 
>>> size=64M
>>> [2008/01/13 23:37:14.898] Proxy Cache disk-size=1024M memory- 
>>> size=64M
>>> [2008/01/13 23:43:31.879] Proxy Cache disk-size=1024M memory- 
>>> size=64M
>>> [2008/01/14 00:11:09.520] Proxy Cache disk-size=1024M memory- 
>>> size=64M
>>> [2008/01/14 00:14:53.424] Proxy Cache disk-size=1024M memory- 
>>> size=64M
>>> [2008/01/14 00:25:35.853] Proxy Cache disk-size=1024M memory- 
>>> size=64M
>>> [2008/01/14 00:41:56.857] Proxy Cache disk-size=1024M memory- 
>>> size=64M
>>> [2008/01/14 01:49:27.968] Proxy Cache disk-size=1024M memory- 
>>> size=256M
>>> [2008/01/14 23:12:57.908] Proxy Cache disk-size=1024M memory- 
>>> size=256M
>>> [2008/01/15 00:16:37.125] Proxy Cache disk-size=1024M memory- 
>>> size=256M
>>>
>>> The headers of the page returned look I think.  I followed the  
>>> advice
>>> from elsewhere on this site to override the Cache-Control: private
>>> header which is getting set somehow, even though this page has no
>>> session and no cookies - regardless it is coming back as public, but
>>> the page is still not cached.
>>>
>>> HTTP/1.x 200 OK
>>>
>>> Server: Resin/3.1.4
>>>
>>> Cache-Control: max-age=15, public
>>>
>>> Content-Type: text/html; charset=ISO-8859-1
>>>
>>> Transfer-Encoding: chunked
>>>
>>> Date: Tue, 15 Jan 2008 08:40:28 GMT
>>>
>>>
>>>
>>> Also this is what is in resin.conf:
>>>
>>>
>>>  
>>>
>>>
>>>  
>>>
>>>
>>>
>>>
>>> Any ideas.it is really stumping me.  Any suggestions of what  
>>> else
>>> I could try to debug this at least?  More logs to turn on, common
>>> problems in this area, anything like that?
>>>
>>> Thanks for any help,
>>>
>>> Gerard Lynch
>>>
>>> --
>>> http://skreemr.com
>>> gerard at skreemr.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
>>
>
>
> ___
> 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] trouble getting caching to work

2008-01-15 Thread Gerard Lynch
On Jan 15, 2008 1:42 PM, Scott Ferguson <[EMAIL PROTECTED]> wrote:
>
> On Jan 15, 2008, at 1:32 PM, Gerard Lynch wrote:
>
> > Hello,
> >  We've been having trouble getting caching in Resin 3.1.4 Pro to work
> > on FC6.  It does work in our test environment, but not in production.
> > Everything looks the same:  this test jsp:
>
> The "public" might be confusing the caching code.  Try removing that
> header and see if that makes a difference.
>

Hi Scott,
   Thanks for your reply - actually, the problem there is that if I
don't set it explictly, Resin puts the "private" header
in there, which as I understand it, will definitely force it to be not
cached.  This I can't figure out either actually, as there are no
cookies or session for this jsp, so why does it set it as private?

Gerard





> >
> > <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
> >pageEncoding="ISO-8859-1" session="false"%>
> > <%! int counter; %>
> > <%
> > response.setHeader("Cache-Control", "max-age=15");
> > response.addHeader("Cache-Control", "public");
> > %>
> > Count: <%= counter++ %>
> >  > "http://www.w3.org/TR/html4/loose.dtd";>
> > 
> > 
> > 
> > cache test
> > 
> > 
> > test
> > 
> > 
> > 
> >
> >
> > The cache.log is created, but logs only a startup message:
> >
> > [2008/01/13 22:50:56.169] Proxy Cache disk-size=1024M memory-size=64M
> > [2008/01/13 23:37:14.898] Proxy Cache disk-size=1024M memory-size=64M
> > [2008/01/13 23:43:31.879] Proxy Cache disk-size=1024M memory-size=64M
> > [2008/01/14 00:11:09.520] Proxy Cache disk-size=1024M memory-size=64M
> > [2008/01/14 00:14:53.424] Proxy Cache disk-size=1024M memory-size=64M
> > [2008/01/14 00:25:35.853] Proxy Cache disk-size=1024M memory-size=64M
> > [2008/01/14 00:41:56.857] Proxy Cache disk-size=1024M memory-size=64M
> > [2008/01/14 01:49:27.968] Proxy Cache disk-size=1024M memory-size=256M
> > [2008/01/14 23:12:57.908] Proxy Cache disk-size=1024M memory-size=256M
> > [2008/01/15 00:16:37.125] Proxy Cache disk-size=1024M memory-size=256M
> >
> > The headers of the page returned look I think.  I followed the advice
> > from elsewhere on this site to override the Cache-Control: private
> > header which is getting set somehow, even though this page has no
> > session and no cookies - regardless it is coming back as public, but
> > the page is still not cached.
> >
> > HTTP/1.x 200 OK
> >
> > Server: Resin/3.1.4
> >
> > Cache-Control: max-age=15, public
> >
> > Content-Type: text/html; charset=ISO-8859-1
> >
> > Transfer-Encoding: chunked
> >
> > Date: Tue, 15 Jan 2008 08:40:28 GMT
> >
> >
> >
> > Also this is what is in resin.conf:
> >
> >
> >  
> >
> >
> >  
> >
> >
> >
> >
> > Any ideas.it is really stumping me.  Any suggestions of what else
> > I could try to debug this at least?  More logs to turn on, common
> > problems in this area, anything like that?
> >
> > Thanks for any help,
> >
> > Gerard Lynch
> >
> > --
> > http://skreemr.com
> > gerard at skreemr.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
>


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


[Resin-interest] java.lang.IllegalStateException: forward() not allowed after buffer has committed.

2008-01-15 Thread Huitang Li
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.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:141)
[14:20:59.218] at 
com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:108)
[14:20:59.218] at 
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
[14:20:59.218] at 
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
[14:20:59.218] at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
[14:20:59.218] at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
[14:20:59.218] at 
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
[14:20:59.218] at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:114)
[14:20:59.218] at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
[14:20:59.218] at 
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
[14:20:59.218] at 
com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:97)
[14:20:59.218] at 
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:266)
[14:20:59.218] at 
com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:491)
[14:20:59.218] at 
com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:355)
[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




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


Re: [Resin-interest] trouble getting caching to work

2008-01-15 Thread Scott Ferguson

On Jan 15, 2008, at 1:32 PM, Gerard Lynch wrote:

> Hello,
>  We've been having trouble getting caching in Resin 3.1.4 Pro to work
> on FC6.  It does work in our test environment, but not in production.
> Everything looks the same:  this test jsp:

The "public" might be confusing the caching code.  Try removing that  
header and see if that makes a difference.

-- Scott
>
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
>pageEncoding="ISO-8859-1" session="false"%>
> <%! int counter; %>
> <%
> response.setHeader("Cache-Control", "max-age=15");
> response.addHeader("Cache-Control", "public");
> %>
> Count: <%= counter++ %>
>  "http://www.w3.org/TR/html4/loose.dtd";>
> 
> 
> 
> cache test
> 
> 
> test
> 
> 
> 
>
>
> The cache.log is created, but logs only a startup message:
>
> [2008/01/13 22:50:56.169] Proxy Cache disk-size=1024M memory-size=64M
> [2008/01/13 23:37:14.898] Proxy Cache disk-size=1024M memory-size=64M
> [2008/01/13 23:43:31.879] Proxy Cache disk-size=1024M memory-size=64M
> [2008/01/14 00:11:09.520] Proxy Cache disk-size=1024M memory-size=64M
> [2008/01/14 00:14:53.424] Proxy Cache disk-size=1024M memory-size=64M
> [2008/01/14 00:25:35.853] Proxy Cache disk-size=1024M memory-size=64M
> [2008/01/14 00:41:56.857] Proxy Cache disk-size=1024M memory-size=64M
> [2008/01/14 01:49:27.968] Proxy Cache disk-size=1024M memory-size=256M
> [2008/01/14 23:12:57.908] Proxy Cache disk-size=1024M memory-size=256M
> [2008/01/15 00:16:37.125] Proxy Cache disk-size=1024M memory-size=256M
>
> The headers of the page returned look I think.  I followed the advice
> from elsewhere on this site to override the Cache-Control: private
> header which is getting set somehow, even though this page has no
> session and no cookies - regardless it is coming back as public, but
> the page is still not cached.
>
> HTTP/1.x 200 OK
>
> Server: Resin/3.1.4
>
> Cache-Control: max-age=15, public
>
> Content-Type: text/html; charset=ISO-8859-1
>
> Transfer-Encoding: chunked
>
> Date: Tue, 15 Jan 2008 08:40:28 GMT
>
>
>
> Also this is what is in resin.conf:
>
>
>  
>
>
>  
>
>
>
>
> Any ideas.it is really stumping me.  Any suggestions of what else
> I could try to debug this at least?  More logs to turn on, common
> problems in this area, anything like that?
>
> Thanks for any help,
>
> Gerard Lynch
>
> --
> http://skreemr.com
> gerard at skreemr.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


[Resin-interest] trouble getting caching to work

2008-01-15 Thread Gerard Lynch
Hello,
 We've been having trouble getting caching in Resin 3.1.4 Pro to work
on FC6.  It does work in our test environment, but not in production.
Everything looks the same:  this test jsp:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
   pageEncoding="ISO-8859-1" session="false"%>
<%! int counter; %>
<%
response.setHeader("Cache-Control", "max-age=15");
response.addHeader("Cache-Control", "public");
%>
Count: <%= counter++ %>
http://www.w3.org/TR/html4/loose.dtd";>



cache test


test





The cache.log is created, but logs only a startup message:

[2008/01/13 22:50:56.169] Proxy Cache disk-size=1024M memory-size=64M
[2008/01/13 23:37:14.898] Proxy Cache disk-size=1024M memory-size=64M
[2008/01/13 23:43:31.879] Proxy Cache disk-size=1024M memory-size=64M
[2008/01/14 00:11:09.520] Proxy Cache disk-size=1024M memory-size=64M
[2008/01/14 00:14:53.424] Proxy Cache disk-size=1024M memory-size=64M
[2008/01/14 00:25:35.853] Proxy Cache disk-size=1024M memory-size=64M
[2008/01/14 00:41:56.857] Proxy Cache disk-size=1024M memory-size=64M
[2008/01/14 01:49:27.968] Proxy Cache disk-size=1024M memory-size=256M
[2008/01/14 23:12:57.908] Proxy Cache disk-size=1024M memory-size=256M
[2008/01/15 00:16:37.125] Proxy Cache disk-size=1024M memory-size=256M

The headers of the page returned look I think.  I followed the advice
from elsewhere on this site to override the Cache-Control: private
header which is getting set somehow, even though this page has no
session and no cookies - regardless it is coming back as public, but
the page is still not cached.

HTTP/1.x 200 OK

Server: Resin/3.1.4

Cache-Control: max-age=15, public

Content-Type: text/html; charset=ISO-8859-1

Transfer-Encoding: chunked

Date: Tue, 15 Jan 2008 08:40:28 GMT



Also this is what is in resin.conf:

   
 
   
   
 
   



Any ideas.it is really stumping me.  Any suggestions of what else
I could try to debug this at least?  More logs to turn on, common
problems in this area, anything like that?

Thanks for any help,

Gerard Lynch

--
http://skreemr.com
gerard at skreemr.com


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


Re: [Resin-interest] ResinObjectFactory does not support scope

2008-01-15 Thread Scott Ferguson


On Jan 15, 2008, at 1:14 AM, wesley wrote:

The object is a normal bean, not an struts2 action. BTW, a struts2  
action might not be a singleton according to XWork/Struts2 code,  
but a normal bean created every time when requested.


Caused by: java.lang.NoSuchMethodError:  
com.mycompany.builders.ArticleListBuilder: method ()V not found


Can you try adding a protected or public zero-arg constructor for  
ArticleListBuilder?


public class ArticleListBuilder {
  protected ArticleListBuilder()
  {
  }
  ...
}

The scoped values are interesting in webbeans, and in some cases  
require a generated proxy object, which then requires a protected or  
public zero-arg constructor.


If you inject a @RequestScoped  bean into an @ApplicationScoped  
value, Resin gives you a proxy to the underlying bean.  When your  
code accesses the request-scoped bean, the proxy will lookup the  
actual bean in the current request and invoke the proper methods on  
the actual bean.


-- Scott


 at com.mycompany.builders.ArticleListBuilder$ScopeProxy. 
(Unknown Source)

 ... 39 more

[16:54:40.720] {http--8080-4}  
com.mycompany.actions.ListArticleAction.articleListbuilder:  
java.lang.RuntimeException:  
java.lang.reflect.InvocationTargetException

My source code:
=
package com.mycompany.actions;

// no @Component
public class ListArticleAction extends ActionSupport {
 @In
 ArticleListBuilder articleListbuilder;
 public String execute() {
...
 }
}
=
package com.mycompany.builders;

@Component
@SessionScoped
public class ArticleListBuilder {
...
}
=




And then I change the inject method to constructor inject:
=
package com.mycompany.actions;

// no @Component
public class ListArticleAction extends ActionSupport {
 ArticleListBuilder articleListbuilder;

 public ListArticleAction(@In ArticleListBuilder articleListbuilder) {
  this.articleListbuilder = articleListbuilder;
  System.out.println(this);
  System.out.println(articleListbuilder);
 }


 public String execute() {
...
 }
}
=
No exception occurred, but every time I refresh the web page,
system output was like below

[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
the @SessionScope does not applied.

- Original Message -
From: Scott Ferguson
To: General Discussion for the Resin application server
Sent: Tuesday, January 15, 2008 5:47 AM
Subject: Re: [Resin-interest] ResinObjectFactory does not support  
scope



On Jan 13, 2008, at 8:47 AM, wesley wrote:

When annotated class with @Component combined with @SessionScoped  
(or @ConversationScoped/@ApplicationScoped), ResinObjectFactory  
throws


java.lang.RuntimeException:
java.lang.reflect.InvocationTargetException

I'm using s080111 snapshot.


I've filed this as http://bugs.caucho.com/view.php?id=2332

Is the object a normal bean or is it something like a struts2  
action?  If it's a struts action, then it really shouldn't have a  
@SessionScope (?), since it's a singleton.


Also, do you have a full stack trace?

thanks,

(BTW, we've added a wiki page for the struts2 integration at http:// 
wiki.caucho.com/Struts2)


-- Scott


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




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


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


Re: [Resin-interest] snapshot (08/01/14): adding spring/webbeans and embedded resin

2008-01-15 Thread Scott Ferguson

On Jan 14, 2008, at 11:29 PM, Daniel López wrote:

> It sounds very interesting.
>
> On a side note, the link at the top of the page to the javadocs
> (ResinEmbed JavaDoc ->
> http://caucho.com/javadoc/com/caucho/resin/package.html) returns a  
> 404.

Thanks.  I've fixed the link.

ResinEmbed has some interesting features beyond generic embedding:

  * testing apis (can be used for templating, too)
  * bean (webbean) embedding
  * remoting servlets (hessian, burlap for now)

* Testing API:  The testing API in ResinEmbed is similar to the APIs  
we use internally for testing Resin.  Testing code can call HTTP  
requests directly using a resin.request() call.  An example might  
look like the following:

   ResinEmbed resin = new ResinEmbed();

   resin.addWebApp(new WebAppEmbed("/", "/home/qa/test1"));
   resin.start();

   String result = resin.request("GET /test.php");

   resin.stop()

* Bean embedding.  You can add application beans to the ResinEmbed or  
WebAppEmbed objects with a BeanEmbed wrapper.  The web-app's servlets  
can grab the bean using webbeans injection, like @In or @Named.

An application might use the bean embedding to provide a service bean  
to its embedded Resin instance, e.g.

   ResinEmbed resin = new ResinEmbed();
   resin.addHttp(new HttpEmbed(8080));

   BeanEmbed bean = new BeanEmbed(myApplicationService);
   resin.addBean(bean);

   WebAppEmbed webApp = new WebAppEmbed("/admin", "/var/www/admin");
   resin.addWebApp(webApp);

   resin.start();
   resin.join();

-- Scott

>
> S!
> D.
>
> Scott Ferguson escribió:
>> The new snapshot should fix the build issues people have been
>> having.  The previous one had only partially updated the configure
>> and make files.
>>
>> It also includes a basic integration of Spring with Resin's
>> WebBeans.  The wiki has some details at http://wiki.caucho.com/ 
>> Spring.
>>
>> Basically, you can set Resin as a parent BeanFactory of Spring's web-
>> app ApplicationContext.  If Spring can't find a bean in its own
>> context, it will ask Resin to see if the bean is configured in Resin.
>>
>> http://caucho.com/resin/doc/resin-embedding.xtp has an overview of
>> the embedding API for Resin, which a number of people have asked
>> for.  The embedding API can be used for things like unit testing,
>> Maven integration and IDE integration.
>>
>> -- Scott
>>
>>
>>
>> ___
>> resin-interest mailing list
>> resin-interest@caucho.com
>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>
> -- 
> ---
> Daniel Lopez Janariz ([EMAIL PROTECTED])
> Web Services
> Centre for Information and Technology
> Balearic Islands University
> (SPAIN)
> ---
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest



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


Re: [Resin-interest] 3.0.25 changes?

2008-01-15 Thread Sam
> What changes are included in resin 3.0.25 since 3.0.24? 

http://www.caucho.com/resin-3.0/features/changes.xtp

jsp: tag-file pageEncoding not properly picked up (#2170) 
configure.in fix with -lc for linux (#2082) 
session - always-load-session would load for static pages (#2154) 
win32: isapi_srun.dll should return 503 on backend disconnect (#2040) 
win32: isapi_srun.dll config of client-read-time (#2039, #2129) 
win32: isapi_srun.dll saving of config (#1879)
proxy cache: redo cache loading for sync issues (#1992) 
hessian: issue with class serialization (#198)
windows issues with webapps and trailing dot 
request.getInputStream issues with encodings (#1915) 

-- Sam



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


Re: [Resin-interest] javax.mail.Session - JNDI

2008-01-15 Thread Ron Pitts
Thanks Scott,

 try
  {
   javax.naming.Context env = (Context) new javax.naming.InitialContext
().lookup("java:comp/env");
 session = (javax.mail.Session) env.lookup("mail/MailSession");
  }
  catch (javax.naming.NamingException e)
  {
   log.debug("failed to lookup mail mail/MailSession in
resin.conf"+e.getMessage());
   properties.put("mail.smtp.host","localhost");
  session = Session.getDefaultInstance(properties);
   log.debug(mailhost);
  }

It looks like mail.smtp.password & mail.smtp.user arent used, mainly because
the authentication comes from *javax.mail.PasswordAuthentication.*



**


On Jan 15, 2008 4:31 AM, Scott Ferguson <[EMAIL PROTECTED]> wrote:

>
>   On Jan 12, 2008, at 6:21 PM, Ron Pitts wrote:
>
>  I've setup a entry wiithn resin.conf as follows
>
>
>   
>imap
>smtp
>somedomain.com
>somedomain.com
>somedomain.com
>somepassword
> someuser
> true
>
>
>
> However, I'm getting javax.mail.AuthenticationFailedException when trying
> to send the message, looks like I cant use JNDI to pass the username &
> password because it requires some Authenticator object?
>
>
> I've added a bug report as http://bugs.caucho.com/view_all_bug_page.php
>
> I think we'll want a  tag to make this clearer.
>
> I'm not sure what the Authenticator issue is.  It's not related to Resin's
> authenticators.  As a workaround, you might need to set the
>  values instead.
>
> -- Scott
>
>
> 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
>
>
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] ResinObjectFactory does not support scope

2008-01-15 Thread wesley
Further test:

When applied @Component & @SessionScoped to action class, no matter what scope 
was applied to those classes need to be injected, every component turned into 
session scoped.

code:
=
package com.mycompany.actions;

@SessionScoped
@Component

public class ListArticleAction extends ActionSupport {
 ArticleListBuilder articleListbuilder;

 public ListArticleAction(@In ArticleListBuilder articleListbuilder) {
  this.articleListbuilder = articleListbuilder;
 }

 public String execute() {
  System.out.println(this);
  System.out.println(articleListbuilder);
...
 }
}

=
package com.mycompany.blocks;

@Component
@RequestScoped
public class ArticleListBuilder {
...
}
=

output:
[EMAIL PROTECTED]
[EMAIL PROTECTED]// should be request scoped, but seems to be session 
scoped
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
  - Original Message - 
  From: wesley 
  To: General Discussion for the Resin application server 
  Sent: Tuesday, January 15, 2008 5:14 PM
  Subject: Re: [Resin-interest] ResinObjectFactory does not support scope


  The object is a normal bean, not an struts2 action. BTW, a struts2 action 
might not be a singleton according to XWork/Struts2 code, but a normal bean 
created every time when requested.

  These were the stacktrace:

  2008-01-15 16:54:40,718 4970  ERROR [http--8080-4] ResinObjectFactory (51) - 
com.caucho.config.ConfigException: 
com.mycompany.actions.ListArticleAction.articleListbuilder: 
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
   at com.caucho.webbeans.inject.ComponentInject.inject(ComponentInject.java:69)
   at com.caucho.webbeans.component.ComponentImpl.init(ComponentImpl.java:461)
   at com.caucho.webbeans.component.ComponentImpl.create(ComponentImpl.java:413)
   at com.caucho.webbeans.component.ComponentImpl.get(ComponentImpl.java:365)
   at 
com.caucho.xwork2.ResinObjectFactory.buildBean(ResinObjectFactory.java:49)  
 // return component.get();
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:154)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143)
   at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:113)
   at 
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:275)
   at 
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365)
   at 
com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38)
   at 
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83)
   at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at 
com.opensymphony.xwork2.DefaultActionInvocation.(DefaultActionInvocation.java:74)
   at 
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
   at 
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
   at 
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
   at 
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
   at 
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
   at 
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
   at 
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)
   at 
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
   at 
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
   at 
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
   at com.yaqu.servlet.filter.gzip.GZIPFilter.doFilter(GZIPFilter.java:36)
   at 
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
   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:268)
   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)
  Caused by: java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException
   at com.caucho.webbeans.bytecode.ScopeAdapter.wrap(ScopeAdapter.java:73)
   at com.caucho.webbeans.component.ClassComponent.get(ClassComponent.java:267)
   at com.caucho.webbeans.inject.ComponentInject.inject(ComponentInject.java:63)
   ... 32 more
  Caused by: java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeConstructorAccessorI

Re: [Resin-interest] ResinObjectFactory does not support scope

2008-01-15 Thread wesley
The object is a normal bean, not an struts2 action. BTW, a struts2 action might 
not be a singleton according to XWork/Struts2 code, but a normal bean created 
every time when requested.

These were the stacktrace:

2008-01-15 16:54:40,718 4970  ERROR [http--8080-4] ResinObjectFactory (51) - 
com.caucho.config.ConfigException: 
com.mycompany.actions.ListArticleAction.articleListbuilder: 
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
 at com.caucho.webbeans.inject.ComponentInject.inject(ComponentInject.java:69)
 at com.caucho.webbeans.component.ComponentImpl.init(ComponentImpl.java:461)
 at com.caucho.webbeans.component.ComponentImpl.create(ComponentImpl.java:413)
 at com.caucho.webbeans.component.ComponentImpl.get(ComponentImpl.java:365)
 at com.caucho.xwork2.ResinObjectFactory.buildBean(ResinObjectFactory.java:49)  
 // return component.get();
 at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:154)
 at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143)
 at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:113)
 at 
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:275)
 at 
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365)
 at 
com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38)
 at 
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83)
 at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
 at 
com.opensymphony.xwork2.DefaultActionInvocation.(DefaultActionInvocation.java:74)
 at 
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
 at 
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
 at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
 at 
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
 at 
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
 at 
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
 at 
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)
 at 
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
 at 
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
 at 
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
 at com.yaqu.servlet.filter.gzip.GZIPFilter.doFilter(GZIPFilter.java:36)
 at 
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
 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:268)
 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)
Caused by: java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException
 at com.caucho.webbeans.bytecode.ScopeAdapter.wrap(ScopeAdapter.java:73)
 at com.caucho.webbeans.component.ClassComponent.get(ClassComponent.java:267)
 at com.caucho.webbeans.inject.ComponentInject.inject(ComponentInject.java:63)
 ... 32 more
Caused by: java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
 at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at com.caucho.webbeans.bytecode.ScopeAdapter.wrap(ScopeAdapter.java:68)
 ... 34 more
Caused by: java.lang.NoSuchMethodError: 
com.mycompany.builders.ArticleListBuilder: method ()V not found
 at com.mycompany.builders.ArticleListBuilder$ScopeProxy.(Unknown Source)
 ... 39 more

[16:54:40.720] {http--8080-4} 
com.mycompany.actions.ListArticleAction.articleListbuilder: 
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

My source code:
=
package com.mycompany.actions;

// no @Component
public class ListArticleAction extends ActionSupport {
 @In
 ArticleListBuilder articleListbuilder;

 public String execute() {
...
 }
}
=
package com.mycompany.builders;

@Component
@SessionScoped
public class ArticleListBuilder {
...
}
=




And then I change the inject method to constructor inject:
=
package com.mycompany.actions;

// no @Component
public